/* ==========================================================================
   CS Hero Background Slider
   ========================================================================== */

.cs-hero-slider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: var(--hero-min-height, 80vh);
    overflow: hidden;
    background-color: #111;
}

/* --------------------------------------------------------------------------
   Background image stack
   -------------------------------------------------------------------------- */

.cs-hero-slider__images {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.cs-hero-slider__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    will-change: opacity, transform;
    transition: opacity 1.5s ease-in-out;
}

.cs-hero-slider__image--active {
    opacity: 1;
}

/* --------------------------------------------------------------------------
   Ken Burns — CSS-only, starts immediately on the active image.
   Each image gets its own animation cycle. The JS toggles the class.
   -------------------------------------------------------------------------- */

.cs-hero-slider__image--kb {
    animation: cs-hero-kb 10s ease-in-out forwards;
}

@keyframes cs-hero-kb {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.08) translate(-0.5%, -0.5%);
    }
}

/* Alternate direction for variety — JS applies --kb-alt on even indexes. */
.cs-hero-slider__image--kb-alt {
    animation: cs-hero-kb-alt 10s ease-in-out forwards;
}

@keyframes cs-hero-kb-alt {
    0% {
        transform: scale(1) translate(0, 0);
    }
    100% {
        transform: scale(1.08) translate(0.5%, 0.5%);
    }
}

/* Start Ken Burns on the first image immediately (no JS needed).
   Uses a data attribute so JS can remove it to take over control. */
.cs-hero-slider__image[data-kb-init] {
    animation: cs-hero-kb 10s ease-in-out forwards;
}

/* --------------------------------------------------------------------------
   Overlay
   -------------------------------------------------------------------------- */

.cs-hero-slider__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background-color: rgba(0, 0, 0, var(--hero-overlay-opacity, 0.4));
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Content
   -------------------------------------------------------------------------- */

.cs-hero-slider__content {
    position: relative;
    z-index: 2;
    max-width: 48rem;
    padding: 2rem;
    text-align: center;
    color: #fff;
}

.cs-hero-slider__eyebrow {
    margin: 0 0 0.75em;
    font-size: clamp(0.7rem, 1.2vw, 0.85rem);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    opacity: 0.85;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cs-hero-slider__heading {
    margin: 0 0 0.5em;
    font-size: clamp(2rem, 5vw, 4rem);
    font-weight: 700;
    line-height: 1.15;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.cs-hero-slider__subheading {
    margin: 0 0 1.5em;
    font-size: clamp(1rem, 2vw, 1.35rem);
    line-height: 1.5;
    opacity: 0.9;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.cs-hero-slider__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.cs-hero-slider__cta {
    display: inline-block;
    padding: 0.85em 2em;
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.cs-hero-slider__cta--primary {
    background-color: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.6);
}

.cs-hero-slider__cta--primary:hover,
.cs-hero-slider__cta--primary:focus-visible {
    background-color: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    color: #fff;
}

.cs-hero-slider__cta--secondary {
    background-color: transparent;
    border: 2px solid rgba(255, 255, 255, 0.35);
}

.cs-hero-slider__cta--secondary:hover,
.cs-hero-slider__cta--secondary:focus-visible {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.6);
    color: #fff;
}

.cs-hero-slider__cta:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Reduced motion — respect user preferences.
   Disables Ken Burns and crossfade; shows first image only, static.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .cs-hero-slider__image {
        animation: none !important;
        transition: none !important;
    }
}
