/* ======================================================================
   Go Wild Expedition: Homepage hero "Expedition Showcase" (refined, Dec 2026)
   Front page only.
   - Desktop (>= 901px): bright full-bleed photo framed at its native 16:9
     where the viewport allows; only a soft, localized scrim sits behind the
     text column. Upright headings, minimal pagination dots.
   - Tablet/mobile (<= 900px): stacked editorial layout. The full-width photo
     keeps its landscape ratio and is never covered by copy; crisp white text
     sits on a navy panel below. All slides share one grid cell (zero CLS).
   - Crossfade: the incoming slide fades in over the outgoing one, while the
     outgoing slide's text is hidden instantly, so copy never ghosts.
   ====================================================================== */
.esn-hero { position: relative; }

/* The footer's in-body <style> later sets these exact rules. Applying them
   from <head> prevents the body box jumping (margin-collapse change) when
   that late style is parsed after first paint. Final layout is identical. */
body.esn-home {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
body.esn-home > .esn-main { flex: 1 0 auto; }

.he-hero {
    --he-bg: #0a0e1a;
    --he-surface: #0d1117;
    --he-gold: #e8a838;
    --he-gold-muted: #d4944a;
    --he-gold-light: #f5c76b;
    --he-white: #ffffff;
    --he-copy: #e6e8f0;
    --he-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --he-sans: 'Raleway', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --he-ui: system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    --he-speed: 800ms;
    --he-gutter: max(20px, calc((100% - 1160px) / 2));
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--he-bg);
    color: var(--he-white);
    isolation: isolate;
}
.he-hero *,
.he-hero *::before,
.he-hero *::after { box-sizing: border-box; }

/* ---- Track & slides ---- */
.he-track {
    display: grid;
    grid-template-areas: "stack";
}
.he-slide {
    grid-area: stack;
    position: relative;
    z-index: 0;
    margin: 0;
    opacity: 0;
    visibility: hidden;
    /* Outgoing slide stays opaque underneath until the incoming one has faded in. */
    transition: opacity 0s linear var(--he-speed), visibility 0s linear var(--he-speed);
}
.he-slide.is-active {
    z-index: 2;
    opacity: 1;
    visibility: visible;
    transition: opacity var(--he-speed) ease, visibility 0s;
}
/* Text of any inactive slide disappears immediately: no ghosting. */
.he-slide:not(.is-active) .he-slide__content {
    opacity: 0;
    visibility: hidden;
}
.he-slide__media { position: relative; overflow: hidden; background: var(--he-surface); }
.he-slide__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 45%;
}

/* ---- Copy ---- */
.he-slide__content { position: relative; z-index: 2; }
.he-slide__tag {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 16px;
    font-family: var(--he-ui);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .18em;
    line-height: 1.3;
    text-transform: uppercase;
    color: var(--he-gold-light);
}
.he-slide__tag::before {
    content: "";
    flex: 0 0 30px;
    height: 2px;
    background: var(--he-gold);
}
.he-slide__title {
    margin: 0 0 18px;
    font-family: var(--he-serif);
    font-style: normal;
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.01em;
    color: var(--he-white);
    text-wrap: balance;
}
.he-slide__desc {
    margin: 0 0 28px;
    max-width: 46ch;
    font-family: var(--he-sans);
    font-weight: 500;
    line-height: 1.65;
    color: var(--he-copy);
}
.he-slide__cta {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 10px 0 26px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--he-gold-light) 0%, var(--he-gold) 48%, var(--he-gold-muted) 100%);
    color: var(--he-bg);
    font-family: var(--he-ui);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
    text-shadow: none;
    transition: transform .2s ease, filter .2s ease;
}
.he-slide__cta svg {
    width: 34px;
    height: 34px;
    padding: 8px;
    border-radius: 50%;
    background: rgba(10, 14, 26, .14);
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .2s ease;
}
.he-slide__cta:hover,
.he-slide__cta:focus-visible {
    color: var(--he-bg);
    transform: translateY(-2px);
    filter: brightness(1.06);
}
.he-slide__cta:hover svg,
.he-slide__cta:focus-visible svg { transform: translateX(3px); }
.he-slide__cta:focus-visible {
    outline: 3px solid var(--he-white);
    outline-offset: 4px;
}

