/* ===========================================================================
   Theme — Report 2026-07, "A Proactive Strategy for Mitigating the
   Twenty-First-Century Polycrisis"

   Aesthetic: classical journal. Warm cream, deep burgundy, a contrasting
   teal, and a high-contrast didone for display. The distinguishing move is
   compositional rather than chromatic: this is the first report in the
   series with a centred, symmetric masthead — a title page rather than a
   left-aligned banner.

   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: #faf6ef;
  --bg-card: #ffffff;
  --bg-accent: #f2ebe0;
  --bg-dark: #2b1a1d;
  --bg-dark-2: #1e1114;

  --text: #221a1a;
  --text-secondary: #4a3c3c;
  --text-muted: #7d6d6d;
  --text-inverse: #f7f1e8;

  --primary: #7a1f2b;
  --primary-light: #a03544;
  --accent: #12574f;
  --accent-light: #1d7f74;

  --border: #ded2c2;
  --border-light: #ebe2d5;
  --rule: #c4b39c;

  --chart-blue: #2f4a6d;
  --chart-blue-light: #7d95b5;
  --chart-gold: #9c6b1f;
  --chart-red: #7a1f2b;
  --chart-teal: #12574f;
  --chart-gray: #8a7f75;
  --chart-orange: #b5541f;
  --chart-purple: #5b3a5e;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --sans: Jost, -apple-system, BlinkMacSystemFont, "system-ui", sans-serif;
  --mono: "Courier Prime", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-width: 940px;
}

/* Jost runs small and open; nudge the body up a little. */
body { font-size: 1.05rem; line-height: 1.72; }

/* Courier Prime is a light typewriter face: set in uppercase at 11px with
   wide tracking, its slab serifs run together and the label reads as a struck
   -through rule rather than as letters. Every mono label therefore carries
   extra weight and a slightly larger size in this theme. */
.abstract h2,
.endmatter h2,
.callout .callout-title,
.chart-container .chart-label,
.table-caption,
.ref-list .ref-org,
.stat-card .stat-source,
.pull-quote .attribution { font-weight: 700; }
.abstract h2,
.endmatter h2 { font-size: 0.78rem; letter-spacing: 0.1em; }
.chart-container .chart-label,
.table-caption { font-size: 0.7rem; letter-spacing: 0.08em; }

::selection { background: rgba(122, 31, 43, 0.16); }
:where(a, button, [tabindex]):focus-visible { outline-color: var(--primary); }

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

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

/* --- masthead: a centred title page --------------------------------------- */

.masthead {
  background: var(--bg);
  color: var(--text);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 3rem var(--gutter) 0;
}
.masthead-inner {
  text-align: center;
  border-top: 3px double var(--primary);
  padding-top: 2.2rem;
}
.masthead .overline {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.68rem;
  letter-spacing: 0.22em;
  margin-bottom: 1.5rem;
}
.masthead h1 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.005em;
  line-height: 1.12;
  max-width: 20ch;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(2rem, 5vw, 2.9rem);
}
.masthead .subtitle {
  color: var(--text-secondary);
  font-weight: 400;
  font-style: italic;
  font-family: var(--serif);
  max-width: 54ch;
  margin-left: auto;
  margin-right: auto;
  font-size: clamp(1.02rem, 2.2vw, 1.18rem);
}
.masthead .strapline {
  border-left: 0;
  padding: 1.3rem 0 0;
  margin: 1.5rem auto 0;
  border-top: 1px solid var(--border);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 400;
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 52ch;
}
.masthead .meta-row {
  justify-content: center;
  gap: 1rem 2.6rem;
  margin-top: 2.2rem;
  padding: 1.2rem 0 1.8rem;
  border-top: 1px solid var(--rule);
  border-bottom: 3px double var(--primary);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-align: center;
}
.masthead .meta-row strong {
  color: var(--accent);
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin-bottom: 0.3rem;
}

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

