/* ==========================================================================
   hero-slider.css — Homepage Slidable Hero Banner
   Herba Sparsh Child Theme
   Author: Pratik Patil
   ========================================================================== */

.hst-hero-slider {
    width: 100%;
    background: var(--color-muted);
}

.hst-hero-slider__viewport {
    position: relative;
    overflow: hidden;
    width: 100%;
    /* Matches the recommended 1920x640 desktop banner (3:1) — the container's
       own shape now follows the IMAGE's shape, not a fraction of whatever
       the visitor's browser window happens to be tall. The old `height: 60vh`
       only avoided cropping at one specific viewport height (~1067px); on
       most real laptop/desktop windows it rendered proportionally wider
       than 3:1, so `background-size: cover` cropped the top and bottom of
       every desktop banner image, symmetrically, every time — confirmed
       live from Pratik's screenshot (a correctly-sized 1920x640 upload with
       its top visibly cut off). min-height is just a safety floor for an
       unusually narrow desktop window; max-height stops it growing past the
       image's own native height on very wide/ultrawide monitors. */
    aspect-ratio: 3 / 1;
    min-height: 300px;
    max-height: 640px;
}

.hst-hero-slider__track {
    display: flex;
    height: 100%;
    transition: transform 500ms cubic-bezier(0.65, 0, 0.35, 1);
    will-change: transform;
}

.hst-hero-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Slides with a photo/poster: the image arrives as a CSS variable (see
   template-parts/hero-slider.php) so a separate phone image can swap in. */
.hst-hero-slide--has-image {
    background-image: var(--hst-slide-img);
}

@media (max-width: 767px) {
    .hst-hero-slide--has-mobile {
        background-image: var(--hst-slide-img-m);
    }
}

/* Poster (advertisement) slides: the picture is the whole slide — no darkening
   overlay, no text — and the entire slide can be a link. */
.hst-hero-slide--poster .hst-hero-slide__overlay {
    display: none;
}

.hst-hero-slide__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.hst-hero-slide__link:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: -6px;
}

/* Gradient fallback backgrounds — used whenever a slide has no photo yet,
   so the slider always looks intentional rather than blank. Rotates through
   three brand-derived gradients. */
.hst-hero-slide--gradient-1 {
    background-image: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 55%, var(--color-accent) 100%);
}

.hst-hero-slide--gradient-2 {
    background-image: linear-gradient(135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
}

.hst-hero-slide--gradient-3 {
    background-image: linear-gradient(135deg, var(--color-foreground) 0%, var(--color-primary) 60%, var(--color-secondary) 100%);
}

/* Interpolate the gradients in OKLCH where supported. In plain sRGB a green ->
   gold/marigold blend passes through a muddy olive-brown; OKLCH travels through
   clean yellow-greens instead. Browsers without support keep the sRGB gradients above. */
@supports (background-image: linear-gradient(in oklch, red, blue)) {
    .hst-hero-slide--gradient-1 {
        background-image: linear-gradient(in oklch 135deg, var(--color-primary) 0%, var(--color-secondary) 55%, var(--color-accent) 100%);
    }

    .hst-hero-slide--gradient-2 {
        background-image: linear-gradient(in oklch 135deg, var(--color-secondary) 0%, var(--color-accent) 100%);
    }

    .hst-hero-slide--gradient-3 {
        background-image: linear-gradient(in oklch 135deg, var(--color-foreground) 0%, var(--color-primary) 60%, var(--color-secondary) 100%);
    }
}

/* Darkening overlay — guarantees text contrast whether the background is a
   gradient or a future photo. z-index 0, below .hst-hero-slide__link (1):
   on text-mode slides that's just background dressing, not its own click
   target — the full-banner link sits above it. */
.hst-hero-slide__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.12) 60%, rgba(0, 0, 0, 0) 100%);
}

.hst-hero-slide--has-image .hst-hero-slide__overlay {
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0.2) 55%, rgba(0, 0, 0, 0) 100%);
}

.hst-hero-slide__content {
    position: relative;
    z-index: 2;
    max-width: 560px;
    /* Extra left clearance so the prev arrow (44px wide, sitting at
       left: var(--space-lg)) never overlaps the heading text. */
    padding: 0 var(--space-2xl) 0 calc(var(--space-2xl) + 56px);
    color: var(--color-on-primary);
}

.hst-hero-slide__eyebrow {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-on-primary);
    background: var(--color-accent-tint);
    border: 1px solid rgba(255, 255, 255, 0.4);
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-md);
}

