/* Grille 4 colonnes avec rangées fixes */
.full_width_images .inner-container.gallery-mosaic {
    padding: 15px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 180px;
    grid-auto-flow: dense;
    gap: 10px;
    background-color: #ffffff;
}

/* Paysage : 2 colonnes × 1 rangée */
.gallery-item.span-wide {
    grid-column: span 2;
    grid-row: span 1;
}

/* Portrait : 1 colonne × 2 rangées */
.gallery-item.span-tall {
    grid-column: span 1;
    grid-row: span 2;
}

/* Carré / non classifié : 1 × 1 */
.gallery-item:not(.span-wide):not(.span-tall) {
    grid-column: span 1;
    grid-row: span 1;
}

/* Image interne — cover strict, jamais de trou */
.gallery-item {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
    border-radius: 2px;
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    cursor: pointer;
    display: block;
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1), filter 0.3s ease;
}

.gallery-img:hover {
    transform: scale(1.02);
    filter: brightness(0.9);
}

/* Lightbox */
dialog#lightbox {
    border: none;
    background: transparent;
    max-width: 95vw;
    max-height: 95vh;
    padding: 0;
}

dialog#lightbox::backdrop {
    background: rgba(10, 10, 15, 0.85);
    backdrop-filter: blur(5px);
}

dialog#lightbox img {
    max-width: 100%;
    max-height: 95vh;
    display: block;
    margin: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}

/* Tablette */
@media screen and (max-width: 900px) {
    .full_width_images .inner-container.gallery-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 150px;
        gap: 6px;
    }

    .gallery-item.span-wide {
        grid-column: span 2;
        grid-row: span 1;
    }

    .gallery-item.span-tall {
        grid-column: span 1;
        grid-row: span 2;
    }
}

/* Mobile */
@media screen and (max-width: 500px) {
    .full_width_images .inner-container.gallery-mosaic {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 120px;
        gap: 4px;
    }

    .gallery-item.span-wide {
        grid-column: span 2;
        grid-row: span 1;
    }

    .gallery-item.span-tall {
        grid-column: span 1;
        grid-row: span 2;
    }
}

.gallery-btn {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}