/* Event Neutral kit v1: the shared look for every event page.
   Self-contained. Paths inside this file are relative to this folder. */

@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Source Sans 3";
  font-style: italic;
  font-weight: 200 900;
  font-display: swap;
  src: url("fonts/source-sans-3-latin-wght-italic.woff2") format("woff2");
}

/* ---- Colours. Dark is the default; light is opt-in via the switch. ---- */
:root {
  color-scheme: dark;
  --bg:        #11151c;
  --bg-raise:  #19202b;
  --line:      #2b3442;
  --ink:       #e8eaef;
  --ink-soft:  #aab1bf;
  --ink-faint: #7f8898;
  --accent:    #8fb4ff;
  --band:      rgba(232, 234, 239, 0.13);
  /* chart series, in a fixed order */
  --s1: #4cc2ad;
  --s2: #e6aa5a;
  --s3: #e88aa8;
  --sans: "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg:        #fcfcfd;
  --bg-raise:  #f1f3f6;
  --line:      #d8dde5;
  --ink:       #161a21;
  --ink-soft:  #485262;
  --ink-faint: #677183;
  --accent:    #1f55c4;
  --band:      rgba(22, 26, 33, 0.10);
  --s1: #0d7f6e;
  --s2: #a4610c;
  --s3: #bd3768;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 18px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 2px; }

.wrap { max-width: 760px; margin: 0 auto; padding: 0 24px; width: 100%; }
.wrap.wide { max-width: 980px; }
.measure { max-width: 66ch; }

/* ---- Top bar ---- */
header.bar { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.bar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 54px; }
.brand { font-size: 17px; font-weight: 650; color: var(--ink); white-space: nowrap; }
.brand:hover { text-decoration: none; }
.nav { display: flex; align-items: center; gap: 20px; font-size: 15.5px; }
.nav a { color: var(--ink-soft); }
.nav a[aria-current="page"] { color: var(--ink); }
.theme-switch { font: inherit; color: var(--ink-soft); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 3px 10px; cursor: pointer; }
.theme-switch:hover { color: var(--ink); border-color: var(--ink-faint); }

main { flex: 1; padding: 56px 0 40px; }

footer { border-top: 1px solid var(--line); padding: 28px 0 44px; }
.foot-inner { font-size: 14.5px; color: var(--ink-faint); }

/* ---- Text ---- */
h1 { font-size: 36px; line-height: 1.15; margin: 0 0 18px; font-weight: 700; letter-spacing: -0.012em; }
h2 { font-size: 22px; line-height: 1.3; margin: 48px 0 10px; font-weight: 650; }
h3 { font-size: 18px; margin: 0 0 4px; font-weight: 650; }
p { margin: 0 0 16px; }
ul { padding-left: 20px; margin: 0 0 16px; }
li { margin-bottom: 8px; }
code { font-family: inherit; font-size: inherit; color: var(--ink-soft); }
.lede { color: var(--ink-soft); font-size: 19px; }
.muted { color: var(--ink-faint); font-size: 15px; }
h2 a.t { color: var(--ink); }
h2 a.t:hover { color: var(--accent); }

/* ---- Event page furniture ---- */
.kicker { font-size: 14.5px; color: var(--ink-faint); margin-bottom: 10px; }
nav.wiki { display: flex; gap: 24px; font-size: 16px; border-bottom: 1px solid var(--line); margin: 6px 0 28px; }
nav.wiki a { color: var(--ink-soft); padding: 8px 0; margin-bottom: -1px; border-bottom: 2px solid transparent; }
nav.wiki a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.src { font-size: 14.5px; color: var(--ink-faint); margin: -14px 0 28px; }
.crumbs { font-size: 14.5px; color: var(--ink-faint); margin: -10px 0 8px; }
figure { margin: 24px 0; }
figure img { width: 100%; border-radius: 4px; background: #fff; }
figcaption { font-size: 14.5px; color: var(--ink-faint); margin-top: 8px; }

/* ---- Tables ---- */
table.num, table.catalog { width: 100%; border-collapse: collapse; font-size: 16.5px; margin: 8px 0 20px; font-variant-numeric: tabular-nums; }
table.num th, table.catalog th { text-align: left; font-size: 14.5px; color: var(--ink-faint); font-weight: 400; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line); }
table.num td, table.catalog td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
table.num th.r, table.num td.r { text-align: right; padding-right: 0; padding-left: 12px; }
table.catalog td.date { color: var(--ink-soft); white-space: nowrap; }
.scroll { overflow-x: auto; }

/* ---- Controls ---- */
.en-btn { font: inherit; font-size: 15.5px; color: var(--ink); background: none; border: 1px solid var(--line); border-radius: 4px; padding: 5px 12px; cursor: pointer; }
.en-btn:hover { border-color: var(--ink-faint); }
.en-btn:disabled { color: var(--ink-faint); cursor: default; border-color: var(--line); }

/* segmented choice: a row of radio inputs wrapped in labels */
.en-seg { display: inline-flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.en-seg label { position: relative; font-size: 15.5px; padding: 5px 14px; color: var(--ink-soft); cursor: pointer; border-left: 1px solid var(--line); }
.en-seg label:first-child { border-left: 0; }
.en-seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.en-seg label:has(input:checked) { background: var(--bg-raise); color: var(--ink); }
.en-seg label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: -2px; }

/* number box with an optional unit after it */
.en-num { display: inline-flex; align-items: center; gap: 5px; color: var(--ink-faint); font-size: 15px; white-space: nowrap; }
.en-num input { width: 74px; font: inherit; font-size: 16.5px; font-variant-numeric: tabular-nums; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 5px 8px; text-align: right; }
.en-num input:hover { border-color: var(--ink-faint); }
.en-num input:focus { outline: none; border-color: var(--accent); }
.en-num input.changed { border-color: var(--accent); }

/* slider. --lo and --hi (0 to 100) draw an optional range band on the track */
.en-range { --lo: 0; --hi: 0; --tone: var(--ink-faint); -webkit-appearance: none; appearance: none; width: 100%; height: 24px; margin: 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.en-range::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, transparent calc(var(--lo) * 1%), var(--tone) calc(var(--lo) * 1%), var(--tone) calc(var(--hi) * 1%), transparent calc(var(--hi) * 1%)) , var(--line); background-blend-mode: normal; }
.en-range::-moz-range-track { height: 6px; border-radius: 3px; background: linear-gradient(to right, transparent calc(var(--lo) * 1%), var(--tone) calc(var(--lo) * 1%), var(--tone) calc(var(--hi) * 1%), transparent calc(var(--hi) * 1%)), var(--line); }
.en-range::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -6px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ink-faint); }
.en-range::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ink); border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--ink-faint); }
.en-range:focus-visible { outline: none; }
.en-range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--accent); }
.en-range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--accent); }

