/* Home page: hero with the overlapping search panel, highlights, reviews, popular routes, airports. */
@layer pages {
    /* ---------- Hero ---------- */
    .hero { --hero-h: 520px; --hero-overlap: 6rem; position: relative; display: flow-root; }
    .hero-slides { position: relative; height: var(--hero-h); overflow: hidden; border-radius: 0 0 var(--radius-xl) var(--radius-xl); background: var(--color-ink-deep); color: var(--color-on-dark); }
    .hero-slide { position: absolute; inset: 0; opacity: 0; visibility: hidden; transition: opacity .9s var(--ease), visibility .9s; }
    .hero-slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
    .hero-slide-default { background: radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--color-accent) 38%, transparent), transparent 42%), radial-gradient(circle at 88% 8%, color-mix(in srgb, var(--teal-400) 45%, transparent), transparent 46%), var(--gradient-brand); }
    .hero-image { width: 100%; height: 100%; object-fit: cover; transform: scale(1.04); transition: transform 8s var(--ease); }
    .hero-slide.is-active .hero-image { transform: scale(1.12); }
    .hero-overlay { position: absolute; inset: 0; background: linear-gradient(165deg, color-mix(in srgb, var(--color-ink-deep) 88%, transparent) 0%, color-mix(in srgb, var(--color-primary) 52%, transparent) 55%, color-mix(in srgb, var(--color-ink-deep) 82%, transparent) 100%); }
    .hero-content { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding-top: var(--space-5); padding-bottom: calc(var(--hero-overlap) + var(--space-4)); color: var(--color-on-dark); }
    .hero-title { max-width: 18ch; color: var(--color-on-dark); font-size: var(--text-3xl); font-weight: 800; line-height: 1.08; letter-spacing: -0.025em; text-shadow: 0 2px 24px color-mix(in srgb, var(--color-primary-strong) 40%, transparent); }
    .hero-title::after { content: ""; display: block; width: 64px; height: 6px; margin-top: var(--space-4); border-radius: var(--radius-pill); background: var(--gradient-accent); }
    .hero-subtitle { max-width: 46ch; margin: var(--space-4) 0 0; color: color-mix(in srgb, var(--color-on-dark) 90%, transparent); font-size: var(--text-lg); line-height: 1.55; }
    .hero-cta { margin-top: var(--space-5); }

    .hero-arrow { position: absolute; top: calc(var(--hero-h) / 2 - 22px); z-index: 3; display: none; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid color-mix(in srgb, var(--color-on-dark) 35%, transparent); border-radius: var(--radius-round); background: color-mix(in srgb, var(--color-ink-deep) 35%, transparent); color: var(--color-on-dark); transition: background 0.18s; }
    .hero-arrow:hover { background: color-mix(in srgb, var(--color-ink-deep) 65%, transparent); }
    .hero-arrow-prev { left: var(--space-4); }
    .hero-arrow-next { right: var(--space-4); }
    .hero-dots { position: absolute; left: 0; right: 0; top: calc(var(--hero-h) - var(--hero-overlap) - 2.25rem); z-index: 3; display: flex; justify-content: center; gap: var(--space-2); }
    .hero-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: var(--radius-round); background: color-mix(in srgb, var(--color-on-dark) 45%, transparent); transition: width 0.2s var(--ease), background 0.2s; }
    .hero-dot.is-active { width: 28px; border-radius: var(--radius-pill); background: var(--gradient-accent); }

    .hero-search { position: relative; z-index: 5; display: flex; justify-content: center; margin-top: calc(-1 * var(--hero-overlap)); padding-bottom: var(--space-2); }

    @media (min-width: 768px) {
        .hero { --hero-h: 600px; --hero-overlap: 8rem; }
        .hero-content { padding-top: var(--space-6); }
        .hero-arrow { display: inline-flex; }
    }

    /* ---------- Sections ---------- */
    .highlights, .testimonials, .presets, .airports-section { padding-top: var(--space-7); }
    .presets-head h2, .testimonials-head h2, .airports-section-head h2 { color: var(--color-primary-strong); font-size: var(--text-2xl); font-weight: 800; }
    .presets-head h2::after, .testimonials-head h2::after, .airports-section-head h2::after { content: ""; display: block; width: 56px; height: 5px; margin-top: var(--space-3); border-radius: var(--radius-pill); background: var(--gradient-accent); }
    .presets-head p, .airports-section-head p { margin: var(--space-3) 0 0; color: var(--color-text-muted); }
    .presets-head, .airports-section-head, .testimonials-head { margin-bottom: var(--space-5); }

    /* ---------- Highlights ---------- */
    /* A swipeable row on a phone, so four items are not squeezed side by side; the grid comes back from tablets up. */
    .highlights-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 62%; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-3); scrollbar-width: none; }
    .highlights-grid::-webkit-scrollbar { display: none; }
    .highlight { text-align: center; scroll-snap-align: start; }
    .highlight-image { width: 100%; max-width: 250px; height: 110px; margin: 0 auto var(--space-3); object-fit: contain; }
    .highlight-title { margin-bottom: var(--space-1); color: var(--color-primary-strong); font-size: var(--text-md); font-weight: 800; line-height: 1.25; overflow-wrap: anywhere; }
    .highlight-text { max-width: 30ch; margin: 0 auto; color: var(--color-text-muted); font-size: var(--text-sm); line-height: 1.4; overflow-wrap: anywhere; }

    @media (min-width: 768px) {
        .highlights-grid { grid-auto-flow: row; grid-auto-columns: auto; overflow: visible; scroll-snap-type: none; padding-bottom: 0; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: var(--space-6) var(--space-5); }
        .highlight { padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
        .highlight:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
        .highlight-image { height: 200px; margin-bottom: var(--space-5); }
        .highlight-title { margin-bottom: var(--space-3); font-size: var(--text-lg); }
        .highlight-text { font-size: var(--text-sm); }
    }

    /* ---------- Reviews carousel (scroll-snap) ---------- */
    .testimonials-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
    .testimonials-nav { display: none; gap: var(--space-2); }
    .carousel-arrow { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; border: 1.5px solid var(--color-border); border-radius: var(--radius-round); background: var(--color-surface); color: var(--color-primary); }
    .carousel-arrow:hover { border-color: var(--color-primary); }
    .testimonials-track { display: flex; gap: var(--space-4); overflow-x: auto; scroll-snap-type: x mandatory; padding: var(--space-1) var(--space-1) var(--space-4); scrollbar-width: none; }
    .testimonials-track::-webkit-scrollbar { display: none; }
    .testimonial { flex: 0 0 88%; scroll-snap-align: start; display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
    .testimonial-stars { display: flex; gap: .15rem; color: var(--color-border); }
    .testimonial-stars .is-filled { color: var(--color-star); fill: var(--color-star); }
    .testimonial-text { flex: 1; margin: 0; color: var(--color-text); font-size: var(--text-sm); display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
    .testimonial-author { display: flex; align-items: center; gap: var(--space-3); }
    .testimonial-avatar { width: 44px; height: 44px; border-radius: var(--radius-round); object-fit: cover; flex: 0 0 auto; }
    .testimonial-initial { display: inline-flex; align-items: center; justify-content: center; background: var(--color-primary); color: var(--color-on-dark); font-weight: 700; }
    .testimonial-name { color: var(--color-primary-strong); font-weight: 700; }
    a.testimonial-name:hover { color: var(--color-link); }
    .testimonial-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-xs); color: var(--color-text-muted); }
    .testimonial-source { padding: .05rem var(--space-2); border-radius: var(--radius-pill); background: var(--color-surface-alt); color: var(--color-primary); font-weight: 700; font-size: 0.7rem; }

    /* The card that slides into view settles in: a short rise and fade. */
    .testimonial.is-entering { animation: testimonial-settle .55s var(--ease); }
    @keyframes testimonial-settle {
        from { opacity: .35; transform: translateY(14px) scale(.96); }
        to { opacity: 1; transform: none; }
    }
    @media (prefers-reduced-motion: reduce) { .testimonial.is-entering { animation: none; } }

    @media (min-width: 768px) {
        .testimonials-nav { display: flex; }
        .testimonial { flex-basis: calc((100% - var(--space-4)) / 2); }
    }
    @media (min-width: 1024px) {
        .testimonial { flex-basis: calc((100% - 2 * var(--space-4)) / 3); }
    }

    /* ---------- Popular routes: a swipeable row on phones, a grid from tablets up ---------- */
    .presets-grid { display: grid; grid-auto-flow: column; grid-auto-columns: 84%; gap: var(--space-3); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: var(--space-3); scrollbar-width: none; }
    .presets-grid::-webkit-scrollbar { display: none; }

    .preset-card {
        position: relative; display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-4) var(--space-5); overflow: hidden; text-align: left; scroll-snap-align: start;
        background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-xl); box-shadow: var(--shadow-sm);
        transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s var(--ease);
    }
    .preset-card::after { content: ""; position: absolute; right: -32px; bottom: -32px; width: 96px; height: 96px; border-radius: var(--radius-round); background: color-mix(in srgb, var(--color-accent) 12%, transparent); transition: transform .35s var(--ease); }
    .preset-card:hover, .preset-card:focus-visible { transform: translateY(-4px); border-color: var(--color-accent); box-shadow: var(--shadow); outline: none; }
    .preset-card:hover::after { transform: scale(1.6); }

    /* From/to as a small timeline: ring, dotted line, dot. */
    .preset-route { position: relative; z-index: 1; display: grid; gap: var(--space-3); min-width: 0; padding-left: 1.4rem; }
    .preset-route::before { content: ""; position: absolute; left: 4px; top: .75rem; bottom: .75rem; border-left: 2px dotted var(--color-border); }
    .preset-stop { position: relative; display: block; font-size: var(--text-sm); line-height: 1.3; }
    /* The line clamp sits on an inner span: overflow hidden on the stop itself would clip its timeline dot. */
    .preset-name { display: -webkit-box; overflow: hidden; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
    .preset-stop::before { content: ""; position: absolute; left: -1.4rem; top: .28em; width: 10px; height: 10px; border-radius: var(--radius-round); background: var(--color-surface); }
    .preset-from { font-weight: 700; color: var(--color-primary-strong); }
    .preset-from::before { border: 2.5px solid var(--color-accent); }
    .preset-to { color: var(--color-text-muted); }
    .preset-to::before { background: var(--color-primary); }

    .preset-foot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--color-border); }
    .preset-price { display: flex; align-items: baseline; gap: var(--space-2); min-width: 0; }
    .preset-price small { font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--color-text-muted); }
    .preset-price strong { font-size: var(--text-xl); font-weight: 800; letter-spacing: -.01em; color: var(--color-primary-strong); white-space: nowrap; }
    .preset-go { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-round); border: 1.5px solid var(--color-border); color: var(--color-primary); transition: background .2s, border-color .2s, color .2s, transform .2s; }
    .preset-card:hover .preset-go, .preset-card:focus-visible .preset-go { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-ink-deep); transform: translateX(3px); }

    .preset-modal[hidden] { display: none; }
    .preset-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: var(--space-4); }
    .preset-modal-backdrop { position: absolute; inset: 0; background: color-mix(in srgb, var(--color-ink-deep) 60%, transparent); backdrop-filter: blur(2px); }
    .preset-modal-card { position: relative; display: grid; gap: var(--space-3); width: 100%; max-width: 440px; padding: var(--space-5); background: var(--color-surface); border-radius: var(--radius-xl); box-shadow: var(--shadow); animation: preset-in .25s var(--ease); }
    @keyframes preset-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
    .preset-modal-x { position: absolute; top: var(--space-3); right: var(--space-3); display: inline-flex; padding: var(--space-2); border: 0; background: none; color: var(--color-text-muted); border-radius: var(--radius-round); }
    .preset-modal-x:hover { background: var(--color-surface-alt); color: var(--color-primary-strong); }
    .preset-modal-title { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-right: var(--space-6); font-size: var(--text-md); line-height: 1.3; }
    .preset-modal-title .icon { color: var(--color-accent-strong); }
    .preset-modal-hint { margin: calc(-1 * var(--space-1)) 0 0; color: var(--color-text-muted); font-size: var(--text-sm); }
    .preset-modal-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
    .preset-modal .passengers-popover { width: min(360px, 78vw); }

    @media (min-width: 768px) {
        .presets-grid { grid-auto-flow: row; grid-auto-columns: auto; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); overflow: visible; padding-bottom: 0; }
    }
    @media (min-width: 1024px) {
        .presets-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    }
    @media (min-width: 1280px) {
        .presets-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    }

    /* ---------- Airports strip ---------- */
    .airports-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }
    .airports-all { display: inline-flex; align-items: center; gap: var(--space-1); min-height: var(--tap); color: var(--color-primary); font-weight: 700; }
    .airports-all:hover { color: var(--color-primary-strong); }
}
