.section-gallery {
    width: 80%;
    margin: 97px auto;
    background: #f4f4f4;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#javascript-gallery {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    gap: 15px;
}

.gallery-card {
    width: calc(33.333% - 15px);
    max-width: 250px;
    height: 250px;
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card:hover img {
    transform: scale(1.1);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
    transition: background 0.3s ease;
}

.title {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 10px;
}

.description {
    display: none; /* Masquer par défaut */
    font-size: 0.9em;
    text-align: center;
    padding-top: 5px;
}

.gallery-card:hover .description,
.gallery-card.active .description {
    display: block; /* Afficher la description au survol ou au clic */
}

/* Media Queries pour l'adaptation mobile */
@media (max-width: 768px) {
    .section-gallery {
        width: 90%;
        padding: 10px;
    }

    #javascript-gallery {
        gap: 10px;
    }

    .gallery-card {
        width: calc(50% - 10px); /* Deux cartes par ligne */
        height: 200px;
    }

    .description {
        font-size: 0.8em;
    }
}

@media (max-width: 480px) {
    .section-gallery {
        width: 100%;
    }

    .gallery-card {
        width: calc(50% - 5px); /* Toujours deux cartes par ligne */
        height: 180px; /* Réduction de la hauteur */
    }

    .title {
        font-size: 1em;
    }

    .description {
        font-size: 0.75em;
    }
}
