/* ==========================================================================
   Finca Escondida — design system: reusable component families

   Single source of truth, shared by the marketing site (sites/marketing,
   which receives a copy in vendor/ via scripts/sync-design.mjs) and the club
   application (apps/book). Do not edit the vendored copy.
   ========================================================================== */

/* --- Shared primitives ---------------------------------------------------- */

.wrap { max-width: var(--maxw); margin: 0 auto; }

/* Section kicker — v2 uses a heavier, wider-tracked label than v1 */
.kicker {
  margin: 0 0 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--olive);
}
.kicker--gold  { color: var(--gold); }
.kicker--rose  { color: var(--rose-kicker); }
.kicker--bold  { font-weight: 700; }

.display {
  margin: 0;
  text-wrap: balance;
  font-family: var(--serif);
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.02em;
}
/* A page's H1 that carries its kicker, so the heading names the page
   ("Membership Play by the day…"): the spans keep their own looks and the
   H1 itself adds nothing. */
.heading { margin: 0; font: inherit; letter-spacing: inherit; color: inherit; }
.heading > span { display: block; }

.display--xl { font-size: clamp(38px, 5.4vw, 78px); }
.display--lg { font-size: clamp(38px, 5vw, 72px); }
.display--md { font-size: clamp(36px, 4.6vw, 66px); line-height: 1.02; margin-bottom: 32px; }
.display--sm { font-size: clamp(30px, 3.8vw, 50px); line-height: 1.05; }

.display--light  { color: var(--paper-warm); margin-bottom: 24px; }
.display--gap-xs { margin-bottom: 16px; }
.display--gap-sm { margin-bottom: 12px; }
.display--gap-md { margin-bottom: 32px; }
.display--gap-lg { margin-bottom: 44px; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: baseline;
  justify-content: space-between;
}
.section-head--ruled {
  gap: 40px;
  align-items: flex-end;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule-ink-20);
}
.section-head__aside {
  margin: 0 0 8px auto;
  font-size: 16px;
  line-height: 1.6;
  color: var(--moss);
  max-width: 34ch;
}

.link-terracotta { color: var(--terracotta-text); }

.underline-link {
  align-self: flex-start;
  display: inline-block;
  margin-top: 4px;
  padding-top: 16px;             /* the hit area grows upward; the underline stays put */
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;                /* forest on paper, paper on forest — the ground decides */
  border-bottom: 1.5px solid var(--terracotta);
  padding-bottom: 3px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;              /* Fitts: every button is a comfortable thumb target */
  box-sizing: border-box;
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 32px;
  border-radius: 2px;
  text-align: center;            /* a label that wraps stays centred */
  text-wrap: balance;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.btn--paper       { background: var(--paper); color: var(--forest); }
.btn--paper:hover { background: var(--gold);  color: var(--forest); }

.btn--ghost-light       { border: 1px solid var(--rule-paper-50); color: var(--paper); }
.btn--ghost-light:hover { border-color: var(--gold); color: var(--gold); }

.btn--gold {
  background: var(--gold);
  color: var(--forest);
  font-size: 12px;
  letter-spacing: 0.2em;
  padding: 16px 32px;
}
.btn--gold:hover { background: var(--paper); color: var(--forest); }
.btn--dining { margin-top: 32px; }

/* Step rail */
.steps {
  list-style: none;
  margin: 0 0 32px;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0;
}
.step {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.step + .step::before {
  content: "";
  width: clamp(24px, 6vw, 84px);
  height: 1px;
  background: var(--rule-ink-22);
  margin: 0 16px;
}
.step__num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--moss-mute);
  border: 1px solid var(--rule-ink-22);
  background: transparent;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.step__label {
  font-size: 14px;
  color: var(--moss-mute);
  white-space: nowrap;           /* a label that wraps breaks the rail */
  transition: color 0.2s ease;
}
.step.is-active .step__num,
.step.is-done .step__num {
  background: var(--forest);
  border-color: var(--forest);
  color: var(--paper);
}
.step.is-active .step__label { color: var(--forest); }
.step.is-done .step__label { color: var(--moss); }

/* Stages */
.stage { display: block; }
/* .stage sets display, which outranks the UA's [hidden]{display:none}. */
.stage[hidden] { display: none; }

.stage__title {
  margin: 0 0 24px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 27px;
  line-height: 1.2;
}
.stage__sub {
  margin: -12px 0 24px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--terracotta-text);
}
.stage__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 28px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.control__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss-mute);
  margin-bottom: 8px;
}
.chip-row { display: flex; gap: 8px; }

