/* 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; position: relative; }
.races-hero::before {
  content: "";
  position: absolute; inset: -30px -60px 0 -60px;
  background: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 640 480%22 fill=%22none%22 stroke=%22%23c9a45c%22 stroke-width=%221.3%22 opacity=%220.55%22%3E%3Cpath d=%22M461.1 150.0C461.3 153.6 462.9 157.7 461.1 160.8C459.3 163.8 454.2 166.0 450.3 168.3C446.4 170.7 442.5 173.6 437.8 174.7C433.1 175.7 426.5 176.2 422.1 174.8C417.8 173.5 414.7 169.1 411.7 166.5C408.8 163.8 407.4 161.7 404.1 159.0C400.9 156.2 392.7 153.1 392.3 150.0C391.9 146.9 398.7 143.1 401.7 140.2C404.8 137.3 407.4 135.5 410.6 132.5C413.9 129.5 416.8 123.4 421.2 122.3C425.7 121.3 432.1 125.3 437.5 126.4C442.9 127.4 449.7 126.6 453.5 128.8C457.3 131.0 459.1 135.9 460.4 139.5C461.7 143.0 461.0 146.4 461.1 150.0Z%22/%3E%3Cpath d=%22M488.2 150.0C488.2 155.8 483.1 161.5 479.8 167.3C476.5 173.1 474.7 181.0 468.5 184.7C462.3 188.5 451.0 189.0 442.6 189.6C434.1 190.2 426.4 189.0 417.9 188.2C409.4 187.4 400.4 187.4 391.4 184.8C382.5 182.2 369.4 178.7 364.0 172.9C358.7 167.1 358.9 157.4 359.4 150.0C359.9 142.6 361.3 133.6 367.1 128.2C372.8 122.8 385.8 121.4 393.9 117.4C402.0 113.5 407.4 106.0 415.6 104.5C423.8 103.0 434.8 106.3 443.1 108.5C451.5 110.8 459.3 114.0 465.4 118.0C471.5 122.1 476.1 127.4 479.9 132.7C483.6 138.0 488.2 144.2 488.2 150.0Z%22/%3E%3Cpath d=%22M528.3 150.0C530.8 159.8 527.8 172.2 522.2 182.0C516.7 191.8 506.3 201.2 495.0 208.7C483.7 216.1 468.9 224.5 454.3 226.7C439.7 228.9 422.6 224.4 407.2 221.8C391.9 219.2 370.2 219.1 362.3 211.1C354.4 203.2 364.2 184.5 360.0 174.3C355.8 164.1 341.9 159.7 337.2 150.0C332.4 140.3 326.3 125.1 331.5 115.8C336.7 106.5 355.8 101.1 368.2 94.2C380.6 87.3 392.7 74.4 406.0 74.3C419.3 74.2 434.3 89.5 447.9 93.4C461.6 97.3 478.1 92.7 487.9 97.7C497.7 102.7 500.1 114.7 506.8 123.4C513.5 132.1 525.7 140.2 528.3 150.0Z%22/%3E%3Cpath d=%22M568.3 150.0C571.2 163.5 566.1 182.1 555.8 193.6C545.6 205.2 523.7 213.5 506.9 219.4C490.1 225.3 471.5 228.8 455.0 228.9C438.5 229.0 425.7 220.8 407.8 220.0C389.9 219.2 362.5 229.5 347.8 224.3C333.0 219.0 328.6 200.7 319.6 188.3C310.5 175.9 292.7 162.5 293.4 150.0C294.1 137.5 315.3 126.1 323.8 113.2C332.4 100.3 331.0 79.9 344.5 72.8C358.0 65.7 385.5 74.1 404.9 70.7C424.3 67.4 442.6 52.1 460.9 52.7C479.1 53.2 501.4 63.9 514.3 73.9C527.1 83.9 529.0 99.9 538.0 112.6C547.0 125.3 565.3 136.5 568.3 150.0Z%22/%3E%3Cpath d=%22M572.7 150.0C566.2 166.0 555.4 175.8 548.6 191.1C541.8 206.5 547.1 234.2 532.0 242.1C517.0 250.1 481.0 235.9 458.2 238.9C435.4 241.8 415.0 260.9 395.2 259.7C375.4 258.5 352.4 243.6 339.3 231.8C326.3 220.1 327.4 202.9 316.8 189.3C306.1 175.6 275.3 163.0 275.5 150.0C275.7 137.0 307.8 125.2 317.9 111.1C328.1 97.1 322.6 74.0 336.6 65.7C350.6 57.4 381.6 62.1 401.9 61.2C422.2 60.3 438.2 59.5 458.4 60.3C478.6 61.1 501.5 60.2 523.0 66.0C544.5 71.9 579.3 81.4 587.6 95.3C595.9 109.3 579.2 134.0 572.7 150.0Z%22/%3E%3Cpath d=%22M229.5 320.0C229.2 323.3 228.9 326.4 227.5 329.6C226.2 332.7 224.7 337.3 221.2 339.2C217.8 341.1 211.3 340.5 206.6 340.8C201.9 341.1 197.6 341.7 193.3 341.1C189.0 340.5 183.7 339.5 180.8 337.4C177.8 335.2 177.5 331.3 175.7 328.4C173.9 325.5 170.5 323.0 169.9 320.0C169.2 317.0 170.2 313.3 171.8 310.2C173.5 307.2 175.8 303.0 179.5 301.5C183.3 300.1 189.7 301.9 194.2 301.7C198.6 301.5 202.6 299.7 206.3 300.3C209.9 300.9 212.3 303.8 216.3 305.3C220.2 306.9 227.5 307.3 229.7 309.7C231.9 312.1 229.9 316.7 229.5 320.0Z%22/%3E%3Cpath d=%22M259.5 320.0C260.1 326.4 260.3 333.8 257.0 339.8C253.7 345.7 247.1 352.8 239.6 355.7C232.0 358.6 220.2 357.1 211.7 356.9C203.3 356.8 196.8 355.8 188.9 355.0C181.0 354.3 170.7 355.3 164.2 352.3C157.7 349.4 155.2 342.7 150.1 337.3C145.0 331.9 134.9 326.2 133.6 320.0C132.3 313.8 137.8 305.9 142.4 300.0C147.0 294.2 154.0 288.9 161.3 285.0C168.6 281.2 177.6 278.6 186.4 277.0C195.2 275.5 206.3 273.3 214.1 275.5C221.8 277.8 226.4 286.0 232.8 290.3C239.3 294.7 248.5 296.7 252.9 301.6C257.4 306.6 258.8 313.6 259.5 320.0Z%22/%3E%3Cpath d=%22M282.0 320.0C283.3 329.6 290.3 341.0 286.6 350.0C282.9 359.0 270.6 367.2 259.9 374.1C249.2 381.0 235.5 391.0 222.6 391.3C209.7 391.6 194.5 380.1 182.3 375.9C170.1 371.6 158.3 370.9 149.4 365.6C140.6 360.4 134.5 352.1 129.4 344.5C124.4 336.9 122.0 329.2 119.1 320.0C116.2 310.8 106.5 296.8 111.9 289.5C117.3 282.2 140.2 281.8 151.5 276.2C162.8 270.7 168.7 258.2 179.7 256.1C190.8 254.0 205.9 260.6 217.9 263.5C229.9 266.3 241.7 268.3 251.9 273.2C262.1 278.0 274.0 284.8 279.0 292.6C284.1 300.4 280.8 310.4 282.0 320.0Z%22/%3E%3Cpath d=%22M301.5 320.0C304.9 332.3 320.4 348.5 316.7 360.5C313.0 372.4 293.5 381.9 279.3 391.6C265.0 401.3 248.6 417.9 231.3 418.8C214.0 419.6 192.2 403.0 175.7 396.7C159.2 390.4 148.0 387.0 132.3 381.1C116.7 375.1 91.9 371.1 82.0 360.9C72.0 350.7 69.5 332.6 72.5 320.0C75.6 307.4 92.4 297.5 100.2 285.4C108.1 273.3 107.4 255.3 119.8 247.6C132.1 239.9 156.1 242.7 174.4 239.2C192.7 235.7 214.7 222.7 229.6 226.6C244.5 230.5 252.5 252.6 263.6 262.6C274.8 272.6 290.1 277.0 296.4 286.6C302.7 296.2 298.1 307.7 301.5 320.0Z%22/%3E%3Cpath d=%22M425 146l10 8M435 146l-10 8%22 stroke-width=%222.2%22/%3E%3Cpath d=%22M195 316l10 8M205 316l-10 8%22 stroke-width=%222.2%22/%3E%3C/svg%3E") no-repeat center top / 980px auto;
  opacity: 0.5;
  pointer-events: none;
}
@media (prefers-color-scheme: dark) { .races-hero::before { opacity: 0.28; } }
.races-hero > * { position: relative; }
.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; }