.sticky-nav {
  background: rgba(43, 26, 29, 0.96);
  border-bottom: 1px solid rgba(247, 241, 232, 0.14);
}
.nav-inner a {
  color: rgba(247, 241, 232, 0.66);
  font-size: 0.82rem;
  letter-spacing: 0.01em;
}
.nav-inner a:hover { color: #fff; }
.nav-inner a.is-active { color: var(--accent-light); border-bottom-color: var(--accent-light); }

/* --- section headings: a short rule above --------------------------------- */

section > h2 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.005em;
  border-bottom: 0;
  padding-bottom: 0;
  position: relative;
  padding-top: 1.3rem;
}
section > h2::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 64px;
  height: 3px;
  background: var(--accent);
}
section > .section-dek {
  font-style: italic;
  font-family: var(--serif);
  color: var(--text-muted);
  font-size: 1.02rem;
  margin-top: 0.7rem;
  max-width: 64ch;
}
section > h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.22rem;
  color: var(--text);
  margin: 2.4rem 0 0.7rem;
}
section > h4 { color: var(--accent); font-family: var(--mono); font-size: 0.82rem; }

.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: 1px solid var(--border);
  border-top: 3px double var(--primary);
}
.abstract h2 { color: var(--accent); }

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

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-bottom: 3px solid var(--primary);
  padding: 1.2rem 1.25rem 1.1rem;
}
.stat-card .stat-value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.95rem;
  color: var(--primary);
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.8rem; }

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

.exec-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 1.5rem;
  text-align: center;
}
.exec-card .exec-num {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--accent);
  line-height: 1;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--border-light);
  display: block;
}
.exec-card .exec-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.16rem;
  color: var(--primary);
  margin: 0.9rem 0 0.6rem;
}
.exec-card .exec-body { text-align: left; }

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

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

/* --- pull quote: centred, classical --------------------------------------- */

.pull-quote {
  background: transparent;
  border: 0;
  border-top: 3px double var(--primary);
  border-bottom: 3px double var(--primary);
  padding: 1.8rem 1rem;
  margin: 3rem auto;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.2rem, 2.8vw, 1.55rem);
  line-height: 1.34;
  color: var(--primary);
  max-width: 44ch;
}
.pull-quote .attribution {
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-top: 1rem;
}

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

.callout {
  background: var(--bg-accent);
  border: 0;
  border-left: 3px solid var(--accent);
  padding: 1.3rem 1.5rem;
}
.callout .callout-title { color: var(--accent); font-weight: 700; letter-spacing: 0.14em; }
.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(--primary); color: #fff; }
.data-table thead th { font-family: var(--mono); letter-spacing: 0.06em; }
.data-table tbody tr:nth-child(even) { background: var(--bg-accent); }
.data-table tbody tr:hover { background: rgba(18, 87, 79, 0.07); }
.table-caption { color: var(--accent); font-weight: 700; letter-spacing: 0.1em; }

.matrix thead th { background: var(--primary); color: #fff; }
.matrix tbody th { background: var(--bg-card); }
.matrix .lv0 { background: #f2ebe0; color: var(--text-muted); }
.matrix .lv1 { background: #dfd2c0; color: var(--text); }
.matrix .lv2 { background: #a08a6e; }
.matrix .lv3 { background: #7a1f2b; }

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

.ref-list .ref-org { color: var(--accent); }
.endmatter h2 { color: var(--primary); border-bottom-color: var(--rule); }
.endmatter .kw {
  background: var(--bg-card);
  border-color: var(--border);
  font-family: var(--mono);
  font-size: 0.7rem;
}

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

.report-footer { border-top: 3px double var(--accent-light); }
.footer-inner h3 { color: var(--accent-light); font-family: var(--serif); }
.cite-box { border-left-color: var(--accent-light); }

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

@media (max-width: 760px) {
  .masthead-inner { padding-top: 1.5rem; }
  .masthead .meta-row { gap: 0.9rem 1.6rem; }
}

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

@media print {
  .masthead h1 { color: #000; }
  section > h2::before { background: #666; }
}
