/*
 * Styles spécifiques pour la page d'accueil (slideshow et recherche).
 * Version corrigée : transition séquentielle 1 > 2 > 3 sans mélange visuel.
 */

.vs-hero {
    position: relative;
    overflow: hidden;
    background: #000 url('/assets/images/hero-serris.webp') center center / cover no-repeat;
}

.vs-hero-slides {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: url('/assets/images/hero-serris.webp') center center / cover no-repeat;
}

.vs-hero-slides .vs-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    z-index: 0;
    animation-name: vsHeroCycle;
    animation-duration: 18s;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-fill-mode: both;
    will-change: opacity;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.vs-hero-slides .vs-hero-img:nth-child(1) {
    animation-delay: 0s;
}

.vs-hero-slides .vs-hero-img:nth-child(2) {
    animation-delay: 6s;
}

.vs-hero-slides .vs-hero-img:nth-child(3) {
    animation-delay: 6s;
}

/*
 * Cycle par image :
 * - apparition rapide
 * - affichage stable
 * - disparition rapide
 * - reste cachée le reste du temps
 *
 * Les délais 0 / 6 / 12 s créent une séquence stricte : 1 puis 2 puis 3.
 */
@keyframes vsHeroCycle {
    0% {
        opacity: 0;
    }
    4% {
        opacity: 1;
    }
    29% {
        opacity: 1;
    }
    33.333% {
        opacity: 0;
    }
    100% {
        opacity: 0;
    }
}

/* overlay toujours au-dessus des images */
.vs-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* contenu toujours au-dessus de l'overlay */
.vs-hero-content {
    position: relative;
    z-index: 2;
}

/* Recherche dans le hero */
.vs-hero-search {
    display: flex;
    flex-wrap: nowrap;
    max-width: 600px;
    margin: 20px 0;
    border-radius: 999px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.9);
}

.vs-hero-search input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 1rem;
    border-radius: 999px 0 0 999px;
    outline: none;
}

.vs-hero-search button {
    padding: 0 20px;
    border: none;
    background: var(--vs-blue);
    color: #fff;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0 999px 999px 0;
}

.vs-hero-search button:hover {
    background: var(--vs-blue-dark);
}
