/* =====================================================
   Layover airport drawer — entry link + panel content
   =====================================================

   Colocated and imported by the components themselves (the flights convention:
   see CompareTray/flight-compare.css), not by each page — the drawer is a lazy
   chunk and must carry its own styles.

   The panel geometry lives in components/ui/drawer.css; only what is specific
   to layover content is here.
   ===================================================== */

/* ── Entry link ───────────────────────────────────────────────────────── */

.layover-link {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border: 0;
    background: transparent;
    color: var(--review-flight-blue, #147ad6);
    font-family: var(--font-family-inter);
    font-weight: 600;
    cursor: pointer;
    /* Kills the 300ms tap delay without disabling pinch-zoom. */
    touch-action: manipulation;
}

.layover-link:hover { text-decoration: underline; }

.layover-link:focus-visible {
    outline: 2px solid var(--color-first);
    outline-offset: 2px;
    border-radius: 4px;
}

.layover-link--inline { font-size: 0.8125rem; }

/* Inside the results tooltip, where it sits on a tinted panel and has to read
   as the one actionable thing there. */
.layover-link--compact { font-size: 0.8125rem; }

/* The visual text is small, so the *touch* target is grown downward and
   outward instead — 44px tall without a 44px-tall blue link in the layout. */
@media (pointer: coarse) {
    .layover-link {
        position: relative;
        padding: 10px 2px;
    }
    .layover-link::after {
        content: '';
        position: absolute;
        inset: 50% 0 auto;
        transform: translateY(-50%);
        height: 44px;
    }
}

/* ── Trip chip ────────────────────────────────────────────────────────── */

.layover-drawer .layover-chip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    padding: 12px 16px;
    background: var(--color-blue-light, #e7f2ff);
    color: var(--color-dark);
    font-family: var(--font-family-inter);
    font-size: 0.8125rem;
}

@media (min-width: 768px) {
    .layover-drawer .layover-chip { padding: 14px 24px; }
}

.layover-chip__lead { font-weight: 700; }

/* A separator that is drawn, not typed: a "·" between wrapped items strands
   itself at the end of a line. */
.layover-chip__part { position: relative; padding-left: 12px; }

.layover-chip__part::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 50%;
    width: 3px;
    height: 3px;
    margin-top: -1.5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
}

/* ── Rating summary ───────────────────────────────────────────────────── */

.layover-rating {
    display: flex;
    align-items: center;
    gap: 14px;
}

.layover-rating__score {
    font-family: var(--font-family-inter);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--color-first);
    /* Lining figures so 4.2 and 3.8 occupy the same width and the block beside
       them does not shift between airports. */
    font-variant-numeric: tabular-nums;
}

