/* ===========================================================================
   Theme — Report 2026-14, "Food, Energy, Water: Disruption and Substitution"

   Aesthetic: stratigraphy. The masthead is a dark water-blue ground banded in
   horizontal strata, like a section drawn through an aquifer; section
   headings sit on a three-band rule (water, silt, wheat) that repeats the
   motif; substitution numbers are set in small banded chips. Instrument
   Serif — high contrast, narrow — carries the display, Mulish the argument,
   Azeret Mono the labels.

   Loaded after report.css: tokens first (which also re-colours every chart,
   since report.js reads the palette from them), then the rules that assume
   the default surface.
   =========================================================================== */

:root {
  --bg: #f7f5f0;
  --bg-card: #ffffff;
  --bg-accent: #ece7dc;
  --bg-dark: #0d3a46;
  --bg-dark-2: #092a33;

  --text: #1a2224;
  --text-secondary: #384447;
  --text-muted: #6a7477;
  --text-inverse: #eef4f4;

  --primary: #0f4c5c;
  --primary-light: #2a7f8f;
  --accent: #c8963e;
  --accent-light: #dfb56a;

  --border: #dbd5c8;
  --border-light: #e9e4d9;
  --rule: #c5bfb0;

  --chart-blue: #0f4c5c;
  --chart-blue-light: #6aa7b3;
  --chart-gold: #c8963e;
  --chart-red: #a2542f;
  --chart-teal: #2a7f8f;
  --chart-gray: #8d8b82;
  --chart-orange: #c07b3a;
  --chart-purple: #5a5f7d;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: Mulish, -apple-system, BlinkMacSystemFont, "system-ui", "Segoe UI", sans-serif;
  --mono: "Azeret Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Strata: horizontal bands, deepest at the foot of the masthead. */
  --strata: repeating-linear-gradient(180deg,
    rgba(255, 255, 255, 0.05) 0 3px,
    rgba(255, 255, 255, 0) 3px 26px,
    rgba(200, 150, 62, 0.10) 26px 29px,
    rgba(255, 255, 255, 0) 29px 58px);
}

body { font-size: 1.03rem; line-height: 1.76; }

::selection { background: rgba(15, 76, 92, 0.16); }
:where(a, button, [tabindex]):focus-visible { outline-color: var(--accent); }

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

.progress__bar { background: var(--accent); }
.skip-link { background: var(--primary); }

/* --- masthead: a section through the water table -------------------------- */

.masthead {
  position: relative;
  background: var(--strata), linear-gradient(180deg, #11515f 0%, #0d3a46 62%, #092a33 100%);
  color: var(--text-inverse);
  border-bottom: 0;
  padding: 3.2rem var(--gutter) 3rem;
}
/* Three strata close the masthead: water, silt, wheat. */
.masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 9px;
  background: linear-gradient(var(--primary-light), var(--primary-light)) top / 100% 3px no-repeat,
    linear-gradient(#8a7a55, #8a7a55) center / 100% 3px no-repeat,
    linear-gradient(var(--accent), var(--accent)) bottom / 100% 3px no-repeat;
}
.masthead .overline {
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.2em;
  color: var(--accent-light);
  margin-bottom: 1.3rem;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.3rem, 6vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: 0;
  max-width: 20ch;
  color: #ffffff;
}
.masthead .subtitle {
  font-family: var(--sans);
  font-weight: 300;
  font-size: clamp(1rem, 2.2vw, 1.18rem);
  color: rgba(238, 244, 244, 0.82);
  max-width: 56ch;
}
.masthead .strapline {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.02rem, 2.3vw, 1.2rem);
  color: rgba(238, 244, 244, 0.86);
  border-left: 3px solid var(--accent);
  max-width: 60ch;
}
.masthead .meta-row {
  border-top: 1px solid rgba(238, 244, 244, 0.22);
  color: rgba(238, 244, 244, 0.76);
  font-family: var(--mono);
  font-size: 0.72rem;
}
.masthead .meta-row strong {
  color: var(--accent-light);
  font-family: var(--mono);
  font-weight: 500;
  font-size: 0.6rem;
  letter-spacing: 0.14em;
}

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

.sticky-nav {
  background: rgba(247, 245, 240, 0.95);
  border-bottom: 1px solid var(--rule);
}
.nav-inner a {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.nav-inner a:hover { color: var(--primary); }
.nav-inner a.is-active { color: var(--primary); border-bottom-color: var(--accent); }

/* --- section headings: three strata --------------------------------------- */

section > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.8vw, 2.2rem);
  letter-spacing: 0;
  color: var(--text);
  border-bottom: 0;
  padding-bottom: 0.75rem;
  background: linear-gradient(var(--primary-light), var(--primary-light)) left calc(100% - 6px) / 100% 2px no-repeat,
    linear-gradient(#a99a76, #a99a76) left calc(100% - 3px) / 100% 2px no-repeat,
    linear-gradient(var(--accent), var(--accent)) left 100% / 100% 2px no-repeat;
}
section > .section-dek {
  font-style: normal;
  color: var(--text-muted);
  font-size: 1.01rem;
  max-width: 68ch;
}
section > h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.36rem;
  color: var(--primary);
  margin: 2.4rem 0 0.7rem;
}

