/* Article-page styles. Layered on top of styles-v2.css.
   Used by anything in /articles/*.html — load both stylesheets. */

:root {
  --amber: #ffd76b;
  --amber-soft: #fff4d0;
  --rose-soft: #fde2dc;
  --rose-deep: #a33;
  --ink-dim: #3b4742;
  --max-prose: 720px;
}

.article {
  max-width: var(--max-prose);
  margin: 0 auto;
  padding: 28px 20px 80px;
}

.article-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  margin-bottom: 24px;
}
.article-back:hover { color: var(--sage-deep); }
.article-back::before { content: "←"; }

.article-eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 700;
  margin-bottom: 14px;
  padding-left: 12px;
  border-left: 3px solid var(--sage);
}
.article-eyebrow .dot { color: var(--line); }
.article-eyebrow .date {
  color: var(--muted);
  letter-spacing: 0.04em;
  text-transform: none;
  font-weight: 500;
}

/* Article-type variants */
.article-eyebrow.alert {
  color: var(--accent-alert);
  border-left-color: var(--accent-alert);
}
.article-eyebrow.explainer {
  color: var(--accent-explainer);
  border-left-color: var(--accent-explainer);
}

.article h1 {
  font-size: clamp(26px, 5.6vw, 36px);
  line-height: 1.25;
  margin: 0 0 26px;
}

.article-hero-image {
  margin: -8px 0 28px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  background: var(--paper);
}

.article-hero-image img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* ---------- TL;DR card ---------- */

.tldr {
  background: var(--grass-soft);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin: 0 0 28px;
  position: relative;
}
.tldr .label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--sage-deep);
  font-weight: 700;
  margin-bottom: 8px;
}
.tldr p {
  font-size: 18px;
  line-height: 1.55;
  margin: 0;
  color: var(--ink);
}

/* ---------- Year warning (calm amber) ---------- */

.year-warning {
  background: var(--amber-soft);
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin: 0 0 24px;
  font-size: 15px;
  color: var(--ink-dim);
}
.year-warning strong { color: var(--ink); }

/* ---------- Article meta footer line ---------- */

.article-meta {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

/* ---------- Section headings ---------- */

.article h2 {
  font-size: clamp(20px, 4.4vw, 24px);
  margin: 44px 0 14px;
  letter-spacing: -0.005em;
}
.article h3 {
  font-size: 17px;
  margin: 24px 0 10px;
  color: var(--sage-deep);
}

.article p { margin: 0 0 14px; }
.article ul, .article ol { margin: 0 0 16px; padding-left: 22px; }
.article ul li, .article ol li { margin-bottom: 6px; }

/* ---------- Stat strip (used for "what happened" bullets) ---------- */

.stat-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 14px 0 24px;
}
.stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.stat .num {
  display: block;
  font-size: 26px;
  font-weight: 800;
  color: var(--sage-deep);
  line-height: 1.1;
  margin-bottom: 4px;
}
.stat .lbl {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.4;
}

