/* ===========================================================================
   Theme — Report 2026-20, "The Last Third"

   Aesthetic: the scorecard as ornament. The report's own finding — 36 per
   cent of targets moving, 49 per cent too slow, 15 per cent regressed — is
   drawn as a proportional three-state band that closes the masthead and
   repeats, thinner, under every section heading. Earth-brown ink on
   parchment; green, ochre and brick carry the three states throughout.
   Gloock sets the display, Nunito Sans reads, Inconsolata 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: #f6f2ea;
  --bg-card: #fffdf8;
  --bg-accent: #ece5d8;
  --bg-dark: #3b2a20;
  --bg-dark-2: #2a1d16;

  --text: #2b2420;
  --text-secondary: #4a3f38;
  --text-muted: #6f625a;
  --text-inverse: #f6efe6;

  --primary: #3b2a20;
  --primary-light: #5e4636;
  --accent: #b0412e;
  --accent-light: #d98c74;

  --border: #ddd4c4;
  --border-light: #ebe4d7;
  --rule: #c9bfae;

  /* The three states. */
  --moved: #3f7d5c;
  --stalled: #c99a2e;
  --reversed: #b0412e;

  --chart-blue: #3b2a20;
  --chart-blue-light: #9a8573;
  --chart-gold: #c99a2e;
  --chart-red: #b0412e;
  --chart-teal: #3f7d5c;
  --chart-gray: #9b9188;
  --chart-orange: #c9733a;
  --chart-purple: #5d4e6d;

  --serif: Gloock, Georgia, "Times New Roman", serif;
  --sans: "Nunito Sans", -apple-system, BlinkMacSystemFont, "system-ui", "Segoe UI", sans-serif;
  --mono: Inconsolata, ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* The scorecard band: 36 / 49 / 15, as reported. */
  --scorecard: linear-gradient(90deg,
    var(--moved) 0 36%, var(--stalled) 36% 85%, var(--reversed) 85% 100%);
}

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

::selection { background: rgba(63, 125, 92, 0.18); }
:where(a, button, [tabindex]):focus-visible { outline-color: var(--moved); }

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

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

/* --- masthead: parchment plate closed by the scorecard -------------------- */

.masthead {
  position: relative;
  background: var(--bg-accent);
  color: var(--text);
  border-top: 6px solid var(--primary);
  border-bottom: 0;
  padding: 3rem var(--gutter) 3.1rem;
}
.masthead::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 10px;
  background: var(--scorecard);
}
.masthead .overline {
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--accent);
  margin-bottom: 1.3rem;
}
.masthead h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 4.2rem);
  line-height: 1;
  letter-spacing: -0.01em;
  max-width: 16ch;
  color: var(--primary);
}
.masthead .subtitle {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  color: var(--text-secondary);
  max-width: 58ch;
}
.masthead .strapline {
  font-family: var(--sans);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-secondary);
  border-left: 4px solid var(--moved);
  max-width: 64ch;
}
.masthead .meta-row {
  border-top: 1px solid var(--rule);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.78rem;
}
.masthead .meta-row strong {
  color: var(--primary);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.66rem;
  letter-spacing: 0.14em;
}

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

.sticky-nav {
  background: rgba(246, 242, 234, 0.96);
  border-bottom: 1px solid var(--rule);
}
.nav-inner a {
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.02em;
}
.nav-inner a:hover { color: var(--primary); }
.nav-inner a.is-active { color: var(--primary); border-bottom-color: var(--moved); }

/* --- section headings: the scorecard, thin -------------------------------- */

section > h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 3.8vw, 2.2rem);
  letter-spacing: -0.005em;
  color: var(--primary);
  border-bottom: 0;
  padding-bottom: 0.75rem;
  background: var(--scorecard) left 100% / 100% 3px no-repeat;
}
section > .section-dek {
  font-style: normal;
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 68ch;
}
section > h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.32rem;
  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: 5px solid var(--primary);
}
.abstract h2 { color: var(--primary); font-family: var(--mono); letter-spacing: 0.14em; }

/* --- executive cards: one per state --------------------------------------- */

.exec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary);
  padding: 1.35rem 1.4rem 1.25rem;
}
.exec-card--moved { border-top-color: var(--moved); }
.exec-card--stalled { border-top-color: var(--stalled); }
.exec-card--reversed { border-top-color: var(--reversed); }
.exec-card .exec-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--text-muted);
}
.exec-card--moved .exec-title { color: var(--moved); }
.exec-card--stalled .exec-title { color: #94700f; }
.exec-card--reversed .exec-title { color: var(--reversed); }
.exec-card .exec-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 1.45rem;
  line-height: 1.12;
}

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-bottom: 4px solid var(--primary);
  padding: 1.1rem 1.2rem;
}
.stat-card .stat-value {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 2.1rem;
  color: var(--primary);
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.82rem; }
.stat-card .stat-source { font-family: var(--mono); font-size: 0.68rem; }

/* --- 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: 600;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  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 {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-top: 0;
  padding: 1.9rem 1.9rem 1.6rem;
  margin: 2.9rem 0;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 400;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.28;
  color: var(--primary);
  max-width: none;
}
.pull-quote::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 6px;
  background: var(--scorecard);
}
.pull-quote .attribution {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  font-weight: 600;
  margin-top: 0.9rem;
}

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

.callout {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 5px solid var(--moved);
  padding: 1.3rem 1.45rem;
}
.callout .callout-title { font-family: var(--mono); color: var(--moved); font-weight: 600; font-size: 0.68rem; letter-spacing: 0.12em; }
.callout strong { color: var(--text); }
.callout--warn { border-left-color: var(--stalled); }
.callout--warn .callout-title { color: #94700f; }

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

.data-table thead { background: var(--primary); color: var(--text-inverse); }
.data-table thead th { font-family: var(--mono); font-size: 0.66rem; font-weight: 500; letter-spacing: 0.06em; }
.data-table tbody tr:nth-child(even) { background: #f3eee4; }
.data-table tbody th { font-family: var(--serif); font-weight: 400; font-size: 1.05rem; color: var(--text); }
.table-caption { font-family: var(--mono); color: var(--primary); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.06em; }

/* State chips in Table 1. */
.st {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fff;
  padding: 0.2rem 0.5rem;
}
.st-moved { background: var(--moved); }
.st-stalled { background: var(--stalled); }
.st-reversed { background: var(--reversed); }

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

.ref-list .ref-org { font-family: var(--mono); color: var(--accent); font-size: 0.68rem; }
.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.7rem;
}
.endmatter dt { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 0.06em; }

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

.report-footer { position: relative; border-top: 0; padding-top: calc(3rem + 8px); }
.report-footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 8px;
  background: var(--scorecard);
}
.footer-inner h3 { color: #ffffff; font-family: var(--serif); font-weight: 400; font-size: 1.55rem; }
.footer-inner a { color: var(--accent-light); }
.cite-box { border-left-color: var(--moved); }
.cite-box strong { color: var(--accent-light); }

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

@media (max-width: 760px) {
  .masthead { padding-top: 2.4rem; padding-bottom: 2.6rem; }
  .pull-quote { padding: 1.6rem 1.3rem 1.3rem; }
  .st { font-size: 0.6rem; }
}

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

@media print {
  .masthead { background: #fff !important; border-top: 4px solid #3b2a20; }
  section > h2 { background: var(--scorecard) left 100% / 100% 3px no-repeat; }
  .pull-quote { background: #fff !important; }
}
