/* Phoenix Policy Desk — Editorial Civic Portfolio Design System */
:root {
  --bg: #faf8f5;
  --surface: #ffffff;
  --surface-alt: #f3efe8;
  --fg: #17191c;
  --muted: #57534e;
  --line: #e4dfd7;
  --accent: #b45309;
  --accent-strong: #9a3412;
  --water: #0369a1;
  --energy: #c2410c;
  --heat: #b91c1c;
  --gov: #334155;
  --ok: #047857;
  --serif: Georgia, "Iowan Old Style", "Palatino Linotype", Palatino, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --maxw: 1080px;
  --prose: 72ch;
  --radius: 8px;
}

[data-theme="dark"] {
  --bg: #111315;
  --surface: #191c20;
  --surface-alt: #21252b;
  --fg: #f3f1ed;
  --muted: #a8a29e;
  --line: #2c3138;
  --accent: #f59e0b;
  --accent-strong: #fbbf24;
  --water: #38bdf8;
  --energy: #fb923c;
  --heat: #f87171;
  --gov: #94a3b8;
  --ok: #34d399;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
}

a {
  color: var(--accent-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--fg); }

.tnum { font-variant-numeric: tabular-nums; }

/* Navigation */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.brand {
  text-decoration: none;
  color: var(--fg);
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}
.brand-title {
  font-family: var(--serif);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.brand-sub {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--muted);
  margin-top: 2px;
}
.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 18px;
}
.nav-links a {
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
  padding: 4px 0;
  border-bottom: 2px solid transparent;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--fg);
  border-bottom-color: var(--accent);
}
.theme-btn {
  appearance: none;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.theme-btn:hover { color: var(--fg); border-color: var(--accent); }

/* Container */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Editorial Masthead */
.masthead {
  padding: 44px 0 34px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 1.85fr) minmax(0, 1fr);
  gap: 32px;
  align-items: end;
}
.eyebrow {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin: 0 0 10px 0;
}
.h1-editorial {
  font-family: var(--serif);
  font-size: clamp(2rem, 3.6vw, 2.85rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 14px 0;
  font-weight: 700;
  text-wrap: balance;
}
.lead {
  font-size: 17px;
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}
.meta-desk {
  border-left: 1px solid var(--line);
  padding-left: 22px;
  font-size: 13px;
}
.meta-row {
  padding: 7px 0;
  border-bottom: 1px dashed var(--line);
}
.meta-row:last-child { border-bottom: none; }
.meta-k {
  display: block;
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.meta-v { font-weight: 600; color: var(--fg); }

/* Section headers */
.sec {
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}
.sec-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px 16px;
  margin-bottom: 22px;
}
.sec-title {
  font-family: var(--serif);
  font-size: 24px;
  margin: 0;
  letter-spacing: -0.015em;
}
.sec-sub {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

/* Dossier List (Home Briefs) */
.dossier-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.dossier {
  display: grid;
  grid-template-columns: 150px minmax(0, 1.8fr) minmax(0, 1fr);
  gap: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.dossier:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  color: inherit;
}
.dossier-num {
  font-family: var(--mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.06em;
}
.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 3px 8px;
  border-radius: 4px;
  margin-top: 6px;
}
.tag-water { color: var(--water); background: color-mix(in srgb, var(--water) 11%, transparent); }
.tag-energy { color: var(--energy); background: color-mix(in srgb, var(--energy) 11%, transparent); }
.tag-heat { color: var(--heat); background: color-mix(in srgb, var(--heat) 11%, transparent); }
.tag-gov { color: var(--gov); background: color-mix(in srgb, var(--gov) 12%, transparent); }

.dossier h3 {
  font-family: var(--serif);
  font-size: 21px;
  line-height: 1.25;
  margin: 0 0 8px 0;
}
.dossier p {
  font-size: 14.5px;
  color: var(--muted);
  margin: 0 0 10px 0;
}
.tool-note {
  font-size: 12px;
  font-weight: 600;
  color: var(--fg);
}
.dossier-stats {
  border-left: 1px solid var(--line);
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
}
.stat-mini-val {
  font-size: 19px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
.stat-mini-lbl {
  font-size: 11.5px;
  color: var(--muted);
}
.read-cta {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-strong);
  margin-top: 4px;
}

/* Cross-Cutting Nexus */
.nexus-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.nexus-item {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.nexus-kicker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 5px;
}
.nexus-item h4 {
  font-family: var(--serif);
  font-size: 16px;
  margin: 0 0 6px 0;
}
.nexus-item p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

/* Primer Banner */
.primer-banner {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) auto;
  gap: 24px;
  align-items: center;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid var(--line);
  font-family: inherit;
  white-space: nowrap;
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}
.btn-primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  color: #ffffff;
}
.btn-outline {
  background: var(--surface);
  color: var(--fg);
}
.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