/* ---------- Data tables ---------- */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 14px -4px 24px;
  padding: 0 4px;
}
.table-wrap .scroll-hint {
  font-size: 12px;
  color: var(--soft);
  margin-bottom: 6px;
}
@media (min-width: 720px) {
  .table-wrap .scroll-hint { display: none; }
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line);
  min-width: 560px;
}
table.data caption {
  text-align: left;
  font-weight: 700;
  font-size: 15px;
  color: var(--sage-deep);
  padding: 12px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
table.data caption .ref {
  display: block;
  font-weight: 500;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0;
}
table.data th, table.data td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data th {
  background: var(--paper);
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
  white-space: nowrap;
}
table.data tr:last-child td { border-bottom: none; }
table.data td.num {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
table.data td.over { color: var(--rose-deep); font-weight: 600; }
table.data td.ok { color: var(--sage-deep); font-weight: 600; }

/* ---------- Action blocks (§5 of the article) ---------- */

.actions {
  display: grid;
  gap: 14px;
  margin: 14px 0 28px;
}
.action {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}
.action h3 {
  margin: 0 0 8px;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--sage);
}
.action ul { margin: 0; padding-left: 18px; }
.action ul li { color: var(--ink-dim); font-size: 15px; }

@media (min-width: 720px) {
  .actions { grid-template-columns: repeat(3, 1fr); }
  .action ul li { font-size: 14px; }
}

/* ---------- Caveats ---------- */

.caveats {
  background: var(--paper);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  margin: 14px 0 28px;
}
.caveats ul { margin: 0; padding-left: 18px; }
.caveats li { color: var(--ink-dim); margin-bottom: 8px; font-size: 14.5px; }

/* ---------- Sources list ---------- */

.sources {
  margin: 32px 0 0;
  padding: 20px 22px;
  background: var(--paper);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  font-size: 14px;
}
.sources h2 { margin-top: 0; font-size: 17px; }
.sources ol { padding-left: 22px; margin: 8px 0 0; }
.sources li { margin-bottom: 10px; line-height: 1.5; color: var(--ink-dim); word-break: break-word; }
.sources a { color: var(--sage-deep); }

/* ---------- Article footer CTA ---------- */

.article-cta {
  margin-top: 40px;
  padding: 24px;
  background: var(--sky-pale);
  border-radius: var(--radius);
  text-align: center;
}
.article-cta h3 { margin-top: 0; }
.article-cta p { color: var(--muted); margin-bottom: 16px; }
.article-cta .hero-actions { justify-content: center; }

/* ============================================================
   MOBILE-FIRST ARTICLE PAGES (Phase 3 — 2026-05-23)
   --------------------------------------------------------------
   TL;DR card, year warning, caveats, summary→detail flow,
   long-form body typography, scrollable tables, footnote refs.
   Body-content typography overrides use body-selector prefix to
   beat per-page inline <style> blocks in detailed articles.
   ============================================================ */

@media (max-width: 719px) {
  /* Summary article container (alongside .article from Phase 2) */
  .article-summary {
    padding: 20px 16px 56px;
  }

  /* TL;DR card at top of detailed articles */
  .tldr {
    padding: 16px 18px;
    margin: 0 0 20px;
  }
  .tldr .label {
    font-size: 11px;
    margin-bottom: 6px;
  }
  .tldr p {
    font-size: 15px;
    line-height: 1.6;
  }

  /* Summary box on summary pages (amber/explainer-tinted callout) */
  .summary-box {
    padding: 18px 18px;
    margin: 16px 0 22px;
  }
  .summary-box .summary-label {
    font-size: 11px;
    margin-bottom: 8px;
  }
  .summary-box p {
    font-size: 15px;
    line-height: 1.65;
  }

  .summary-context {
    font-size: 15px;
    margin-bottom: 24px;
  }

  /* Year warning amber callout */
  .year-warning {
    padding: 14px 16px;
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 18px;
  }
  .year-warning a {
    word-break: break-word;
  }

  /* Read-more CTA on summary pages → full-width button */
  .read-more-cta {
    padding: 20px 18px;
    margin: 4px 0 20px;
  }
  .read-more-cta .button.primary {
    padding: 14px 24px;
    font-size: 15px;
    width: 100%;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
  }
  .read-more-cta .read-more-note {
    font-size: 12px;
  }

  /* Caveats box */
  .caveats {
    padding: 16px 18px;
    margin: 14px 0 22px;
  }
  .caveats li {
    font-size: 14px;
    line-height: 1.55;
    margin-bottom: 6px;
  }

  /* ----- Long-form body typography (detailed articles' .body wrapper).
     `body` selector prefix beats the per-page inline <style> at the
     same class specificity, so these overrides actually take effect. */
  body .article .body h2 {
    font-size: 19px;
    margin: 32px 0 12px;
  }
  body .article .body h3 {
    font-size: 16px;
    margin: 22px 0 10px;
  }
  body .article .body p {
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 14px;
  }
  body .article .body ul,
  body .article .body ol {
    padding-left: 20px;
    margin: 0 0 16px;
  }
  body .article .body li {
    font-size: 15px;
    line-height: 1.65;
    margin-bottom: 6px;
  }

  /* ----- Tables: scroll horizontally on mobile.
     display:block + overflow-x:auto turns the table into a scrolling
     container; white-space:nowrap stops cells from collapsing to one
     letter wide. Applies to both .body inline tables and .table-wrap. */
  body .article .body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
    font-size: 13px;
  }
  body .article .body table th,
  body .article .body table td {
    padding: 8px 10px;
  }
  table.data {
    font-size: 13px;
    min-width: 480px;
  }
  table.data th, table.data td {
    padding: 8px 10px;
  }
  table.data caption {
    font-size: 14px;
    padding: 10px 12px;
  }

  /* ----- Footnote system (Markdown-rendered footnotes) ----- */
  .footnote {
    font-size: 13px;
    line-height: 1.55;
    color: var(--ink-dim);
    margin-top: 32px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }
  .footnote ol {
    padding-left: 20px;
  }
  .footnote li {
    margin-bottom: 10px;
    word-break: break-word;
  }
  /* Inline footnote ref and backref — same expanded hit-area trick as .cite-ref */
  .footnote-ref,
  .footnote-backref {
    position: relative;
    padding: 0 2px;
    text-decoration: none;
    color: var(--accent-explainer);
    font-weight: 600;
  }
  .footnote-ref::after,
  .footnote-backref::after {
    content: "";
    position: absolute;
    inset: -14px -6px;
  }

  /* Actions block: tighter spacing (already mobile-first 1-col by default) */
  .actions { gap: 10px; }
  .action { padding: 14px 16px; }
  .action h3 { font-size: 13px; }
  .action ul li { font-size: 14px; }

  /* TL;DR card stat-strip — already done in Phase 2 (.stat-strip→1fr) */
}