.layover-stars {
    display: inline-flex;
    gap: 1px;
    color: var(--color-grey, #bdbdbd);
}

.layover-stars .is-on { color: #f5a623; }

.layover-attribution {
    font-size: 0.75rem;
    color: var(--color-content);
}

.layover-attribution a { color: var(--review-flight-blue, #147ad6); }

/* ── Hero ─────────────────────────────────────────────────────────────── */

.layover-hero {
    position: relative;
    /* Fixed band, so the skeleton and the photo occupy identical space and the
       body below never jumps when the image lands (CLS). */
    height: 200px;
    overflow: hidden;
    background: var(--color-blue-light, #e7f2ff);
}

@media (min-width: 768px) {
    .layover-hero { height: 260px; }
}

.layover-hero__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* No photo: a tinted panel with a mark, not an empty frame. */
.layover-hero--bare {
    background: linear-gradient(135deg, var(--color-blue-light, #e7f2ff), var(--color-blue-light2, #c9eef9));
}

.layover-hero__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-first);
    opacity: 0.35;
}

/* Depth over the picture as a whole. Not what makes the text readable — see
   .layover-hero__text — because a gradient spanning the hero gets weaker under
   the text as the hero gets taller, which is how a bright terminal photo ended
   up showing grey-on-grey at the 260px desktop height. */
.layover-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(8, 26, 34, 0.35) 0%, rgba(8, 26, 34, 0.12) 45%, rgba(8, 26, 34, 0) 100%);
}

.layover-hero__text {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 44px 16px 16px;
    /*
     * The text block carries its own darkness rather than borrowing the hero's.
     *
     * Tying the band to this element means the two lines always sit on the same
     * ink no matter how tall the hero is or what the photo does there. Against
     * the worst case a photo can present — pure white behind the text — white on
     * the 0.88 stop still measures 11.5:1, so the place line stays legible over
     * a floodlit terminal as readily as over a night apron.
     */
    background: linear-gradient(
        to top,
        rgba(8, 26, 34, 0.94) 0%,
        rgba(8, 26, 34, 0.88) 64%,
        rgba(8, 26, 34, 0.5) 86%,
        rgba(8, 26, 34, 0) 100%
    );
    /* Fixed light-on-dark: the band above is opaque in either theme, so this
       pair must not follow the theme tokens. */
    color: var(--color-white-same, #fff);
}

@media (min-width: 768px) {
    .layover-hero__text { padding: 52px 24px 20px; }
}

.layover-hero__name {
    margin: 0;
    /* Stated, not inherited: this block is portalled out of the page tree, so
       it should not depend on what an ancestor happens to set. */
    color: var(--color-white-same, #fff);
    font-family: var(--font-family-inter);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

/* A tint rather than `opacity`, which would fade the whole run including any
   shadow behind it and cost contrast exactly where it is tightest. */
.layover-hero__iata { font-weight: 500; color: rgba(255, 255, 255, 0.86); }

.layover-hero__place {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 6px 0 0;
    font-family: var(--font-family-inter);
    font-size: 0.875rem;
    /* Full white, no opacity. This is the line that was washing out: 0.95 white
       over a band that was itself too light left it reading as grey on grey. */
    color: var(--color-white-same, #fff);
    /* Long addresses wrap rather than run under the close button. */
    overflow-wrap: anywhere;
}

/* The pin must not shrink to nothing when the address wraps to two lines. */
.layover-hero__place > svg { flex: 0 0 auto; }

.layover-hero__credit {
    position: absolute;
    right: 10px;
    top: 8px;
    margin: 0;
    font-size: 0.625rem;
    color: var(--color-white-same, #fff);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

.layover-hero__credit a { color: inherit; text-decoration: underline; }

/* ── Body + cards ─────────────────────────────────────────────────────── */

.layover-body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 14px;
    background: var(--bgColor-light);
}

@media (min-width: 768px) {
    .layover-body { gap: 16px; padding: 20px 24px 32px; }
}

.layover-card {
    padding: 16px;
    border-radius: 12px;
    background: var(--color-white);
    border: 1px solid var(--review-flight-border, #dfe7ea);
}

.layover-card__title {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    font-family: var(--font-family-inter);
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-dark);
}

/* ── Good to know ─────────────────────────────────────────────────────── */

.layover-gtk__controls { display: flex; gap: 4px; }

.layover-gtk__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Below 44px visually because three sit in a row in a card header; the
       coarse-pointer rule below grows the hit area without growing the button. */
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid var(--review-flight-border, #dfe7ea);
    border-radius: 999px;
    background: var(--color-white);
    color: var(--color-dark);
    cursor: pointer;
}

.layover-gtk__btn:hover { background: var(--bgColor-light); }

@media (pointer: coarse) {
    .layover-gtk__btn { width: 44px; height: 44px; }
}

.layover-gtk__stage {
    min-height: 62px;
    display: flex;
    align-items: center;
    margin-top: 10px;
    /* Horizontal swipe is the gesture here; let the browser keep vertical
       scrolling so the drawer still scrolls with a finger on the carousel. */
    touch-action: pan-y;
}

.layover-gtk__text {
    font-family: var(--font-family-inter);
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--color-dark);
}

.layover-gtk__dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}

.layover-gtk__dot {
    width: 7px;
    height: 7px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-grey, #bdbdbd);
    cursor: pointer;
    /* Same trick as the link: a 7px dot with a 24px target around it, which is
       the WCAG 2.2 AA minimum for a pointer target. */
    position: relative;
}

.layover-gtk__dot::after {
    content: '';
    position: absolute;
    inset: -9px;
}

.layover-gtk__dot.is-on { background: var(--color-first); }

.layover-gtk__footnote {
    margin-top: 12px;
    font-size: 0.6875rem;
    line-height: 1.5;
    color: var(--color-content);
}

/* ── Reviews ──────────────────────────────────────────────────────────── */

.layover-sorts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.layover-sort {
    min-height: 36px;
    padding: 6px 12px;
    border: 1px solid var(--review-flight-border, #dfe7ea);
    border-radius: 999px;
    background: var(--color-white);
    color: var(--color-dark);
    font-family: var(--font-family-inter);
    font-size: 0.8125rem;
    cursor: pointer;
    white-space: nowrap;
}

.layover-sort.is-on {
    border-color: var(--color-first);
    background: var(--color-blue-light, #e7f2ff);
    color: var(--color-first);
    font-weight: 600;
}

.layover-review {
    padding: 14px 0;
    border-top: 1px solid var(--review-flight-border, #dfe7ea);
}

.layover-review:first-child { border-top: 0; padding-top: 0; }

.layover-review__head { display: flex; gap: 10px; align-items: center; }

.layover-review__avatar {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bgColor-light);
}

.layover-review__avatar--initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family-inter);
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-first);
}

.layover-review__author {
    font-family: var(--font-family-inter);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-dark);
}

.layover-review__author a { color: inherit; }

.layover-review__text {
    margin: 10px 0 0;
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-content);
    overflow-wrap: anywhere;
}

/* Three lines, expandable. Places policy allows clamping only because the full
   text is always one control away — never truncated on the way here. */
.layover-review__text.is-clamped {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.layover-review__more {
    margin-top: 4px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--review-flight-blue, #147ad6);
    font-family: var(--font-family-inter);
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
}

.layover-review__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px;
    margin-top: 8px;
    font-size: 0.75rem;
}

.layover-review__actions a { color: var(--review-flight-blue, #147ad6); }

.layover-review__report {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--color-content) !important;
}

/* ── Skeleton ─────────────────────────────────────────────────────────── */

.layover-skeleton { pointer-events: none; user-select: none; }

.layover-skeleton__hero { height: 200px; }

@media (min-width: 768px) {
    .layover-skeleton__hero { height: 260px; }
}

/* ── Focus, once, for everything interactive in the drawer ────────────── */

.layover-sort:focus-visible,
.layover-gtk__btn:focus-visible,
.layover-gtk__dot:focus-visible,
.layover-review__more:focus-visible,
.layover-drawer a:focus-visible {
    outline: 2px solid var(--color-first);
    outline-offset: 2px;
}
