/* Lightbox de base */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 10px;
    box-sizing: border-box;
    overflow-y: auto; /* ✅ permet le scroll vertical si contenu dépasse */
}

/* Contenu principal */
.lightbox-content {
    background: #1e1e1e;
    width: 80%;
    max-width: 1000px;
    max-height: 90vh; /* ✅ limite à la hauteur de l’écran */
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    flex-direction: row; /* image gauche + texte droite sur PC */
    box-sizing: border-box;
}

/* Partie gauche - image principale + carrousel */
/* Partie gauche - image principale + carrousel */
.lightbox-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 10px;
    box-sizing: border-box;
}

.lightbox-left img {
    flex: 1; /* prend toute la hauteur restante */
    width: 100%;
    object-fit: cover;
    border-radius: 10px;
}


/* Carrousel */
.carousel {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: flex-start;
    overflow-x: auto;
    flex-shrink: 0;
}

.carousel img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
    flex-shrink: 0;
}
.carousel img:hover {
    border: 2px solid #ff6600;
}

/* Partie droite - texte */
.lightbox-right {
    flex: 1;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow-y: auto; /* ✅ scroll si texte trop long */
    max-height: 90vh; /* limite au viewport */
}

/* Bouton de fermeture */
.close {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 30px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    z-index: 10;
    transition: color 0.2s ease;
}
.close:hover {
    color: orange;
}

/* === Responsive === */

/* Tablette / petit PC */
@media (max-width: 1024px) {
    .lightbox-content {
        flex-direction: column; /* ✅ image au-dessus, texte en dessous */
        width: 95%;
        max-height: 95vh;
        overflow-y: auto; /* ✅ scroll vertical si besoin */
    }

    .lightbox-left img {
        max-height: 50vh; /* ✅ réduit l’image */
    }

    .lightbox-left, .lightbox-right {
        width: 100%;
        padding: 8px;
    }

    .carousel {
        justify-content: center;
        margin-top: 5px;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .lightbox-left img {
        max-height: 45vh;
    }

    .close {
        top: 5px;
        right: 5px;
        font-size: 25px;
    }
}

/* Très petit mobile */
@media (max-width: 480px) {
    .lightbox-left img {
        max-height: 40vh;
    }

    .close {
        top: 3px;
        right: 3px;
        font-size: 22px;
    }

    .carousel img {
        width: 60px;
        height: 60px;
    }
}
