/* Race day pages. One stylesheet for public/races/, loaded after app.css, so the tokens and the
   wordmark stay the app's. No new colour, font or component: the facts grid and the page list are
   built from the same ink, line, surface and accent. No media query: the grids fill the width they
   are given, so one layout works from 320 px to a desktop. */

.races {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 max(16px, env(safe-area-inset-right)) max(40px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.crumbs a {
  color: var(--link);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.crumbs a:hover {
  text-decoration: underline;
}
.crumbs span[aria-hidden] {
  color: var(--field);
}

.race .standfirst {
  margin: 0;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.5;
  max-width: 64ch;
}

.chips {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chips li {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 600 13px var(--body);
  padding: 4px 10px;
}

.races .block {
  display: grid;
  gap: 10px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
}
.races .block h2 {
  font-size: 19px;
}
.races .block p {
  margin: 0;
  max-width: 70ch;
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 10px;
  margin: 0;
}
.facts > div {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 11px 13px;
  min-width: 0;
}
.facts dt {
  color: var(--label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  margin: 0 0 4px;
}
.facts dd {
  margin: 0;
  font-size: 15px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.ref {
  margin-left: 4px;
  font-weight: 400;
  letter-spacing: 0;
  text-decoration: none;
}
.ref:hover {
  text-decoration: underline;
}

.srcnote {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bullets {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  max-width: 70ch;
}
.bullets li {
  line-height: 1.5;
}

.timeline {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.timeline li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 12px;
  line-height: 1.45;
}
.timeline b {
  display: block;
  color: var(--label);
  font-size: 12px;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.unverified {
  background: var(--warn-bg);
  border-top: 0;
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  padding: 14px 16px;
}
.unverified h2 {
  color: var(--ink);
}
.unverified p {
  color: var(--ink);
}

.cta {
  display: grid;
  gap: 12px;
  background: var(--ink);
  color: #fff;
  border-radius: 12px;
  padding: 20px;
}
.cta h2 {
  color: #fff;
  font-size: 20px;
}
.cta p {
  margin: 0;
  color: #dce4f2;
  max-width: 60ch;
}
.cta .btn {
  text-align: center;
}
.cta .btn.ghost {
  background: transparent;
  border: 1px solid #63739a;
  color: #fff;
}
.cta .btn.ghost:hover {
  background: #22314f;
  color: #fff;
}
.small-print {
  color: #b9c4d8 !important;
  font-size: 13px;
  line-height: 1.45;
}

.more ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 4px 16px;
}
.more li a,
.more li span {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--link);
  text-decoration: none;
  font-size: 15px;
}
.more li span {
  color: var(--muted);
  font-weight: 700;
}
.more li a:hover {
  text-decoration: underline;
}

.sources ol {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}
.sources a {
  color: var(--link);
}
.sources li:target {
  background: var(--info-bg);
  outline: 2px solid var(--link);
  outline-offset: 2px;
  border-radius: 4px;
}

.racefoot {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  color: var(--muted);
  font-size: 14px;
}
.racefoot p {
  margin: 0;
}
.racefoot a {
  color: var(--link);
}

/* The hub, public/races/index.html */
.racelist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px;
}
.racelist a {
  display: grid;
  gap: 4px;
  min-height: 44px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 14px;
  color: var(--ink);
  text-decoration: none;
}
.racelist a:hover {
  border-color: var(--field);
}
.racelist .what {
  font: 600 16px var(--display);
}
.racelist .when {
  color: var(--muted);
  font-size: 13px;
}
.racelist .go {
  color: var(--link);
  font-size: 14px;
  font-weight: 700;
}
