/* ------------------------------------------- */
/* --- 1. Conteneur Principal de la Lightbox --- */
/* ------------------------------------------- */

img.close-icon {
    width: 50px;
}
#custom-lightbox {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.9); /* Arrière-plan sombre semi-transparent */
    display: none; /* Caché par défaut, affiché par JS */
    
    /* Centrage Flexbox */
    justify-content: center;
    align-items: center;
    
    z-index: 1000; /* Priorité maximale pour passer au-dessus de tout (y compris l'en-tête) */
    opacity: 0;
    /* Transformation sans transition pour le décalage JS du scroll */
    transition: opacity 0.3s ease, transform 0s; 
    padding: 20px;
    box-sizing: border-box;
}

#custom-lightbox.is-active {
    opacity: 1; /* Rendu visible pour l'animation */
}

/* ------------------------------------------- */
/* --- 2. Contenu (Image + Légende) --- */
/* ------------------------------------------- */
.lightbox-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centrage horizontal des enfants */
    max-width: 100%;
    /* Limite la hauteur du contenu pour qu'il puisse être centré */
    max-height: 100%; 
    margin: 0; 
}

/* ------------------------------------------- */
/* --- 3. Bouton de Fermeture (la croix blanche) --- */
/* ------------------------------------------- */
/* --- Bouton de Fermeture (Disque Blanc, Croix Noire) --- */
.lightbox-close-btn {
    position: absolute;
    top: 20px!important;
    right: 20px!important;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    /* box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); */
    color: black;
    font-size: 36px;
    line-height: 50px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    z-index: 900;
    transition: transform 0.2s ease, background-color 0.2s;
    /* font-weight: bold; */
}

.lightbox-close-btn:hover {
    transform: rotate(90deg);
    background-color: #f0f0f0;
}


/* ------------------------------------------- */
/* --- 4. Image --- */
/* ------------------------------------------- */
.lightbox-image {
    
    max-width: 94vw;
   
    height: auto;
    object-fit: contain; 
    transition: all 0.3s ease-out;
}

/* ------------------------------------------- */
/* --- 5. Légende --- */
/* ------------------------------------------- */
.lightbox-caption-container {
    width: 100%;
    background-color: rgba(0, 0, 0, 0);
    padding: 15px 20px;
    text-align: center;
    box-sizing: border-box;
    display: none;
}

.lightbox-caption {
    margin: 0;
    /* Texte gris */
    color: white;
    font-weight: bold;
    font-size: 16px;
    line-height: 1.4;
}

/* ================================================= */
/* --- 6. RÉACTIVITÉ & TAILLES --- */
/* ================================================= */

/* --- Mobile (jusqu'à 1000px) --- */



   

@media (max-width: 1000px) {
    
    /* Image Pleine Largeur (100% de la fenêtre visible) */
    .lightbox-image {
        width: 100vw; 
        height: auto;
    } 



    .lightbox-close-btn {
        top: 5px; 
        right: 5px;
        width: 50px;
        height: 50px;
        font-size: 24px;
        line-height: 35px; 
    }


    /* Image Paysage (Largeur 100%) */
    .lightbox-image.is-landscape {
        width: 100vw;
        height: auto;
        max-height: 90vh; 
    }

    /* Image Portrait (Hauteur 100%) */
.lightbox-image.is-portrait {
    max-height: 100vw;
    width: auto;
    max-width: 100vw;
}
    
    .lightbox-caption-container {
        max-width: 100vw; /* Pleine largeur */
    }

    /* Ajustement du bouton de fermeture pour mobile */
    .lightbox-close-btn {
        top: 10px;
        right: 10px;
        font-size: 30px;
    }
}


/* --- PC (> 1000px) --- */
@media (min-width: 1000px) {
    
    /* Contenu (Image + Légende) limité à 800px */
    .lightbox-content {
        max-width: 800px;
    }

    /* Image Paysage (Largeur 800px max) */
    .lightbox-image.is-landscape {
        width: 800px;
        height: auto;
        max-height: 90vh;
    }

    /* Image Portrait (Hauteur 800px max) */
    .lightbox-image.is-portrait {
        height: 800px;
        width: auto;
        max-width: 800px;
    }

    /* Image par défaut (si classes non encore définies) */
.lightbox-image {
    max-width: 800px;
    height: auto;
    border-radius: 5px;
}
    
    .lightbox-caption-container {
        /* Alignement avec la largeur max de l'image PC */
        max-width: 800px; 
    }

    /* Bouton de fermeture positionné à l'extérieur */
    .lightbox-close-btn {
        top: 20px;
        right: 20px;
    }
}