.chip {
  cursor: pointer;
  border-radius: 2px;
  min-height: 44px;
  box-sizing: border-box;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 12px 24px;
  background: transparent;
  color: var(--forest);
  border: 1px solid var(--rule-ink-55);
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip--sm { letter-spacing: 0.14em; padding: 12px 16px; }
.chip:hover { border-color: var(--forest); }
.chip.is-active {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}

/* White card holding the month calendar */
.card {
  background: #FFFFFF;
  border: 1px solid var(--rule-ink-12);
  border-radius: 4px;
  padding: 24px 28px 24px;
}
.card__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}
.card__month {
  font-family: var(--serif);
  font-size: 22px;
  line-height: 1.1;
  text-align: center;
  flex: 1;
}
.card__arrow {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--moss);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 3px;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.card__arrow:hover { background: var(--rule-ink-08); color: var(--forest); }
.card__arrow[disabled] {
  color: var(--rule-ink-28);
  cursor: not-allowed;
  background: transparent;
}
.card__note {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--moss-mute);
}
/* Text button that carries on into next month. On a phone it replaces the
   bare › arrow, which says nothing about where it leads; app.js adds
   is-spilling to the card when the grid has run into next month. */
.card__more {
  display: none;
  align-items: center;
  margin: 12px auto 0;
  min-height: 44px;
  padding: 0 2px;
  background: none;
  border: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--forest);
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 5px;
  cursor: pointer;
}
.card__more:hover { text-decoration-color: var(--forest); }
@media (max-width: 640px) {
  .card__more { display: flex; width: max-content; }
  .card.is-spilling .card__arrow[data-next-month] { visibility: hidden; }
}

