/* ===========================================================================
   Theme — Report 2026-04, "Breaking the Pollution–Poverty–Climate Nexus"

   Aesthetic: dark editorial. The first report in the series to run dark all
   the way through rather than only in the masthead — a near-black ground,
   amber structure, coral for harm, and Fraunces / Figtree / Space Mono.

   Long-form on a dark ground needs deliberate handling: body copy is set on
   a desaturated blue-grey rather than pure black, at a slightly larger size
   and looser leading than the light themes, and text colours are held above
   a 9:1 contrast ratio. Chart palettes are lightened accordingly, since
   report.js reads them from these tokens.
   =========================================================================== */

:root {
  --bg: #14181d;
  --bg-card: #1c2229;
  --bg-accent: #232b34;
  --bg-dark: #0d1014;
  --bg-dark-2: #090c0f;

  --text: #eceff3;
  --text-secondary: #bcc3cb;
  --text-muted: #8b939d;
  --text-inverse: #eceff3;

  --primary: #ffb454;
  --primary-light: #ffc97a;
  --accent: #ff6b6b;
  --accent-light: #ff9a8b;

  --border: #2f3841;
  --border-light: #242c35;
  --rule: #3b4550;

  --chart-blue: #6ea8fe;
  --chart-blue-light: #a5c8ff;
  --chart-gold: #ffb454;
  --chart-red: #ff6b6b;
  --chart-teal: #4ecdc4;
  --chart-gray: #8b939d;
  --chart-orange: #ff9f43;
  --chart-purple: #b28dff;

  --serif: Fraunces, Georgia, "Times New Roman", serif;
  --sans: Figtree, -apple-system, BlinkMacSystemFont, "system-ui", sans-serif;
  --mono: "Space Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-width: 960px;
}

/* Dark ground needs a little more air in the body copy than the light
   themes do, or long passages close up. */
body { font-size: 1.03rem; line-height: 1.78; }

a { color: var(--primary); }
a:hover { color: var(--primary-light); }

::selection { background: rgba(255, 180, 84, 0.3); color: #fff; }
:where(a, button, [tabindex]):focus-visible { outline-color: var(--primary); }

.progress__bar { background: var(--primary); }
.skip-link { background: var(--primary); color: #14181d; }

/* --- masthead: near-black, amber-ruled ------------------------------------ */

.masthead {
  border-bottom: 4px solid var(--primary);
  padding: 3rem var(--gutter) 2.6rem;
}
.masthead-inner { border-top: 1px solid rgba(255, 180, 84, 0.35); padding-top: 1.8rem; }
.masthead .overline { color: var(--primary); font-weight: 700; font-size: 0.68rem; }
.masthead h1 {
  font-weight: 600;
  letter-spacing: -0.018em;
  color: #fff;
  max-width: 19ch;
  font-size: clamp(2rem, 5.4vw, 3rem);
}
.masthead .subtitle { color: rgba(236, 239, 243, 0.72); font-weight: 400; max-width: 60ch; }
.masthead .strapline {
  border-left: 3px solid var(--accent);
  color: rgba(236, 239, 243, 0.62);
  font-family: var(--sans);
  font-style: normal;
  font-size: 0.98rem;
}
/* Cells are separated by space rather than rules: the row wraps at narrow
   widths, and a right-hand rule is then left dangling at the end of a line. */
.masthead .meta-row {
  border-top: 1px solid rgba(236, 239, 243, 0.14);
  font-family: var(--mono);
  font-size: 0.74rem;
  gap: 1.1rem 2.8rem;
}
.masthead .meta-row strong {
  color: var(--primary);
  font-family: var(--sans);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

/* --- sticky nav ------------------------------------------------------------ */

.sticky-nav {
  background: rgba(13, 16, 20, 0.94);
  border-bottom: 1px solid var(--border);
}
.nav-inner a { color: var(--text-muted); font-size: 0.81rem; font-weight: 500; }
.nav-inner a:hover { color: var(--text); }
.nav-inner a.is-active { color: var(--primary); border-bottom-color: var(--primary); }

/* --- section headings: amber, rule beneath at full measure ---------------- */

section > h2 {
  color: var(--primary);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 0.7rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
section > .section-dek {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.97rem;
  max-width: 68ch;
}
section > h3 {
  font-family: var(--sans);
  font-size: 1.14rem;
  font-weight: 600;
  color: #fff;
  margin: 2.4rem 0 0.7rem;
}
section > h4 { color: var(--primary); font-family: var(--mono); font-size: 0.8rem; }

.section-rule { border-top: 1px solid var(--border); margin: 3.2rem 0 3.4rem; }

/* --- abstract -------------------------------------------------------------- */

.abstract {
  background: var(--bg-card);
  border: 0;
  border-left: 3px solid var(--primary);
}
.abstract h2 { color: var(--primary); border: 0; }
.abstract p { color: var(--text-secondary); }

/* --- statistics ------------------------------------------------------------ */

.stat-card {
  background: var(--bg-card);
  border: 0;
  border-left: 0;
  border-top: 3px solid var(--accent);
  padding: 1.2rem 1.3rem 1.15rem;
}
.stat-card .stat-value { color: var(--primary); font-weight: 600; font-size: 1.85rem; }
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.79rem; }
.stat-card .stat-source { color: var(--text-muted); }

/* --- executive cards ------------------------------------------------------- */

.exec-card { background: var(--bg-card); border: 0; padding: 1.4rem; }
.exec-card .exec-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  line-height: 1;
}
.exec-card .exec-title {
  font-family: var(--serif);
  font-size: 1.16rem;
  font-weight: 600;
  color: #fff;
  margin: 0.6rem 0 0.5rem;
}
.exec-card .exec-body { color: var(--text-secondary); }

/* --- charts ---------------------------------------------------------------- */

.chart-container { background: var(--bg-card); border: 0; padding: 1.3rem 1.4rem; }
.chart-container .chart-label {
  color: var(--primary);
  font-weight: 700;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.7rem;
}
.chart-container .chart-caption {
  font-style: normal;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}
.schematic-wrap { background: var(--bg-card); }

/* --- pull quote: ruled above, full measure -------------------------------- */

.pull-quote {
  background: transparent;
  border-left: 0;
  border-top: 2px solid var(--primary);
  padding: 1.4rem 0 0;
  margin: 2.8rem 0;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.7vw, 1.55rem);
  line-height: 1.36;
  color: #fff;
  max-width: 34ch;
}
.pull-quote .attribution {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin-top: 0.9rem;
}

/* --- callouts: inset panels, no border ------------------------------------ */

.callout {
  background: var(--bg-accent);
  border: 0;
  border-left: 3px solid var(--accent);
  padding: 1.3rem 1.4rem;
  color: var(--text-secondary);
}
.callout .callout-title { color: var(--accent); font-weight: 700; }
.callout strong { color: var(--primary); }
.callout--warn { border-left-color: var(--primary); }
.callout--warn .callout-title { color: var(--primary); }

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

.data-table thead { background: var(--bg-dark); color: var(--primary); }
.data-table tbody th { color: #fff; border-bottom-color: var(--border-light); }
.data-table tbody td { border-bottom-color: var(--border-light); }
.data-table tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.025); }
.data-table tbody tr:hover { background: rgba(255, 180, 84, 0.08); }
.table-caption { color: var(--primary); font-weight: 700; }
.table-note { color: var(--text-muted); }

