/* A survey-chart look: pale sheet, dark ink, colour reserved for what was hit.
   One typeface (Archivo); its width axis separates the title, the body and the dense labels. */
/* Archivo (SIL Open Font License), served from this site so no other host is needed before first paint. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url("/fonts/archivo-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Archivo"; font-style: normal; font-weight: 400 800; font-stretch: 62% 125%; font-display: swap;
  src: url("/fonts/archivo-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --sheet: #E8ECEA;
  --paper: #F6F5F0;
  --ink: #16242B;
  --ink-soft: #51616A;
  --rule: #C9D0CF;
  --claim: #6B777D;
  --focus: #1B5FD1;
  --narrow: 76;
  --wide: 112;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  font-family: "Archivo", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--sheet);
}
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.app { display: grid; grid-template-columns: 384px 1fr; height: 100%; }

/* ---------- panel ---------- */
.panel {
  display: flex; flex-direction: column;
  min-height: 0;
  background: var(--paper);
  border-right: 1px solid var(--rule);
}
.masthead { padding: 22px 24px 16px; }
.masthead h1 {
  margin: 0 0 10px;
  font-size: 27px; line-height: 1.08; font-weight: 750;
  font-stretch: 112%; font-variation-settings: "wdth" var(--wide);
  letter-spacing: -0.012em;
  text-wrap: balance;
}
.lede { margin: 0 0 10px; color: var(--ink-soft); max-width: 44ch; }
.updated { margin: 0; font-size: 13px; color: var(--ink-soft); }

.filters { padding: 14px 24px 16px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.filters h2 { margin: 0 0 7px; font-size: 13px; font-weight: 650; }
.filters h2:not(:first-child) { margin-top: 14px; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--rule); border-radius: 999px;
  background: transparent; cursor: pointer;
  font-size: 13px; font-stretch: 88%; font-variation-settings: "wdth" 88;
}
.chip .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.chip .n { color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.chip[aria-pressed="false"] { color: var(--ink-soft); text-decoration: line-through; }
.chip[aria-pressed="false"] .dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--rule); }

.segmented { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--ink); border-radius: 4px; overflow: hidden; }
.segmented button {
  padding: 6px 4px; border: 0; border-left: 1px solid var(--ink); background: transparent; cursor: pointer;
  font-size: 12.5px; line-height: 1.2; font-stretch: 80%; font-variation-settings: "wdth" 80;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.segmented button:first-child { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.segmented svg { display: block; }

.check { display: flex; gap: 8px; align-items: center; margin-top: 12px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--ink); margin: 0; }
.claim-key {
  display: inline-block; width: 11px; height: 11px; margin-left: 3px; vertical-align: -1px;
  border: 1.5px dashed var(--claim); border-radius: 50%;
}

.trends { border-bottom: 1px solid var(--rule); }
.trends summary { padding: 10px 24px; font-size: 13px; font-weight: 650; cursor: pointer; }
.trends[open] summary { border-bottom: 1px solid var(--rule); }
#trends { padding: 12px 24px 16px; max-height: 44vh; overflow-y: auto; }
#trends h3 { margin: 16px 0 4px; font-size: 13px; font-weight: 650; }
#trends p { margin: 0 0 6px; font-size: 14px; }
.weeks { width: 100%; border-collapse: collapse; font-size: 13px; font-variant-numeric: tabular-nums; }
.weeks caption { text-align: left; font-weight: 650; padding-bottom: 6px; }
.weeks th, .weeks td { padding: 3px 0; border-top: 1px solid var(--rule); text-align: right; font-weight: 400; }
.weeks thead th { border-top: 0; color: var(--ink-soft); font-stretch: 84%; font-variation-settings: "wdth" 84; }
.weeks th:first-child { text-align: left; }
.weeks .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--c); margin-right: 6px; }
.weeks .total th, .weeks .total td { font-weight: 650; border-top: 1px solid var(--ink); }
.linklike {
  padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
  font-weight: 600; text-decoration: underline; text-underline-offset: 2px;
}
#facility-card { padding: 14px 24px; border-bottom: 1px solid var(--rule); background: #ECEBE4; }
#facility-card h2 { margin: 0 0 4px; font-size: 18px; line-height: 1.2; font-weight: 700; }
#facility-card p { margin: 0 0 10px; font-size: 14px; }
.updated a { color: inherit; text-underline-offset: 2px; }

