/* The data page: same night, type and chart colours as the essay, laid out wide for reading
   tables rather than a single column of prose. Builds on ../style.css. */
.datapage {
  --page: 72rem;
  font-size: 1rem;
  line-height: 1.55;
}

.crumb {
  max-width: var(--page);
  margin: 0 auto;
  padding: 1.5rem var(--gutter) 0;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.crumb a { display: inline-flex; align-items: center; gap: 0.5rem; min-height: 44px; color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--accent-ink); }

/* ---------- Header ---------- */
.d-head {
  max-width: var(--page);
  margin: 0 auto;
  padding: 3rem var(--gutter) 1rem;
}
@media (min-width: 64rem) {
  .d-head { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; column-gap: 4rem; align-items: end; }
  .d-head .kicker, .d-head h1, .d-head .d-lede { grid-column: 1; }
  .d-head .stats { grid-column: 2; grid-row: 1 / span 3; align-self: end; grid-template-columns: repeat(2, minmax(0, 1fr)) !important; margin: 0; }
}
.d-head .kicker {
  margin: 0 0 1rem;
  font: 500 0.78rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent-ink);
}
.d-head h1 {
  max-width: 14ch;
  margin: 0;
  font: 400 clamp(2.6rem, 7vw, 4.5rem)/1 var(--display);
  letter-spacing: -0.01em;
  text-wrap: balance;
}
.d-lede {
  max-width: 40rem;
  margin: 1.5rem 0 0;
  font: 400 1.2rem/1.55 var(--serif);
  color: color-mix(in srgb, var(--ink) 88%, var(--paper));
}
.d-lede strong { color: var(--accent-ink); font-weight: 600; }
.d-lede .num { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  max-width: 44rem;
  margin: 2.5rem 0 0;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--rule);
  overflow: hidden;
}
@media (min-width: 40rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.stats div { padding: 1rem 1.1rem; background: var(--paper); }
.stats dt { font: 400 0.76rem/1.3 var(--sans); color: var(--muted); }
.stats dd { margin: 0.35rem 0 0; font: 400 2.1rem/1 var(--display); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */
.d-main { max-width: var(--page); margin: 0 auto; padding: 0 var(--gutter) 5rem; }
.d-sec { padding-top: 4rem; }
.datapage .d-sec h2 {
  margin: 0 0 1.25rem;
  padding-top: 1.1rem;
  border-top: 1px solid var(--rule);
  font: 500 0.8rem/1 var(--mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
  text-align: left;
  color: var(--accent-ink);
}
.datapage .d-sec h2::before { content: none; }
.d-intro { max-width: 40rem; margin: 0 0 1.5rem; color: var(--muted); font-family: var(--serif); font-size: 1.05rem; }

/* Frames: the key to every colour on the page. */
.frames {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem 2rem;
}
@media (min-width: 40rem) { .frames { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 64rem) { .frames { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.frames li { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.5rem 0; }
.frames .sw { flex: none; width: 0.85rem; height: 0.85rem; margin-top: 0.3rem; }
.frames p { margin: 0; font: 400 0.9rem/1.45 var(--sans); color: var(--muted); }
.frames .f-name { margin-bottom: 0.2rem; font: 600 1.05rem/1.3 var(--serif); color: var(--ink); }

/* ---------- Charts ---------- */
.d-chart { padding: 1.75rem 1.75rem 1.25rem; border: 1px solid var(--rule); border-radius: 3px; }
@media (max-width: 40rem) { .d-chart { padding: 1.25rem 1rem 1rem; } }
.d-figtitle { margin: 0; font: 600 1.3rem/1.25 var(--serif); }
.d-chart .lbl { font-size: 0.92rem; }
.lbl .n { color: var(--muted); font-size: 0.8em; margin-left: 0.45rem; }
.d-chart .track { height: 1.9rem; }
.seg[role="button"] { cursor: pointer; }
.seg:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

.events { display: grid; gap: 1rem; }
@media (min-width: 60rem) { .events { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.event {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 1.4rem 1.3rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  font-family: var(--sans);
}
.event h3 { margin: 0; font: 600 1.2rem/1.25 var(--serif); text-wrap: balance; }
.event .meta { margin: 0.4rem 0 0; font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-ink); }
.event .note { margin: 0.8rem 0 1rem; font: 400 0.98rem/1.5 var(--serif); color: color-mix(in srgb, var(--ink) 85%, var(--paper)); }
.event .bars { margin-top: auto; }
.event .row { padding: 0.4rem 0; }
.event .lbl { font-size: 0.8rem; }
.event .track { height: 1.15rem; }
.event .seg { font-size: 0.66rem; padding-left: 0.3rem; }
.event .seg { color: transparent; }

/* ---------- Sources ---------- */
.tabs { display: flex; gap: 0.25rem; border-bottom: 1px solid var(--rule); }
.tabs button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  margin-bottom: -1px;
  padding: 0 1rem;
  border: 0;
  border-bottom: 2px solid transparent;
  background: none;
  color: var(--muted);
  font: 500 0.95rem/1 var(--sans);
  cursor: pointer;
}
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.tabs button:hover { color: var(--ink); }
.tab-n { font: 400 0.75rem/1 var(--mono); color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: flex-end; margin: 1.25rem 0 0.75rem; font-family: var(--sans); }
.filters label { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; flex: 1 1 9rem; }
.filters label.grow { flex: 3 1 14rem; }
.filters label > span { font: 500 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.filters select, .filters input {
  width: 100%;
  min-height: 40px;
  padding: 0 0.7rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: color-mix(in srgb, var(--ink) 3%, var(--paper));
  color: var(--ink);
  font: 400 0.9rem/1 var(--sans);
}
.filters select:focus-visible, .filters input:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.reset {
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: none;
  color: var(--muted);
  font: 400 0.88rem/1 var(--sans);
  cursor: pointer;
}
.reset:hover { color: var(--ink); border-color: var(--muted); }
.count { margin: 0.5rem 0 0.25rem; font: 400 0.85rem/1.4 var(--sans); color: var(--muted); }
.count b { color: var(--ink); font-weight: 600; }

/* Each source is one entry: who and when on the left, what they said on the right. */
.list { list-style: none; margin: 0; padding: 0; }
.entry {
  display: grid;
  gap: 0.35rem 2rem;
  padding: 1.15rem 0;
  border-bottom: 1px solid var(--rule);
  font-family: var(--sans);
}
@media (min-width: 52rem) { .entry { grid-template-columns: 15rem minmax(0, 1fr); } }
.e-who { min-width: 0; }
.e-src { margin: 0; font: 600 0.92rem/1.35 var(--sans); color: var(--ink); overflow-wrap: anywhere; }
.e-by { margin: 0.1rem 0 0; font-size: 0.82rem; color: var(--muted); overflow-wrap: anywhere; }
.e-tags { display: flex; flex-wrap: wrap; gap: 0.3rem 0.75rem; margin: 0.45rem 0 0; font: 400 0.72rem/1.3 var(--mono); letter-spacing: 0.04em; color: var(--muted); }
.e-body { min-width: 0; }
.e-cat { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.9rem; margin: 0 0 0.35rem; font-size: 0.8rem; color: var(--muted); }
.e-cat span { display: inline-flex; align-items: center; gap: 0.4rem; }
.e-cat .main { color: var(--ink); font-weight: 500; }
.e-cat .sw { width: 0.6rem; height: 0.6rem; }
.e-cat .flag { padding: 0.1rem 0.4rem; border: 1px solid var(--rule); border-radius: 2px; font: 400 0.68rem/1.2 var(--mono); }
.e-title { margin: 0; font: 600 1.08rem/1.35 var(--serif); }
.e-title a { text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.e-en { margin: 0.15rem 0 0; font: italic 400 0.95rem/1.4 var(--serif); color: var(--muted); }
.e-quote { margin: 0.55rem 0 0; padding-left: 0.85rem; border-left: 2px solid var(--rule); font: 400 1rem/1.5 var(--serif); color: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.e-quote.para { font-style: italic; }
.empty { padding: 2rem 0; color: var(--muted); font-family: var(--sans); }
.more {
  display: block;
  min-height: 44px;
  margin: 1.5rem auto 0;
  padding: 0 1.4rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: none;
  color: var(--ink);
  font: 500 0.9rem/1 var(--sans);
  cursor: pointer;
}
.more:hover { border-color: var(--accent); color: var(--accent-ink); }
.flash { animation: flash 1.2s ease-out; }
@keyframes flash { from { background: color-mix(in srgb, var(--accent) 12%, transparent); } to { background: transparent; } }

/* ---------- Method ---------- */
.method-grid { display: grid; gap: 2rem; }
@media (min-width: 60rem) { .method-grid { grid-template-columns: minmax(0, 1fr) 17rem; gap: 4rem; } }
.method-list { margin: 0; padding: 0; list-style: none; display: grid; gap: 1rem; max-width: 46rem; }
.method-list li { font: 400 1rem/1.55 var(--serif); color: color-mix(in srgb, var(--ink) 88%, var(--paper)); }
.method-list strong { color: var(--ink); }
.downloads { display: flex; flex-direction: column; gap: 0.5rem; font-family: var(--sans); }
.dl-title { margin: 0 0 0.25rem; font: 500 0.68rem/1 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.downloads a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 48px;
  padding: 0 1rem;
  border: 1px solid var(--rule);
  border-radius: 3px;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.9rem;
}
.downloads a span { font: 400 0.72rem/1 var(--mono); color: var(--muted); }
.downloads a:hover { border-color: var(--accent); }

.datapage .footer-inner { padding-top: 4rem; }
.footer-title a { color: inherit; text-decoration: none; }
.footer-title a:hover { color: var(--accent-ink); }

@media (prefers-reduced-motion: reduce) { .flash { animation: none; } }
