/* Gallery grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr); /* Default to 3 columns */
    gap: 5px;
    padding: 10px;
    padding-bottom: 40px;
    max-width: 960px;
    margin: 2.5rem auto 0 auto;
}

@media (min-width: 600px) { .gallery-grid { --columns: 3; } }
@media (min-width: 900px) { .gallery-grid { --columns: 4; } }
@media (min-width: 1200px) { .gallery-grid { --columns: 5; } }

.picture-card {
    overflow: hidden;
    transition: transform 0.3s ease;
}

.picture-card:hover {
    transform: scale(1.03);
}

.picture-card,
.picture-card__image,
.gallery-grid > * {
    margin: 0;
    padding: 0;
}

.picture-card__image img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    cursor: pointer;
    border-radius: 5px;
}

.picture-card__contents {
    padding: 10px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    text-align: center;
}

/* Lightbox styles */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.lightbox img {
    max-width: 80%;
    max-height: 80%;
    border-radius: 8px;
}

.lightbox.active { display: flex; }

.close-lightbox {
    position: absolute;
    top: 20px;
    right: 20px;

    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;

    font-size: 28px;
    font-weight: 700;
    width: 55px;
    height: 55px;
    line-height: 55px;
    text-align: center;

    cursor: pointer;
    z-index: 1001;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: background 0.3s, transform 0.2s;
}

.close-lightbox:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.12);
}

.prev-button,
.next-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;

    /* Taille augmentée */
    font-size: 32px;
    font-weight: 600;
    width: 60px;
    height: 60px;
    line-height: 60px;

    cursor: pointer;
    z-index: 1001;
    border-radius: 50%; /* rond */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6);
    transition: background 0.3s, transform 0.2s;
    text-align: center;
}

.prev-button { left: 25px; }
.next-button { right: 25px; }

.prev-button:hover,
.next-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-50%) scale(1.12);
}

.prev-button { left: 20px; }
.next-button { right: 20px; }