/* Results 2026 (/resultats/). Reads tokens.css only. One job: find a runner fast, on a phone at the finish line.
   The race colour (Trail blue, Cursa yellow) marks the selected race, its podium and the bib; nothing else is coloured. */
.res { padding-block-end: var(--s6); }

/* Race tabs + search stay on screen while the list scrolls */
.res__bar {
  position: sticky; top: var(--header-h); z-index: 5;
  display: grid; gap: var(--s2);
  margin-block-start: var(--s4); padding-block: var(--s2);
  background: color-mix(in srgb, var(--ink) 90%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.res__tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--s1); }
.res__tab {
  display: grid; gap: 2px; justify-items: start; padding: 14px 16px; text-align: left;
  border: 1px solid var(--rule); border-radius: var(--r-md); background: transparent; color: var(--text-dim);
  transition: border-color var(--t-micro) var(--ease), color var(--t-micro) var(--ease), background var(--t-micro) var(--ease);
}
.res__tab span { display: flex; align-items: center; gap: 10px; font-size: var(--fs-h3); font-weight: var(--w-bold); line-height: 1.1; color: var(--text); }
.res__tab span::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--c); }
.res__tab[aria-selected="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, transparent); }
.res__tab:not([aria-selected="true"]) span { color: var(--text-dim); }
.res__tab:active { transform: scale(0.98); }

.res__tools { display: grid; grid-template-columns: 1fr auto; gap: var(--s1); }
.res__search { position: relative; display: block; min-width: 0; }
.res__search svg { position: absolute; left: 16px; top: 50%; width: 20px; height: 20px; transform: translateY(calc(-50% + 1px)); /* the lens sits 1px above the box centre; this puts it on the text's x-height */ fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.res__search input {
  width: 100%; height: 3.25rem; padding: 0 16px 0 46px;
  border: 1px solid var(--rule-strong); border-radius: var(--r-pill); background: transparent;
  color: var(--text); font: inherit; font-size: 1.05rem; -webkit-appearance: none; appearance: none;
}
.res__search input::placeholder { color: var(--text-dim); }
.res__search input:focus { outline: none; border-color: var(--accent); }
.res__sex { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-pill); border: 1px solid var(--rule); }
.res__sex button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: calc(3.25rem - 8px); min-width: 3rem; padding: 0 14px; border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-small); font-weight: var(--w-bold); }
.res__sex button[aria-pressed="true"] { color: var(--ink); }

/* The list: position, name, time, bib. A row opens (native <details>) to show the split times. */
.res__head, .res__row { display: grid; grid-template-columns: 4.5rem 1fr auto auto; align-items: center; column-gap: var(--s2); }
.res__head span:nth-last-child(-n+2) { text-align: right; }
.res__head { margin-block-start: var(--s3); padding-block: 0 8px; color: var(--text-dim); font-size: var(--fs-small); border-block-end: 1px solid var(--rule-strong); }
.res__list { list-style: none; margin: 0; padding: 0; min-height: 80dvh; } /* a short result list still lets the bar stay stuck */
.res__row { min-height: 3.5rem; padding-block: 10px; border-block-end: 1px solid var(--rule); }
.res__pos { font-size: 1.5rem; font-weight: var(--w-black); font-variant-numeric: tabular-nums; line-height: 1; }
.res__nm { min-width: 0; font-size: 1.08rem; font-weight: var(--w-bold); line-height: 1.25; overflow-wrap: anywhere; }
.res__bib { min-width: 3.4rem; padding: 6px 10px; border: 1.5px solid var(--c); border-radius: 8px; text-align: center; font-weight: var(--w-bold); font-variant-numeric: tabular-nums; color: var(--text); }
.res__nm mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; }
/* Podium: the first three of the selected race stand out */
.res__row--podium .res__pos { color: var(--c); font-size: 2.25rem; }
.res__row--podium .res__nm { font-size: 1.3rem; }
.res__row--podium .res__row { min-height: 4.5rem; }
.res__empty { padding-block: var(--s4); color: var(--text-dim); text-align: center; }
.res__note { margin-block-start: var(--s3); }

