/* Styles généraux */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f0f2f5;
    margin: 0;
    padding: 2rem;
    color: #333;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    margin-bottom: 0.5rem;
}

code {
    background-color: #e0e0e0;
    padding: 0.2em 0.4em;
    border-radius: 3px;
}

/* Grille de la galerie */
.gallery-container {
    display: grid;
    /* Crée des colonnes de taille égale, qui s'adaptent à la largeur de l'écran */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.gallery-item {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.gallery-item:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Assure que l'image remplit son conteneur sans se déformer */
    display: block;
    cursor: pointer;
}

.no-images {
    grid-column: 1 / -1; /* Prend toute la largeur de la grille */
    text-align: center;
    font-size: 1.2rem;
    color: #888;
}

/* Styles du Lightbox (caché par défaut) */
.lightbox {
    display: none; /* Initialement caché */
    position: fixed; /* Reste en place même si on scrolle */
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    /* Centrage de l'image avec Flexbox */
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0; /* Pour l'animation d'apparition */
    transition: opacity 0.3s ease;
    visibility: hidden;
}

/* Classe ajoutée par JS pour afficher le lightbox */
.lightbox.show {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
}

/* Bouton pour fermer */
.close-btn {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.close-btn:hover {
    color: #bbb;
}

/* Animation de zoom */
@keyframes zoomIn {
    from {
        transform: scale(0.8);
    }
    to {
        transform: scale(1);
    }
}