.results { flex: 1; min-height: 0; overflow-y: auto; }
.count { margin: 0; padding: 12px 24px 8px; font-size: 13px; color: var(--ink-soft); }
.events { list-style: none; margin: 0; padding: 0; }
.events li + li { border-top: 1px solid var(--rule); }
.event {
  display: grid; grid-template-columns: 22px 1fr; column-gap: 10px;
  width: 100%; padding: 11px 24px; border: 0; background: transparent; text-align: left; cursor: pointer;
}
.event:hover { background: #ECEBE4; }
.event .glyph { grid-row: span 3; padding-top: 2px; }
.event .when { font-size: 12.5px; color: var(--ink-soft); font-variant-numeric: tabular-nums;
  font-stretch: 84%; font-variation-settings: "wdth" 84; }
.event .place { font-weight: 650; line-height: 1.25; }
.event .meta { font-size: 13px; color: var(--ink-soft); }
.empty { padding: 20px 24px; color: var(--ink-soft); }
.empty button, .back {
  padding: 5px 10px; border: 1px solid var(--ink); border-radius: 4px; background: transparent; cursor: pointer;
}

/* ---------- detail ---------- */
#detail-view { padding: 14px 24px 28px; }
#detail-view h2 { margin: 16px 0 2px; font-size: 21px; line-height: 1.15; font-weight: 700;
  font-stretch: 106%; font-variation-settings: "wdth" 106; }
