/* The desk values, copied from ledger/src/renderer/src/styles/globals.css (docs/STYLE-DOCTRINE.md).
   Data colours live in theme.ts; the two here are the chart bars, which CSS paints.
   The map imports this file; publish.py copies it into the static pages' stylesheet. */
:root {
  color-scheme: dark;
  --surface-0: #0e0e0e;
  --surface-1: #181818;
  --surface-2: #151515;
  --surface-3: #1f1f1f;
  --surface-4: #121212;
  --surface-5: #2c2c2c;
  --ink-primary: #ececec;
  --ink-secondary: #b4b4b4;
  --ink-tertiary: #8c8c8c;
  --ink-muted: #666666;
  --border-default: rgba(255, 255, 255, 0.07);
  --border-hover: rgba(255, 255, 255, 0.12);
  --panel-edge: #222222;
  --focus: rgba(236, 236, 236, 0.45);
  --idle: #444444;
  --shadow-pop: 0 24px 60px rgba(0, 0, 0, 0.45);
  --data-lead: #f39b40; /* theme.ts YEAR_STOPS 1995 */
  --data-context: #3b3b3b;
  --font-sans: 'Inter Variable', Inter, 'Segoe UI Variable Text', 'Segoe UI', system-ui, sans-serif;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-pill: 999px;
  --radius-panel: 12px;
  --type-11: 11px;
  --type-12: 12px;
  --type-13: 13px;
  --type-15: 15px;
  --sidebar-width: 288px;
  --inspector-width: 360px;
  --title-height: 44px;
  --sheet-peek: 60px; /* Sheet.tsx PEEK_PX */
  --z-float: 10;
  --z-sheet: 14; /* a phone's bottom sheet, over the map's floats */
  --z-menu: 16; /* the search list, over a sheet */
  --z-tip: 20;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

/* The static event and region pages (pages.py). publish.py writes tokens.css and this file together as
   /pages/site.css, so the pages wear the map's desk look: the title strip on surface-1, the page on the curved
   surface-0 panel. */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--surface-1);
  color: var(--ink-primary);
  font: 450 var(--type-15)/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--ink-primary); text-decoration-color: var(--ink-muted); text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--ink-primary); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.readout { font-variant-numeric: tabular-nums; }

.site-strip {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  height: var(--title-height); padding: 0 16px; color: var(--ink-secondary);
}
.site-brand { display: flex; align-items: center; gap: 10px; color: var(--ink-primary); font-weight: 600;
  font-size: var(--type-13); text-decoration: none; }
.site-brand img { width: 20px; height: 20px; }
.site-nav { display: flex; gap: 16px; font-size: var(--type-13); }
.site-nav a { color: var(--ink-secondary); text-decoration: none; }
.site-nav a:hover { color: var(--ink-primary); }

.site-panel {
  min-height: calc(100vh - var(--title-height));
  background: var(--surface-0);
  border-top: 1px solid var(--panel-edge);
  border-left: 1px solid var(--panel-edge);
  border-top-left-radius: var(--radius-panel);
  margin-left: 16px;
}
.page { max-width: 760px; padding: 40px 32px 64px; }

.crumbs { display: flex; flex-wrap: wrap; gap: 6px; color: var(--ink-tertiary); font-size: var(--type-12); }
.crumbs a { color: var(--ink-tertiary); }
h1 { margin: 12px 0 6px; font-size: 26px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em;
  text-wrap: balance; }
h2 { margin: 36px 0 10px; font-size: var(--type-11); font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--ink-tertiary); }
.lede { margin: 0; color: var(--ink-secondary); }
.summary { margin: 24px 0 0; max-width: 62ch; font-size: var(--type-15); line-height: 1.55; color: var(--ink-primary); }
.summary + .note { margin-top: 8px; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.button {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px; border-radius: var(--radius-md);
  background: var(--surface-3); border: 1px solid var(--border-default); color: var(--ink-primary);
  font-size: var(--type-13); font-weight: 500; text-decoration: none;
}
.button:hover { border-color: var(--border-hover); }
.button-lead { background: var(--ink-primary); color: var(--surface-0); border-color: transparent; }
.button-lead:hover { opacity: 0.9; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 0; font-size: var(--type-13); }
.facts dt { color: var(--ink-tertiary); }
.facts dd { margin: 0; }
.capital::first-letter { text-transform: uppercase; }

.rows { list-style: none; margin: 0; padding: 0; font-size: var(--type-13); }
.rows li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0;
  border-top: 1px solid var(--border-default); }
.rows .meta { color: var(--ink-tertiary); white-space: nowrap; }
.count-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0 24px; }

.note { margin-top: 40px; color: var(--ink-muted); font-size: var(--type-12); }

@media (max-width: 640px) {
  .site-panel { margin-left: 0; border-left: 0; border-top-left-radius: 0; }
  .page { padding: 28px 16px 48px; }
  h1 { font-size: 22px; }
  .rows li { flex-direction: column; gap: 2px; }
}
