/* ================================================================
   BEN-BATI — HERO SLIDER
   Carrusel fade-in/fade-out con imágenes existentes
   CSS puro + vanilla JS | 60 FPS GPU-accelerated
   ================================================================ */

/* ================================================================
   1. CONTENEUR DU SLIDER
   ================================================================ */
.hero-slider {
    position: absolute;
    inset: 0;
    z-index: -2;
    overflow: hidden;
}

/* ================================================================
   2. CHAQUE SLIDE — Empilé en absolute, opacité 0 par défaut
   ================================================================ */
.hero-slider__slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: opacity;
}

/* Slide actif */
.hero-slider__slide.is-active {
    opacity: 1;
}

/* Slide en transition de sortie (légèrement plus rapide) */
.hero-slider__slide.is-leaving {
    opacity: 0;
    transition: opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ================================================================
   3. IMAGE DANS CHAQUE SLIDE — Cover, centrée, zoom lent
   ================================================================ */
.hero-slider__slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Zoom progressif subtil pendant que la slide est active */
    animation: hero-ken-burns 18s ease-in-out infinite;
}

/* Ralentir le ken burns quand la slide n'est pas active */
.hero-slider__slide:not(.is-active) img {
    animation: none;
}

@keyframes hero-ken-burns {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.08); }
    100% { transform: scale(1); }
}

/* ================================================================
   4. FALLBACK — Image de fond statique (quand JS désactivé)
   ================================================================ */
.hero-slider__fallback {
    position: absolute;
    inset: 0;
    z-index: -3;
}

.hero-slider__fallback img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Cacher le fallback quand JS active le slider */
.hero.has-slider .hero-slider__fallback {
    display: none;
}

/* ================================================================
   5. OVERLAY — Assombrissement pour lisibilité du texte
   ================================================================ */
.hero-slider__overlay {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: linear-gradient(
        135deg,
        rgba(11, 31, 54, 0.9) 0%,
        rgba(11, 31, 54, 0.72) 40%,
        rgba(11, 31, 54, 0.52) 100%
    );
    pointer-events: none;
}

/* ================================================================
   6. INDICATEURS (DOTS) — Discrets, élégants
   ================================================================ */
.hero-slider__dots {
    position: absolute;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
    display: flex;
    gap: 10px;
    padding: 6px;
}

.hero-slider__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.35);
    background: transparent;
    cursor: pointer;
    transition:
        background 0.35s ease,
        border-color 0.35s ease,
        transform 0.3s ease,
        box-shadow 0.35s ease;
    padding: 0;
    outline: none;
}

.hero-slider__dot:hover {
    border-color: rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.15);
    transform: scale(1.2);
}

.hero-slider__dot:focus-visible {
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5);
}

/* Dot actif */
.hero-slider__dot.is-active {
    background: var(--cta-amber, #f59e0b);
    border-color: transparent;
    transform: scale(1.15);
    box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
}

/* ================================================================
   7. FLÈCHES — Minimalistes, apparaissent au hover
   ================================================================ */
.hero-slider__arrows {
    position: absolute;
    inset: 0;
    z-index: 5;
    pointer-events: none;
}

.hero-slider__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: auto;
    transition:
        opacity 0.4s ease,
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.3s ease;
    padding: 0;
    outline: none;
}

.hero-slider__arrow--prev { left: 24px; }
.hero-slider__arrow--next { right: 24px; }

/* Apparition au survol du hero */
.hero:hover .hero-slider__arrow {
    opacity: 1;
}

.hero-slider__arrow:hover {
    background: rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.45);
    color: #ffffff;
    transform: translateY(-50%) scale(1.08);
}

.hero-slider__arrow:focus-visible {
    opacity: 1;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.5);
}

/* Icône flèche */
.hero-slider__arrow svg {
    width: 20px;
    height: 20px;
}

/* ================================================================
   8. PAUSE AU HOVER — Ralentissement visuel via JS
   ================================================================ */

/* Quand le slider est en pause, le ken burns continue mais pas de transition */
.hero-slider.is-paused .hero-slider__slide.is-active img {
    animation-play-state: paused;
}

/* ================================================================
   9. RESPONSIVE
   ================================================================ */
@media (max-width: 639px) {
    .hero-slider__dots {
        bottom: 80px;
        gap: 8px;
    }

    .hero-slider__dot {
        width: 8px;
        height: 8px;
    }

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

    .hero-slider__arrow--prev { left: 12px; }
    .hero-slider__arrow--next { right: 12px; }

    @keyframes hero-ken-burns {
        0%   { transform: scale(1); }
        50%  { transform: scale(1.04); }
        100% { transform: scale(1); }
    }
}

@media (min-width: 1024px) {
    .hero-slider__dots {
        bottom: 120px;
    }
}

/* ================================================================
   10. REDUCED MOTION — Pas d'animation ken burns
   ================================================================ */
@media (prefers-reduced-motion: reduce) {
    .hero-slider__slide img {
        animation: none !important;
    }
    .hero-slider__slide {
        transition: none !important;
    }
}