/* questions that open */
details.en-q { border-top: 1px solid var(--line); }
details.en-q:last-of-type { border-bottom: 1px solid var(--line); }
details.en-q summary { cursor: pointer; padding: 12px 0; font-weight: 600; list-style-position: outside; margin-left: 20px; }
details.en-q > :not(summary) { margin-left: 20px; }

/* ---- Charts (D3) ---- */
.en-chart { position: relative; margin: 8px 0 0; }
.en-chart svg { display: block; width: 100%; overflow: visible; font-family: var(--sans); font-variant-numeric: tabular-nums; }
.en-chart .axis text { fill: var(--ink-faint); font-size: 14px; font-family: var(--sans); }
.en-chart .axis path, .en-chart .axis line { stroke: var(--line); }
.en-chart .grid line { stroke: var(--line); stroke-opacity: 0.6; }
.en-chart .grid path { display: none; }
.en-chart .note { fill: var(--ink-faint); font-size: 14px; }
.en-chart .end-label { font-size: 14.5px; font-weight: 600; }

@media (max-width: 560px) {
  body { font-size: 17px; }
  .wrap { padding: 0 16px; }
  main { padding-top: 36px; }
  h1 { font-size: 29px; }
  h2 { margin-top: 40px; }
  .nav { gap: 14px; }
  nav.wiki { gap: 18px; }
  .en-chart .axis text, .en-chart .note { font-size: 13px; }
  .en-chart .end-label { font-size: 13.5px; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* a second top-level heading further down a page */
h1.section { margin-top: 64px; }

/* numbered footnotes and the Sources list they point to */
sup.fn { font-size: 0.72em; line-height: 0; margin-left: 1px; }
ol.sources { font-size: 15.5px; color: var(--ink-soft); padding-left: 24px; }
ol.sources li { margin-bottom: 6px; }
ol.sources li:target { color: var(--ink); }
