/* ====================================================================
 * HOME HERO SLIDER — MARKETING STYLESHEET
 * ====================================================================
 * Everything about the home-page hero slider lives here: slides,
 * arrows, dots, and the per-slide words. This file is expected to
 * change with marketing content a couple of times a month — the main
 * styles.css should not need touching for slider tweaks.
 *
 * Where things are wired up:
 *   - Slide content (photos + copy):  $heroSlides array in index.php
 *   - Markup:                         header.php (inside the hero section)
 *   - Behaviour (fade/arrows/swipe/autoplay): home-slider.js
 *   - This file is only loaded on pages that define $heroSlides.
 *
 * Two layouts:
 *   - 1200px and up: words sit in a column to the left or right of the
 *     photo's subject, over the photo, with a soft fade behind them.
 *   - Below 1200px: the hero is too short for words on top, so the photo
 *     shows clean and the words sit in a band directly underneath it.
 *
 * Quick recipes:
 *   - Re-colour a look:   edit the --cap-* variables under INK below.
 *   - Column width:       --cap-col-max on .sws-hero-slide-caption.
 *   - Fade strength:      --cap-scrim in each ink.
 * ==================================================================== */

/* ---------- Slider shell (structure — rarely needs editing) ---------- */

.sws-hero--slider {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.sws-hero-slider {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.sws-hero-slide {
    position: absolute;
    inset: 0;
    z-index: 0;
    opacity: 0;
    /* visibility (not just opacity) so hidden slides drop out of hit-testing
     * and tab order — otherwise the caption link on the last slide in the
     * DOM would sit invisibly on top of the active slide's link.
     * The outgoing slide stays fully opaque under the incoming one until
     * its fade completes, then drops out. Fading both at once would leave
     * each half-transparent mid-way and let the hero's own background
     * photo show through. */
    visibility: hidden;
    transition: opacity 0s linear 0.65s, visibility 0s linear 0.65s;
}

.sws-hero-slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.65s ease, visibility 0s;
}

/* <picture> wraps the <img> only so a slide can offer a separate phone
 * crop; it should not add a box of its own. */
.sws-hero-slide picture {
    display: contents;
}

.sws-hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Bottom-anchored: wide screens trim sky off the top, never the
     * subject along the bottom. --slide-focus (per slide, "focus" in
     * index.php) picks which part survives when narrow screens crop the
     * sides — set it to where the bottles are. */
    object-position: var(--slide-focus, 50%) bottom;
    display: block;
}

/* ---------- Arrows + dots (soft glass) ---------- */

.sws-hero-slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(255, 252, 246, 0.28);
    background: rgba(24, 12, 15, 0.3);
    color: rgba(253, 246, 231, 0.92);
    font-size: 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    box-shadow:
        0 4px 16px rgba(20, 12, 14, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.16);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sws-hero-slider-btn:hover,
.sws-hero-slider-btn:focus-visible {
    background: rgba(24, 12, 15, 0.48);
    border-color: rgba(255, 252, 246, 0.5);
    color: #fff;
}

.sws-hero-slider-btn--prev {
    left: 1.1rem;
}

.sws-hero-slider-btn--next {
    right: 1.1rem;
}

.sws-hero-slider-controls {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0.85rem;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.sws-hero-slider-dots {
    display: flex;
    gap: 0.45rem;
}

.sws-hero-slider-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    border: 1px solid rgba(255, 252, 246, 0.45);
    background: rgba(24, 12, 15, 0.26);
    box-shadow: 0 1px 5px rgba(20, 12, 14, 0.28);
    padding: 0;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.sws-hero-slider-dot:hover {
    border-color: rgba(255, 252, 246, 0.7);
}

.sws-hero-slider-dot.is-active {
    background: rgba(253, 246, 231, 0.95);
    border-color: rgba(253, 246, 231, 0.6);
    transform: scale(1.2);
}

/* Pause / play for the autoplay — same glass as the arrows, dot-sized. */
.sws-hero-slider-play {
    width: 22px;
    height: 22px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255, 252, 246, 0.4);
    background: rgba(24, 12, 15, 0.3);
    color: rgba(253, 246, 231, 0.92);
    font-size: 0.78rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.sws-hero-slider-play:hover,
.sws-hero-slider-play:focus-visible {
    background: rgba(24, 12, 15, 0.5);
    border-color: rgba(255, 252, 246, 0.7);
}

/* ====================================================================
 * THE WORDS
 * ==================================================================== */

.sws-hero-slide-caption {
    /* Inset matches the page container (min(1280px, 100% - 2.25rem)), but
     * never closer to the edge than the arrows. */
    --cap-inset: max(5.5rem, calc((100vw - 1280px) / 2));
    /* Column stops short of the countdown clock in the top centre. */
    --cap-col-max: min(31rem, calc(50vw - 9rem - var(--cap-inset)));

    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    padding: 2rem var(--cap-inset) 2.75rem;
    background: var(--cap-scrim);
}

.sws-hero-slide-caption--left {
    justify-content: flex-start;
}

.sws-hero-slide-caption--right {
    justify-content: flex-end;
}

/* Centre: the old lockup — a narrower block under the clock. Only for
 * photos with real empty space in the middle. */
.sws-hero-slide-caption--center {
    --cap-col-max: min(38rem, 70vw);
    justify-content: center;
    align-items: flex-start;
    padding-top: clamp(112px, 8.5vw, 132px);
    text-align: center;
}

.sws-hero-slide-caption--no-scrim {
    background: none;
}

.sws-hero-slide-copy {
    max-width: var(--cap-col-max);
}

.sws-hero-slide-caption--right .sws-hero-slide-copy {
    text-align: right;
}

.sws-hero-slide-eyebrow {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 0.7rem;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--cap-eyebrow-ink);
    text-shadow: var(--cap-small-shadow);
}

