/* Racing Babes — public site. Palettes taken from The Colors of Her Soul business cards. */
:root {
  --teal-1: #1d5a6c;   --teal-2: #4a9ab6;
  --rasp-1: #9c2456;   --rasp-2: #d58aa0;
  --plum-1: #4b2150;   --plum-2: #a77ba6;
  --forest-1: #1c5a4b; --forest-2: #6b9b8b;
  --indigo-1: #15156d; --indigo-2: #3b3dcf;

  --c1: var(--teal-1);
  --c2: var(--teal-2);

  --ink: #1f2430;
  --muted: #5b6474;
  --paper: #ffffff;
  --mist: #c9d0d9;
  --bg: #eef1f5;
  --line: #d9dee6;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(21, 28, 48, .10);
  --script: 'Kaushan Script', 'Brush Script MT', cursive;
  --sans: 'Overpass', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.theme-teal   { --c1: var(--teal-1);   --c2: var(--teal-2); }
.theme-rasp   { --c1: var(--rasp-1);   --c2: var(--rasp-2); }
.theme-plum   { --c1: var(--plum-1);   --c2: var(--plum-2); }
.theme-forest { --c1: var(--forest-1); --c2: var(--forest-2); }
.theme-indigo { --c1: var(--indigo-1); --c2: var(--indigo-2); }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--c1); }
a:hover { color: var(--c2); }
:focus-visible { outline: 3px solid var(--c2); outline-offset: 3px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--paper); padding: 8px 14px; z-index: 100; border-radius: 8px; }
.skip-link:focus { left: 8px; }
.wrap { width: min(1160px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 1rem; min-height: 72px; }
.brand { display: flex; align-items: center; gap: .7rem; text-decoration: none; color: var(--ink); }
.brand img { width: 50px; height: 50px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-size: 1.4rem; font-weight: 800; color: #1f5f6e; letter-spacing: -.01em; }
.brand-text strong .script { font-family: var(--script); font-weight: 400; color: #9c2456; font-size: 1.15em; }
.brand-text small { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted, #6b5a6e); }
.nav { margin-left: auto; display: flex; gap: .25rem; flex-wrap: wrap; }
.nav a {
  text-decoration: none; color: var(--ink); font-weight: 600; font-size: .95rem;
  padding: .55rem .85rem; border-radius: 999px;
}
.nav a:hover { background: var(--bg); color: var(--c1); }
.nav a[aria-current="page"] { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: 10px; padding: .45rem .7rem; font: inherit; cursor: pointer; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; top: 72px; left: 0; right: 0; flex-direction: column; background: #fff; padding: .75rem 1.25rem 1rem; border-bottom: 1px solid var(--line); }
  .nav.open { display: flex; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: linear-gradient(115deg, var(--c1) 0%, var(--c1) 35%, var(--c2) 100%);
}
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 85% 20%, rgba(255,255,255,.18), transparent 45%);
  pointer-events: none;
}
/* Every coloured title band has the same height, padding and title size. */
.hero .wrap {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1fr); align-content: center; gap: 1.2rem;
  min-height: var(--hero-h, 16rem); padding: 2rem 0; box-sizing: border-box;
}
.hero .eyebrow { font-family: var(--script); font-size: 1.4rem; opacity: .95; margin: 0; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); line-height: 1.05; margin: .2rem 0 .6rem; letter-spacing: -.01em; }
.hero p.lead { font-size: 1.12rem; max-width: 36rem; opacity: .95; margin: 0; }
/* Welcome only: the horse always sits to the right of the text. */
.hero.has-horse .wrap { grid-template-columns: minmax(0, 1fr) auto; align-items: center; padding: .5rem 0; }
.hero picture { display: contents; }
.hero picture source { display: none; }
.hero-horse {
  height: calc(var(--hero-h, 16rem) - 1rem); width: auto; filter: drop-shadow(0 10px 18px rgba(0,0,0,.28));
}
@media (max-width: 760px) {
  .race-header .meta { font-size: .9rem; }
  .hero h1 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .hero p.lead { font-size: 1rem; }
  .hero.has-horse .wrap { gap: .6rem; }
}
@media (max-width: 380px) {
  .hero.has-horse .hero-horse { height: 11rem; }
  .hero p.lead { font-size: .95rem; }
  .hero .eyebrow { font-size: 1.2rem; }
  .race-header h1 { font-size: 1.6rem; }
}
/* ---------- Race buttons (001 Welcome) ---------- */
.race-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: -1.4rem; position: relative; z-index: 2; }
.race-button {
  --c1: var(--teal-1); --c2: var(--teal-2);
  display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: #fff; white-space: nowrap;
  padding: .6rem .7rem .6rem 1.1rem; border-radius: 999px; box-shadow: var(--shadow);
  background: linear-gradient(120deg, var(--c1), var(--c2));
  transition: transform .18s ease, box-shadow .18s ease;
}
.race-button:hover, .race-button:focus-visible { transform: translateY(-2px); color: #fff; box-shadow: 0 12px 26px rgba(21,28,48,.18); }
.race-button .label { font-size: 1rem; font-weight: 700; }
.race-button .count { font-size: .9rem; font-weight: 800; line-height: 1; background: rgba(255,255,255,.22); border-radius: 999px; padding: .3rem .55rem; min-width: 1.7rem; text-align: center; }
.race-button.current { --c1: var(--rasp-1); --c2: var(--rasp-2); }
.race-button.past { --c1: var(--plum-1); --c2: var(--plum-2); }
.race-button.future { --c1: var(--indigo-1); --c2: var(--indigo-2); }
.live-dot { display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: #fff; margin-right: .4rem; animation: pulse 1.4s infinite; vertical-align: middle; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255,255,255,.8); } 70% { box-shadow: 0 0 0 10px rgba(255,255,255,0); } 100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); } }
@media (max-width: 760px) { .race-buttons { margin-top: .9rem; } }
@media (max-width: 520px) { .race-buttons { gap: .3rem; flex-wrap: nowrap; } .race-button { padding: .45rem .35rem .45rem .6rem; gap: .25rem; } .race-button .label { font-size: .78rem; white-space: nowrap; } .race-button .count { font-size: .72rem; padding: .2rem .35rem; min-width: 1.2rem; } }
@media (max-width: 380px) { .race-button .opt { display: none; } }

/* ---------- Sections & cards ---------- */
.section { padding: 3.2rem 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.section-head h2 { margin: 0; font-size: clamp(1.6rem, 3vw, 2.2rem); }
.intro { max-width: 46rem; margin: -.4rem 0 1.4rem; color: var(--muted, #6b5a6e); font-size: 1.05rem; }
.section-head .script { font-family: var(--script); color: var(--c1); font-size: 1.2rem; margin: 0; }
.card { background: var(--paper); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; }
.band { background: linear-gradient(180deg, #fff, var(--bg)); }

/* ---------- Badges & buttons ---------- */
.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: .25rem .65rem; border-radius: 999px; white-space: nowrap; }
.badge.live { background: #fbe6ee; color: var(--rasp-1); }
.badge.live::before { content: ''; width: .5rem; height: .5rem; border-radius: 50%; background: var(--rasp-1); animation: blink 1.2s infinite; }
.badge.upcoming { background: #e3e4fb; color: var(--indigo-1); }
.badge.completed { background: #efe6ef; color: var(--plum-1); }
.badge.cancelled { background: #eceff3; color: var(--muted); }
@keyframes blink { 50% { opacity: .25; } }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
  padding: .7rem 1.2rem; border-radius: 999px; border: 2px solid transparent;
  background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff;
}
.btn:hover { color: #fff; filter: brightness(1.07); }
.btn.ghost { background: transparent; color: var(--c1); border-color: currentColor; }
.btn.ghost:hover { background: var(--bg); color: var(--c1); }
.btn.small { padding: .4rem .85rem; font-size: .9rem; }

/* ---------- Races list ---------- */
.toolbar { display: flex; gap: .8rem; flex-wrap: wrap; align-items: center; margin-bottom: 1.2rem; }
.tabs { display: inline-flex; background: #fff; border-radius: 999px; padding: .3rem; box-shadow: var(--shadow); flex-wrap: wrap; }
.tabs button, .tabs a {
  font: inherit; font-weight: 700; border: 0; background: none; cursor: pointer; color: var(--muted);
  padding: .55rem 1.1rem; border-radius: 999px; text-decoration: none;
}
.tabs [aria-selected="true"], .tabs [aria-current="true"] { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff; }
.field { display: flex; flex-direction: column; gap: .3rem; font-weight: 600; font-size: .9rem; }
.input, select.input, textarea.input {
  font: inherit; padding: .65rem .9rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); min-width: 0;
}
.toolbar .input { min-width: 220px; }

.race-table { width: 100%; border-collapse: separate; border-spacing: 0; background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.race-table th { text-align: left; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: #f6f8fa; padding: .85rem 1rem; }
.race-table td { padding: .95rem 1rem; border-top: 1px solid var(--line); vertical-align: middle; }
.race-table tbody tr { cursor: pointer; transition: background .15s; }
.race-table tbody tr:hover { background: #f7f8fc; }
.race-name { font-weight: 700; color: var(--ink); text-decoration: none; }
.race-name:hover { color: var(--c1); }
.race-id { color: var(--muted); font-size: .82rem; }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--muted); }
@media (max-width: 760px) {
  .race-table thead { display: none; }
  .race-table, .race-table tbody, .race-table tr, .race-table td { display: block; width: 100%; }
  .race-table tr { padding: .8rem 1rem; border-top: 1px solid var(--line); }
  .race-table td { border: 0; padding: .15rem 0; }
  .race-table td[data-label]::before { content: attr(data-label) ': '; font-weight: 700; color: var(--muted); font-size: .85rem; }
}

/* ---------- Map ---------- */
.map-layout { display: grid; grid-template-columns: minmax(280px, 520px) 1fr; gap: 1.5rem; align-items: start; }
.map-card { padding: 1rem; }
.map-legend { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: .6rem; }
.chip { font: inherit; font-size: .85rem; font-weight: 700; border: 1px solid var(--line); background: #fff; color: var(--muted); padding: .35rem .8rem; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem; }
.chip[aria-pressed="true"] { border-color: var(--c1); color: var(--c1); background: #f1f7f6; }
.chip .swatch { width: .7rem; height: .7rem; border-radius: 50%; }
svg.alberta { width: 100%; height: auto; display: block; }
.alberta .province { fill: url(#abFill); stroke: var(--forest-1); stroke-width: 2; stroke-linejoin: round; }
.alberta .grid { stroke: rgba(28, 90, 75, .12); stroke-width: 1; }
.alberta .ref-city { fill: var(--muted); font-size: 11px; font-family: var(--sans); }
.alberta .ref-dot { fill: var(--muted); }
.alberta .label { fill: rgba(28, 90, 75, .35); font-family: var(--script); font-size: 34px; }
.alberta .pin { cursor: pointer; }
.alberta .pin .pin-body { transition: transform .15s ease; transform-box: fill-box; transform-origin: 50% 100%; }
.alberta .pin:hover .pin-body, .alberta .pin:focus .pin-body { transform: scale(1.18); }
.alberta .pin:focus { outline: none; }
.alberta .pin:focus .pin-ring { stroke: var(--ink); stroke-width: 3; }
.alberta .pin-count { font: 700 11px var(--sans); fill: #fff; pointer-events: none; }
.alberta .pin-name { font: 700 11px var(--sans); fill: var(--ink); paint-order: stroke; stroke: #fff; stroke-width: 3px; pointer-events: none; }
.alberta .pulse { fill: var(--rasp-1); opacity: .5; animation: ring 1.8s infinite; transform-box: fill-box; transform-origin: center; }
@keyframes ring { from { transform: scale(.6); opacity: .55; } to { transform: scale(2.2); opacity: 0; } }
.city-list { display: grid; gap: .8rem; }
.city-item { display: flex; gap: .9rem; align-items: flex-start; padding: 1rem 1.1rem; }
.city-item h3 { margin: 0 0 .3rem; font-size: 1.05rem; }
.city-item ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; }
.city-item li button, .linklike { font: inherit; background: none; border: 0; padding: 0; color: var(--c1); cursor: pointer; text-align: left; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.city-dot { width: 14px; height: 14px; border-radius: 50%; flex: none; margin-top: .35rem; }
@media (max-width: 900px) { .map-layout { grid-template-columns: 1fr; } }

/* ---------- Modal ---------- */
dialog.event-dialog { border: 0; padding: 0; border-radius: 22px; width: min(560px, 94vw); max-height: 90vh; box-shadow: 0 30px 80px rgba(0,0,0,.35); color: var(--ink); }
dialog.event-dialog::backdrop { background: rgba(20, 24, 40, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
.dialog-head { color: #fff; padding: 1.4rem 1.5rem 1.2rem; background: linear-gradient(115deg, var(--c1), var(--c2)); position: relative; }
.dialog-head h2 { margin: .35rem 2rem 0 0; font-size: 1.45rem; line-height: 1.2; }
.dialog-head .badge { background: rgba(255,255,255,.92); }
.dialog-close { position: absolute; top: .8rem; right: .8rem; background: rgba(255,255,255,.2); border: 0; color: #fff; width: 2.2rem; height: 2.2rem; border-radius: 50%; font-size: 1.3rem; cursor: pointer; }
.dialog-body { padding: 1.3rem 1.5rem 1.5rem; display: grid; gap: 1rem; }
.facts { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: .4rem 1rem; margin: 0; }
.facts dt { font-weight: 700; color: var(--muted); font-size: .9rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.contact-box { background: var(--bg); border-radius: 14px; padding: 1rem 1.1rem; }
.contact-box h3 { margin: 0 0 .4rem; font-size: 1rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; }
.dialog-event-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.dialog-event-list li { display: flex; justify-content: space-between; gap: .8rem; align-items: center; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px; }

/* ---------- Race page ---------- */
.race-header .wrap { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 0; }
.race-header .race-kicker { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.race-header h1 { margin: .3rem 0 .2rem; }
.race-header .meta { display: flex; gap: .3rem 1.2rem; flex-wrap: wrap; opacity: .95; font-size: .98rem; }
.race-header .race-number { font-family: var(--script); font-size: 1.3rem; }
.panel-note { color: var(--muted); font-size: .92rem; margin: .4rem 0 1rem; }
.results-table { width: 100%; border-collapse: collapse; }
.results-table th { text-align: left; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .6rem .8rem; border-bottom: 2px solid var(--line); }
.results-table td { padding: .7rem .8rem; border-bottom: 1px solid var(--line); }
.results-table td.num, .results-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.results-table tr.section-row td { background: #f6f8fa; font-weight: 700; color: var(--c1); }
.results-table tr.on-deck td { background: #fbe6ee; }
.results-table tr.pending td { color: var(--muted); }
.time { font-weight: 800; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }

.division { margin-bottom: 2rem; }
.division h3 { margin: 0 0 1rem; display: flex; align-items: center; gap: .6rem; }
.division h3 .pill { background: linear-gradient(90deg, var(--c1), var(--c2)); color: #fff; padding: .15rem .7rem; border-radius: 999px; font-size: .95rem; }
.division h3 .placings-note { margin-left: auto; font-size: .9rem; font-weight: 600; color: var(--muted); }
.leaderboard-table tr.winner td { background: #eaf6ef; }

.privacy-note { display: flex; gap: .7rem; align-items: flex-start; font-size: .9rem; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: 14px; padding: .8rem 1rem; }

/* ---------- About ---------- */
.feature-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1rem; }
.feature { border-top: 5px solid var(--c1); }
.feature h3 { margin: .2rem 0 .4rem; }
.feature p { margin: 0; color: var(--muted); }
.feature .icon { font-size: 1.6rem; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: 0 24px 60px rgba(21,28,48,.25); background: #111; }
.video-frame iframe, .video-frame video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.goal { background: linear-gradient(115deg, var(--c1), var(--c2)); color: #fff; }
.goal blockquote { font-family: var(--script); font-size: clamp(1.4rem, 3vw, 2rem); margin: 0; line-height: 1.35; }

/* ---------- Contact ---------- */
.contact-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 1.5rem; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; }
.form-grid .row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; }
textarea.input { min-height: 150px; resize: vertical; }
.form-status { font-weight: 600; color: var(--c1); min-height: 1.4em; margin: 0; }
@media (max-width: 760px) { .contact-layout, .form-grid .row { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Footer ---------- */
.site-footer { background: #151a26; color: #c9d0d9; padding: 2.5rem 0; margin-top: 2rem; }
.site-footer .wrap { display: flex; gap: 2rem; justify-content: space-between; flex-wrap: wrap; align-items: center; }
.site-footer a { color: #fff; }
.site-footer .script { font-family: var(--script); color: #fff; font-size: 1.4rem; }
.site-footer small { display: block; opacity: .8; }
.footer-brand { display: flex; align-items: center; gap: .8rem; }
.footer-brand img { width: 35px; height: 56px; flex: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
