/* ===========================================================================
   Theme — Report 2026-06, "Climate Adaptation as Infrastructure"

   Aesthetic: engineering drawing. A pale blue-grey ground with a faint
   blueprint grid behind the masthead and the annotation panels, deep
   drawing-blue structure, safety orange for the binding constraint, and a
   slab serif — the first in the series — for display.

   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: #eef2f6;
  --bg-card: #ffffff;
  --bg-accent: #e2e9f0;
  --bg-dark: #0f3d5c;
  --bg-dark-2: #0a2c43;

  --text: #152232;
  --text-secondary: #37485c;
  --text-muted: #6b7c8f;
  --text-inverse: #eef2f6;

  --primary: #0f3d5c;
  --primary-light: #1f6d9e;
  --accent: #e05c00;
  --accent-light: #ff8a3d;

  --border: #c3d0dc;
  --border-light: #d8e1e9;
  --rule: #9fb3c4;

  --chart-blue: #0f3d5c;
  --chart-blue-light: #6fa8c9;
  --chart-gold: #b07a12;
  --chart-red: #e05c00;
  --chart-teal: #0d7a70;
  --chart-gray: #8798a8;
  --chart-orange: #cf4b12;
  --chart-purple: #5a4b96;

  --serif: "Roboto Slab", Georgia, "Times New Roman", serif;
  --sans: Manrope, -apple-system, BlinkMacSystemFont, "system-ui", sans-serif;
  --mono: "Source Code Pro", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --max-width: 980px;
  /* Reused by every element that carries the drawing grid. */
  --grid: linear-gradient(to right, rgba(15, 61, 92, 0.07) 1px, transparent 1px),
          linear-gradient(to bottom, rgba(15, 61, 92, 0.07) 1px, transparent 1px);
}

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

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

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

/* --- masthead: a drawing sheet -------------------------------------------- */

.masthead {
  background-color: var(--bg);
  background-image: var(--grid);
  background-size: 24px 24px;
  color: var(--text);
  border-top: 3px solid var(--primary);
  border-bottom: 3px double var(--primary);
  padding: 2.4rem var(--gutter) 0;
}
.masthead-inner {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  padding: 1.7rem 1.8rem 0;
}
.masthead .overline {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  margin-bottom: 1.1rem;
}
.masthead h1 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.08;
  max-width: 18ch;
  font-size: clamp(2rem, 5.2vw, 2.95rem);
}
.masthead .subtitle { color: var(--text-secondary); font-weight: 400; max-width: 60ch; }
.masthead .strapline {
  border-left: 3px solid var(--accent);
  color: var(--text-secondary);
  font-family: var(--sans);
  font-style: normal;
  font-weight: 500;
  font-size: 1rem;
}
.masthead .meta-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  margin-top: 2rem;
  padding-top: 0;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: var(--mono);
  font-size: 0.76rem;
}
.masthead .meta-row div { padding: 0.85rem 1rem 1rem 0; }
.masthead .meta-row strong {
  color: var(--primary);
  font-family: var(--sans);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  margin-bottom: 0.3rem;
}

/* --- sticky nav: drawing-blue bar ----------------------------------------- */

.sticky-nav {
  background: rgba(15, 61, 92, 0.96);
  border-bottom: 2px solid var(--accent);
}
.nav-inner a {
  color: rgba(238, 242, 246, 0.68);
  font-family: var(--mono);
  font-size: 0.73rem;
}
.nav-inner a:hover { color: #fff; }
.nav-inner a.is-active { color: #fff; border-bottom-color: var(--accent); }

/* --- section headings: double rule ---------------------------------------- */

section > h2 {
  color: var(--primary);
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 4px double var(--primary);
  padding-bottom: 0.55rem;
}
section > .section-dek {
  font-style: normal;
  color: var(--text-muted);
  font-size: 0.98rem;
  max-width: 66ch;
}
section > h3 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.18rem;
  color: var(--primary-light);
  margin: 2.3rem 0 0.7rem;
}
section > h4 { color: var(--accent); font-family: var(--mono); font-size: 0.8rem; }

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

/* --- abstract: annotation panel ------------------------------------------- */

.abstract {
  background-color: var(--bg-card);
  background-image: var(--grid);
  background-size: 24px 24px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
}
.abstract h2 { color: var(--accent); }

/* --- statistics: dimensioned boxes ---------------------------------------- */

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 1px solid var(--border);
  border-top: 4px solid var(--accent);
  padding: 1.1rem 1.2rem;
}
.stat-card .stat-value {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.85rem;
  letter-spacing: -0.02em;
  color: var(--primary);
}
.stat-card .stat-label { color: var(--text-secondary); font-size: 0.79rem; }

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

.exec-card { background: var(--bg-card); border: 1px solid var(--border); padding: 1.4rem; }
.exec-card .exec-num {
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.13em;
  color: var(--accent);
  line-height: 1;
}
.exec-card .exec-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.12rem;
  color: var(--primary);
  margin: 0.65rem 0 0.5rem;
}

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

.chart-container { background: var(--bg-card); border: 1px solid var(--border); padding: 1.2rem 1.3rem; }
.chart-container .chart-label {
  color: var(--primary);
  font-weight: 600;
  letter-spacing: 0.09em;
  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-color: var(--bg-card);
  background-image: var(--grid);
  background-size: 24px 24px;
}

/* --- pull quote: annotation on the drawing -------------------------------- */

.pull-quote {
  background-color: var(--bg-accent);
  background-image: var(--grid);
  background-size: 20px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  padding: 1.4rem 1.6rem;
  margin: 2.6rem 0;
  font-family: var(--serif);
  font-style: normal;
  font-weight: 600;
  font-size: clamp(1.15rem, 2.6vw, 1.45rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--primary);
  max-width: 40ch;
}
.pull-quote .attribution {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-top: 0.9rem;
  font-weight: 500;
}

/* --- callouts: dashed technical note -------------------------------------- */

.callout {
  background: var(--bg-card);
  border: 1px dashed var(--primary);
  border-left: 1px dashed var(--primary);
  padding: 1.3rem 1.4rem;
}
.callout .callout-title { color: var(--accent); font-weight: 700; }
.callout strong { color: var(--primary); }
.callout--warn { border-color: var(--accent); border-style: solid; }
.callout--warn .callout-title { color: var(--accent); }

/* --- 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(224, 92, 0, 0.07); }
.table-caption { color: var(--accent); font-weight: 600; letter-spacing: 0.09em; }

.matrix thead th { background: var(--primary); color: #fff; }
.matrix tbody th { background: var(--bg-card); }
.matrix .lv0 { background: #e7edf3; color: var(--text-muted); }
.matrix .lv1 { background: #c6d7e4; color: var(--text); }
.matrix .lv2 { background: #4e88ac; }
.matrix .lv3 { background: #0f3d5c; }

/* --- 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: 4px solid var(--accent); }
.footer-inner h3 { color: var(--accent-light); font-family: var(--serif); }
.cite-box { border-left-color: var(--accent); }

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

@media (max-width: 760px) {
  .masthead-inner { padding: 1.2rem 1.1rem 0; }
  .masthead .meta-row div { padding-right: 0.5rem; }
}

/* --- print: drop the grid, it does not reproduce ---------------------------- */

@media print {
  .masthead, .abstract, .pull-quote, .schematic-wrap { background-image: none !important; }
  .masthead-inner { background: none; border: 0; padding-left: 0; }
  .masthead h1 { color: #000; }
}