/* ---- Minimal pagination dots (24px hit area, 8px visual) ---- */
.he-dots {
    position: absolute;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 2px;
}
.he-dot {
    position: relative;
    width: 24px;
    height: 24px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.he-dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .7);
    box-shadow: 0 0 0 1px rgba(10, 14, 26, .35), 0 1px 4px rgba(10, 14, 26, .45);
    transition: width .3s ease, margin .3s ease, background-color .3s ease;
}
.he-dot:hover::before { background: #fff; }
.he-dot[aria-current="true"] { width: 34px; }
.he-dot[aria-current="true"]::before {
    width: 22px;
    margin-left: -11px;
    background: var(--he-gold-light);
}
.he-dot:focus-visible {
    outline: 2px solid var(--he-gold-light);
    outline-offset: 0;
    border-radius: 999px;
}

/* Entrance: only after the first change, so slide 1 paints immediately. */
.he-hero.has-changed .he-slide.is-active .he-slide__content { animation: heRise .6s .1s both; }
@keyframes heRise {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
}

/* ======================================================================
   Desktop & landscape tablet
   ====================================================================== */
@media (min-width: 901px) {
    .he-hero {
        /* Native 16:9 framing, capped to the space below the fixed header. */
        height: min(56.25vw, max(560px, calc(100vh - 118px)));
        height: min(56.25vw, max(560px, calc(100svh - 118px)));
    }
    .he-track,
    .he-slide { height: 100%; }
    .he-slide__media {
        position: absolute;
        inset: 0;
    }
    /* Bottom-up shade only: the upper part of every photo stays untouched. */
    .he-slide__media::after {
        content: "";
        position: absolute;
        inset: 0;
        background: linear-gradient(to top, rgba(10, 14, 26, .84) 0%, rgba(10, 14, 26, .58) 36%, rgba(10, 14, 26, 0) 64%);
        pointer-events: none;
    }
    /* Text anchored low and wide (bottom-left), clear of the search bar. */
    .he-slide__body {
        position: relative;
        z-index: 2;
        display: flex;
        align-items: flex-end;
        height: 100%;
        padding: 40px var(--he-gutter) 96px;
    }
    .he-slide__content { max-width: 680px; }
    .he-slide__title,
    .he-slide__desc {
        text-shadow: 0 1px 2px rgba(10, 14, 26, .55), 0 0 14px rgba(10, 14, 26, .4);
    }

    /* Location / kicker: translucent crimson pill. */
    .he-slide__tag {
        display: inline-flex;
        width: fit-content;
        margin: 0 0 18px;
        padding: 7px 14px 7px 15px;
        border: 1px solid rgba(255, 255, 255, .28);
        border-radius: 999px;
        background: rgba(150, 32, 24, .88);
        -webkit-backdrop-filter: blur(4px);
        backdrop-filter: blur(4px);
        color: #fff;
        font-size: 11.5px;
        letter-spacing: .16em;
        line-height: 1.2;
        text-shadow: none;
    }
    .he-slide__tag::before { display: none; }

    .he-slide__title { font-size: clamp(2.2rem, 3.4vw, 3.25rem); max-width: none; margin-bottom: 14px; }
    .he-slide__desc { font-size: clamp(1rem, 1.15vw, 1.1rem); margin-bottom: 24px; color: #f5f6fa; }

    /* Compact dots, bottom-right, 30px clear of the search bar
       (which overlaps the hero's last 50px). */
    .he-dots {
        z-index: 6;
        left: auto;
        right: calc(var(--he-gutter) - 5px);
        bottom: 80px;
    }
    .he-dot::before {
        background: rgba(255, 255, 255, .88);
        box-shadow: 0 0 0 1.5px rgba(10, 14, 26, .55), 0 1px 6px rgba(10, 14, 26, .6);
    }
    .he-dot[aria-current="true"]::before {
        background: var(--he-gold-light);
        box-shadow: 0 0 0 1.5px rgba(10, 14, 26, .6), 0 1px 6px rgba(10, 14, 26, .6);
    }
}

/* ======================================================================
   Tablet & mobile: stacked editorial layout
   ====================================================================== */
@media (max-width: 900px) {
    .he-hero { --he-media-ratio: 16 / 9; --he-media-h: 56.25vw; }
    .he-slide__media { aspect-ratio: var(--he-media-ratio); }
    .he-slide__body {
        position: relative;
        padding: 28px 28px 76px;
        background: var(--he-bg);
    }
    .he-slide__body::before {
        content: "";
        position: absolute;
        top: 0;
        left: 28px;
        right: 28px;
        height: 1px;
        background: linear-gradient(90deg, transparent, var(--he-gold-muted) 25%, var(--he-gold-muted) 75%, transparent);
    }
    .he-slide__content { max-width: 640px; }
    .he-slide__title { font-size: clamp(1.7rem, 5vw, 2.4rem); color: var(--he-white); }
    .he-slide__desc { font-size: 1rem; margin-bottom: 24px; color: var(--he-copy); }
    .he-slide__tag { margin-bottom: 12px; font-size: 11.5px; }

    /* Dots sit on the photo's lower edge, centred and unobtrusive. */
    .he-dots {
        top: calc(var(--he-media-h) - 32px);
        left: 50%;
        transform: translateX(-50%);
    }
}
@media (max-width: 600px) {
    .he-hero { --he-media-ratio: 3 / 2; --he-media-h: 66.6667vw; }
    .he-slide__body { padding: 24px 20px 68px; }
    .he-slide__body::before { left: 20px; right: 20px; }
}
@media (max-width: 480px) {
    .he-slide__cta { width: 100%; justify-content: space-between; }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    .he-slide,
    .he-slide.is-active { transition: none; }
    .he-slide.is-active .he-slide__img,
    .he-hero.has-changed .he-slide.is-active .he-slide__content { animation: none !important; }
    .he-slide__cta,
    .he-slide__cta svg,
    .he-dot::before { transition: none; }
    .he-slide__cta:hover,
    .he-slide__cta:focus-visible { transform: none; }
}

@media (hover: none) and (pointer: coarse) {
    .he-track { touch-action: pan-y; }
}

/* WP Travel Engine search bar beneath the hero: on tablets the six items
   squeezed into one row (labels truncated to a few pixels). Wrap them into
   a tidy 3 x 2 grid so the bar pairs cleanly with the stacked hero. */
@media (min-width: 601px) and (max-width: 1100px) {
    .esn-home .esn-trip-search .wpte-trip__search-fields.horizontal {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .esn-home .esn-trip-search .wpte-trip__search-fields.horizontal > .wpte-trip__adv-field,
    .esn-home .esn-trip-search .wpte-trip__search-fields.horizontal > .wpte-trip__submit-field {
        flex: 1 1 30%;
        min-width: 0;
    }
    .esn-home .esn-trip-search .wpte-trip__search-fields.horizontal > .wpte-trip__submit-field {
        min-height: 64px;
    }
    .esn-home .esn-trip-search .wpte-trip__search-fields.horizontal > .wpte-trip__submit-field > * {
        width: 100%;
    }
}
