/* =============================================================================
   Cursafosca · entrenament.css: the Merrell test training sign-up
   Loaded only by /entrenament/. Key facts, the two shoes, and the reservation
   form (chips, size grid, underlined fields, the done state). Values come
   from tokens.css, never from here. Logic: js/entrenament.js.
   ========================================================================== */

/* One action on this page: reserving a pair. The race's Inscriu-te (header
   and mobile bar, shared partials) would compete with it, so it steps aside
   here; the tab bar then takes the full width. */
.header .header__cta,
.mbar__cta {
  display: none;
}

/* 1 ── Key facts: four answers before anything else ─────────────────────── */

.efacts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--s3) var(--gutter);
  padding-block-start: var(--s3);
  border-block-start: 1px solid var(--rule);
}
@media (min-width: 48rem) {
  .efacts {
    grid-template-columns: repeat(4, 1fr);
  }
}
.efacts dt {
  font-size: var(--fs-kicker);
  font-weight: var(--w-bold);
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  color: var(--text-dim);
}
.efacts dd {
  margin: 0.4rem 0 0;
  font-size: var(--fs-data);
  font-weight: var(--w-black);
  letter-spacing: var(--track-snug);
  font-variant-numeric: tabular-nums;
  line-height: 1.05;
}
.efacts small {
  display: block;
  margin-block-start: 0.35rem;
  font-size: var(--fs-small);
  font-weight: var(--w-regular);
  letter-spacing: 0;
  color: var(--text-dim);
}

/* The runner stands right of centre: keep her in frame on a tall phone crop
   and leave the left of the sky to the headline. */
.ehero .rhero__photo img {
  object-position: 78% 35%;
}

/* 2 ── The two shoes: a photograph, a name, one line, three figures ─────── */

.shoes {
  display: grid;
  gap: var(--s5) var(--gutter);
  margin-block-start: var(--s4);
}
@media (min-width: 48rem) {
  .shoes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.shoe__photo {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: clip;
  background: var(--ink-2);
}
.shoe__photo img {
  inline-size: 100%;
  block-size: 100%;
  object-fit: cover;
}
.shoe__name {
  margin-block-start: var(--s3);
  font-size: var(--fs-h3);
  font-weight: var(--w-black);
  letter-spacing: var(--track-snug);
  line-height: var(--lh-snug);
}
.shoe__line {
  margin-block-start: 0.4rem;
  color: var(--text-dim);
  max-inline-size: 36ch;
}
.shoe__specs {
  display: grid;
  grid-template-columns: repeat(3, auto);
  justify-content: start;
  gap: var(--gutter);
  margin-block-start: var(--s3);
  padding-block-start: var(--s2);
  border-block-start: 1px solid var(--rule);
}
.shoe__specs dt {
  font-size: var(--fs-caption);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--text-dim);
}
.shoe__specs dd {
  margin: 0.2rem 0 0;
  font-weight: var(--w-bold);
  font-variant-numeric: tabular-nums;
}
.shoes__note {
  margin-block-start: var(--s4);
  font-size: var(--fs-small);
  color: var(--text-dim);
}

/* 3 ── The form ─────────────────────────────────────────────────────────── */

.rform {
  max-inline-size: 46rem;
  margin-block-start: var(--s4);
}
.rform > * + * {
  margin-block-start: var(--s4);
}
.rform__group {
  border: 0;
  margin-inline: 0;
  padding: 0;
  min-inline-size: 0; /* a fieldset refuses to shrink below its content */
}
.rform__group legend,
.field > span {
  display: block;
  padding: 0;
  margin-block-end: var(--s2);
  font-size: var(--fs-kicker);
  font-weight: var(--w-bold);
  letter-spacing: var(--track-kicker);
  text-transform: uppercase;
  color: var(--text-dim);
}
/* "No, vinc a córrer": the shoe questions step out of the form entirely. */
.rform__group:disabled,
.check[hidden] {
  display: none;
}
.rform__hint {
  margin-block-start: var(--s2);
  font-size: var(--fs-small);
  color: var(--text-dim);
}
.rform__hint a,
.rform__msg a {
  color: inherit;
}

