/* Carrousel */
.carousel {
    width: 458px; /* Largeur pour afficher 3 vignettes : 140px * 3 + 2 gaps de 15px */
    padding: 5px;
    margin-top: 30px;
    border-radius: 12px;
    background: #fff;
    position: relative;
    overflow: hidden; /* Empêche l’affichage des vignettes hors cadre */
}

/* nom pour texte sur vidéo */

#video-title {
    position: absolute;
    top: 10%;          /* ajuste selon besoin */
    left: 50%;
    transform: translateX(-50%);
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 0 0 5px black;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none; /* clic passe à la vidéo */
    white-space: nowrap;
}


/* Boutons */
.carousel-button:hover {
    background: rgba(175, 175, 175, 0.8);
}

.carousel-button.prev { left: 5px; }
.carousel-button.next { right: 5px; }

/* Piste du carrousel */
.carousel-track {
    display: flex;
    justify-content: flex-start;
    width: 100%;
}

/* Contenu du carrousel */
.carousel-track-inner {
    display: flex;
    gap: 15px;
    width: max-content;
    transition: transform 0.4s ease;
}

/* Correction essentielle : taille fixe des vignettes */
.thumb {
    flex: 0 0 140px; /* Force exactement 3 vignettes visibles */
}

/* Images */
.carousel img {
    width: 140px;
    height: 100px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    flex-shrink: 0;
    box-shadow: 0 0 10px rgba(0,0,0,0.4);
    transition: transform .2s, box-shadow .2s;
}

.carousel img:hover {
    transform: scale(1.05);
    box-shadow: 0 0 15px rgba(0,0,0,0.6);
}

/* Container global */
.card-container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Responsive */
@media screen and (max-width: 900px) {

    .carousel {
        width: 100%;
    }

    .carousel img {
        width: 100px;
        height: 70px;
    }

    .thumb {
        flex: 0 0 100px; /* adaptation responsive */
    }

    .carousel-button {
        width: 25px;
        height: 50px;
        font-size: 20px;
    }
}

/* Décalage des boutons uniquement sur grand écran */
@media screen and (min-width: 901px) {
    .carousel-button.prev {
        left: 100px;
    }

    .carousel-button.next {
        right: 100px;
    }
}
