/* ========================================
   Customisation Modal Bootstrap (Desktop)
   ======================================== */

/* Backdrop plus sombre et flouté (C'est ce réglage spécifique de transparence) */
.modal-backdrop.show {
    opacity: 0.85; /* Plus sombre que le défaut 0.5 */
    backdrop-filter: blur(5px); /* Effet de flou moderne */
}

/* Ajustement de la modale */
#imageModalBootstrap .modal-content {
    background-color: transparent;
    box-shadow: none;
    border: none;
}

#imageModalBootstrap .modal-body {
    padding: 0;
    /* Centrage absolu du contenu */
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    width: 100%;
}

/* Correction du conteneur <figure> pour centrer l'image */
#imageModalBootstrap figure {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

/* Image : Hauteur réduite et centrage forcé */
#imageModalBootstrap img {
    max-height: 80vh; /* Ajusté pour laisser de la place au texte */
    width: auto;
    max-width: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.5);
    display: block; /* Important pour le centrage */
}

/* Légende stylisée (Alt text) */
#modalCaptionBootstrap {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(4px);
    padding: 8px 24px;
    border-radius: 50px;
    display: inline-block;
    margin-top: 15px;
    font-weight: 500;
    font-size: 1rem;
    color: #fff;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Bouton de fermeture ajusté */
#imageModalBootstrap .btn-close {
    background-color: white;
    opacity: 0.9;
    padding: 10px;
    border-radius: 50%;
    position: absolute;
    top: -20px; 
    right: 0;
    z-index: 1050;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
    transition: transform 0.2s ease;
}

#imageModalBootstrap .btn-close:hover {
    transform: scale(1.1) rotate(90deg);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #imageModalBootstrap img {
        max-height: 70vh;
    }
    #imageModalBootstrap .btn-close {
        top: 10px;
        right: 10px;
    }
}