@media (max-width: 40rem) {
  .res__tools { grid-template-columns: 1fr; }
  .res__sex { width: auto; }
  .res__head, .res__row { grid-template-columns: 2.5rem 1fr auto auto; column-gap: 10px; }
  .res__bib { min-width: 2.9rem; padding: 5px 7px; }
  .res__tm { font-size: 0.95rem; }
  .res__tab { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) { .res__tab { transition: none; } }
/* On wide screens the list keeps a readable width: position, name and bib stay close together */
.res__bar, .res__head, .res__list, .res__empty, .res__note { max-width: 52rem; }

/* ♂ / ♀ before Homes / Dones: drawn with the same stroke as the bold label beside it */
.res__sex svg { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* Category chips (bleed to the .wrap padding): overall, age categories, locals. One row that scrolls sideways on a phone. */
.res__cats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; margin-inline: calc(max(6vw, 1.25rem) * -1); padding-inline: max(6vw, 1.25rem); scroll-padding-inline: max(6vw, 1.25rem); }
.res__cats::-webkit-scrollbar { display: none; }
.res__cats button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--rule); border-radius: var(--r-pill); background: transparent; color: var(--text-dim); font: inherit; font-size: var(--fs-small); font-weight: var(--w-bold); white-space: nowrap; transition: background var(--t-micro) var(--ease), color var(--t-micro) var(--ease), border-color var(--t-micro) var(--ease); }
.res__cats button[hidden] { display: none; }
.res__cats button[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--ink); }
.res__cats button:active, .res__sex button:active { transform: scale(0.97); }
@media (prefers-reduced-motion: reduce) { .res__cats button { transition: none; } }
/* Category and Local tag under the name */
.res__nm small { display: flex; flex-wrap: wrap; align-items: center; column-gap: 6px; margin-block-start: 3px; line-height: 1.35; color: var(--text-dim); font-size: var(--fs-small); font-weight: var(--w-regular); }
.res__nm small:empty { display: none; }

