/* ============================================================
   blog-article.css — 読者の判断と次の行動を支える記事専用部品

   本文の事実を画像へ閉じ込めず、検索・コピー・読み上げができる
   HTML/CSS図解として表示する。固有の図だけ記事内styleで補う。
   ============================================================ */

article.post .post-reader {
  margin: 0 0 2em;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-top: 4px solid var(--moegi);
  border-radius: var(--r-lg);
  background: var(--shiro);
}

article.post .post-reader-kicker {
  margin: 0 0 13px;
  color: var(--sugi);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .1em;
}

article.post .post-reader-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--line);
}

article.post .post-reader-item {
  min-width: 0;
  padding: 14px 15px;
  background: var(--yuki);
}

article.post .post-reader-label {
  display: block;
  margin-bottom: 6px;
  color: var(--moegi-t);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: .05em;
}

article.post .post-reader-item strong {
  display: block;
  color: var(--iwa);
  font-size: 13.5px;
  line-height: 1.7;
}

article.post .post-viz {
  margin: 18px 0 30px;
  padding: clamp(16px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--shiro);
  box-shadow: var(--sh-xs);
}

article.post .post-viz-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 15px;
  color: var(--iwa);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.65;
}

article.post .post-viz-title::before {
  content: "図解";
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--moegi-l);
  color: var(--sugi);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .04em;
}

article.post .post-viz figcaption {
  margin-top: 14px;
  color: var(--ink3);
  font-size: 12.5px;
  line-height: 1.8;
}

article.post .post-flow {
  display: flex;
  align-items: stretch;
  gap: 9px;
}

article.post .post-flow-step,
article.post .post-viz-card,
article.post .post-choice {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--yuki);
}

article.post .post-flow-step { flex: 1 1 0; }

article.post .post-flow-step b,
article.post .post-flow-step span,
article.post .post-viz-card b,
article.post .post-viz-card span,
article.post .post-choice b,
article.post .post-choice span {
  display: block;
}

article.post .post-flow-step b,
article.post .post-viz-card b,
article.post .post-choice b {
  margin-bottom: 6px;
  color: var(--sugi);
  font-size: 13.5px;
  line-height: 1.55;
}

article.post .post-flow-step span,
article.post .post-viz-card span,
article.post .post-choice span {
  color: var(--ink3);
  font-size: 12.5px;
  line-height: 1.75;
}

article.post .post-flow-arrow {
  align-self: center;
  flex: 0 0 auto;
  color: var(--moegi-t);
  font-weight: 900;
}

article.post .post-viz-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 10px;
}

article.post .post-viz-card.is-primary {
  border-color: var(--moegi);
  background: var(--moegi-l);
}

article.post .post-viz-card.is-warn {
  border-color: #E6C87E;
  background: #FCF6E8;
}

article.post .post-timeline {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: timeline;
}

article.post .post-timeline > li {
  display: grid;
  grid-template-columns: 32px minmax(88px, 128px) minmax(0, 1fr);
  align-items: start;
  gap: 11px;
  margin: 0;
  padding: 13px 15px;
  border-left: 4px solid var(--moegi);
  background: var(--yuki);
  counter-increment: timeline;
}

article.post .post-timeline > li::before {
  content: counter(timeline, decimal-leading-zero);
  display: grid;
  width: 29px;
  height: 29px;
  place-items: center;
  border-radius: 50%;
  background: var(--sugi);
  color: var(--shiro);
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 800;
}

article.post .post-timeline b {
  color: var(--sugi);
  font-size: 13px;
  line-height: 1.65;
}

article.post .post-timeline span {
  color: var(--ink3);
  font-size: 12.5px;
  line-height: 1.75;
}

article.post .post-checks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}

article.post .post-checks > li {
  position: relative;
  margin: 0;
  padding: 12px 13px 12px 40px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--yuki);
  color: var(--ink2);
  font-size: 13px;
  line-height: 1.7;
}