#detail-view .where { margin: 0 0 12px; color: var(--ink-soft); }
#detail-view .summary { margin: 0 0 14px; max-width: 46ch; }
.facts { margin: 0 0 16px; display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 14px; }
.facts dt { color: var(--ink-soft); }
.facts dd { margin: 0; }
.verdict { margin: 0 0 16px; padding: 10px 12px; border-left: 3px solid var(--ink); background: #ECEBE4; font-size: 14px; }
.verdict strong { display: block; }
#detail-view h3 { margin: 18px 0 6px; font-size: 13px; font-weight: 650; }
.detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.sources, .links { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.sources li, .links li { padding: 7px 0; border-top: 1px solid var(--rule); }
.sources a, .links a { color: var(--ink); font-weight: 600; text-underline-offset: 2px; }
.side { color: var(--ink-soft); }
.source-line { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.show-post, .more-sources {
  flex: none; padding: 3px 9px; border: 1px solid var(--ink); border-radius: 4px; background: transparent; cursor: pointer;
  font-size: 13px; white-space: nowrap;
}
.more-sources { margin-top: 10px; }
.embed { margin-top: 8px; min-height: 80px; }
.embed iframe { max-width: 100%; }
.embed.video { min-height: 0; }
.embed.video iframe { display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; }
.note { margin: 0 0 8px; font-size: 13px; color: var(--ink-soft); }
.key { margin: -6px 0 0; font-size: 13px; color: var(--ink-soft); }
.key-fire, .key-earlier { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }
.key-fire { background: #D7301F; }
.key-earlier { border: 1.5px solid var(--claim); margin-left: 4px; }
.new-tag {
  margin-left: 8px; padding: 0 6px; border: 1px solid var(--ink); border-radius: 999px;
  font-size: 11.5px; font-weight: 600; vertical-align: 1px; white-space: nowrap;
}

/* ---------- map ---------- */
.stage { position: relative; display: grid; grid-template-rows: 1fr auto; min-width: 0; min-height: 0; }
#map { min-height: 0; background: var(--sheet); }
.leaflet-container { font-family: inherit; background: var(--sheet); }
.leaflet-control-attribution { font-size: 11px; background: rgba(246, 245, 240, 0.85) !important; }
.leaflet-bar a { color: var(--ink); background: var(--paper); border-color: var(--rule); }
.leaflet-tooltip.tip {
  border: 1px solid var(--ink); border-radius: 3px; background: var(--paper); color: var(--ink);
  box-shadow: none; padding: 4px 8px; font-size: 13px; font-family: inherit;
}
.leaflet-tooltip.tip::before { display: none; }

.mk { position: relative; display: block; color: var(--c); }
.mk svg { display: block; overflow: visible; }
/* Selection is an ink ring around the marker, so the marker keeps its own colour and fill. */
.mk.is-selected::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 30px; height: 30px;
  margin: -15px 0 0 -15px; border: 2px solid var(--ink); border-radius: 50%;
}
.mk.is-new::before {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px;
  margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid currentColor;
  animation: ping 2.2s ease-out infinite;
}
@keyframes ping { from { transform: scale(1); opacity: 0.9; } to { transform: scale(3.4); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .mk.is-new::before { animation: none; transform: scale(2); opacity: 0.45; } }

/* ---------- timeline ---------- */
.timeline {
  display: grid; grid-template-columns: auto 1fr; align-items: end; gap: 18px;
  padding: 10px 18px 8px; background: var(--paper); border-top: 1px solid var(--rule);
}
.timeline-controls { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; }
.timeline-controls button {
  padding: 5px 12px; border: 1px solid var(--ink); border-radius: 4px; background: transparent; cursor: pointer;
  font-size: 13px; white-space: nowrap;
}
.timeline-controls button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.timeline-controls button:disabled { border-color: var(--rule); color: var(--ink-soft); cursor: default; }
.days { display: flex; align-items: flex-end; gap: 3px; overflow-x: auto; padding-bottom: 2px; }
.day {
  flex: 1 0 34px; max-width: 90px; display: flex; flex-direction: column; align-items: stretch;
  padding: 0; border: 0; background: transparent; cursor: pointer;
}
.day .stack { height: 62px; display: flex; flex-direction: column; justify-content: flex-end; border-bottom: 1px solid var(--ink); }
.day .bar-claims { background: repeating-linear-gradient(-45deg, var(--rule) 0 2px, transparent 2px 4px); }
.day .bar-hits { background: var(--ink); }
.day .num { font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; color: var(--ink-soft); height: 16px; }
.day .label { padding-top: 3px; font-size: 12px; text-align: center; white-space: nowrap;
  font-stretch: 76%; font-variation-settings: "wdth" var(--narrow); color: var(--ink-soft); }
.day[aria-pressed="true"] .label { color: var(--ink); font-weight: 700; }
.day.is-dim .stack { opacity: 0.3; }

/* ---------- text pages (About) ---------- */
.page-body { height: auto; background: var(--paper); }
.page { max-width: 42rem; margin: 0 auto; padding: 32px 24px 64px; font-size: 16px; line-height: 1.55; }
.page h1 { margin: 20px 0 14px; font-size: 34px; line-height: 1.1; font-weight: 750;
  font-stretch: 112%; font-variation-settings: "wdth" var(--wide); letter-spacing: -0.012em; }
.page h2 { margin: 34px 0 8px; font-size: 20px; line-height: 1.2; font-weight: 700; }
.page p, .page ul, .page ol, .page dl { margin: 0 0 14px; }
.page ul, .page ol { padding-left: 1.2em; }
.page li { margin-bottom: 6px; }
.page dt { font-weight: 650; margin-top: 10px; }
.page dd { margin: 0; color: var(--ink-soft); }
.page a { color: var(--ink); text-underline-offset: 2px; }

/* ---------- small screens ---------- */
@media (max-width: 820px) {
  html, body { height: auto; }
  .app { grid-template-columns: 1fr; height: auto; }
  .stage { order: -1; height: 58vh; position: sticky; top: 0; z-index: 500; }
  #detail-view { scroll-margin-top: 58vh; }
  .panel { border-right: 0; border-top: 1px solid var(--rule); }
  .results { overflow: visible; }
  .masthead h1 { font-size: 23px; }
  .timeline { grid-template-columns: 1fr; gap: 6px; }
  .timeline-controls { flex-direction: row; padding-bottom: 0; }
  .day .stack { height: 36px; }
}
