.bienvenue {
    display :block;
    text-align: center;
    background: linear-gradient(rgba(0, 0, 0, 0.503),rgba(0, 0, 0, 0.526)), 
    url('images/Galerie.webp');

    background-size:cover; /* Ajuste l'image pour qu'elle couvre tout le bloc */
    background-position: center; /* Centre l'image */
    background-repeat: no-repeat; /* Empêche la répétition */
    background-attachment: fixed;
    opacity: var(--Opacity);
    
    border-radius: 20px;
}

.BePatient {
    display: flex;
    flex-direction: column;
    
    background-color: var(--FondColor2);
    color: var(--TextColor2);
    margin-top: 25px;
    margin-bottom: 25px;
    border-radius: 15px;
    padding: 2%;
}


#gallery-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    overflow:visible;
    transition: max-height 0.5s ease-out; /* Animation de collapse */
}

#gallery-container.collapsed {
    max-height: 0;
    display: flex; /* Important pour garder la structure flex */
    opacity: 0%; /* Effet de transition sur l'opacité */
}

.gallery-image {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);

    transition: transform 0.3s ease; /* Transition douce pour le survol */
    z-index: 1;
}

.gallery-image:hover {
    transform: scale(1.1); /* Effet d'agrandissement lors du survol */
    box-shadow: 0px 0px 15px rgba(0, 0, 0, 1); /* Ombre légère pour un effet organique */
    z-index: 2;
}

/* Modal */
.modal {
    display: none; /* Cache le modal par défaut */
    position: fixed; /* Fixe le modal en haut de la page */
    z-index: 2000; /* Place le modal au-dessus du contenu */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fond semi-transparent */
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* Image dans le modal */
.modal-content {
    max-width: 80%;
    max-height: 80%;
    border-radius: 20px;
}

/* Le bouton de fermeture (la croix) */
.close {
    position: absolute;
    top: 5%;
    right: 15%;
    color: var(--TextColor);
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s ease; /* Durée de 0.3s avec une transition fluide */
}

/* Change la couleur de la croix au survol */
.close:hover {      
    text-decoration: none;
    cursor: pointer;
    transform: rotate(90deg); /* Rotation de 45 degrés */
}




@media screen and (max-width: 900px) {
    .bienvenue {
        /*background-attachment: scroll;*/
        background: linear-gradient(rgba(0, 0, 0, 0.503),rgba(0, 0, 0, 0.526)), 
        url('images/Galerie_50.webp');

        background-size:cover; /* Ajuste l'image pour qu'elle couvre tout le bloc */
        background-position: center; /* Centre l'image */
        background-repeat: no-repeat; /* Empêche la répétition */
        background-attachment: scroll;
        padding: 5%;
    }

    .gallery-image {
        width: 150px;
        height: 150px;
        object-fit: cover;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.5);
    }
}