/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; line-height: 1.15; }

/* ===== Base ===== */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Kaku Gothic ProN",
    "Hiragino Sans", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.8;
  color: #1e293b;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== Back to Index ===== */
.back-to-index {
  margin-bottom: 24px;
}
.back-to-index a {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  color: #64748b;
  text-decoration: none;
  transition: color 0.2s;
}
.back-to-index a:hover {
  color: #2563eb;
}

/* ===== Layout ===== */
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

@media (max-width: 640px) {
  .article-body {
    padding: 24px 16px 60px;
  }
}

/* ===== Hero Image ===== */
.article-hero {
  margin: 0 0 1.5rem;
}
.article-hero img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* ===== Article Dates ===== */
.article-dates {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 1.5rem;
}

/* ===== Typography ===== */
.article-body h1 {
  font-size: 1.875rem;
  font-weight: 700;
  line-height: 1.3;
  color: #0f172a;
  margin-bottom: 1.5rem;
  letter-spacing: -0.01em;
}

.article-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.4;
  color: #0f172a;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid #e2e8f0;
}

.article-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  color: #1e293b;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
}

.article-body h4 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #1e293b;
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

.article-body p {
  margin-bottom: 1.25rem;
  color: #334155;
}

.article-body strong {
  font-weight: 600;
  color: #0f172a;
}

.article-body em {
  font-style: italic;
}

/* ===== Links ===== */
.article-body a {
  color: #2563eb;
  text-decoration: underline;
  text-decoration-color: #93c5fd;
  text-underline-offset: 2px;
  transition: color 0.15s, text-decoration-color 0.15s;
}

.article-body a:hover {
  color: #1d4ed8;
  text-decoration-color: #1d4ed8;
}

/* ===== Images ===== */
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5rem 0;
  display: block;
}

.article-body figure {
  margin: 1.5rem 0;
}

.article-body figcaption {
  font-size: 0.875rem;
  color: #64748b;
  text-align: center;
  margin-top: 0.5rem;
}

/* ===== Lists ===== */
.article-body ul,
.article-body ol {
  margin-bottom: 1.25rem;
  padding-left: 1.75rem;
}

.article-body ul {
  list-style-type: disc;
}

.article-body ol {
  list-style-type: decimal;
}

.article-body li {
  margin-bottom: 0.375rem;
  color: #334155;
}

.article-body li > ul,
.article-body li > ol {
  margin-top: 0.375rem;
  margin-bottom: 0;
}

/* ===== Blockquote ===== */
.article-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  border-left: 4px solid #3b82f6;
  background-color: #f8fafc;
  border-radius: 0 8px 8px 0;
  color: #475569;
}

.article-body blockquote p:last-child {
  margin-bottom: 0;
}

/* ===== Table ===== */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
  overflow-x: auto;
  display: block;
  border: 1px solid #e2e8f0;
}

@media (min-width: 641px) {
  .article-body table {
    display: table;
  }
}

.article-body thead th,
.article-body tbody tr:first-child th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: #0f172a;
  text-align: left;
  padding: 0.75rem 1rem;
  border: 1px solid #cbd5e1;
}

.article-body tbody td {
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  color: #334155;
}

.article-body tbody tr:hover {
  background-color: #f8fafc;
}

/* ===== Code ===== */
.article-body code {
  font-family: "SF Mono", "Fira Code", "Fira Mono", Menlo, Consolas, monospace;
  font-size: 0.875em;
  background-color: #f1f5f9;
  color: #be185d;
  padding: 0.15em 0.4em;
  border-radius: 4px;
}

.article-body pre {
  margin: 1.5rem 0;
  padding: 1.25rem;
  background-color: #1e293b;
  border-radius: 8px;
  overflow-x: auto;
  line-height: 1.6;
}

.article-body pre code {
  background-color: transparent;
  color: #e2e8f0;
  padding: 0;
  font-size: 0.875rem;
}

/* ===== Horizontal Rule ===== */
.article-body hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2.5rem 0;
}

/* ===== Definition List ===== */
.article-body dl {
  margin-bottom: 1.25rem;
}

.article-body dt {
  font-weight: 600;
  color: #0f172a;
  margin-top: 1rem;
}

.article-body dd {
  margin-left: 1.5rem;
  color: #334155;
}

/* ===== iframe (YouTube等) ===== */
.article-body iframe {
  max-width: 100%;
  margin: 1.5rem 0;
  border-radius: 8px;
}

