/* ==========================================================
   Hero Slider — Homepage Module
   Image-only slides, rounded frame, white dots bottom center.
   Markup: inc/hero-slider.php   Behavior: js/hero-slider.js (Slick)
   Loads after slick.css (core only, no slick-theme.css).
   ========================================================== */

.hero-slider {
    /* Corner radius and outer gutter scale with the viewport. */
    --hero-radius: clamp(10px, 1.25vw, 20px);
    --hero-gutter: clamp(12px, 1.6vw, 25px);
    --hero-ratio: var(--hero-ratio-desktop, 24 / 11);

    padding: var(--hero-gutter);
}

/* Match the <source media> breakpoint in hero-slider.php. */
@media (max-width: 960px) {
    .hero-slider {
        --hero-ratio: var(--hero-ratio-mobile, 4 / 5);
    }
}

.hero-slider__viewport {
    position: relative;
    overflow: hidden;
    border-radius: var(--hero-radius);
    background: var(--color-gray-900);
    /* Keeps the clipped corners crisp while Slick transforms the track in Safari. */
    isolation: isolate;
    -webkit-mask-image: -webkit-radial-gradient(white, black);
}

/* Before Slick starts, show only the first slide (no stacked-image flash). */
.hero-slider__track:not(.slick-initialized) .hero-slider__slide + .hero-slider__slide {
    display: none;
}

.hero-slider__link {
    display: block;
}

.hero-slider__link:focus-visible {
    outline: 3px solid var(--color-white);
    outline-offset: -6px;
    border-radius: var(--hero-radius);
}

.hero-slider__slide picture {
    display: block;
}

.hero-slider__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--hero-ratio);
    object-fit: cover;
    user-select: none;
    -webkit-user-drag: none;
}

/* ── Paging dots (Slick builds the list) ──── */
.hero-slider__controls {
    position: absolute;
    left: 0;
    right: 0;
    bottom: clamp(8px, 1.4vw, 20px);
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
}

.hero-slider__dots {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    pointer-events: auto;
}

.hero-slider__dots li {
    margin: 0;
    padding: 0;
}

/* 24px hit area, 8px visible dot. */
.hero-slider__dot {
    position: relative;
    display: block;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.hero-slider__dot::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--color-white);
    opacity: 0.45;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.35);
    transition: opacity 250ms ease, transform 250ms ease;
}

.hero-slider__dot:hover::before {
    opacity: 0.8;
}

.hero-slider__dots .slick-active .hero-slider__dot::before {
    opacity: 1;
    transform: scale(1.15);
}

.hero-slider__dot:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: -3px;
    border-radius: 50%;
}

/* ── Pause / play ──────────────────────────── */
.hero-slider__pause {
    position: absolute;
    right: clamp(8px, 1.4vw, 20px);
    bottom: clamp(8px, 1.4vw, 20px);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    color: var(--color-white);
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 200ms ease, background-color 200ms ease;
}

.hero-slider__pause[hidden] {
    display: none;
}

.hero-slider__pause:hover,
.hero-slider__pause:focus-visible {
    opacity: 1;
    background: rgba(0, 0, 0, 0.6);
}

.hero-slider__pause:focus-visible {
    outline: 2px solid var(--color-white);
    outline-offset: 2px;
}

.hero-slider__pause svg {
    width: 12px;
    height: 12px;
    fill: currentColor;
}

.hero-slider__icon-play,
.hero-slider.is-paused .hero-slider__icon-pause {
    display: none;
}

.hero-slider.is-paused .hero-slider__icon-play {
    display: block;
}
