/* SHARED COMPONENTS — rendered by more than one surface, so loaded on all of them.
 *
 * ── WHY THIS FILE EXISTS ───────────────────────────────────────────────────────────────────
 *
 * These rules lived in landing.css, which is named for a PAGE and contained three COMPONENTS.
 * Measured at the split: 8 018 of landing.css's 20 703 bytes — 40% — were component CSS, and
 * the consequence showed up the day the event page called tb_render_route(): the schematic and
 * its accessible list arrived unstyled, because the function is portable and its styles were
 * not. The first fix was to enqueue landing.css on event pages too, which is the coupling made
 * invisible rather than removed — a page stylesheet loaded on a surface that is not that page.
 *
 * So the question was never "which pages need landing.css". It was "why is component CSS living
 * in a page file". This file is the answer, and it is in tb_css_bundle_sources(), which is the
 * theme's existing mechanism for exactly this. Cost, measured: the bundle grows 129 621 →
 * ~138 000 bytes, +6.6% before gzip, on a file that is already concatenated and mtime-keyed.
 *
 * ── WHY NOT A SELF-ENQUEUING PARTIAL ───────────────────────────────────────────────────────
 *
 * The obvious alternative is for each partial to wp_enqueue_style() itself. Rejected for a
 * reason that is easy to miss: THE ROUTE IS RENDERED BY A FUNCTION, not only a partial. A
 * shortcode calling tb_render_route() inside the_content enqueues AFTER wp_head, so the CSS
 * lands in the footer and the map paints unstyled first — a visible flash on a component this
 * size. It would also add a second mechanism beside the bundle, which is the same invisible
 * coupling relocated.
 *
 * ── THE COLOUR CONTRACT: --tb-accent, FALLING BACK TO --red ────────────────────────────────
 *
 * ⚠️ Every colour here resolves through var(--tb-accent, var(--red)). A surface that sets
 * --tb-accent gets the event's identity; a surface that sets nothing gets the site brand,
 * automatically. That is what makes these components droppable anywhere: a third surface has to
 * know neither which stylesheet to load nor which token the component secretly reads.
 *
 * It replaces a real bug. `.tb-ep-ticket__buy` read var(--red) — the SITE primary — while the
 * event accent was defined as --lp-accent, so the accent could never reach the button however
 * correctly it was scoped. Two names for one concept, with the consumer reading the one that is
 * not the truth. See the trap catalogue: it is the same fault as _ticket_price vs
 * _event_price_min and _ticket_capacity vs _event_capacity, one layer further out.
 */

/* Surface-neutral defaults. A page that sets none of these still gets a coherent component:
   these are what "no opinion" looks like, not what the landing page looks like. */