/* ===== Author Footer ===== */
.author-footer-container {
  display: flex;
  align-items: flex-start;
  border-top: 2px solid #e0e0e0;
  padding: 25px;
  margin-top: 30px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.author-footer-image-wrapper {
  flex-shrink: 0;
  margin-right: 20px;
}

.article-body .author-footer-image {
  width: 100px;
  height: 100px;
  min-width: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  display: inline-block;
  margin: 0;
}

.author-footer-info p {
  margin: 0 0 5px 0;
  color: #343a40;
  line-height: 1.5;
}

.author-footer-name {
  font-size: 1.3em;
  font-weight: bold;
  margin-bottom: 8px;
}

.author-footer-title,
.author-footer-organization {
  font-size: 1em;
  color: #555;
}

.author-footer-bio {
  font-size: 0.95em;
  color: #444;
}

.author-footer-links a {
  color: #2563eb;
  text-decoration: none;
  margin-right: 12px;
  font-size: 0.9em;
}

.author-footer-links a:hover {
  text-decoration: underline;
}

.author-footer-published-at {
  font-size: 0.9em;
  color: #777;
  margin-top: 10px;
}

.author-footer-name {
  cursor: pointer;
  transition: color 0.2s;
}
.author-footer-name:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ===== Author Profile Modal ===== */
.author-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.author-modal {
  position: relative;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  max-width: 480px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 32px;
  text-align: center;
}
.author-modal-close {
  position: absolute;
  top: 12px;
  right: 16px;
  background: none;
  border: none;
  font-size: 24px;
  color: #94a3b8;
  cursor: pointer;
  line-height: 1;
}
.author-modal-close:hover {
  color: #475569;
}
.author-modal-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-bottom: 16px;
}
.author-modal-name {
  font-size: 1.5em;
  font-weight: bold;
  color: #1e293b;
  margin-bottom: 4px;
}
.author-modal-title {
  font-size: 1em;
  color: #475569;
  margin-bottom: 2px;
}
.author-modal-organization {
  font-size: 0.9em;
  color: #64748b;
}
.author-modal-divider {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 20px 0;
}
.author-modal-bio-label {
  font-size: 0.85em;
  font-weight: 600;
  color: #475569;
  margin-bottom: 8px;
  text-align: left;
}
.author-modal-bio {
  font-size: 0.95em;
  color: #475569;
  line-height: 1.8;
  white-space: pre-wrap;
  text-align: left;
}
.author-modal-links {
  text-align: left;
}
.author-modal-links a {
  display: block;
  color: #2563eb;
  text-decoration: none;
  font-size: 0.9em;
  margin-bottom: 6px;
}
.author-modal-links a:hover {
  text-decoration: underline;
}

