/* races pages — warm editorial theme layered over ../style.css tokens.
   Inspired by the trumpaccounts.gov design language (Instrument Serif
   display type, warm layered creams, deep ink-navy, muted gold, pills). */

/* ---- token overrides: races section only (this sheet loads only here) ---- */
:root {
  --page:        #efece7;
  --surface:     #f7f4ee;
  --ink:         #212c33;
  --ink-2:       #465660;
  --muted:       #7a745f;  /* 4.5:1 on the cream page */
  --grid:        #e3dfd5;
  --baseline:    #cbc5b6;
  --border:      rgba(33, 44, 51, 0.10);
  --series:      #2d3a50;
  --series-soft: rgba(45, 58, 80, 0.10);
  --gold:        #dfc084;
  --gold-ink:    #8a6d2f;
  --pill-bg:     #2d3a50;
  --pill-fg:     #f9f7f1;
}
@media (prefers-color-scheme: dark) {
  :root {
    --page:        #131210;
    --surface:     #1d1b17;
    --ink:         #f3f0e8;
    --ink-2:       #c9c3b4;
    --muted:       #8f897a;
    --grid:        #2b2924;
    --baseline:    #3d3a32;
    --border:      rgba(243, 240, 232, 0.12);
    --series:      #5c7bab;
    --series-soft: rgba(140, 166, 205, 0.16);
    --gold:        #d9b871;
    --gold-ink:    #dfc084;
    --pill-bg:     #f3f0e8;
    --pill-fg:     #16150f;
  }
}

/* ---- editorial type ---- */
h1, h2, h3, .year-head {
  font-family: "Instrument Serif", Georgia, "Times New Roman", serif;
  font-weight: 400;
}
h1 { font-size: clamp(46px, 7vw, 74px); line-height: 1.03; letter-spacing: -0.025em; margin: 0 0 14px; }
h2 { font-size: clamp(32px, 4.5vw, 46px); line-height: 1.1; letter-spacing: -0.02em; margin: 0 0 10px; }
h3 { letter-spacing: -0.01em; }
.year-head { font-size: 30px !important; font-weight: 400 !important; }

.races-hero { padding: 84px 0 20px; text-align: center; }
.races-hero .lede {
  font-size: 17.5px;
  color: var(--ink-2);
  max-width: 640px;
  margin: 0 auto;
}

.race-meta {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 30px 0 6px;
}
.race-stat .num {
  font-family: "Instrument Serif", Georgia, serif;
  font-size: 46px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.race-stat .label { font-size: 12.5px; color: var(--muted); }

.path-key { justify-content: center; }

.badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 2px 9px;
  vertical-align: 1px;
  border: 1px solid var(--border);
  color: var(--ink-2);
  white-space: nowrap;
}
.badge.runsignup   { color: #2563eb; border-color: color-mix(in srgb, #2563eb 40%, transparent); }
.badge.ultrasignup { color: #b45309; border-color: color-mix(in srgb, #b45309 45%, transparent); }
.badge.raceroster  { color: #0e7490; border-color: color-mix(in srgb, #0e7490 45%, transparent); }
.badge.confirmed   { color: #15803d; border-color: color-mix(in srgb, #15803d 45%, transparent); }
.badge.likely      { color: #b45309; border-color: color-mix(in srgb, #b45309 45%, transparent); }
@media (prefers-color-scheme: dark) {
  .badge.runsignup   { color: #7aa8f5; }
  .badge.ultrasignup { color: #e0a35c; }
  .badge.raceroster  { color: #67cbe0; }
  .badge.confirmed   { color: #6fce8f; }
  .badge.likely      { color: #e0a35c; }
}

.filter-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 20px 0 6px; }
.filter-row input[type="search"] {
  font: inherit;
  font-size: 15px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--baseline);
  background: var(--surface);
  color: var(--ink);
  flex: 1 1 240px;
  max-width: 340px;
}
.filter-row input:focus { outline: 2px solid var(--series-soft); border-color: var(--series); }

.month-head {
  margin: 34px 0 4px;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-family: inherit;
}

.race-list { list-style: none; margin: 0; padding: 0; }
.race-list li {
  display: grid;
  grid-template-columns: 58px 1fr auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 11px 2px;
  border-bottom: 1px solid var(--grid);
}
.race-list .rdate { color: var(--ink-2); font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.race-list .rname a { color: var(--ink); font-weight: 550; }
.race-list .rname a:hover { color: var(--series); text-decoration: none; }
.race-list .rsub { display: block; font-size: 12.5px; color: var(--muted); }
.race-list .rdist-away { justify-self: end; }
@media (max-width: 560px) {
  .race-list li { grid-template-columns: 58px 1fr; }
  .race-list .rdist-away { display: none; }
}

.past-card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 26px 28px;
  margin-top: 16px;
  color: var(--ink);
  transition: border-color 0.15s, transform 0.15s;
}
.past-card:hover { border-color: var(--gold); text-decoration: none; transform: translateY(-1px); }
.past-card h3 { margin: 0 0 4px; font-size: 24px; }
.past-card p { margin: 0; color: var(--ink-2); font-size: 14px; }

/* results table */
.results-table { width: 100%; overflow-x: auto; margin-top: 18px; }
.results-table table { border-collapse: collapse; width: 100%; }
.results-table th, .results-table td {
  text-align: left;
  padding: 7px 14px 7px 0;
  border-bottom: 1px solid var(--grid);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.results-table th {
  color: var(--muted);
  font-weight: 550;
  font-size: 12.5px;
  position: sticky;
  top: 0;
  background: var(--page);
}
.results-table tr.matched td { background: var(--series-soft); }
.results-table tr.matched td:first-child { border-radius: 6px 0 0 6px; }
.results-table tr.matched td:last-child { border-radius: 0 6px 6px 0; }
.results-table .sub { font-size: 12px; color: var(--muted); }
.results-table td.dim { color: var(--muted); }

.cta-note {
  margin-top: 26px;
  background: var(--surface);
  border: 1px dashed var(--baseline);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 14px;
  color: var(--ink-2);
}

.updated-note { color: var(--muted); font-size: 12.5px; margin-top: 26px; }