:root {
  --tb-accent-ink:  #1A1818;
  --tb-comp-bg:     transparent;
  --tb-comp-bg-2:   rgba(0,0,0,.03);
  --tb-comp-text:   var(--tb-text, #1A1818);
  --tb-comp-dim:    var(--tb-text-muted, #6E6A65);
  --tb-comp-line:   rgba(26,24,24,.12);
}

/* ── Map ── */
.tb-map__shell {
  background: var(--tb-comp-bg-2); border: 1px solid var(--tb-comp-line);
  padding: 34px 30px 26px;
}
.tb-route__leg-label {
  font-size: 13px; text-transform: uppercase; letter-spacing: .19em;
  color: var(--tb-comp-dim); margin: 0 0 14px; font-weight: 600;
}
.tb-route__svg { display: none; width: 100%; height: auto; }
.tb-route__svg-end {
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: 23px; letter-spacing: 1.5px; fill: #F4F1EC;
}
.tb-route__svg-stop { font-family: var(--tb-font); font-size: 13px; fill: #9A958F; }
.tb-route__svg-time { font-family: var(--tb-font); font-size: 12px; fill: #7E7A75; }
.tb-route__svg-flag { font-family: var(--tb-font); font-size: 12.5px; font-weight: 700; letter-spacing: 2.2px; }
.tb-route__svg-sea  {
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: 15px; letter-spacing: 2px; fill: #4A6B78;
}

.tb-map__legend {
  display: flex; flex-wrap: wrap; gap: 26px; margin-top: 24px; padding-top: 22px;
  border-top: 1px solid var(--tb-comp-line); font-size: 14px; color: var(--tb-comp-dim);
}
.tb-map__lg { display: flex; align-items: center; gap: 9px; }
.tb-map__lg b { color: var(--tb-comp-text); font-weight: 600; }
.tb-map__lg-dot { width: 11px; height: 11px; border-radius: 50%; flex: 0 0 auto; }
.tb-map__lg--note { margin-left: auto; }

/* The <ol> is the accessible truth and the only thing that survives at 320px; the map is
   aria-hidden decoration from 720px up. Both come from one array — see inc/route-map.php. */
.tb-route__list { list-style: none; margin: 0; padding: 0; border-left: 4px solid var(--tb-accent, var(--red)); }
.tb-route__item { position: relative; padding: 10px 0 10px 24px; }
.tb-route__item::before {
  content: ""; position: absolute; left: -11px; top: 18px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--tb-comp-bg-2); border: 4px solid var(--tb-accent, var(--red));
}
.tb-route__item.is-start::before,
.tb-route__item.is-finish::before {
  background: var(--tb-accent, var(--red)); width: 18px; height: 18px; left: -13px;
}
.tb-route__name { font-weight: 600; }
.tb-route__item.is-start .tb-route__name,
.tb-route__item.is-finish .tb-route__name {
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: 1.5rem; text-transform: uppercase; letter-spacing: .03em; font-weight: 400;
}
.tb-route__time { color: var(--tb-accent, var(--red)); font-weight: 600; margin-left: 10px; }
.tb-route__note { display: block; color: var(--tb-comp-dim); font-size: 14px; }

@media (min-width: 720px) {
  .tb-route__svg  { display: block; }
  .tb-route__list { display: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
 * Homepage band — the rides.
 *
 * Lives in this file because it is landing-adjacent, but it is enqueued on the
 * HOMEPAGE too (see inc/enqueue.php): the band is the entry point to the landing
 * pages and shares their accent tokens.
 * ───────────────────────────────────────────────────────────────────────────── */
.tb-rides { background: var(--tb-black); padding: clamp(40px, 6vw, 64px) 0; }
.tb-rides__inner { width: min(100% - 32px, 1160px); margin: 0 auto; }
.tb-rides__heading {
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  text-transform: uppercase; letter-spacing: .03em;
  color: #fff; margin: 0 0 28px; text-align: center;
}
.tb-rides__grid { display: grid; gap: 20px; }
@media (min-width: 760px) { .tb-rides__grid[data-count="2"] { grid-template-columns: 1fr 1fr; } }
@media (min-width: 980px) { .tb-rides__grid[data-count="3"] { grid-template-columns: repeat(3, 1fr); } }

.tb-ride {
  display: block; text-decoration: none; position: relative; overflow: hidden;
  border-radius: 12px; min-height: 200px;
  background: var(--ride-accent); color: var(--ride-ink);
}
/* With a poster the card becomes the image, and the scrim carries the text. The accent
   survives as the border so the two rides stay distinguishable at a glance. */
.tb-ride--poster {
  background-image: var(--ride-poster);
  background-size: cover; background-position: center;
  border: 3px solid var(--ride-accent);
  color: #fff;
}
.tb-ride__body { display: block; padding: 26px 24px; position: relative; z-index: 1; }
/* ⚠️ The scrim is not decoration. Neither accent is safe as text on an unknown photograph —
   #FF652B is 2.94:1 on white and #FAEB0A is 1.24:1 — so text over a poster is plain white
   over a dark gradient, and the accent appears only as the border and the CTA underline. */
.tb-ride--poster::after {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: linear-gradient(180deg, rgba(0,0,0,.25) 0%, rgba(0,0,0,.78) 100%);
}
.tb-ride__kick {
  display: block; font-size: var(--tb-text-xs); font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; opacity: .85; margin: 0 0 8px;
}
.tb-ride__title {
  display: block;
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: clamp(1.75rem, 4.5vw, 2.5rem); line-height: 1.05;
  text-transform: uppercase; letter-spacing: .02em; margin: 0 0 10px;
}
.tb-ride__route {
  display: block; font-size: var(--tb-text-sm); font-weight: 600;
  letter-spacing: .04em; margin: 0 0 18px; opacity: .9;
}
.tb-ride__cta {
  display: inline-block; font-weight: 700; font-size: var(--tb-text-sm);
  text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 3px solid currentColor; padding-bottom: 2px;
}
.tb-ride--poster .tb-ride__cta { border-bottom-color: var(--ride-accent); }
.tb-ride:hover .tb-ride__title { text-decoration: underline; text-underline-offset: 4px; }
.tb-ride:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }




/* ─────────────────────────────────────────────────────────────────────────────
 * THE REGISTRATION PANEL — a designed component, not a form dropped into a column.
 *
 * ⚠️ SCOPED TO .tb-ep-ticket, NOT TO A PAGE. These rules were .tb-lp-scoped, so the panel was
 * styled on the landing page only; on the event page the SAME partial fell back to theme
 * defaults. Measured there: inputs 153px inside a 375px column (41%), labels wrapping to two
 * lines, a five-line consent block 136px tall, a submit button 2.4x wider than the fields above
 * it, and the price note at 10px #666. It read as broken because it was unstyled.
 *
 * ⚠️ AND IT SURVIVED THE FIRST EXTRACTION. That split was done BY LINE RANGE: the map (183-240)
 * and the rides band (379+) moved, and these rules at 209-267 fell inside "the rest". Split
 * component CSS by CONTENT, never by position.
 *
 * Every colour goes through the --tb-* contract, so the panel takes the accent of whatever
 * surface renders it and needs no page stylesheet to look right.
 * ───────────────────────────────────────────────────────────────────────────── */

/* The event page's sticky right rail is NOT this component. Reset it wherever the panel renders
   outside that context — the rail's viewport height put the submit button below an inner fold
   and nobody could register from a laptop. */
.tb-lp .tb-ep-ticket,
.tb-door .tb-ep-ticket {
  position: static; height: auto; overflow: visible; border-left: 0;
  background: var(--tb-comp-bg-2); border: 1px solid var(--tb-comp-line); padding: 34px;
}

/* ── Fields: FULL WIDTH, always ──
   A 153px input under its own label is the single thing that made this read as broken. */
.tb-ep-ticket .tb-input,
.tb-ep-ticket input[type="text"],
.tb-ep-ticket input[type="email"],
.tb-ep-ticket input[type="tel"],
.tb-ep-ticket input[type="number"],
.tb-ep-ticket select,
.tb-ep-ticket textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  background: var(--tb-comp-bg);
  color: var(--tb-comp-text);
  border: 1px solid var(--tb-comp-line);
  border-radius: 0;
  font: inherit;
  font-size: 16px;            /* >=16px or iOS zooms the page on focus */
  padding: 12px 14px;
  transition: border-color .15s;
}
.tb-ep-ticket .tb-input:focus,
.tb-ep-ticket input:focus,
.tb-ep-ticket select:focus,
.tb-ep-ticket textarea:focus {
  outline: 0;
  border-color: var(--tb-accent, var(--red));
}
.tb-ep-ticket ::placeholder { color: var(--tb-comp-dim); opacity: 1; }

/* ── Labels: they name a field, they are not content ──
   ⚠️ .tb-field__label, NOT a bare `label`. The markup used to wrap the input inside its label,
   so a bare rule styled the FIELD too — the fields inherited 12px uppercase and could not be
   sized on their own. The partial now emits label/for pairs. */
.tb-ep-ticket .tb-field__label {
  display: block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--tb-comp-dim);
  font-weight: 600;
  margin: 0 0 7px;
  line-height: 1.35;
}
.tb-ep-ticket .tb-field { margin: 0 0 18px; }
.tb-ep-ticket .row { display: grid; gap: 16px; }
.tb-ep-ticket .row .tb-field { margin: 0; }
@media (min-width: 520px) { .tb-ep-ticket .row { grid-template-columns: 1fr 1fr; } }

/* ── Consent ──
   ⚠️ It ran FIVE LINES at 16px and dominated the panel. It is a legal necessity, not the subject
   of the page: smaller, tighter, in a bounded box, with the checkbox in its own grid column so
   the text cannot wrap underneath it. Still 14px at 1.55 on a high-contrast ground — shrinking
   consent past readability would be a different kind of wrong. */
.tb-ep-ticket .tb-consent__label {
  display: block;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 400;
  color: var(--tb-comp-text);
  margin: 0;
}
.tb-ep-ticket .tb-consent {
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  margin: 4px 0 0;
  background: var(--tb-comp-bg);
  border: 1px solid var(--tb-comp-line);
}
.tb-ep-ticket input[type="checkbox"] {
  width: 18px; height: 18px; margin: 2px 0 0;
  accent-color: var(--tb-accent, var(--red));
}

/* ── Submit: the width of the fields it follows, because it belongs to them ── */
.tb-ep-ticket .tb-ep-ticket__buy {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin: 20px 0 0;
  background: var(--tb-accent, var(--red));
  color: var(--tb-accent-ink);
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: 22px;
  letter-spacing: .06em;
  text-transform: uppercase;
  border: 0; border-radius: 0;
  padding: 16px 20px;
  cursor: pointer;
  min-height: 56px;
}
.tb-ep-ticket .tb-ep-ticket__buy:hover { filter: brightness(1.08); }
.tb-ep-ticket .tb-ep-ticket__buy:focus-visible {
  outline: 3px solid var(--tb-accent, var(--red)); outline-offset: 3px;
}

/* ── The price ──
   ⚠️ NOT FINE PRINT. It rendered at 10px #666 UNDER the button: a visitor must not learn what
   something costs by squinting after the control that commits them to it. The amount is display
   type at the head of the panel; the payment sentence stays a SEPARATE, quieter sentence,
   because it is a statement about us rather than a property of the ride. */
.tb-ep-ticket__label {
  font-family: var(--tb-heading-font, var(--tb-font));
  font-size: 30px;
  letter-spacing: .02em;
  color: var(--tb-comp-text);
  margin: 0 0 18px;
  text-transform: none;
}
.tb-ep-ticket__hd { padding: 0; border: 0; }
.tb-ep-ticket [data-testid="tb-pay-note"],
.tb-ep-ticket .tb-ep-ticket__note {
  display: block;
  margin: 16px 0 0;
  padding: 12px 14px;
  border-left: 3px solid var(--tb-accent, var(--red));
  background: var(--tb-comp-bg);
  color: var(--tb-comp-text);
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
}
.tb-ep-ticket__status { color: var(--tb-comp-text); font-size: 15px; }

/* ── The global floating CTA ──
   ⚠️ Missed in the --tb-accent migration: it stayed site gold (rgb(212,175,55)) on an event
   whose accent is #FF652B. Global element, so it takes an accent only where one is set. */
.tb-fab {
  background: var(--tb-accent, var(--red));
  color: var(--tb-accent-ink, #fff);
}


/* ── Components on a phone ──
   ⚠️ These two lived inside landing.css's own @media block, so the map lost its mobile padding
   on every surface that does not load that file. Found by auditing the page stylesheet BY
   CONTENT — the first extraction was done by line range and could not see them. */
@media (max-width: 560px) {
  .tb-map__shell { padding: 22px 18px 18px; }
  .tb-map__lg--note { margin-left: 0; }
  .tb-lp .tb-ep-ticket, .tb-door .tb-ep-ticket { padding: 24px 20px; }
}