/* Short rule leading into the eyebrow — the site's hairline motif. */
.sws-hero-slide-eyebrow::before {
    content: "";
    flex: 0 0 auto;
    width: 28px;
    height: 1px;
    background: var(--cap-hairline-ink);
}

.sws-hero-slide-caption--right .sws-hero-slide-eyebrow {
    flex-direction: row-reverse;
}

.sws-hero-slide-caption--center .sws-hero-slide-eyebrow {
    justify-content: center;
}

.sws-hero-slide-caption--center .sws-hero-slide-eyebrow::after {
    content: "";
    flex: 0 0 auto;
    width: 28px;
    height: 1px;
    background: var(--cap-hairline-ink);
}

.sws-hero-slide-title {
    margin: 0;
    font-size: clamp(1.7rem, 2.75vw, 2.9rem);
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.015em;
    color: var(--cap-title-ink);
    text-shadow: var(--cap-title-shadow);
    text-wrap: balance;
}

.sws-hero-slide-text {
    margin: 0.8rem 0 0;
    font-size: clamp(0.92rem, 1.05vw, 1.06rem);
    line-height: 1.5;
    font-weight: 500;
    color: var(--cap-text-ink);
    text-shadow: var(--cap-small-shadow);
    text-wrap: pretty;
}

.sws-hero-slide-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.25rem;
    padding: 0.66rem 1.2rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    text-decoration: none;
    background: var(--cap-cta-bg);
    color: var(--cap-cta-ink);
    box-shadow: var(--cap-cta-shadow);
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.sws-hero-slide-cta i {
    transition: transform 0.2s ease;
}

.sws-hero-slide-cta:hover,
.sws-hero-slide-cta:focus-visible {
    background: var(--cap-cta-bg-hover);
    color: var(--cap-cta-ink);
    transform: translateY(-1px);
}

.sws-hero-slide-cta:hover i,
.sws-hero-slide-cta:focus-visible i {
    transform: translateX(3px);
}

/* ====================================================================
 * INK — the light and dark versions of the words
 * ====================================================================
 * Chosen per slide with "theme" in index.php. Pick by the photo behind
 * the words, not the photo overall:
 *   light  cream words, dark fade — for dark or busy backgrounds
 *   dark   plum words, cream fade — for bright, pale backgrounds
 * The fade comes in from the text side only, so the subject on the far
 * side stays untouched.
 * ==================================================================== */

.sws-hero-slide-caption--light {
    --cap-eyebrow-ink: #e3cb98;
    --cap-hairline-ink: rgba(227, 203, 152, 0.75);
    --cap-title-ink: #fffaf0;
    --cap-text-ink: rgba(255, 250, 240, 0.88);
    --cap-title-shadow: 0 2px 18px rgba(12, 8, 9, 0.38);
    --cap-small-shadow: 0 1px 8px rgba(12, 8, 9, 0.4);
    --cap-cta-bg: #fdf9f1;
    --cap-cta-bg-hover: #ffffff;
    --cap-cta-ink: #4a1b27;
    --cap-cta-shadow: 0 8px 22px rgba(12, 8, 9, 0.28);
    --cap-scrim-ink: 14, 10, 12;
    --cap-scrim-strength: 0.62;
}

.sws-hero-slide-caption--dark {
    --cap-eyebrow-ink: #7e323f;
    --cap-hairline-ink: rgba(126, 50, 63, 0.5);
    --cap-title-ink: #2b1418;
    --cap-text-ink: rgba(43, 20, 24, 0.82);
    --cap-title-shadow: none;
    --cap-small-shadow: none;
    --cap-cta-bg: #4a222b;
    --cap-cta-bg-hover: #331419;
    --cap-cta-ink: #fdf6e7;
    --cap-cta-shadow: 0 8px 20px rgba(36, 14, 20, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.12);
    --cap-scrim-ink: 250, 247, 240;
    --cap-scrim-strength: 0.72;
}

.sws-hero-slide-caption--left {
    --cap-scrim: linear-gradient(90deg,
        rgba(var(--cap-scrim-ink), var(--cap-scrim-strength)) 0%,
        rgba(var(--cap-scrim-ink), calc(var(--cap-scrim-strength) * 0.55)) 32%,
        rgba(var(--cap-scrim-ink), 0) 58%);
}

