/* Race pages (scripts/build-race-pages.mjs). Builds on styles.css (.landing-page, .week-example, .landing-faq, ...). Brand colour: --ember. */
.race-page .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.race-page .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.race-page { --race-tint: #fff3ec; }
.race-section { margin-top: 56px; }
.race-section > h2 { margin-top: 0; }

/* Hero */
.race-hero { padding: 8px 0 8px; }
.race-eyebrow { margin: 0 0 10px; color: var(--ember); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 13px; }
.race-hero h1 { margin: 0 0 14px; font-size: clamp(32px, 6vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.race-hero .landing-lead { font-size: 19px; line-height: 1.55; max-width: 62ch; }
.race-hero-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin: 22px 0 28px; }
.race-btn { display: inline-block; background: var(--ember); color: #fff !important; text-decoration: none; font-weight: 700; padding: 14px 26px; border-radius: 12px; }
.race-btn:hover { filter: brightness(0.95); }
.race-link { color: var(--ember); font-weight: 600; text-decoration: none; }
.race-link:hover { text-decoration: underline; }

.race-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--border); border-radius: 16px; overflow: hidden; background: #fff; }
.race-strip > div { padding: 16px 18px; border-left: 1px solid var(--border); }
.race-strip > div:first-child { border-left: 0; }
.race-strip dt { font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-secondary); margin: 0 0 4px; }
.race-strip dd { margin: 0; font-weight: 700; line-height: 1.3; }
.race-strip > div:last-child { background: var(--race-tint); }
.race-strip > div:last-child dd { color: var(--ember); font-size: 20px; }
@media (max-width: 760px) {
  .race-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .race-strip > div:nth-child(3) { border-left: 0; border-top: 1px solid var(--border); }
  .race-strip > div:nth-child(4) { border-top: 1px solid var(--border); }
}

/* Who is it for */
.route-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 18px; }
.route-card { position: relative; display: block; cursor: pointer; border: 1px solid var(--border); border-top: 4px solid var(--ember); border-radius: 16px; padding: 20px 22px; background: #fff; }
.route-card input { position: absolute; opacity: 0; pointer-events: none; }
.route-card:has(input:checked) { border-color: var(--ember); box-shadow: 0 0 0 2px var(--ember); }
.route-card:has(input:focus-visible) { outline: 2px solid var(--ember); outline-offset: 3px; }
.route-card::after { content: ""; position: absolute; top: 18px; right: 18px; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border-strong, #c7c7cc); background: #fff; }
.route-card:has(input:checked)::after { border-color: var(--ember); background: radial-gradient(circle, var(--ember) 0 45%, #fff 50%); }
.route-card.is-beginner { background: var(--race-tint); }
.route-tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--ember); }
.route-card h3 { margin: 6px 0 4px; font-size: 20px; }
.route-weeks { margin: 0 0 12px; font-weight: 600; color: var(--text-secondary); }
.route-card ul { margin: 0; padding-left: 18px; }
.route-card li { margin: 0 0 6px; }

/* How to train: pace, heart rate or feel */
.metric-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 18px 0 8px; }
@media (max-width: 720px) { .metric-cards { grid-template-columns: 1fr; } }
.metric-card { border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; background: #fff; }
.metric-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--race-tint); color: var(--ember); font-size: 20px; margin-bottom: 10px; }
.metric-card h3 { margin: 0 0 6px; font-size: 18px; }
.metric-card p { margin: 0; color: var(--text-secondary); }

/* How the plan is built */
.session-list { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.session-list li { display: flex; gap: 14px; border: 1px solid var(--border); border-radius: 16px; padding: 16px 18px; background: #fff; }
.session-number { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--ember); color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.session-list h3 { margin: 0 0 4px; font-size: 17px; }
.session-list p { margin: 0; color: var(--text-secondary); }

/* Days a week: radios and labels first, panels after, so the checked state shows the right week without JavaScript. */
.band-picker > input { position: absolute; opacity: 0; pointer-events: none; }
.band-picker > label { display: inline-block; margin: 4px 8px 4px 0; padding: 10px 18px; border: 1px solid var(--border); border-radius: 999px; cursor: pointer; font-weight: 600; background: #fff; }
.band-picker > label:hover { border-color: var(--ember); }
.band-picker > input:checked + label { background: var(--ember); border-color: var(--ember); color: #fff; }
.band-picker > input:focus-visible + label { outline: 2px solid var(--ember); outline-offset: 2px; }
.band-hint, .band-panel { display: none; }
#band-2-3:checked ~ .band-hints .band-hint[data-band="2-3"],
#band-4-5:checked ~ .band-hints .band-hint[data-band="4-5"],
#band-6-7:checked ~ .band-hints .band-hint[data-band="6-7"] { display: block; color: var(--text-secondary); margin: 10px 0 4px; }
#band-2-3:checked ~ .band-panels .band-panel[data-band="2-3"],
#band-4-5:checked ~ .band-panels .band-panel[data-band="4-5"],
#band-6-7:checked ~ .band-panels .band-panel[data-band="6-7"] { display: block; }
.band-panel h3 { margin: 22px 0 6px; font-size: 16px; }
.week-amount { color: var(--text-secondary); white-space: nowrap; }
.race-page .week-example { border-radius: 16px; background: #fff; }

.race-status { font-weight: 700; color: #b34a1f; background: var(--race-tint); border-radius: 12px; padding: 12px 16px; }

/* Pace calculator */
.pace-calc fieldset { border: 0; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.pace-calc legend { font-weight: 600; margin-bottom: 6px; }
.pace-calc label { display: inline-flex; align-items: center; gap: 6px; }
.pace-calc input[type="number"] { width: 68px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; }
.pace-calc input[type="number"]:focus { outline: 2px solid var(--ember); border-color: var(--ember); }
.pace-result { font-size: 20px; margin: 10px 0; }
.pace-result strong { color: var(--ember); font-size: 28px; }
.pace-table { border-collapse: collapse; width: 100%; max-width: 380px; }
.pace-table th, .pace-table td { text-align: left; padding: 7px 12px 7px 0; border-bottom: 1px solid var(--border); }

/* Closing panel */
.race-cta-panel { margin-top: 64px; padding: 32px clamp(20px, 4vw, 40px); border-radius: 20px; background: var(--race-tint); border: 1px solid #ffd9c6; }
.race-cta-panel h2 { margin: 0 0 8px; }
.race-save { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 16px 0 6px; }
.race-save input[type="email"] { flex: 1 1 240px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; font: inherit; background: #fff; }
.race-save input[type="email"]:focus { outline: 2px solid var(--ember); border-color: var(--ember); }
.race-save button { padding: 14px 24px; border: 0; border-radius: 12px; background: var(--ember); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.race-save button:hover { filter: brightness(0.95); }
.race-save button:disabled { opacity: 0.6; cursor: default; }
.race-save-message { flex-basis: 100%; margin: 4px 0 0; font-weight: 600; color: #1e7b34; }
.race-save-message.is-error { color: #c0392b; }
.race-fineprint { font-size: 13px; color: var(--text-secondary); margin: 6px 0 22px; }
.race-panel-title { font-weight: 700; margin: 8px 0 10px; }

/* Route: experienced by default; the beginner route swaps the sections that differ. */
.only-beginner { display: none; }
.race-page[data-route="beginner"] .only-beginner { display: block; }
.race-page[data-route="beginner"] .only-experienced { display: none; }
