/* ==========================================================================
   Galerie Techich Frères — grille 3 images / ligne
   ========================================================================== */

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    list-style: none;
    margin: 24px 0;
    padding: 0;
}

.gallery__item {
    margin: 0;
}

.gallery__link {
    display: block;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
    line-height: 0;
}

.gallery__img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.gallery__link:hover .gallery__img,
.gallery__link:focus-visible .gallery__img {
    transform: scale(1.05);
}

/* Tablette : 2 images par ligne (desktop-first, max-width) */
@media (max-width: 900px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* Mobile : 1 image par ligne */
@media (max-width: 560px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.25);
}

.lightbox--open {
    display: flex;
}

.lightbox__stage {
    position: relative;
    display: inline-block;
    max-width: 90vw;
    max-height: 85vh;
}

.lightbox__img {
    display: block;
    max-width: 90vw;
    max-height: 85vh;
    width: auto;
    height: auto;
    border: 3px solid;
}

/* Bouton fermer */
.lightbox__close {
    position: absolute;
    top: -16px;
    right: -24px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

/* Flèches */
.lightbox__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.lightbox__nav--prev {
    left: -60px;
}

.lightbox__nav--next {
    right: -60px;
}

.lightbox__counter {
    position: absolute;
    bottom: -35px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
}

@media (max-width: 768px) {
    .lightbox__nav--prev {
        left: 10px;
    }

    .lightbox__nav--next {
        right: 10px;
    }

    .lightbox__close {
        top: 8px;
        right: 8px;
        width: 36px;
        height: 36px;
    }
}