/* THE HUB SEARCH CARD, polished (2026-10-28). Loaded by
   templates/partials/_travel_search.html after search-card.css, so it only
   refines: an icon in every field label instead of the step number, a clear
   blue focus ring, 48px touch targets, one-tap route chips, the + / - guests
   picker and a slim "Your plan" line. Blue and white only. Text sizes stay
   under static/css/font-size.css, which caps them on purpose. */

#travelSearch {
    --hs-blue: var(--c-primary, #2563eb);
    --hs-blue-soft: var(--eb-blue-soft, #eef4ff);
    --hs-ink: var(--c-ink, #0f1a2c);
    --hs-line: var(--c-line, #e5e5e7);
    --hs-muted: var(--c-muted, #4f5a6b);
    --hs-ring: 0 0 0 3px rgba(37, 99, 235, 0.32);
}

/* Fields: the label carries its own icon, so the numbered badge goes. */
#travelSearch .tsc__field,
#travelSearch #heroBook .tsc__duo .tsc__field { min-height: 64px; padding: 10px 14px; transform: none; }
#travelSearch .tsc__field::before,
#travelSearch .tsc__field + .tsc__field::before,
#travelSearch .tsc__field.is-filled::before { display: none; }
#travelSearch .tsc__field:hover { transform: none; }
#travelSearch .tsc__field:focus-within,
#travelSearch #heroBook .tsc__duo .tsc__field:focus-within {
    border-color: var(--hs-blue); background: #fff; box-shadow: var(--hs-ring); transform: none;
}
#travelSearch .tsc__lab { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
#travelSearch .tsc__lab .et-i { flex: none; width: 14px; height: 14px; color: var(--hs-blue); }
#travelSearch .tsc__field.is-filled .tsc__lab .et-i { color: var(--hs-ink); }
#travelSearch .tsc__field input, #travelSearch .tsc__field select { min-height: 28px; }

/* Keyboard focus on every button in the card. */
#travelSearch button:focus-visible,
#travelSearch .tsc__opt select:focus-visible { outline: 2px solid var(--hs-blue); outline-offset: 2px; }

/* One-tap route chips. They only fill the fields; nothing submits. */
.tsc-routes { flex: 1 1 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; margin: 2px 0 0; }
.tsc-routes__h { font-size: 12px; font-weight: 700; color: var(--hs-muted); margin-right: 2px; }
.tsc-route {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; max-width: 100%;
    padding: 0 12px; border: 1px solid var(--hs-line); border-radius: 999px; background: #fff;
    color: var(--hs-ink); font: 600 13px/1.2 var(--f-sans, inherit); cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}
.tsc-route .et-i { flex: none; width: 12px; height: 12px; color: var(--hs-blue); }
.tsc-route:hover { border-color: var(--hs-blue); background: var(--hs-blue-soft); }
.tsc-route.is-on { border-color: var(--hs-blue); background: var(--hs-blue); color: #fff; }
.tsc-route.is-on .et-i { color: #fff; }
.tsc__form--wrap > .tsc-routes { margin-top: 0; }

/* The guests picker. The original selects stay in the form, hidden away. */
.tsc-gp__hide {
    position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.tsc-gp { position: relative; }
.tsc-gp.is-open { z-index: 40; }
.tsc-gp__btn {
    display: flex; align-items: center; width: 100%; min-height: 28px; padding: 0 22px 0 0; margin: 0;
    border: 0; background: transparent; color: var(--hs-ink); font: 700 1rem/1.2 var(--f-sans, inherit);
    text-align: left; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 9px) 52%, calc(100% - 4px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
#travelSearch .tsc-gp--opt .tsc-gp__btn {
    min-height: 36px; padding: 0 30px 0 12px; border: 1px solid var(--hs-line); border-radius: 999px;
    background-color: #fff; font-size: 14px; font-weight: 600;
    background-position: calc(100% - 15px) 52%, calc(100% - 10px) 52%;
}
.tsc-gp__pop {
    position: absolute; top: calc(100% + 8px); left: 0; z-index: 40; width: 280px; max-width: calc(100vw - 32px);
    padding: 12px; border: 1px solid var(--hs-line); border-radius: 14px; background: #fff;
    box-shadow: 0 16px 40px rgba(15, 26, 44, 0.18);
}
.tsc-gp__pop[hidden] { display: none; }
.tsc__field--guests .tsc-gp__pop { left: auto; right: 0; }
.tsc-gp__row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 0; }
.tsc-gp__row + .tsc-gp__row { border-top: 1px solid var(--hs-line); }
.tsc-gp__name { font-weight: 600; color: var(--hs-ink); }
.tsc-gp__step { display: inline-flex; align-items: center; gap: 10px; }
.tsc-gp__step output { min-width: 22px; text-align: center; font-weight: 700; color: var(--hs-ink); }
.tsc-gp__minus, .tsc-gp__plus {
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 1px solid var(--hs-blue);
    border-radius: 50%; background: #fff; color: var(--hs-blue); font: 700 20px/1 var(--f-sans, inherit); cursor: pointer;
    touch-action: manipulation;
}
.tsc-gp__minus:hover, .tsc-gp__plus:hover { background: var(--hs-blue-soft); }
.tsc-gp__minus:disabled, .tsc-gp__plus:disabled { border-color: var(--hs-line); color: #b6bcc6; background: #fff; cursor: default; }
.tsc-gp__done {
    display: block; width: 100%; min-height: 44px; margin-top: 8px; border: 0; border-radius: 10px;
    background: var(--hs-blue); color: #fff; font: 700 14px/1 var(--f-sans, inherit); cursor: pointer;
}

/* "Your plan": one slim line with a small ring. */
#travelSearch .tsc__bar { gap: 10px; padding: 6px 6px 6px 10px; margin-top: 0; border-radius: 14px; }
#travelSearch .tsc__ring { width: 28px; height: 28px; }
#travelSearch .tsc__ring::before { inset: 3px; }
#travelSearch .tsc__ring b { font-size: 9px; }
#travelSearch .tsc__sum { flex-direction: row; align-items: baseline; gap: 8px; }
#travelSearch .tsc__sum small { flex: none; font-size: 11px; }
#travelSearch .tsc__bar .tsc__go, #travelSearch .tsc__bar .tsc__go--hosts { min-height: 48px; }

/* Phones. The site is drawn at 0.8 scale (html zoom), so 60px here is a
   48px touch target on the glass. */
@media (max-width: 734px) {
    #travelSearch .tsc__field,
    #travelSearch #heroBook .tsc__duo .tsc__field { min-height: 60px; padding: 8px 12px; }
    #travelSearch .tsc__field input, #travelSearch .tsc__field select, #travelSearch .tsc-gp__btn { min-height: 32px; }
    #travelSearch .tsc-route { min-height: 50px; padding: 0 14px; }
    #travelSearch .tsc-gp--opt .tsc-gp__btn, #travelSearch .tsc__opt select, #travelSearch .tsc__flex { min-height: 56px; }
    #travelSearch .tsc-gp--opt .tsc-gp__btn { font-size: 16px; }
    #travelSearch .tsc-gp__minus, #travelSearch .tsc-gp__plus { width: 56px; height: 56px; }
    #travelSearch .tsc-gp__done { min-height: 56px; }
    .tsc-gp__pop, .tsc__field--guests .tsc-gp__pop { width: auto; left: 0; right: 0; max-width: none; }
    .tsc-gp--opt .tsc-gp__pop { width: 300px; max-width: calc(100vw - 40px); right: auto; }
    /* On a phone the fields already show the plan; keep only the button. */
    #travelSearch .tsc__bar { display: block; padding: 0; background: none; }
    #travelSearch .tsc__bar .tsc__ring, #travelSearch .tsc__bar .tsc__sum { display: none; }
    #travelSearch .tsc__bar .tsc__go, #travelSearch .tsc__bar .tsc__go--hosts { width: 100%; min-height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
    .tsc-route { transition: none; }
}

/* ============================================================
   THE FLIGHTS TAB (2026-10-29, A3-A9 of the flights home). Form id
   tscFlights, prefix .fs-. Pills are real radios under a label, so the
   form works with no script; static/js/hub_flights.js adds the swap,
   the nearby hint, the travellers picker and the loading state.
   ============================================================ */
#travelSearch .fs { gap: 10px; }
#travelSearch .fs__opts { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }

/* A3 / A7: pills (trip type, cabin) */
.fs-trip, .fs-cabin { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.fs-trip { background: var(--hs-blue-soft); border-radius: 999px; padding: 3px; gap: 2px; }
.fs-pill { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px;
           border-radius: 999px; border: 1px solid transparent; background: transparent; color: var(--hs-ink);
           font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; -webkit-tap-highlight-color: transparent; }
.fs-pill input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; pointer-events: none; }
.fs-pill .et-i { width: 14px; height: 14px; color: var(--hs-blue); }
.fs-pill:hover { color: var(--hs-blue); }
.fs-pill:has(input:checked) { background: #fff; color: var(--hs-ink); box-shadow: 0 1px 3px rgba(15, 26, 44, 0.16); }
.fs-pill:has(input:focus-visible) { outline: 2px solid var(--hs-blue); outline-offset: 2px; }
.fs-pill.is-on { background: #fff; color: var(--hs-ink); box-shadow: 0 1px 3px rgba(15, 26, 44, 0.16); }
.fs-cabin .fs-pill { border-color: var(--hs-line); background: #fff; }
.fs-cabin .fs-pill:has(input:checked), .fs-cabin .fs-pill.is-on { background: var(--hs-blue); border-color: var(--hs-blue); color: #fff; box-shadow: none; }
.fs-pill--link { color: var(--hs-muted); }
.fs-pill--link:hover { color: var(--hs-blue); }

/* A5: the +/-3 days toggle */
#travelSearch .fs-flex { min-height: 36px; gap: 6px; border-color: var(--hs-line); background: #fff; font-weight: 600; }
#travelSearch .fs-flex input { accent-color: var(--hs-blue); }
#travelSearch .fs-flex:has(input:checked) { border-color: var(--hs-blue); background: var(--hs-blue-soft); color: var(--hs-blue); }
#travelSearch .fs-flex:focus-within { outline-color: var(--hs-blue); }

/* A4: From / To with the swap button between them */
#travelSearch .fs__od { position: relative; gap: 10px; }
#travelSearch .fs__od .tsc__field { flex: 1 1 200px; }
#travelSearch .fs__from { padding-bottom: 8px; }
.fs-nearby { display: block; margin-top: 2px; color: var(--hs-blue); font-weight: 600; line-height: 1.3; }
.fs-nearby[hidden] { display: none; }
.fs-nearby__pick { padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.fs-nearby__pick:hover { color: var(--hs-ink); }
.fs-swap {
    position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
    display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
    border: 1px solid var(--hs-line); border-radius: 50%; background: #fff; color: var(--hs-blue);
    box-shadow: 0 1px 4px rgba(15, 26, 44, 0.14); cursor: pointer; transition: transform 200ms ease, border-color 160ms ease;
}
.fs-swap .et-i { width: 16px; height: 16px; }
.fs-swap:hover { border-color: var(--hs-blue); }
.fs-swap.is-spun { transform: translate(-50%, -50%) rotate(180deg); }

/* A5 / A6: dates and travellers */
#travelSearch .fs__when { gap: 10px; }
#travelSearch .fs__when .tsc__field { flex: 1 1 150px; }
#travelSearch .fs__pax { flex: 1.4 1 200px; }
#travelSearch .fs:has(input[name="trip"][value="oneway"]:checked) .fs__return { display: none; }
#travelSearch .fs.is-oneway .fs__return { display: none; }
.fs-pax__selects { display: flex; flex-wrap: wrap; gap: 6px; }
#travelSearch .fs-pax__selects select { flex: 1 1 80px; min-width: 0; }
.fs-pax__ages { display: flex; flex-wrap: wrap; gap: 6px; }
.fs-pax__ages:empty { display: none; }
/* With the picker drawn, the three selects hide and the button reads them back */
#travelSearch .fs__pax.is-picker .fs-pax__selects { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
#travelSearch .fs__pax .tsc-gp__btn { min-height: 28px; }
#travelSearch .fs__pax.is-picker .fs-pax__ages { display: none; }
.fs-pop__ages { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 2px; }
.fs-pop__ages label { display: inline-flex; align-items: center; gap: 6px; color: var(--hs-muted); font-weight: 600; }
.fs-pop__ages select, .fs-pax__ages select { min-height: 36px; padding: 0 26px 0 10px; border: 1px solid var(--hs-line); border-radius: 999px; background: #fff;
    color: var(--hs-ink); font: 600 14px/1 var(--f-sans, inherit); -webkit-appearance: none; appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
    background-position: calc(100% - 13px) 50%, calc(100% - 8px) 50%; background-size: 5px 5px; background-repeat: no-repeat; }
.fs-pop__ages select:invalid { color: var(--hs-blue); border-color: var(--hs-blue); }
.fs-pop__hint { margin: 0 0 4px; color: var(--hs-muted); }

/* A8: Flight + Stay, only when the flag is on */
.fs-stay { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px;
           border-radius: 12px; background: var(--hs-blue-soft); cursor: pointer; }
.fs-stay > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fs-stay b { display: inline-flex; align-items: center; gap: 6px; }
.fs-stay b .et-i { width: 16px; height: 16px; color: var(--hs-blue); }
.fs-stay small { color: var(--hs-muted); }
.fs-stay input { width: 22px; height: 22px; margin: 0; accent-color: var(--hs-blue); flex: none; }

/* A9: the big button, with its loading state */
#travelSearch .fs-go { position: relative; width: 100%; min-height: 52px; }
#travelSearch .fs-go.is-loading { pointer-events: none; opacity: 0.85; }
#travelSearch .fs-go.is-loading .et-i { display: none; }
#travelSearch .fs-go.is-loading::before {
    content: ""; width: 18px; height: 18px; border-radius: 50%; flex: none;
    border: 2px solid rgba(255, 255, 255, 0.45); border-top-color: #fff; animation: fs-spin 700ms linear infinite;
}
@keyframes fs-spin { to { transform: rotate(360deg); } }

@media (max-width: 734px) {
    #travelSearch .fs__opts { justify-content: flex-start; }
    .fs-trip { width: 100%; display: flex; }
    .fs-trip .fs-pill { flex: 1 1 0; justify-content: center; padding: 0 8px; min-height: 40px; }
    .fs-pill { min-height: 44px; }
    #travelSearch .fs-flex { min-height: 44px; }
    #travelSearch .fs__od { flex-direction: column; }
    #travelSearch .fs__od .tsc__field, #travelSearch .fs__when .tsc__field { flex-basis: 100%; }
    .fs-swap { left: auto; right: 14px; width: 44px; height: 44px; }
    #travelSearch .fs__from { padding-right: 64px; }
    .fs-cabin { width: 100%; }
    .fs-cabin .fs-pill { flex: 1 1 0; justify-content: center; padding: 0 6px; }
    #travelSearch .fs-go { min-height: 60px; }
    .fs-pop__ages select { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) {
    .fs-swap { transition: none; }
    #travelSearch .fs-go.is-loading::before { animation: none; }
}