/* About Section */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.skills-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}
.skill-pill {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--fg);
}
.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

/* Brief Page Layout */
.brief-header {
  padding: 32px 0 24px 0;
  border-bottom: 1px solid var(--line);
}
.crumb {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--fg); }
.brief-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}
.brief-meta-left {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}

/* Embedded Infographic Wrapper */
.widget-shell {
  margin: 26px 0 32px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px 8px 16px;
}
.widget-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}
.widget-frame {
  width: 100%;
  border: 0;
  display: block;
  min-height: 620px;
  background: transparent;
}

/* Editorial Prose */
.prose {
  max-width: var(--prose);
  padding: 6px 0 36px 0;
}
.prose h2 {
  font-family: var(--serif);
  font-size: 23px;
  margin: 34px 0 12px 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  letter-spacing: -0.015em;
}
.prose h2:first-child { border-top: none; padding-top: 0; margin-top: 0; }
.prose h3 {
  font-size: 16px;
  font-weight: 750;
  margin: 22px 0 8px 0;
  color: var(--fg);
}
.prose p { margin: 0 0 14px 0; }
.prose ul, .prose ol { margin: 0 0 16px 0; padding-left: 22px; }
.prose li { margin-bottom: 8px; }

.three-nums {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 22px 0;
  max-width: 100%;
}
.num-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
}
.num-card-val {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 6px;
}
.num-card-txt {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

/* Tables */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 16px 0 22px 0;
}
table.policy-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  background: var(--surface);
  border: 1px solid var(--line);
}
table.policy-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: var(--surface-alt);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
table.policy-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.policy-table tr:last-child td { border-bottom: none; }

/* Prev / Next Brief Footer Nav */
.brief-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 24px 0 40px 0;
  border-top: 1px solid var(--line);
}
.pager-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  text-decoration: none;
  color: inherit;
}
.pager-card:hover { border-color: var(--accent); color: inherit; }
.pager-dir {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.pager-title {
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 24px 0 36px 0;
  font-size: 13px;
  color: var(--muted);
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

/* Interactive Helper Styles for Primer */
.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
}
.chip-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip-btn {
  appearance: none;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.chip-btn:hover { color: var(--fg); border-color: var(--accent); }
.chip-btn.active {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
}

@media (max-width: 820px) {
  .masthead { grid-template-columns: 1fr; padding: 28px 0 24px 0; }
  .meta-desk { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 16px; }
  .dossier { grid-template-columns: 1fr; gap: 12px; }
  .dossier-stats { border-left: none; padding-left: 0; border-top: 1px solid var(--line); padding-top: 12px; }
  .nexus-grid, .three-nums, .about-grid, .brief-pager { grid-template-columns: 1fr; }
  .primer-banner { grid-template-columns: 1fr; }
}

/* Print-to-PDF Stylesheet (Clean 2-page Policy Memo) */
@media print {
  .topbar, .widget-shell, .brief-pager, .no-print, .theme-btn { display: none !important; }
  body { background: #ffffff; color: #111111; font-size: 11pt; line-height: 1.45; }
  .container { max-width: 100%; padding: 0; }
  .prose { max-width: 100%; }
  .brief-header { padding: 0 0 12pt 0; }
  .three-nums { grid-template-columns: repeat(3, 1fr); gap: 8pt; }
  .num-card, table.policy-table { break-inside: avoid; }
  a { color: #111111; text-decoration: none; }
}