.sws-hero-slide-caption--right {
    --cap-scrim: linear-gradient(270deg,
        rgba(var(--cap-scrim-ink), var(--cap-scrim-strength)) 0%,
        rgba(var(--cap-scrim-ink), calc(var(--cap-scrim-strength) * 0.55)) 32%,
        rgba(var(--cap-scrim-ink), 0) 58%);
}

.sws-hero-slide-caption--center {
    --cap-scrim: radial-gradient(ellipse 46% 52% at 50% 46%,
        rgba(var(--cap-scrim-ink), calc(var(--cap-scrim-strength) * 0.7)) 0%,
        rgba(var(--cap-scrim-ink), 0) 100%);
}

/* ---------- Countdown label over the slider ----------
 * The site-wide countdown's cream label gets lost on pale photos, so on
 * the home page it takes the dark ink while a "dark" slide is showing
 * (is-hero-ink-dark, toggled by home-slider.js) and fades back with the
 * slide. The label is hidden once the bar goes compact on scroll. */
#auctionCountdown .countdown-label {
    transition: color 0.65s ease, text-shadow 0.65s ease, opacity 0.18s ease, transform 0.22s ease;
}

#auctionCountdown.is-hero-ink-dark .countdown-label {
    color: #4a222b;
    text-shadow: 0 1px 8px rgba(250, 247, 240, 0.6);
}

/* ====================================================================
 * TABLET + PHONE — words in a band under the photo
 * ==================================================================== */

@media (max-width: 1199.98px) {
    /* The hero grows to fit photo + band, instead of a fixed height. */
    .sws-header--home .sws-hero.sws-hero--slider {
        height: auto;
    }

    .sws-hero-slider {
        --hero-photo-h: clamp(280px, 56vw, 430px);
        position: relative;
        inset: auto;
        /* Every slide shares one grid cell, so they still crossfade on top
         * of each other and the slider is as tall as the tallest slide. */
        display: grid;
    }

    .sws-hero-slide {
        position: relative;
        inset: auto;
        grid-area: 1 / 1;
        display: flex;
        flex-direction: column;
    }

    .sws-hero-slide img {
        height: var(--hero-photo-h);
        flex: 0 0 auto;
    }

    .sws-hero-slide-caption,
    .sws-hero-slide-caption--center {
        position: relative;
        inset: auto;
        flex: 1 1 auto;
        display: block;
        padding: 1.25rem 1.35rem 1.45rem;
        text-align: left;
        background: var(--cap-band);
    }

    .sws-hero-slide-copy,
    .sws-hero-slide-caption--right .sws-hero-slide-copy {
        max-width: 36rem;
        text-align: left;
    }

    .sws-hero-slide-caption--right .sws-hero-slide-eyebrow,
    .sws-hero-slide-caption--center .sws-hero-slide-eyebrow {
        flex-direction: row;
        justify-content: flex-start;
    }

    .sws-hero-slide-caption--center .sws-hero-slide-eyebrow::after {
        content: none;
    }

    /* Band colours follow the ink: light words on a deep band that meets
     * the burgundy header language, dark words on the page's own cream. */
    .sws-hero-slide-caption--light {
        --cap-band: linear-gradient(180deg, #2a1519 0%, #22111a 100%);
        --cap-title-shadow: none;
        --cap-small-shadow: none;
        --cap-cta-shadow: none;
    }

    .sws-hero-slide-caption--dark {
        --cap-band: var(--sws-page-bg, #f9f6f0);
    }

    .sws-hero-slide-eyebrow {
        margin-bottom: 0.45rem;
        font-size: 0.66rem;
    }

    .sws-hero-slide-title {
        font-size: clamp(1.3rem, 4.6vw, 1.85rem);
        line-height: 1.15;
    }

    .sws-hero-slide-text {
        margin-top: 0.5rem;
        font-size: 0.92rem;
    }

    .sws-hero-slide-cta {
        margin-top: 0.95rem;
        padding: 0.58rem 1.05rem;
        font-size: 0.72rem;
    }

    /* Arrows and dots stay on the photo, not the band. */
    .sws-hero-slider-btn {
        top: calc(var(--hero-photo-h) / 2);
    }

    .sws-hero-slider-controls {
        top: calc(var(--hero-photo-h) - 2rem);
        bottom: auto;
    }
}

@media (max-width: 540px) {
    .sws-hero-slider-btn {
        width: 34px;
        height: 34px;
        font-size: 1rem;
    }

    .sws-hero-slider-btn--prev {
        left: 0.6rem;
    }

    .sws-hero-slider-btn--next {
        right: 0.6rem;
    }

    .sws-hero-slide-caption,
    .sws-hero-slide-caption--center {
        padding: 1.1rem 1.1rem 1.3rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sws-hero-slide,
    #auctionCountdown .countdown-label {
        transition: none;
    }
}