article.post .post-checks > li::before {
  content: "✓";
  position: absolute;
  top: 12px;
  left: 14px;
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: var(--moegi-l);
  color: var(--sugi);
  font-size: 11px;
  font-weight: 900;
}

article.post .post-compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

article.post .post-choice {
  height: 100%;
}

article.post .post-choice .post-choice-label {
  display: inline-block;
  width: max-content;
  margin-bottom: 9px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--sugi);
  color: var(--shiro);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 800;
}

article.post .post-choice.is-recommended {
  border-color: var(--moegi);
  background: var(--moegi-l);
}

article.post .post-hard {
  margin: 18px 0 30px;
  padding: clamp(17px, 3vw, 24px);
  border: 1px solid #E7D5AA;
  border-radius: 16px;
  background: #FCF8ED;
}

article.post .post-hard-title {
  margin: 0 0 13px;
  color: var(--iwa);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.65;
}

article.post .post-hard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
  gap: 9px;
}

article.post .post-hard-item {
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #E7D5AA;
  border-radius: 11px;
  background: var(--shiro);
}

article.post .post-hard-item b,
article.post .post-hard-item span { display: block; }

article.post .post-hard-item b {
  margin-bottom: 5px;
  color: var(--iwa);
  font-size: 13px;
  line-height: 1.55;
}

article.post .post-hard-item span {
  color: var(--ink3);
  font-size: 12px;
  line-height: 1.75;
}

article.post .post-action {
  margin: 18px 0 30px;
  padding: clamp(18px, 3vw, 24px);
  border-radius: 16px;
  background: var(--sugi);
  color: var(--shiro);
}

article.post .post-action-title {
  margin: 0 0 12px;
  color: var(--shiro);
  font-size: 15px;
  font-weight: 800;
}

article.post .post-action ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 1.4em;
}

article.post .post-action li {
  margin: 0;
  color: rgba(255, 255, 255, .9);
  font-size: 13px;
  line-height: 1.75;
}

article.post .post-action li::marker { color: var(--moegi-b); }

article.post .post-action .term { color: var(--moegi-b); border-bottom-color: var(--moegi-b); }
article.post .post-action .term::after { background: var(--moegi-b); color: var(--sugi); }

.post-mobile-break { display: none; }

@media (max-width: 620px) {
  .post-mobile-break { display: block; }

  article.post .post-reader-grid,
  article.post .post-checks,
  article.post .post-compare {
    grid-template-columns: 1fr;
  }

  article.post .post-flow { flex-direction: column; }
  article.post .post-flow-arrow { transform: rotate(90deg); }

  article.post .post-timeline > li {
    grid-template-columns: 30px minmax(0, 1fr);
  }

  article.post .post-timeline > li > span {
    grid-column: 2;
  }
}

/* 既存の静的目次をデータ源・no-JSフォールバックとして使う追従目次 */
.post-toc-layout { width: 100%; }
.post-toc-layout > article.post { width: 100%; }
.post-toc-side { display: none; }
.post-toc-card { background: var(--shiro); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 16px 15px 14px; box-shadow: var(--sh-xs); }
.post-toc-title { margin: 0 0 10px; font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: .14em; color: var(--ink4); }
.post-toc-list { display: grid; gap: 2px; list-style: none; margin: 0; padding: 0; }
.post-toc-card .post-toc-link,
.post-toc-mobile-panel .post-toc-link { display: block; border: 0; border-left: 2px solid transparent; border-radius: 6px; padding: 6px 8px; color: var(--ink3); font-size: 11.5px; font-weight: 400; line-height: 1.65; text-decoration: none; transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease); }
.post-toc-card .post-toc-link.on,
.post-toc-mobile-panel .post-toc-link.on { background: var(--moegi-l); border-left-color: var(--moegi); color: var(--sugi); font-weight: 700; }
.post-toc-progress { height: 3px; margin-top: 12px; overflow: hidden; border-radius: 2px; background: var(--line2); }
.post-toc-progress-bar { display: block; width: 0; height: 100%; background: var(--moegi); transition: width .15s linear; }
.post-toc-progress-label { margin-top: 6px; color: var(--ink4); font-family: var(--mono); font-size: 10px; text-align: right; }
.post-toc-mobile { margin: 0 0 1.8em; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--shiro); }
.post-toc-mobile > summary { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 15px; color: var(--sugi); cursor: pointer; font-family: var(--mono); font-size: 11.5px; font-weight: 600; letter-spacing: .1em; list-style: none; }
.post-toc-mobile > summary::-webkit-details-marker { display: none; }
.post-toc-mobile > summary::after { content: '+'; color: var(--moegi-t); font-size: 18px; font-weight: 400; line-height: 1; }
.post-toc-mobile[open] > summary::after { content: '−'; }
.post-toc-mobile-panel { padding: 14px 15px 15px; border-top: 1px solid var(--line2); }

