/*
 * "WHAT 10 DRIVERS' LAPS SHOW" (src/pages/tracks/track-laps.ts; owner-approved design 2 Nov 2026,
 * ps-overnight/alltrails-build-2026-11-02/A-track-data). Loaded after tracks.css, only on pages that carry the section.
 * Its own file so the circuit pages' stylesheet is untouched. No script: a corner row is a <details>, and the map's disc for
 * the open row is lit with :has(). Light only, like the rest of the circuit pages.
 */
.laps { --loss: oklch(0.55 0.2 25); padding: clamp(36px, 6vw, 64px) 0 clamp(24px, 4vw, 48px); }
.laps-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.laps h2 { margin: 0; font-size: clamp(32px, 3.4vw, 44px); line-height: 1; }
.laps .stamp { color: var(--muted); font-size: 14px; }
.laps-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 20px 40px; margin-top: 28px; align-items: start; }
.laps-grid > .spread, .laps-grid > .after { grid-column: 1 / -1; }
.laps h3 { margin: 0; font-family: var(--head); font-weight: 600; font-size: 22px; line-height: 1.1; }

/* Best laps: the middle half as a band, the median as a tick. Never the fastest or slowest lap. */
.laps .spread { padding-top: 20px; border-top: 1px solid var(--rule); }
.laps .spread-row { display: grid; grid-template-columns: 116px minmax(0, 1fr); align-items: center; gap: 16px; margin-top: 16px; }
.laps .spread-who { margin: 0; font-size: 15px; font-weight: 600; line-height: 1.25; }
.laps .spread-who small { display: block; color: var(--muted); font-weight: 400; font-size: 13px; }
.laps .axis { display: block; max-width: 640px; overflow: visible; }
.laps .axis-line { stroke: var(--rule); stroke-width: 2; }
.laps .axis-band { fill: var(--tint); stroke: var(--accent); stroke-width: 1.5; }
.laps .axis-med { fill: var(--accent); }
.laps .axis-lab { fill: var(--muted); font: 400 13px var(--body); font-variant-numeric: tabular-nums; }
.laps .axis-lab.med { fill: var(--ink); font-weight: 700; }
.laps .spread-note { margin: 8px 0 0 132px; color: var(--muted); font-size: 14px; }

/* Where time goes: the map with the five corners, and the ranked list beside it. */
.laps .c-map { margin: 0; padding: 8px; border: 1px solid var(--rule); border-radius: 8px; background: var(--surface); }
.laps .c-map svg { display: block; width: 100%; height: auto; }
.laps .trk-case { fill: none; stroke: #2b2833; stroke-width: 15; stroke-linejoin: round; }
.laps .trk { fill: none; stroke: var(--lavender); stroke-width: 9; stroke-linejoin: round; }
.laps .hot circle { fill: var(--tint); stroke: var(--surface); stroke-width: 3; transform-box: fill-box; transform-origin: center; }
.laps .hot text { font-family: var(--body); font-weight: 700; fill: var(--tint-ink); text-anchor: middle; dominant-baseline: central; }
.laps .corners { min-width: 0; }
.laps .corners .sub { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.laps .c-list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--rule); }
.laps .c-row { border-bottom: 1px solid var(--rule); }
.laps .c-btn { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 12px; min-height: 56px; padding: 8px 4px; border-radius: 6px; list-style: none; }
.laps summary.c-btn { cursor: pointer; }
.laps summary.c-btn::-webkit-details-marker { display: none; }
@media (hover: hover) { .laps summary.c-btn:hover { background: color-mix(in srgb, var(--ink) 4%, transparent); } }
.laps summary.c-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.laps .c-tag { display: grid; place-items: center; height: 30px; border-radius: 15px; background: var(--tint); color: var(--tint-ink); font-weight: 700; font-size: 14px; }
.laps details[open] .c-tag { background: var(--accent); color: #fff; }
.laps .c-bar { display: block; overflow: visible; }
.laps .c-bar rect { fill: var(--loss); opacity: .85; }
.laps .c-val { text-align: right; font-size: 15px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
.laps .c-val small { display: block; font-weight: 400; font-size: 12px; color: var(--muted); }
.laps .c-row p { margin: 0; padding: 0 4px 14px 60px; font-size: 15px; }
/* The open row's corner lit on the map. */
.laps:has(.c-row[data-rank="1"] details[open]) .hot[data-rank="1"] circle,
.laps:has(.c-row[data-rank="2"] details[open]) .hot[data-rank="2"] circle,
.laps:has(.c-row[data-rank="3"] details[open]) .hot[data-rank="3"] circle,
.laps:has(.c-row[data-rank="4"] details[open]) .hot[data-rank="4"] circle,
.laps:has(.c-row[data-rank="5"] details[open]) .hot[data-rank="5"] circle { fill: var(--accent); transform: scale(1.2); }
.laps:has(.c-row[data-rank="1"] details[open]) .hot[data-rank="1"] text,
.laps:has(.c-row[data-rank="2"] details[open]) .hot[data-rank="2"] text,
.laps:has(.c-row[data-rank="3"] details[open]) .hot[data-rank="3"] text,
.laps:has(.c-row[data-rank="4"] details[open]) .hot[data-rank="4"] text,
.laps:has(.c-row[data-rank="5"] details[open]) .hot[data-rank="5"] text { fill: #fff; }

/* After a debrief. */
.laps .after { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; padding-top: 20px; border-top: 1px solid var(--rule); }
.laps .win { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 6px 14px 6px 6px; border-radius: 20px; background: color-mix(in srgb, oklch(0.62 0.17 155) 14%, var(--surface)); }
.laps .win .c-tag { min-width: 40px; padding: 0 10px; height: 28px; }
.laps .win b { color: oklch(0.45 0.15 155); font-variant-numeric: tabular-nums; }

.laps .foot-link { margin: 20px 0 0; font-size: 15px; }
.laps .foot-link a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.laps .how { margin: 6px 0 0; max-width: 70ch; color: var(--muted); font-size: 13px; }

@media (max-width: 900px) {
  .laps-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .laps .spread-row { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .laps .spread-note { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) { .laps * { transition: none !important; } }
