/* ============================================================
   article/style.css — 記事詳細（/article、WPでは動的URL）
   ヒーロー帯・パンくずは archives/style.css を併用（同ページで読み込む）。
   記事ヘッダー(catch)は1240全幅、本文以下は800中央寄せ。
   カテゴリ色は --article-cat（既定=悩み赤）。記事のカテゴリで差し替え。
   ============================================================ */
.article-main {
  --article-cat: #dc2626;
  background: #fff;
  padding-bottom: 100px;       /* 前/次ナビ → CV帯 の余白（Figma 100px） */
}
.article-inner {
  width: min(var(--container-w), calc(100% - var(--pc-gutter) * 2));
  margin-inline: auto;
}
/* 本文以下の幅800中央 */
.article-narrow {
  width: 800px;
  max-width: 100%;
  margin-inline: auto;
}

/* --- 記事ヘッダー（catch：1000px中央。Figma更新で全幅1240→1000） ---- */
.article-catch {
  width: 1000px;
  max-width: 100%;
  margin-inline: auto;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 30px;
}
.article-cat {
  display: inline-flex;
  align-items: center;
  padding: 10px 40px;
  border-radius: 60px;
  background: var(--article-cat);
  color: #fff;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
}
.article-title {
  font-family: var(--font-jp);
  font-weight: 900;
  font-size: 48px;
  line-height: 68px;
  color: #333;
  margin: 20px 0;
}
.article-subtitle {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: #333;
  margin: 0 0 20px;
}
.article-eyecatch {
  width: 100%;
  aspect-ratio: 1000 / 562;   /* Figma更新: 1000×562（16:9） */
  background: #d9d9d9;
  overflow: hidden;
}
.article-eyecatch img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* --- 目次 ------------------------------------------------- */
.article-toc {
  margin-top: 30px;
  padding-bottom: 60px;
}
.article-toc-title {
  background: var(--color-text-secondary, #4a5568);
  color: #fff;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  padding: 0 20px;
  border: 1px solid var(--color-border);
  margin: 0;
}
.article-toc-list {
  list-style: decimal;
  padding: 20px 20px 20px 47px;
  margin: 0;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-top: none;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 48px;
  color: #333;
}
.article-toc-list a {
  color: inherit;
  text-decoration: none;
}
.article-toc-list a:hover { text-decoration: underline; }

/* --- 本文セクション --------------------------------------- */
.article-section { padding-bottom: 60px; }
.article-h2 {
  border-left: 10px solid var(--article-cat);
  padding-left: 30px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 36px;
  line-height: 56px;
  color: #333;
  margin: 0;
}
.article-text {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 18px;
  line-height: 34px;
  color: #333;
  margin: 0;
  padding: 10px 0 30px;
}
.article-text .em {
  font-weight: 700;
  color: var(--article-cat);
}
.article-text a {
  color: #1a1a1a;
  text-decoration: underline;
}
.article-figure { padding-bottom: 30px; }
.article-figure-img {
  width: 100%;
  aspect-ratio: 800 / 472;
  background: #d9d9d9;
  display: block;
  overflow: hidden;
}
.article-figure-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.article-figure-cap {
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 26px;
  color: #333;
  margin: 10px 0 0;
}

/* --- 情報ボックス（ヒント） ------------------------------- */
.article-box {
  background: var(--color-gold-bg-pale, #fffbeb);
  border: 1px solid #fcd34d;
  border-radius: 30px;
  padding: 31px;
  margin-bottom: 20px;
}
.article-box .article-box-head {
  display: grid;                      /* アイコン列(38px) + テキスト列(1fr)。テキストが列幅内で折り返す */
  grid-template-columns: 38px 1fr;
  align-items: center;
  column-gap: 10px;
  padding-bottom: 10px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: #000;
  margin-bottom: 0;
}
/* アイコンはCSSで付与（ブロックパターン＝段落だけで完結させるため）。
   旧来のインライン img 版（.article-box-icon）も後方互換で残置。 */
.article-box-head::before {
  content: "";
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  background: url(../../img/common/icon-hint.svg) center / contain no-repeat;
}
.article-box-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}
.article-box .article-box-body {
  font-family: var(--font-jp);
  font-size: 16px;
  line-height: 24px;
  color: #171717;
  margin: 0;
  padding: 0 50px;
}

/* --- 関連記事（合わせて読みたい） / 横型カード ------------ */
.article-related { padding-bottom: 60px; }
.article-related-title {
  border-left: 10px solid var(--color-brand);
  padding-left: 30px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: #333;
  margin: 0 0 8px;
}
.article-rcard {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
}
.article-rcard-thumb {
  flex: 0 0 246px;
  width: 246px;
  height: 138px;
  background: #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.article-rcard-thumb img {
  width: 200px;
  height: auto;
}
.article-rcard-body {
  flex: 1 1 0;
  min-width: 0;
}
.article-rcard-cat {
  display: inline-flex;
  align-items: center;
  height: 23px;
  padding: 0 10px;
  border-radius: 8px;
  background: var(--article-cat);
  color: #fff;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  margin-bottom: 12px;
}
.article-rcard-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: #333;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-rcard-tags {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 0;
}
.article-rcard-tag-icon {
  width: 25px;
  height: 25px;
}
.article-rcard-tag {
  border: 1px solid var(--color-text-secondary, #4a5568);
  border-radius: 60px;
  padding: 0 10px;
  font-size: 14px;
  line-height: 26px;
  color: var(--color-text-secondary, #4a5568);
}
.article-rcard-date {
  font-size: 14px;
  line-height: 26px;
  color: #101828;
}
.article-rcard-arrow {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  background: url(../../img/common/link-arrow.svg) center / contain no-repeat;
}

/* --- KEYWORDS --------------------------------------------- */
.article-keywords { padding-bottom: 60px; }
.article-keywords-title {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: #333;
  margin: 0 0 12px;
}
.article-keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.article-keyword {
  display: inline-flex;
  align-items: center;
  padding: 8px 20px;
  border: 1px solid var(--color-text-secondary, #4a5568);
  border-radius: 60px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 16px;
  line-height: 28px;
  color: var(--color-text-secondary, #4a5568);
  text-decoration: none;
  white-space: nowrap;
}
.article-keyword:hover { opacity: 0.7; }

/* --- 著者 ------------------------------------------------- */
.article-author { padding: 30px 0 60px; }
.article-author-box {
  background: var(--color-gold-bg-pale, #fffbeb);
  border: 1px solid #fcd34d;
  border-radius: 30px;
  padding: 60px;
  display: flex;
  align-items: center;
  gap: 30px;
}
.article-author-avatar {
  flex: 0 0 170px;
  width: 170px;
  height: 170px;
  border-radius: 50%;
  background: #e2e8f0;
  overflow: hidden;
}
.article-author-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.article-author-label {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  color: #a0aec0;
  margin: 0;
}
.article-author-name {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 22px;
  line-height: 42px;
  color: var(--color-text-sub);
  margin: 0;
}
.article-author-role {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 14px;
  line-height: 22px;
  color: #b45309;
  margin: 0;
}
.article-author-bio {
  font-family: var(--font-jp);
  font-size: 18px;
  line-height: 34px;
  color: #333;
  margin: 10px 0 0;
}

/* --- 前/次の記事ナビ -------------------------------------- */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}
.article-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 20px;
  padding: 22px 50px;
  border-radius: 200px;
  border: 3px solid #fff;
  background: var(--color-text-secondary, #4a5568);
  box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.15);
  color: #fff;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 18px;
  line-height: 28px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.article-nav-btn:hover { opacity: 0.85; }
.article-nav-ico {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.article-nav-ico::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-top: 2px solid var(--color-text-secondary, #4a5568);
  border-right: 2px solid var(--color-text-secondary, #4a5568);
}
.article-nav-btn--prev .article-nav-ico::after { transform: translate(-30%, -50%) rotate(-135deg); }
.article-nav-btn--next .article-nav-ico::after { transform: translate(-70%, -50%) rotate(45deg); }

/* ============================================================
   SP（≤749px）— PCデザインをスケール（記事SPデザインはFigma無し）
   ============================================================ */
/* SP（≤749px）：固定px → fluid（N = SP値×2）。記事SPデザインはFigma無しのためPC値を基準にスケール。 */
@media (max-width: 749px) {
  .article-inner {
    width: 100%;
    padding-inline: calc(40 / 750 * 100vw);
  }
  .article-main { padding-bottom: min(calc(200 / 750 * 100vw), 100px); }
  .article-narrow { width: 100%; }

  /* 記事ヘッダー */
  .article-cat {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(56 / 750 * 100vw), 56px);
    padding: calc(12 / 750 * 100vw) calc(48 / 750 * 100vw);
  }
  .article-title {
    font-size: min(calc(56 / 750 * 100vw), 56px);
    line-height: 1.5;
    margin: calc(32 / 750 * 100vw) 0;
  }
  .article-subtitle {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: 1.6;
  }

  /* 目次 */
  .article-toc { padding-bottom: calc(120 / 750 * 100vw); }
  .article-toc-title {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: min(calc(72 / 750 * 100vw), 72px);
  }
  .article-toc-list {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(72 / 750 * 100vw), 72px);
  }

  /* 本文セクション */
  .article-section { padding-bottom: calc(120 / 750 * 100vw); }
  .article-h2 {
    font-size: min(calc(48 / 750 * 100vw), 48px);
    line-height: 1.5;
    border-left-width: min(calc(12 / 750 * 100vw), 10px);
    padding-left: calc(32 / 750 * 100vw);
  }
  .article-text {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(60 / 750 * 100vw), 60px);
  }
  .article-figure-cap {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(52 / 750 * 100vw), 52px);
  }
  /* 情報ボックスは Figma SP(335基準) と PC で値が同一（padding31 / radius30 / icon38 /
     見出し18-28 / 本文16-24・左右インデント50）。SPは幅が狭く見出し・本文が折り返すだけなので、
     PCの固定pxをそのまま使う（旧 /750 上書きは小さく潰れる不具合だったため撤去）。 */

  /* 関連記事 */
  .article-related { padding-bottom: calc(120 / 750 * 100vw); }
  .article-related-title {
    font-size: min(calc(44 / 750 * 100vw), 44px);
    line-height: min(calc(84 / 750 * 100vw), 84px);
    border-left-width: min(calc(12 / 750 * 100vw), 10px);
    padding-left: calc(32 / 750 * 100vw);
  }
  .article-rcard {
    gap: calc(20 / 750 * 100vw);
    padding: calc(40 / 750 * 100vw) 0;
  }
  .article-rcard-thumb {
    flex-basis: min(calc(220 / 750 * 100vw), 246px);
    width: min(calc(220 / 750 * 100vw), 246px);
    height: min(calc(180 / 750 * 100vw), 138px);
  }
  .article-rcard-thumb img { width: min(calc(192 / 750 * 100vw), 200px); }
  .article-rcard-cat {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(44 / 750 * 100vw), 44px);
    height: min(calc(46 / 750 * 100vw), 46px);
    padding: 0 calc(20 / 750 * 100vw);
    margin-bottom: calc(24 / 750 * 100vw);
  }
  .article-rcard-title {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(44 / 750 * 100vw), 44px);
  }
  .article-rcard-tags { padding: calc(20 / 750 * 100vw) 0; }
  .article-rcard-tag-icon {
    width: min(calc(50 / 750 * 100vw), 50px);
    height: min(calc(50 / 750 * 100vw), 50px);
  }
  .article-rcard-tag {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(52 / 750 * 100vw), 52px);
    padding: 0 calc(20 / 750 * 100vw);
  }
  .article-rcard-date {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(52 / 750 * 100vw), 52px);
  }
  .article-rcard-arrow {
    width: min(calc(64 / 750 * 100vw), 64px);
    height: min(calc(64 / 750 * 100vw), 64px);
  }

  /* KEYWORDS */
  .article-keywords { padding-bottom: calc(120 / 750 * 100vw); }
  .article-keywords-title {
    font-size: min(calc(44 / 750 * 100vw), 44px);
    line-height: min(calc(84 / 750 * 100vw), 84px);
    margin-bottom: calc(24 / 750 * 100vw);
  }
  .article-keywords-list { gap: calc(24 / 750 * 100vw); }
  .article-keyword {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(56 / 750 * 100vw), 56px);
    padding: calc(16 / 750 * 100vw) calc(40 / 750 * 100vw);
  }

  /* 著者：縦積み */
  .article-author { padding: calc(60 / 750 * 100vw) 0 calc(120 / 750 * 100vw); }
  .article-author-box {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: calc(40 / 750 * 100vw);
    padding: calc(60 / 750 * 100vw) calc(40 / 750 * 100vw);
    border-radius: calc(60 / 750 * 100vw);
  }
  .article-author-avatar {
    flex-basis: min(calc(240 / 750 * 100vw), 240px);
    width: min(calc(240 / 750 * 100vw), 240px);
    height: min(calc(240 / 750 * 100vw), 240px);
  }
  .article-author-label {
    font-size: min(calc(36 / 750 * 100vw), 36px);
    line-height: min(calc(56 / 750 * 100vw), 56px);
  }
  .article-author-name {
    font-size: min(calc(44 / 750 * 100vw), 44px);
    line-height: min(calc(84 / 750 * 100vw), 84px);
  }
  .article-author-role {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(44 / 750 * 100vw), 44px);
  }
  .article-author-bio {
    text-align: left;
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(60 / 750 * 100vw), 60px);
  }

  /* 前/次ナビ */
  .article-nav { gap: calc(24 / 750 * 100vw); }
  .article-nav-btn {
    padding: calc(28 / 750 * 100vw) calc(48 / 750 * 100vw);
    font-size: min(calc(28 / 750 * 100vw), 28px);
    gap: calc(20 / 750 * 100vw);
    flex: 1;
    justify-content: center;
  }
  .article-nav-ico {
    width: min(calc(64 / 750 * 100vw), 64px);
    height: min(calc(64 / 750 * 100vw), 64px);
  }
}

