/*
 * NexCore Starter Theme
 * Page Section Hero Slideshow
 * Version: 1.0.0
 *
 * Slideshow-specific presentation.
 *
 * Responsibilities:
 * - keep every Hero slide at exactly the same height
 * - stack slides in one visual stage
 * - prevent inactive slides from entering document flow
 * - provide a clean fade transition
 * - prevent interaction with inactive slides
 * - keep slideshow controls above the slides
 * - respect reduced-motion preferences
 */

/* ==========================================================================
   1. Slideshow Stage
   ========================================================================== */

.js-enabled.page-section--hero-slideshow,
.js-enabled .page-section--hero-slideshow {
    position: relative;

    /*
     * One stable Hero height for the entire slideshow.
     * Individual slide content must not resize the slideshow.
     */
    height: clamp(432px, 48vh, 532px);
    min-height: 432px;

    overflow: hidden;
    background: #0f172a;
}

/* ==========================================================================
   2. Slides
   ========================================================================== */

.js-enabled
.page-section--hero-slideshow
.page-section-hero__slide {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: center;

    width: 100%;
    height: 100%;
    min-height: 0;

    /*
     * Keep the existing desktop Hero spacing while making it part
     * of the fixed slideshow stage rather than slide-driven height.
     */
    padding: 96px 0;

    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    z-index: 1;

    transition:
        opacity 450ms ease,
        visibility 0s linear 450ms;
}

/* ==========================================================================
   3. Active Slide
   ========================================================================== */

.js-enabled
.page-section--hero-slideshow
.page-section-hero__slide.is-active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;

    z-index: 2;

    transition:
        opacity 450ms ease,
        visibility 0s linear 0s;
}

/* ==========================================================================
   4. Controls
   ========================================================================== */

.js-enabled
.page-section--hero-slideshow
.page-section-hero__arrow,
.js-enabled
.page-section--hero-slideshow
.page-section-hero__dots,
.js-enabled
.page-section--hero-slideshow
.page-section-hero__autoplay-toggle {
    z-index: 10;
}

.js-enabled
.page-section--hero-slideshow
.page-section-hero__autoplay-toggle {
    position: absolute;
    right: 24px;
    bottom: 24px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 40px;
    height: 40px;
    padding: 0;

    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;

    background: rgba(15, 23, 42, 0.72);
    color: #ffffff;

    font: inherit;
    font-size: 16px;
    line-height: 1;

    cursor: pointer;

    transition:
        background-color 180ms ease,
        border-color 180ms ease,
        transform 180ms ease;
}

.js-enabled
.page-section--hero-slideshow
.page-section-hero__autoplay-toggle:hover {
    background: rgba(15, 23, 42, 0.92);
    border-color: rgba(255, 255, 255, 0.8);
}

.js-enabled
.page-section--hero-slideshow
.page-section-hero__autoplay-toggle:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.js-enabled
.page-section--hero-slideshow
.page-section-hero__autoplay-toggle:active {
    transform: scale(0.96);
}

/* ==========================================================================
   5. Tablet / Mobile
   ========================================================================== */

@media (max-width: 800px) {
    .js-enabled.page-section--hero-slideshow,
    .js-enabled .page-section--hero-slideshow {
        height: 404px;
        min-height: 404px;
    }

    .js-enabled
    .page-section--hero-slideshow
    .page-section-hero__slide {
        height: 100%;
        min-height: 0;
        padding: 72px 0;
    }
}

/* ==========================================================================
   6. Small Mobile
   ========================================================================== */

@media (max-width: 480px) {
    .js-enabled.page-section--hero-slideshow,
    .js-enabled .page-section--hero-slideshow {
        height: 374px;
        min-height: 374px;
    }

    .js-enabled
    .page-section--hero-slideshow
    .page-section-hero__slide {
        height: 100%;
        min-height: 0;
        padding: 64px 0 72px;
    }

    .js-enabled
    .page-section--hero-slideshow
    .page-section-hero__autoplay-toggle {
        right: 16px;
        bottom: 16px;
        width: 38px;
        height: 38px;
    }
}

/* ==========================================================================
   7. Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
    .js-enabled
    .page-section--hero-slideshow
    .page-section-hero__slide,
    .js-enabled
    .page-section--hero-slideshow
    .page-section-hero__slide.is-active {
        transition: none;
    }
}