.matrix th, .matrix td { border-color: var(--border-light); }
.matrix thead th { background: var(--bg-dark); color: var(--primary); }
.matrix tbody th { background: var(--bg-card); color: var(--text); }
.matrix tbody tr:hover th { background: var(--bg-accent); }
.matrix .lv0 { background: #1f262e; color: var(--text-muted); }
.matrix .lv1 { background: #3a4652; color: var(--text); }
.matrix .lv2 { background: #b3762e; color: #fff; }
.matrix .lv3 { background: #ffb454; color: #14181d; }
.matrix-key { color: var(--text-muted); }
.matrix-key i { border-color: var(--border); }

/* --- references and end matter -------------------------------------------- */

.ref-list li { border-bottom-color: var(--border-light); color: var(--text-secondary); }
.ref-list .ref-org { color: var(--accent); }
.endmatter h2 { color: var(--primary); border-bottom-color: var(--rule); }
.endmatter__list > div { border-bottom-color: var(--border-light); }
.endmatter dd { color: var(--text-secondary); }
.endmatter .kw {
  background: var(--bg-accent);
  border-color: var(--border);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.7rem;
}

/* --- footer ---------------------------------------------------------------- */

.report-footer { border-top: 4px solid var(--primary); }
.footer-inner h3 { color: var(--primary); }
.cite-box { background: rgba(0, 0, 0, 0.35); border-left-color: var(--primary); }
.cite-box strong { color: var(--primary); }

/* --- print: invert back to ink on paper ------------------------------------ */

@media print {
  :root {
    --bg: #fff; --bg-card: #fff; --bg-accent: #f4f4f4;
    --text: #000; --text-secondary: #222; --text-muted: #555;
    --primary: #8a5a00; --accent: #a03030;
    --border: #bbb; --border-light: #ddd; --rule: #999;
  }
  body { background: #fff; color: #000; }
  .masthead, .report-footer { background: #fff !important; color: #000 !important; }
  .masthead h1, section > h3, .exec-card .exec-title, .pull-quote { color: #000 !important; }
  .masthead .subtitle, .masthead .meta-row { color: #333 !important; }
  .data-table thead, .matrix thead th { background: #eee !important; color: #000 !important; }
}
