/* CCS D2 Running Reference — matches lukepopler.me: Georgia, black on white, plain black links */

:root {
  --ink: #000;
  --ink-2: #444;
  --muted: #777;
  --line: #000;
  --line-soft: #ccc;
  --zebra: #f6f6f6;
  --hover: #eee;
  --grid: #e3e3e3;
  --axis: #aaa;
}

* { box-sizing: border-box; }

body {
  margin: 56px 0 40px;
  font-family: Georgia, "Times New Roman", Times, serif;
  font-size: 15px;
  line-height: 1.45;
  color: #000;
  background: #fff;
}

a, a:visited { color: #000; }
a:hover { text-decoration-thickness: 2px; }

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* ---------- header ---------- */
header.site { margin-bottom: 8px; }
header.site .back { font-size: 0.95em; margin: 0 0 14px; }
header.site h1 { font-size: 2.4em; line-height: 1.1; margin: 0 0 4px; font-weight: 700; }
header.site h1 a { text-decoration: none; }
header.site .tagline { display: block; color: var(--ink-2); font-size: 0.95em; font-style: italic; }
nav.main {
  display: flex; gap: 4px 16px; flex-wrap: wrap; align-items: center;
  margin-top: 14px; padding: 8px 0; border-top: 1px solid #000; border-bottom: 1px solid #000;
  font-size: 0.95em;
}
nav.main a.on { font-weight: 700; text-decoration: none; }
nav.main .spacer { flex: 1; }

.searchbox { position: relative; }
.searchbox input {
  font: inherit; font-size: 0.9em; padding: 3px 6px; width: 230px;
  border: 1px solid #000; border-radius: 0; background: #fff; color: #000;
}
.searchbox .drop {
  position: absolute; right: 0; top: 28px; z-index: 50; min-width: 300px;
  background: #fff; border: 1px solid #000;
}
.searchbox .drop a {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 10px; text-decoration: none; border-bottom: 1px solid var(--line-soft);
}
.searchbox .drop a:last-child { border-bottom: 0; }
.searchbox .drop a .k { color: var(--muted); font-size: 0.85em; }
.searchbox .drop a.sel, .searchbox .drop a:hover { background: var(--hover); }

/* ---------- layout ---------- */
main { padding: 8px 0 40px; }
h2 { font-size: 1.3em; margin: 22px 0 0; padding-bottom: 3px; border-bottom: 1px solid #000; }
h3 { font-size: 1.1em; margin: 28px 0 4px; padding-bottom: 3px; border-bottom: 1px solid #000; }
.sub { color: var(--ink-2); margin: 8px 0 14px; max-width: 760px; }
.cols { display: flex; gap: 32px; flex-wrap: wrap; align-items: flex-start; }
.cols > div { flex: 1 1 340px; min-width: 0; }
.note { color: var(--muted); font-size: 0.85em; margin-top: 4px; }

/* ---------- tables ---------- */
table.data {
  border-collapse: collapse; width: 100%; font-size: 0.9em; margin: 8px 0 14px;
  border-top: 1px solid #000; border-bottom: 1px solid #000;
}
table.data caption {
  text-align: left; font-weight: 700; font-size: 1.02em; padding: 4px 0;
  caption-side: top;
}
table.data th {
  font-weight: 700; font-size: 0.82em; text-transform: uppercase; letter-spacing: .04em;
  text-align: left; padding: 4px 8px; border-bottom: 1px solid #000; white-space: nowrap;
}
table.data th.sortable { cursor: pointer; }
table.data th.sortable:hover { text-decoration: underline; }
table.data th.sort-asc::after { content: " ▲"; font-size: 8px; }
table.data th.sort-desc::after { content: " ▼"; font-size: 8px; }
table.data td { padding: 3px 8px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--hover); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data td.ctr, table.data th.ctr { text-align: center; }

/* ---------- tags ---------- */
.tag {
  display: inline-block; font-size: 0.68em; font-weight: 700; letter-spacing: .04em;
  padding: 0 4px; margin-left: 6px; vertical-align: 1px; cursor: help; line-height: 1.5;
  border: 1px solid #000;
}
.tag.OFF { color: var(--muted); border-color: var(--muted); }

.banner { border: 1px solid #000; padding: 6px 10px; margin: 8px 0; font-size: 0.9em; }
.banner.gray { border-color: var(--muted); color: var(--ink-2); }

/* ---------- charts ---------- */
.chartcard { margin: 12px 0 18px; border-top: 1px solid #000; border-bottom: 1px solid #000; }
.chartcard .chead {
  padding: 4px 0; font-weight: 700; display: flex; justify-content: space-between;
  align-items: baseline; gap: 10px; flex-wrap: wrap;
}
.chartcard .chead .csub { font-weight: 400; font-size: 0.85em; color: var(--muted); font-style: italic; }
.chartcard svg { display: block; width: 100%; height: auto; }
.chartcard .legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 2px 0 8px; font-size: 0.85em; color: var(--ink-2); }
.legend .key, .viztip .row .key { display: inline-block; width: 22px; height: 0; border-top: 2px solid #000; vertical-align: 3px; margin-right: 5px; }
.viztip {
  position: fixed; z-index: 90; pointer-events: none; background: #fff;
  border: 1px solid #000; padding: 5px 8px; font-size: 0.85em; max-width: 280px;
}
.viztip .tt-x { color: var(--muted); font-size: 0.9em; margin-bottom: 3px; }
.viztip .row { display: flex; align-items: baseline; gap: 6px; }
.viztip .row b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.viztip .row span.lbl { color: var(--ink-2); }

.topomap { display: block; width: 100%; max-width: 640px; margin: 0 auto; filter: grayscale(1); }

/* ---------- rivalry web ---------- */
.webwrap { border: 1px solid #000; margin: 10px 0 6px; }
.webwrap svg { display: block; width: 100%; height: 68vh; min-height: 380px; touch-action: none; cursor: grab; }
.webwrap svg:active { cursor: grabbing; }
.webwrap svg circle { cursor: pointer; }
.weblegend { display: flex; flex-wrap: wrap; gap: 4px 14px; padding: 6px 10px; border-top: 1px solid var(--line-soft); font-size: 0.8em; color: var(--ink-2); }
.weblegend .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 4px; vertical-align: -1px; }

/* ---------- controls ---------- */
.controls { display: flex; gap: 10px 16px; flex-wrap: wrap; align-items: center; padding: 8px 0 4px; font-size: 0.92em; }
.controls select, .controls input[type=text] {
  font: inherit; font-size: 0.95em; padding: 2px 5px; border: 1px solid #000; border-radius: 0; background: #fff; color: #000;
}
.controls .seg { display: inline-flex; border: 1px solid #000; }
.controls .seg button {
  font: inherit; font-size: 0.95em; padding: 2px 12px; border: 0; border-right: 1px solid #000;
  background: #fff; color: #000; cursor: pointer;
}
.controls .seg button:last-child { border-right: 0; }
.controls .seg button.on { background: #000; color: #fff; }
.controls .chk { display: inline-flex; align-items: center; gap: 5px; }

/* ---------- misc ---------- */
.statrow { display: flex; gap: 32px; flex-wrap: wrap; margin: 12px 0; }
.stat .lbl { font-size: 0.8em; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.stat .val { font-size: 1.8em; line-height: 1.2; }
.stat .val small { font-size: 0.5em; color: var(--ink-2); }

footer.site { margin-top: 36px; padding-top: 10px; border-top: 1px solid #000; color: var(--ink-2); font-size: 0.85em; }

.crumbs { font-size: 0.85em; color: var(--muted); margin-bottom: 4px; }
.pill { display: inline-block; border: 1px solid #000; padding: 0 8px; font-size: 0.85em; margin: 0 4px 4px 0; }

@media (max-width: 700px) {
  body { margin-top: 28px; }
  .searchbox input { width: 150px; }
  header.site h1 { font-size: 1.8em; }
}

table.data td.num, table.data td a, table.data th { white-space: nowrap; }
.tw { overflow-x: auto; -webkit-overflow-scrolling: touch; }
html { -webkit-text-size-adjust: 100%; }
.cols > div { flex-basis: 280px; }

@media (max-width: 700px) {
  body { margin: 16px 0 28px; font-size: 15px; }
  .wrap { padding: 0 14px; }
  header.site h1 { font-size: 1.7em; }
  header.site .back { margin-bottom: 8px; }
  nav.main { gap: 6px 14px; margin-top: 10px; padding: 8px 0; }
  nav.main a { padding: 3px 0; }
  nav.main .spacer { display: none; }
  nav.main .searchbox { flex: 1 1 100%; }
  .searchbox input { width: 100%; }
  .searchbox .drop { left: 0; right: 0; min-width: 0; }
  h2 { font-size: 1.2em; }
  .cols { gap: 8px; display: block; }
  .cols > div { flex-basis: auto; }
  table.data { font-size: 0.85em; }
  table.data td, table.data th { padding: 5px 6px; }
  .controls { gap: 8px 12px; }
  .controls select, .controls input[type=text], .searchbox input { font-size: 16px; padding: 5px 6px; }
  .controls .seg button { padding: 6px 16px; font-size: 1em; }
  .controls .chk { flex: 1 1 100%; }
  .statrow { gap: 8px 22px; }
  .webwrap svg { height: 58vh; min-height: 320px; }
  .chartcard .chead { font-size: 0.95em; }
  footer.site { font-size: 0.8em; }
}