/* ============================================================
   WP本文（the_content 出力）
   エディタが書いたプレーンな h2/h3/p/ul/figure 等に
   静的版 .article-* と同等のスタイルを要素セレクタで適用。
   ============================================================ */
.article-body { padding-bottom: 60px; }
.article-body > *:first-child { margin-top: 0; }
.article-body h2 {
  border-left: 10px solid var(--color-brand);
  padding-left: 30px;
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 36px;
  line-height: 56px;
  color: #333;
  margin: 50px 0 20px;
}
.article-body h3 {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 26px;
  line-height: 40px;
  color: #333;
  margin: 40px 0 16px;
}
.article-body h4 {
  font-family: var(--font-jp);
  font-weight: 700;
  font-size: 20px;
  line-height: 32px;
  color: #333;
  margin: 32px 0 12px;
}
.article-body p {
  font-family: var(--font-jp);
  font-weight: 400;
  font-size: 18px;
  line-height: 34px;
  color: #333;
  margin: 0 0 24px;
}
.article-body a { color: #1a1a1a; text-decoration: underline; }
.article-body strong,
.article-body b,
.article-body .em {
  font-weight: 700;
  color: var(--color-brand);
}
.article-body ul,
.article-body ol {
  margin: 0 0 24px;
  padding-left: 1.6em;
  font-family: var(--font-jp);
  font-size: 18px;
  line-height: 34px;
  color: #333;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-body img { max-width: 100%; height: auto; }
.article-body figure { margin: 0 0 30px; }
.article-body figure img { width: 100%; display: block; }
.article-body figcaption {
  font-family: var(--font-jp);
  font-size: 14px;
  line-height: 26px;
  color: #333;
  margin-top: 10px;
  text-align: left;   /* Figma node 163:21627: キャプションは左寄せ */
}
.article-body blockquote {
  margin: 0 0 24px;
  padding: 20px 24px;
  border-left: 4px solid var(--article-cat);
  background: #f8fafc;
  color: #333;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 24px;
  font-family: var(--font-jp);
  font-size: 16px;
}
.article-body th,
.article-body td {
  border: 1px solid var(--color-border);
  padding: 10px 14px;
  text-align: left;
}

@media (max-width: 749px) {
  .article-body h2 {
    font-size: min(calc(48 / 750 * 100vw), 48px);
    line-height: 1.5;
    border-left-width: min(calc(12 / 750 * 100vw), 10px);
    padding-left: calc(32 / 750 * 100vw);
  }
  .article-body h3 {
    font-size: min(calc(38 / 750 * 100vw), 38px);
    line-height: 1.5;
  }
  .article-body p,
  .article-body ul,
  .article-body ol {
    font-size: min(calc(32 / 750 * 100vw), 32px);
    line-height: min(calc(60 / 750 * 100vw), 60px);
  }
  .article-body figcaption {
    font-size: min(calc(28 / 750 * 100vw), 28px);
    line-height: min(calc(52 / 750 * 100vw), 52px);
  }
}