/* Chips: real radios, visually replaced by their labels. The route colour,
   when there is one, is a dot - never a fill. */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.chips input,
.sizes input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
}
.chips label {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.7rem 1.2rem;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  font-size: var(--fs-small);
  font-weight: var(--w-bold);
  letter-spacing: var(--track-caps);
  text-transform: uppercase;
  cursor: pointer;
  transition:
    color var(--t-micro) var(--ease),
    background-color var(--t-micro) var(--ease),
    border-color var(--t-micro) var(--ease);
}
.chips label[style]::before {
  content: "";
  inline-size: 0.5em;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--c);
}
.chips label:hover,
.sizes label:hover {
  border-color: currentColor;
}
.chips input:checked + label,
.sizes input:checked + label {
  background: var(--text);
  border-color: var(--text);
  color: var(--ink);
}
.chips input:focus-visible + label,
.sizes input:focus-visible + label {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
/* Sizes: one square per size, figures large and tabular. A sold-out size
   stays in its place, struck through, so the run of sizes keeps its shape. */
.sizes {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(4.25rem, 1fr));
  gap: 0.5rem;
}
.sizes:empty {
  display: none;
}
.sizes label {
  display: grid;
  place-items: center;
  align-content: center;
  aspect-ratio: 1;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-sm);
  font-size: var(--fs-h3);
  font-weight: var(--w-black);
  font-variant-numeric: tabular-nums;
  cursor: pointer;
  transition:
    color var(--t-micro) var(--ease),
    background-color var(--t-micro) var(--ease),
    border-color var(--t-micro) var(--ease);
}
.sizes small {
  font-size: var(--fs-micro);
  font-weight: var(--w-bold);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--accent);
}
.sizes input:checked + label small {
  color: inherit;
}
.sizes input:disabled + label {
  border-color: var(--rule);
  color: var(--text-dim);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  cursor: not-allowed;
  opacity: 0.5;
}

/* Fields: a label and an underline. No boxes. */
.rform__fields {
  display: grid;
  gap: var(--s3);
}
.field input {
  display: block;
  inline-size: 100%;
  padding: 0.35rem 0 0.6rem;
  border: 0;
  border-block-end: 1px solid var(--rule-strong);
  border-radius: 0;
  background: none;
  font-size: var(--fs-h3);
  font-weight: var(--w-bold);
  letter-spacing: var(--track-snug);
  transition: border-color var(--t-micro) var(--ease);
}
.field input:focus {
  outline: none;
  border-color: var(--accent);
}
.field input[aria-invalid="true"] {
  border-color: var(--dusk-3);
}
.field small {
  display: block;
  margin-block-start: 0.5rem;
  font-size: var(--fs-small);
  color: var(--text-dim);
}

.check {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: var(--s2);
  align-items: start;
  max-inline-size: 60ch;
  font-size: var(--fs-small);
  color: var(--text-dim);
  cursor: pointer;
}
.rform > .check + .check {
  margin-block-start: var(--s2);
}
.check input {
  inline-size: 1.25rem;
  block-size: 1.25rem;
  margin: 0.1rem 0 0;
  accent-color: var(--accent);
}
.check:has(input:checked) {
  color: var(--text);
}

.rform__msg {
  padding-inline-start: var(--s2);
  border-inline-start: 2px solid var(--dusk-3);
  color: var(--text);
}
.rform button[aria-busy="true"] {
  opacity: 0.6;
  pointer-events: none;
}

/* 4 ── Done: the handwritten line, the one place the pen speaks here ─────── */

.rdone {
  margin-block-start: var(--s4);
  outline: none;
}
.rdone__hand {
  font-family: var(--font-hand);
  font-size: var(--fs-num-l);
  line-height: 1;
  color: var(--text);
  text-shadow:
    0 0 0.35em color-mix(in srgb, var(--text) 35%, transparent),
    0 0 1.2em color-mix(in srgb, var(--accent) 45%, transparent);
}
.rdone .lead {
  margin-block-start: var(--s3);
  max-inline-size: 40ch;
}
.rdone .rform__hint {
  max-inline-size: 52ch;
}
html[data-theme="day"] .rdone__hand {
  text-shadow: none;
}
