/* docs.css — page layer for /docs/** and /methodology/ (loaded after help.css and guides.css).
   Colors only through var(--color-*) from rr.css. Shared .doc-* rules live in guides.css; this file
   holds what is specific to the documentation set: the page head tint, the evidence ledger, the
   stacked table for phones, the methodology classes that replaced style="" attributes, and print. */

/* ---- Page head (uses the docs tint token) ---- */
.doc-head { padding: var(--sp-6) var(--sp-6) var(--sp-6); margin: 0 0 var(--sp-8); border: 1px solid var(--color-border); border-radius: var(--r-xl); background: var(--color-bg-docs); }
.doc-head .help-title, .doc-head .help-lede { color: var(--color-text); }
.doc-head .help-lede { color: var(--color-text-2); }
.doc-head .doc-byline a { color: var(--color-primary-hover); text-decoration: underline; text-underline-offset: 0.2em; }
.doc-hub-h2 { margin: 0 0 var(--sp-4); font-family: var(--font-ui); font-size: var(--text-sm); font-weight: 600; color: var(--color-text-3); }

/* ---- Evidence ledger (/docs/papers/) ---- */
.ledger { margin-top: var(--sp-12); padding-top: var(--sp-8); border-top: 1px solid var(--color-border); }
.ledger h2 { margin-bottom: var(--sp-3); }
.ledger h3 { margin: var(--sp-8) 0 var(--sp-3); scroll-margin-top: 88px; }
.ledger-grades { font-size: var(--text-sm); color: var(--color-text-3); line-height: 1.7; }
.ledger-grades + .ledger-grades { margin-top: var(--sp-2); }
.ledger-grades a { color: var(--color-primary-hover); text-decoration: underline; text-underline-offset: 0.2em; }
.ledger-claim { padding: var(--sp-4) 0; border-bottom: 1px solid var(--color-border); scroll-margin-top: 88px; }
.ledger-claim:target { background: var(--color-bg-docs); box-shadow: 0 0 0 var(--sp-3) var(--color-bg-docs); }
.ledger-stmt { margin: 0 0 var(--sp-1); line-height: var(--lh-ja); }
.ledger-cert, .ledger-sub { margin: var(--sp-1) 0; font-size: var(--text-xs); font-weight: 700; color: var(--color-text-3); }
.ledger-id { font-weight: 500; color: var(--color-primary-hover); text-decoration: none; font-variant-numeric: tabular-nums; }
.ledger-id:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.ledger-works { margin: var(--sp-1) 0 0; padding-left: 1.2em; font-size: var(--text-sm); line-height: 1.7; color: var(--color-text-2); overflow-wrap: anywhere; }
.ledger-works a { color: var(--color-primary-hover); }
.ledger-history { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); line-height: 1.7; color: var(--color-text-2); }
.ledger-history li + li { margin-top: var(--sp-2); }
.ledger-history a { color: var(--color-primary-hover); }

/* ---- Tables that stack on phones (th[scope=row] becomes the heading of each block) ---- */
@media (max-width: 640px) {
  .doc-table-stack { border: none; border-radius: 0; overflow: visible; }
  .doc-table-stack table { min-width: 0; }
  .doc-table-stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .doc-table-stack tbody, .doc-table-stack tr, .doc-table-stack th, .doc-table-stack td { display: block; }
  .doc-table-stack tr { padding: var(--sp-3) 0 var(--sp-4); border-bottom: 1px solid var(--color-border); }
  .doc-table-stack tr:last-child { border-bottom: none; }
  .doc-table-stack th[scope=row] { padding: 0 0 var(--sp-2); border-bottom: none; font-family: var(--font-ui); font-size: var(--text-body-lg); font-weight: 600; color: var(--color-text); }
  .doc-table-stack td { padding: var(--sp-2) 0; border-bottom: none; }
  .doc-table-stack td::before { content: attr(data-label); display: block; margin-bottom: 2px; font-family: var(--font-ui); font-size: var(--text-xs); font-weight: 600; color: var(--color-text-3); }
}

/* ---- Methodology (classes that replaced inline style attributes) ---- */
.meth-page { padding-top: 0; }
.u-mt-2 { margin-top: var(--sp-2); }
.u-mb-4 { margin-bottom: var(--sp-4); }
.acwr-div { font-size: .75em; font-weight: 400; color: var(--color-text-3); }
.acwr-note { margin-top: var(--sp-4); font-size: var(--text-sm); line-height: 1.75; color: var(--color-text-3); }
.acwr-note strong { color: var(--color-text); }
.acwr-refs { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-4); }
.papers-layout--single { grid-template-columns: 1fr; }
.papers-chips-caption { margin: var(--sp-4) 0 var(--sp-2); font-family: var(--font-ui); font-size: var(--text-xs); font-weight: 600; color: var(--color-text-3); }
.section-eyebrow--muted { color: var(--color-text-3); }
.guard-em { font-style: normal; color: var(--color-primary-hover); }
.guard-em--en { font-style: italic; }
.ayumu-stat-row--single { grid-template-columns: 1fr; }
.svg-label { font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif; }
.meth-corrections { max-width: var(--max-w-text); margin: clamp(32px, 5vw, 48px) auto 0; padding: var(--sp-5) var(--sp-6); border: 1px solid var(--color-border); border-radius: var(--r-lg); background: var(--color-bg-docs); font-size: var(--text-sm); line-height: 1.75; color: var(--color-text-2); }
.meth-corrections h2 { margin: 0 0 var(--sp-2); font-family: var(--font-ui); font-size: var(--text-body-lg); font-weight: 600; color: var(--color-text); }
.meth-corrections a { color: var(--color-primary-hover); text-decoration: underline; text-underline-offset: 0.2em; }
.meth-corrections p + p { margin-top: var(--sp-2); }

@media (prefers-reduced-motion: reduce) {
  .ledger-id { transition: none; }
}

/* ---- Print: article only, link targets spelled out ---- */
@media print {
  .nav, .mobile-menu, .skip-link, .footer, .status-banner, [data-status-ai], .help-aside, .help-toc, .nav-cta, .version-bar, .hero-badge-strip { display: none !important; }
  .page, .meth-page { padding-top: 0; }
  .help-layout { display: block; max-width: none; }
  .help-article, .meth-corrections { max-width: none; }
  .doc-head, .meth-corrections, .ledger-claim:target { background: none; box-shadow: none; }
  .doc-card, .help-table, .doc-head { break-inside: avoid; }
  .ledger-claim { break-inside: avoid; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; color: var(--color-text-3); overflow-wrap: anywhere; }
  .ledger-works a[href^="http"]::after, .doc-cite a[href^="http"]::after, .doc-sources a[href^="http"]::after { content: none; }
  .guard-section, .ayumu-section { background: none; border: 1px solid var(--color-border); color: var(--color-text); }
  .guard-header h2, .guard-header p { color: var(--color-text); }
}