/* Finish time, split panel, and the retired / non-starter groups */
.res__tm { font-weight: var(--w-bold); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.res__list summary { cursor: pointer; list-style: none; }
.res__list summary::-webkit-details-marker { display: none; }
.res__list summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 4px; }
.res__list details[open] > summary { border-block-end-color: transparent; }
.res__splits { display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); padding: 2px 0 14px; padding-inline-start: calc(4.5rem + var(--s2)); border-block-end: 1px solid var(--rule); font-variant-numeric: tabular-nums; font-weight: var(--w-bold); }
.res__splits small { display: block; color: var(--text-dim); font-size: var(--fs-small); font-weight: var(--w-regular); }
.res__list details[open] .res__splits { animation: res-open 200ms var(--ease) both; }
@keyframes res-open { from { opacity: 0; transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .res__list details[open] .res__splits { animation: none; } }
.res__sep { padding: var(--s4) 0 8px; color: var(--text-dim); font-size: var(--fs-small); font-weight: var(--w-bold); border-block-end: 1px solid var(--rule-strong); }
.res__out .res__pos, .res__out .res__tm { color: var(--text-dim); font-size: var(--fs-small); font-weight: var(--w-bold); }
@media (max-width: 40rem) { .res__splits { padding-inline-start: calc(2.5rem + 10px); } }

/* Prize tags and the "prizes don't stack" note (category and local views only) */
.res__nm small i { font-style: normal; }
.res__win { display: inline-flex; align-items: center; gap: 5px; font-weight: var(--w-bold); color: var(--text); white-space: nowrap; }
.res__medal { flex: none; width: 1.2em; height: 1.2em; margin-block: -0.1em; fill: var(--accent); } /* category and local prizes: the brand lilac, apart from gold, silver and bronze */
.res__medal--1 { fill: var(--gold); }
.res__medal--2 { fill: var(--silver); }
.res__medal--3 { fill: var(--bronze); }
.res__prize { display: flex; align-items: center; gap: 6px; margin-block-start: var(--s2); font-size: var(--fs-small); color: var(--text-dim); max-width: 52rem; }
.res__prize[hidden] { display: none; }
.res__info { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--text-dim); font: inherit; font-size: var(--fs-small); text-decoration: underline dotted; text-underline-offset: 0.2em; cursor: pointer; }
.res__info svg { width: 1.15em; height: 1.15em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.res__info:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
#res-info { position: fixed; inset: auto; margin: 0; max-width: min(22rem, calc(100vw - 24px)); padding: 12px 14px; border: 1px solid var(--rule-strong); border-radius: var(--r-md); background: var(--ink); color: var(--text); font-size: var(--fs-small); line-height: 1.45; box-shadow: 0 12px 32px color-mix(in srgb, var(--ink) 60%, transparent); }
#res-info:popover-open { animation: res-pop 160ms var(--ease) both; }
@keyframes res-pop { from { opacity: 0; transform: translateY(-4px) scale(0.97); } }
@media (prefers-reduced-motion: reduce) { #res-info:popover-open { animation: none; } }

/* Three-way switch (Tots / Homes / Dones): the selected one shows icon and word, the others only the icon */
.res__sex svg { flex: none; display: block; }
@media (max-width: 40rem) {
  .res__tab span { font-size: 1.05rem; gap: 8px; }
  .res__tab { padding: 12px 12px; }
}

/* Motion. One curve for everything the user taps (strong ease-out, under 250 ms); every change is a transition, so a
   fast second tap retargets it mid-way instead of restarting. Reduced motion keeps only the colour changes. */
:root { --ease-snap: cubic-bezier(0.23, 1, 0.32, 1); }
.res__sex { position: relative; isolation: isolate; }
.res__sex button { position: relative; z-index: 1; transition: color 200ms var(--ease-snap), transform 120ms var(--ease-snap); }
/* Fixed geometry: the box never changes width (the search beside it stays still); the unselected options are icon
   squares and the selected one takes the rest with its word. The layout switches at once and the motion is played
   with transforms only (see resultats.js), so nothing re-lays out while it moves. */
.res__sex { width: 15rem; }
.res__sex button { flex: 0 0 2.75rem; min-width: 0; padding: 0; }
.res__sex button[aria-pressed="true"] { flex: 1 1 auto; padding: 0 14px; }
.res__sex button span { text-box: trim-both cap alphabetic; line-height: 1; white-space: nowrap; }
.res__sex button[aria-pressed="false"] span { display: none; }
.res__thumb { transition: transform 260ms var(--ease-snap), width 260ms var(--ease-snap); position: absolute; z-index: 0; top: 3px; left: 0; height: calc(100% - 6px); border-radius: var(--r-pill); background: var(--text); pointer-events: none; }
.res__tab { transition: border-color 200ms var(--ease-snap), color 200ms var(--ease-snap), background 200ms var(--ease-snap), transform 120ms var(--ease-snap); }
.res__tab:active, .res__cats button:active, .res__sex button:active { transform: scale(0.97); }
.res__cats button { transition: background 200ms var(--ease-snap), color 200ms var(--ease-snap), border-color 200ms var(--ease-snap), transform 120ms var(--ease-snap); }
.res__list.is-new { animation: res-list 220ms var(--ease-snap); }
@keyframes res-list { from { opacity: 0; transform: translateY(6px); } }
.res__list details[open] .res__splits { animation-timing-function: var(--ease-snap); }
@media (prefers-reduced-motion: reduce) {
  .res__list.is-new { animation: res-fade 160ms ease; }
  .res__tab:active, .res__cats button:active, .res__sex button:active { transform: none; }
}
@keyframes res-fade { from { opacity: 0; } }
.res__thumb--still { transition: none; }
@media (prefers-reduced-motion: reduce) { .res__thumb { transition: none; } }

/* The title's two words share a line when they fit (each stays a masked rise line, side by side) */
.res .t-h1 .rise__l { display: inline-block; vertical-align: top; }