@media (min-width: 1120px) {
  .post-toc-layout { width: min(calc(100% - 32px), 1052px); margin-inline: auto; display: grid; grid-template-columns: 820px minmax(0, 200px); gap: clamp(20px, 2.2vw, 32px); align-items: start; }
  .post-toc-layout > article.post { width: 820px; max-width: 820px; margin-inline: 0; }
  .post-toc-side { display: block; position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; padding-top: clamp(36px, 5vw, 56px); }
  .post-toc-mobile { display: none; }
}

/* ═══ 大きい画面での読みやすさ（2026-08-23） ═══
   実測：1920pxで記事+目次は1052px（画面の55%）、本文は15.5px・47字/行だった。
   行長は足りていて、狭く見える原因は「文字が小さい」ことと
   「図解・表まで本文と同じ幅に閉じ込めている」ことの2つ。
   本文の行長（40〜45字）は崩さず、文字を上げ、図解だけ広げる。 */
@media (min-width: 1120px) {
  article.post p, article.post li { font-size: 17px; }
}
@media (min-width: 1400px) {
  .post-toc-layout { width: min(calc(100% - 32px), 1212px); grid-template-columns: 980px minmax(0, 200px); }
  .post-toc-layout > article.post { width: 980px; max-width: 980px; }
  /* 本文だけ行長を抑える。左端は図解とそろえる（中央寄せにすると左端が食い違う）。 */
  article.post > p, article.post > ul, article.post > ol { max-width: 760px; margin-inline: 0; }
  .related-posts-inner { max-width: 980px; }
}

@media (prefers-reduced-motion: reduce) {
  .post-toc-card .post-toc-link,
  .post-toc-mobile-panel .post-toc-link,
  .post-toc-progress-bar { transition: none !important; }
}


/* ---------- あわせて読みたい（記事末尾の回遊導線） ---------- */
.related-posts { padding: clamp(28px, 4vw, 44px) 0 0; }
.related-posts-inner { max-width: 820px; margin-inline: auto; padding-inline: clamp(20px, 4.5vw, 40px); }
.related-posts-t { font-family: var(--disp); font-size: clamp(17px, 2vw, 20px); font-weight: 800; letter-spacing: .02em; color: var(--iwa); margin: 0 0 16px; padding-left: 14px; border-left: 4px solid var(--moegi); }
.related-posts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 12px; }
.rp-card { display: flex; flex-direction: column; gap: 8px; padding: 16px 17px; background: var(--shiro); border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; transition: border-color .3s var(--ease), transform .3s var(--ease), box-shadow .3s var(--ease); }
.rp-card:hover { border-color: color-mix(in srgb, var(--moegi) 40%, var(--line)); transform: translateY(-2px); box-shadow: 0 12px 26px -16px rgba(18,63,48,.4); }
.rp-cat { align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; color: var(--moegi-t); background: var(--moegi-l); border-radius: 5px; padding: 3px 9px; }
.rp-title { font-family: var(--disp); font-size: 14px; font-weight: 800; line-height: 1.65; color: var(--iwa); word-break: auto-phrase; }
.rp-read { font-size: 11px; color: var(--ink4); letter-spacing: .04em; margin-top: auto; }
@media (prefers-reduced-motion: reduce) { .rp-card { transition: none; } }