@media (max-width: 640px) {
  .author-footer-container {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .author-footer-image-wrapper {
    margin-right: 0;
    margin-bottom: 15px;
  }
  .author-modal {
    padding: 24px 16px;
  }
}

/* ===== Custom CSS ===== */
/* ===== AIおすすめナビ 用 カスタムCSS ===== */

/* ベース */
body {
  background: #f6f9fc;
  color: #1f2937;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  line-height: 1.85;
}

/* ============================= */
/* 記事ページ */
/* ============================= */

.article-body {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px 72px;
  background: #ffffff;
  border: 1px solid #e5edf5;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(25, 55, 99, 0.06);
}

/* 見出し */
.article-body h1,
.article-body h2,
.article-body h3,
.article-body h4 {
  color: #0f172a;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.article-body h1 {
  font-size: 2rem;
  margin: 0 0 1.4em;
  padding-bottom: 0.5em;
  border-bottom: 2px solid #dbeafe;
}

.article-body h2 {
  font-size: 1.5rem;
  margin: 2.4em 0 1em;
  padding: 0.8em 1em;
  background: linear-gradient(135deg, #eef6ff 0%, #f5fbff 100%);
  border-left: 5px solid #38bdf8;
  border-radius: 14px;
}

.article-body h3 {
  font-size: 1.2rem;
  margin: 2em 0 0.8em;
  padding-bottom: 0.35em;
  border-bottom: 1px solid #dbeafe;
}

.article-body h4 {
  font-size: 1.05rem;
  margin: 1.8em 0 0.6em;
  color: #0369a1;
}

/* 本文 */
.article-body p {
  margin: 0 0 1.35em;
  font-size: 1rem;
  color: #334155;
}

/* 強調 */
.article-body strong {
  color: #0f172a;
  background: linear-gradient(transparent 60%, #d8f3ff 60%);
  font-weight: 700;
}

/* リンク */
.article-body a {
  color: #0284c7;
  text-decoration: none;
  border-bottom: 1px solid rgba(2, 132, 199, 0.28);
  transition: all 0.2s ease;
}

.article-body a:hover {
  color: #0369a1;
  border-bottom-color: rgba(3, 105, 161, 0.55);
}

/* 画像 */
.article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 2em auto;
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

/* 引用 */
.article-body blockquote {
  margin: 2em 0;
  padding: 1.2em 1.4em;
  background: linear-gradient(135deg, #f0f9ff 0%, #f8fbff 100%);
  border-left: 4px solid #38bdf8;
  border-radius: 14px;
  color: #334155;
  font-size: 0.98rem;
}

/* テーブル */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 2em 0;
  background: #ffffff;
  border: 1px solid #dbe7f3;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.00);
}

.article-body thead th {
  background: linear-gradient(135deg, #0ea5e9 0%, #38bdf8 100%);
  color: #ffffff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 14px 16px;
  text-align: left;
}

.article-body th,
.article-body td {
  padding: 14px 16px;
  border-bottom: 1px solid #e5edf5;
  font-size: 0.95rem;
  color: #334155;
}

.article-body tbody tr:nth-child(even) {
  background: #f8fbff;
}

/* 箇条書きが本文中にある場合の自然な調整 */
.article-body ul,
.article-body ol {
  margin: 0 0 1.5em 1.4em;
  color: #334155;
}

.article-body li {
  margin-bottom: 0.5em;
}

/* 著者フッター */
.author-footer-container {
  margin-top: 56px;
  padding: 24px;
  background: linear-gradient(135deg, #f8fbff 0%, #eef7ff 100%);
  border: 1px solid #dbeafe;
  border-radius: 18px;
  box-shadow: 0 8px 20px rgba(56, 189, 248, 0.06);
}

/* 戻るリンク */
.back-to-index a {
  display: inline-block;
  margin-top: 28px;
  padding: 12px 18px;
  background: #ffffff;
  color: #0369a1;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(2, 132, 199, 0.08);
}

.back-to-index a:hover {
  background: #f0f9ff;
  border-color: #7dd3fc;
  transform: translateY(-1px);
}

/* ============================= */
/* 記事一覧ページ */
/* ============================= */

.hero {
  position: relative;
  padding: 84px 24px 72px;
  background: linear-gradient(135deg, #0f172a 0%, #0f3d5e 45%, #0ea5e9 100%);
  color: #ffffff;
  text-align: center;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -80px auto;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 70%);
  pointer-events: none;
}

.hero__title {
  position: relative;
  z-index: 1;
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.hero__subtitle {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  font-size: 1.05rem;
  line-height: 1.9;
  color: rgba(255, 255, 255, 0.88);
}

/* 背景画像ありヒーロー時のオーバーレイ例 */
.hero--bg-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0);
  z-index: 0;
}

/* 記事カード */
.article-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 22px 22px 20px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 30px rgba(2, 132, 199, 0.12);
  border-color: #bae6fd;
}

/* カード内の見出しリンクなどにも自然に効きやすい雰囲気 */
.article-card a {
  color: #0f172a;
  text-decoration: none;
  transition: color 0.2s ease;
}

.article-card a:hover {
  color: #0284c7;
}

/* カード本文がある場合に備えた読みやすさ */
.article-card p {
  color: #475569;
  line-height: 1.75;
}
/* ヘッダ文字を小さくして折り返しを軽減 */
.article-body thead th,
.article-body tbody tr:first-child th {
  font-size: 0.8125rem;   /* 13px 目安。0.75rem (12px) も可 */
  white-space: nowrap;    /* 折り返しを完全に禁止したい場合 */
}
/* ============================= */
/* スマホ最適化 */
/* ============================= */

@media (max-width: 768px) {
  .article-body {
    padding: 28px 18px 56px;
    border-radius: 16px;
  }

  .article-body h1 {
    font-size: 1.6rem;
  }

  .article-body h2 {
    font-size: 1.25rem;
    padding: 0.7em 0.9em;
  }

  .article-body h3 {
    font-size: 1.08rem;
  }

  .hero {
    padding: 64px 20px 56px;
  }

  .hero__subtitle {
    font-size: 0.96rem;
  }

  .article-card {
    padding: 18px;
    border-radius: 16px;
  }

  .back-to-index a {
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }
}