.hst-hero-slide__heading {
    font-family: var(--font-display);
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.01em;
    color: var(--color-on-primary);
    margin: 0 0 var(--space-md) 0;
    text-wrap: balance;
}

.hst-hero-slide__subheading {
    font-family: var(--font-body);
    font-size: 1.1875rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.88);
    margin: 0 0 var(--space-xl) 0;
    max-width: 460px;
}

.hst-hero-slide__cta {
    display: inline-flex;
}

/* ---- Arrows ----
   Drawn as a single text glyph (::before, content: '‹'/'›'), not an inline
   SVG and not a multi-property border trick — a two-sided border chevron
   turned out to render with only one border edge visible in production
   (likely a CSS optimizer on the host pruning/altering one declaration), so
   this uses the smallest possible surface area: one property to strip and
   the arrow disappears entirely (easy to notice), not silently distorts. */
.hst-hero-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-full);
    background: var(--color-surface);
    border: 1px solid rgba(0, 0, 0, 0.08);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    transition: background-color 200ms ease, transform 200ms ease;
}

.hst-hero-slider__arrow::before {
    content: '\2039';
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    color: var(--color-primary);
    transform: translateY(-2px);
}

.hst-hero-slider__arrow--next::before {
    content: '\203A';
}

.hst-hero-slider__arrow:hover {
    background: var(--color-accent);
    transform: translateY(-50%) scale(1.06);
}

.hst-hero-slider__arrow:hover::before {
    color: var(--color-on-accent);
}

.hst-hero-slider__arrow:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

.hst-hero-slider__arrow--prev {
    left: var(--space-lg);
}

.hst-hero-slider__arrow--next {
    right: var(--space-lg);
}

/* ---- Dots ---- */
.hst-hero-slider__dots {
    position: absolute;
    bottom: var(--space-lg);
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    gap: var(--space-sm);
}

.hst-hero-slider__dot {
    width: 9px;
    height: 9px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.5);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background-color 200ms ease, transform 200ms ease, width 200ms ease;
}

.hst-hero-slider__dot:hover {
    background: rgba(255, 255, 255, 0.8);
}

.hst-hero-slider__dot.is-active {
    background: var(--color-on-primary);
    width: 22px;
    border-radius: var(--radius-sm);
}

.hst-hero-slider__dot:focus-visible {
    outline: none;
    box-shadow: var(--shadow-glow);
}

/* ---- Visually-hidden live region (announces slide changes to screen readers) ---- */
.hst-hero-slider__status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 1023px) {
    .hst-hero-slide__heading {
        font-size: 2.75rem;
    }

    .hst-hero-slide__content {
        padding: 0 var(--space-xl) 0 calc(var(--space-xl) + 56px);
    }
}

@media (max-width: 768px) {
    .hst-hero-slider__viewport {
        /* The old `height: 70vh` sized this
           box off each PHONE's own screen proportions, completely
           disconnected from the recommended 900x1100 (9:11) portrait
           image's actual shape — e.g. a 393x852 phone gives 70vh=596px, a
           container ratio of 0.659, visibly narrower-relative-to-height
           than the image's 0.818, so `cover` crops the image's top/bottom
           to fill the width. Different phones land at different mismatched
           ratios, so the crop amount varied by device. `aspect-ratio: 9/11`
           makes the container always match the recommended image's own
           shape; max-height is just a ceiling so the hero doesn't swallow
           the whole screen on an unusually tall phone (minor top/bottom
           crop only in that one edge case, not the everyday case this
           replaces). */
        aspect-ratio: 9 / 11;
        min-height: 420px;
        max-height: 75vh;
    }

    .hst-hero-slide__content {
        max-width: 100%;
        padding: 0 var(--space-lg) 0 calc(var(--space-lg) + 40px);
    }

    .hst-hero-slide__heading {
        font-size: 2.125rem;
    }

    .hst-hero-slide__subheading {
        font-size: 1rem;
    }

    .hst-hero-slider__arrow {
        width: 38px;
        height: 38px;
    }

    .hst-hero-slider__arrow--prev {
        left: var(--space-sm);
    }

    .hst-hero-slider__arrow--next {
        right: var(--space-sm);
    }
}

@media (max-width: 400px) {
    .hst-hero-slider__viewport {
        min-height: 380px;
    }

    .hst-hero-slide__heading {
        font-size: 1.75rem;
    }
}

/* ---- Reduced motion: no autoplay, instant slide changes (handled in JS too) ---- */
@media (prefers-reduced-motion: reduce) {
    .hst-hero-slider__track {
        transition-duration: 0.01ms;
    }
}