/* The generated Abstract and Metadata blocks are sections too; keep them plain. */
.abstract h2,
.endmatter h2 { background: none; }

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

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

.abstract {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}
.abstract h2 { color: var(--primary); font-family: var(--mono); letter-spacing: 0.14em; }

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

.exec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  padding: 1.35rem 1.4rem 1.25rem;
}
.exec-card:nth-child(2) { border-top-color: #a99a76; }
.exec-card:nth-child(3) { border-top-color: var(--accent); }
.exec-card .exec-num {
  font-family: var(--mono);
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.exec-card .exec-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.3rem;
  line-height: 1.16;
  color: var(--text);
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--accent);
  padding: 1.1rem 1.2rem;
}
.stat-card .stat-value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.15rem;
  letter-spacing: 0;
  color: var(--primary);
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.8rem; }
.stat-card .stat-source { font-family: var(--mono); font-size: 0.62rem; }

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

.chart-container { background: var(--bg-card); border: 1px solid var(--border); padding: 1.25rem 1.35rem; }
.chart-container .chart-label {
  font-family: var(--mono);
  color: var(--primary);
  font-weight: 500;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--border-light);
}
.chart-container .chart-caption {
  font-style: normal;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}
.schematic-wrap { background: var(--bg-card); }

/* --- pull quote ------------------------------------------------------------ */

.pull-quote {
  background: var(--bg-accent);
  border: 0;
  border-top: 3px solid var(--primary);
  border-bottom: 3px solid var(--accent);
  padding: 1.7rem 1.8rem 1.5rem;
  margin: 2.9rem 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.3rem, 3.1vw, 1.75rem);
  line-height: 1.26;
  color: var(--text);
  max-width: none;
}
.pull-quote .attribution {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--primary);
  font-weight: 500;
  margin-top: 0.9rem;
}

/* --- callouts -------------------------------------------------------------- */

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 1.3rem 1.45rem;
}
.callout .callout-title { font-family: var(--mono); color: var(--primary); font-weight: 500; font-size: 0.62rem; letter-spacing: 0.12em; }
.callout strong { color: var(--text); }
.callout--warn { border-left-color: var(--chart-red); }
.callout--warn .callout-title { color: var(--chart-red); }

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

.data-table thead { background: var(--bg-dark); color: var(--text-inverse); }
.data-table thead th { font-family: var(--mono); font-size: 0.6rem; font-weight: 500; letter-spacing: 0.06em; }
.data-table tbody tr:nth-child(even) { background: #f3efe6; }
.data-table tbody th { font-family: var(--serif); font-weight: 400; font-size: 1.08rem; color: var(--text); }
.table-caption { font-family: var(--mono); color: var(--primary); font-weight: 500; font-size: 0.64rem; letter-spacing: 0.08em; }

/* Substitution numbers in Table 2, banded like the strata. */
.sb {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: #fff;
  background: var(--primary);
  padding: 0.14rem 0.36rem;
  margin-right: 0.4rem;
}
.sb-2 { background: #2a7f8f; }
.sb-3 { background: #a99a76; }
.sb-4 { background: var(--accent); }

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

.ref-list .ref-org { font-family: var(--mono); color: var(--accent); font-size: 0.61rem; }
.endmatter h2 { color: var(--primary); border-bottom: 2px solid var(--rule); }
.endmatter .kw {
  background: var(--bg-accent);
  border-color: var(--border-light);
  font-family: var(--mono);
  font-size: 0.64rem;
}
.endmatter dt { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 0.06em; }

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

.report-footer { border-top: 8px solid var(--accent); }
.footer-inner h3 { color: #ffffff; font-family: var(--serif); font-weight: 400; font-size: 1.5rem; }
.footer-inner a { color: var(--accent-light); }
.cite-box { border-left-color: var(--accent); }
.cite-box strong { color: var(--accent-light); }

/* --- responsive ------------------------------------------------------------ */

@media (max-width: 760px) {
  .masthead { padding-top: 2.4rem; padding-bottom: 2.4rem; }
  .pull-quote { padding: 1.4rem 1.3rem 1.2rem; }
}

/* --- print ----------------------------------------------------------------- */

@media print {
  .masthead { background: #fff !important; color: #000; }
  .masthead h1, .masthead .subtitle, .masthead .strapline, .masthead .meta-row { color: #000 !important; }
  .masthead .overline, .masthead .meta-row strong { color: #0f4c5c !important; }
  section > h2 { background: none; border-bottom: 2px solid #0f4c5c; }
  .pull-quote { background: #f3f3f3 !important; }
}