/* Month grid — borderless cells, serif numerals */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 2px;
}
.calendar__dow {
  text-align: center;
  font-size: 11px;
  color: var(--moss-mute);
  padding-bottom: 12px;
}
/* Month name where the grid runs on into next month */
.calendar__divider {
  grid-column: 1 / -1;
  padding: 12px 0 4px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.day {
  position: relative;
  aspect-ratio: 1 / 1;
  min-height: 44px;              /* a date is the first thing a thumb has to hit */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: none;
  background: transparent;
  color: var(--forest);
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.day__num {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1;
}
.day:hover { background: var(--rule-ink-08); }
.day--blank { cursor: default; }
.day--blank:hover { background: transparent; }
.day--past {
  color: var(--rule-ink-28);
  cursor: not-allowed;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
.day--past:hover { background: transparent; }
/* Beyond the booking window: unavailable like a past day, but not struck
   through — it is still to come; the aria-label says when it opens. */
.day--closed {
  color: var(--rule-ink-28);
  cursor: not-allowed;
}
.day--closed:hover { background: transparent; }
.day--sel,
.day--sel:hover {
  background: var(--forest);
  color: var(--paper);
}
.day__dots { display: flex; gap: 2px; justify-content: center; }
.day__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  display: block;
}
.day--sel .day__dot { background: var(--gold) !important; }

.loadkey {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.loadkey__item { display: flex; align-items: center; gap: 8px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: block; }
.dot--open { background: var(--dot-open); }
.dot--mid  { background: var(--dot-mid); }
.dot--low  { background: var(--dot-low); }

/* Muted status panel between the picker and the CTA */
.statusbar {
  margin: 24px 0 0;
  padding: 24px 24px;
  background: var(--rule-ink-08);
  border-radius: 4px;
  text-align: center;
  font-size: 14.5px;
  color: var(--moss);
}
.statusbar.is-set {
  color: var(--forest);
  font-family: var(--serif);
  font-size: 19px;
}

/* Stage buttons — same metrics as .btn--gold so every primary action on the
   site is the same size: 12px/0.2em, 16px 32px, 2px radius, 44px tall. */
.stage__cta {
  margin-top: 16px;
  width: 100%;
  border: none;
  border-radius: 2px;
  padding: 16px 32px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--forest);
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.18s ease;
}
.stage__cta:hover { background: #163B26; }
.stage__cta[disabled] {
  background: var(--rule-ink-22);
  color: #FFFFFF;
  cursor: not-allowed;
}
.stage__actions {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: stretch;
}
.stage__actions .stage__cta { margin-top: 0; flex: 1; }
.stage__back {
  border: 1px solid var(--rule-ink-28);
  background: transparent;
  color: var(--forest);
  border-radius: 2px;
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}
.stage__back:hover { border-color: var(--forest); background: var(--rule-ink-08); }

/* Availability grid */
.grid-scroll { overflow-x: auto; }
.grid-min { min-width: 560px; }

.grid-head {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--rule-ink-28);
}
.grid-head__time {
  flex: 0 0 70px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.grid-head__court {
  flex: 1;
  min-width: 0;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
}

.grid-row {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--rule-ink-12);
}
.grid-row--peak { background: rgba(180, 98, 47, 0.05); }
.grid-row__time {
  flex: 0 0 70px;
  font-family: var(--serif);
  font-size: 20px;
  line-height: 1;
  color: var(--forest);
}
.grid-row--peak .grid-row__time { color: var(--terracotta-text); }

/* Time-of-day bands. The group label is for the eye only (aria-hidden), so
   it needs no border of its own; the gap row marks the club's midday break. */
.grid-row--group {
  min-height: 24px;
  padding: 0;
  border-bottom: 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.grid-row--gap { border-top: 2px solid var(--rule-ink-20); }

.slot {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 12px 4px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: 3px;
  background: #FFFFFF;
  color: var(--moss);
  border: 1px solid var(--rule-ink-55);
  cursor: pointer;
  transition: background-color 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.slot:hover { border-color: var(--forest); color: var(--forest); }
/* Booked, and hours already gone today: "Booked" / "Past" at 6.2:1. */
.slot--taken,
.slot--past {
  background: var(--rule-ink-08);
  color: var(--moss);
  border-color: transparent;
  cursor: not-allowed;
}
.slot--taken:hover, .slot--past:hover { border-color: transparent; color: var(--moss); }
/* Cannot start a 90-minute booking here (it would run into the midday gap or
   past the 9pm close). Not booked, so it must not read as booked. */
.slot--na,
.slot--na:hover {
  background: var(--paper-warm);
  color: var(--moss-mute);
  border: 1px dashed var(--rule-ink-28);
  cursor: not-allowed;
}
.slot--chosen,
.slot--chosen:hover {
  background: var(--forest);
  color: var(--paper);
  border-color: var(--forest);
}

/* "Any court" mode — app.js renders it for a sport with more than two courts:
   one column of "<n> of <total> open" buttons headed "Any court", and a text
   button under the sub-heading that swaps in the full per-court grid. One
   column needs no minimum width and no cap (the phone-width cap in
   styles.css steps aside too), so it fills the box at every width; the count
   reads as a sentence, so it drops the tracked uppercase of a court cell. */
.grid-min.is-any { min-width: 0; }
.slot--any,
.grid-min.is-any .grid-head__court { max-width: none; }
.slot--any {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: none;
}
.grid-toggle {
  display: block;                /* its own line, flush left under the sub-heading */
  margin: 0 0 12px;
  min-height: 44px;              /* a text link, but still a thumb target */
  padding: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: 14px;
  text-align: left;
  color: var(--terracotta-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}
.grid-toggle:hover { color: var(--forest); }

.legend {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: center;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.legend__item { display: flex; align-items: center; gap: 8px; }
.legend__swatch { width: 20px; height: 11px; display: block; border-radius: 2px; }
.legend__swatch--open   { border: 1px solid var(--rule-ink-55); background: #FFFFFF; }
.legend__swatch--booked { background: var(--rule-ink-08); }
.legend__swatch--mine   { background: var(--forest); }
.legend__swatch--na     { border: 1px dashed var(--rule-ink-28); background: var(--paper-warm); }
.legend__note { margin-left: auto; color: var(--terracotta-text); }

/* Recap on the details step */
.recap {
  margin: 0 0 24px;
  border-top: 1px solid var(--rule-ink-16);
}
.recap__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule-ink-16);
}
.recap dt { font-size: 14px; color: var(--moss); }
.recap dd {
  margin: 0;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--forest);
  text-align: right;
}

.bookform {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  gap: 20px;
}
.bfield { display: flex; flex-direction: column; gap: 8px; }
.bfield--full { grid-column: 1 / -1; }
.bfield__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--moss-mute);
}
.bfield__input {
  background: #FFFFFF;
  border: 1px solid var(--rule-ink-55);
  border-radius: 3px;
  color: var(--forest);
  padding: 16px 16px;
  font-size: 15px;
  resize: vertical;
  transition: border-color 0.18s ease;
}
/* Keyboard focus keeps the base :focus-visible ring; the border only follows. */
.bfield__input:focus { border-color: var(--terracotta); }
.bfield__input::placeholder { color: var(--moss-mute); }
.bookform .stage__actions { grid-column: 1 / -1; }

.booked {
  padding: 32px 28px;
  background: var(--forest);
  color: var(--paper);
  border-radius: 4px;
  text-align: center;
}
.booked[hidden] { display: none; }
.booked__title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 26px;
  color: var(--paper-warm);
}
.booked__body { margin: 0; font-size: 15px; line-height: 1.6; color: var(--cream-warm); }
/* The club address in the panel is a link or selectable text on forest: gold,
   the site's link colour on dark grounds (8.9:1). */
.booked a { color: var(--gold); }
.booked :focus-visible { outline-color: var(--gold); }


/* --- Touch and small screens (shared) --------------------------------------
   Phones zoom into any control under 16px on focus, and thumbs need ~44px.
   Uppercase tracked labels that read fine at 11px on a desk are set a notch
   larger on phones. */
.tab-chip, .stage__cta, .stage__back, .card__arrow, .package__cta, .enquiry__submit, .signup__submit {
  min-height: 44px;
  box-sizing: border-box;
}
.card__arrow { min-width: 44px; }
@media (max-width: 640px) {
  .kicker, .control__label, .calendar__dow, .grid-head__court, .grid-head__time,
  .underline-link, .chip, .step__label, .legend__item, .slot, .calendar__divider { font-size: 12px; }
  .card { padding: 16px 8px 16px; }   /* seven 44px days fit a 375px phone */
  .calendar { gap: 1px; }
}
@media (max-width: 480px) {
  input, select, textarea, .bfield__input { font-size: 16px; }
}

/* The booking form hides after submit; display:grid must not outrank [hidden]. */
.bookform[hidden] { display: none; }

/* The court grid is as wide as it has courts: two fit a phone, eight swipe. */
.grid-min { min-width: calc(76px + var(--courts, 2) * 92px); }
.slot, .grid-head__court { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Section head: the aside only sits beside the heading on a wide screen. */
@media (max-width: 1439px) {
  .section-head--ruled { flex-direction: column; align-items: flex-start; gap: 12px; }
  .section-head__aside { margin-left: 0; max-width: 58ch; }
}

/* Completion state of the booking board: a next action, not a dead end.
   Both actions are links in a sentence on forest, so they take gold. */
.booked__next { margin: 16px 0 0; font-size: 14.5px; line-height: 1.6; }
.booked__again,
.booked__edit {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  min-height: 44px;
}
.booked__again:hover, .booked__edit:hover { color: var(--paper); }

/* --- Integration pass (34-rule review) ------------------------------------ */

/* Buttons share one vertical metric: min-height, no bespoke padding-y. */
.btn, .btn--gold, .stage__cta, .signup__submit, .enquiry__submit { min-height: 48px; padding-top: 0; padding-bottom: 0; padding-left: var(--space-8); padding-right: var(--space-8); }

/* Field errors: text next to the field, not only a red border (rule 22). */
.field__error, .bfield__error {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--terracotta-text);
}
.section--forest .field__error, .visit .field__error { color: var(--gold); }
[aria-invalid="true"] { border-color: var(--terracotta-text); }

/* The selected day keeps its dot count on a paper dot, so the load cue
   survives selection (rule 22). */
.day--sel .day__dot { background: var(--paper) !important; }

/* Headings balance; body copy sits at 1.6. */
.panel__body { line-height: 1.6; }
@media (max-width: 640px) { .bfield__label { font-size: 12px; } }
