/* Galerie - Granulés de Provence */

.realisations {
    --gallery-orange: #EA9531;
    --gallery-green: #00760E;
    --gallery-dark: #2B2B2B;

    color: var(--gallery-dark);
    padding-bottom: 60px;
}

.realisations-hero {
    padding: 75px 24px 45px;
    text-align: center;
    background:
        radial-gradient(ellipse at top, #fff 0%, #F7FAF4 75%);
}

.realisations-hero .eyebrow {
    margin-bottom: 14px;
    color: var(--gallery-green);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.realisations-hero h1 {
    margin-bottom: 18px;
}

.realisations-hero > p:last-child {
    max-width: 620px;
    margin: 0 auto;
    color: #666;
}

.gallery-section {
    width: min(1200px, 100%);
    margin: 0 auto;
    padding: 30px 24px 55px;
}

.gallery-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 35px;
}

.filter-btn {
    padding: 10px 17px;
    border: 1px solid #e2e6dc;
    border-radius: 30px;
    background: #fff;
    color: var(--gallery-dark);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--gallery-green);
    color: #fff;
    border-color: var(--gallery-green);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 24px;
}

.gallery-item {
    min-width: 0;
    animation: galleryAppear .35s ease both;
}

.gallery-item[hidden] {
    display: none;
}

.photo-button {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 15px;
    background: #ecefe8;
    cursor: zoom-in;
    aspect-ratio: 3 / 4;
    text-align: left;
}

.photo-button img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .5s ease;
}

.photo-button:hover img,
.photo-button:focus-visible img {
    transform: scale(1.06);
}

.photo-overlay {
    position: absolute;
    inset: auto 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 35px 16px 15px;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    background: linear-gradient(transparent, rgba(0,0,0,.7));
    opacity: 0;
    transition: opacity .25s ease;
}

.photo-button:hover .photo-overlay,
.photo-button:focus-visible .photo-overlay {
    opacity: 1;
}

.zoom-icon {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 50%;
    font-size: 23px;
    font-weight: 400;
}

.gallery-item h2 {
    margin: 14px 0 5px;
    font-size: 17px;
}

.gallery-item > p {
    color: #777;
    font-size: 13px;
    line-height: 1.5;
}

.gallery-note {
    margin-top: 28px;
    color: #777;
    font-size: 12px;
    text-align: center;
}

.gallery-contact {
    margin: 0 24px;
    padding: 48px 24px;
    border-radius: 20px;
    background: #edf4e9;
    text-align: center;
}

.gallery-contact h2 {
    font-size: clamp(24px, 3vw, 34px);
}

.gallery-contact p {
    margin-bottom: 24px;
    color: #666;
}

.gallery-contact-btn {
    display: inline-block;
    padding: 13px 22px;
    border-radius: 10px;
    background: var(--gallery-orange);
    color: #fff;
    font-weight: 800;
    transition: background .2s;
}

.gallery-contact-btn:hover {
    background: #d77e20;
    color: #fff;
}

/* Visionneuse */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 65px 70px;
    background: rgba(16, 18, 16, .94);
}

.lightbox.is-open {
    display: flex;
}

.lightbox figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.lightbox figure img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    width: auto;
    height: auto;
    object-fit: contain;
}

.lightbox figcaption {
    color: #fff;
    text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 50%;
    background: rgba(255,255,255,.1);
    color: #fff;
    cursor: pointer;
}

.lightbox-close {
    top: 18px;
    right: 22px;
    width: 44px;
    height: 44px;
    font-size: 30px;
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    width: 46px;
    height: 46px;
    transform: translateY(-50%);
    font-size: 34px;
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox button:hover {
    background: var(--gallery-green);
}

body.lightbox-open {
    overflow: hidden;
}

@keyframes galleryAppear {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 850px) {
    .gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 16px;
    }

    .photo-overlay {
        opacity: 1;
    }
}

@media (max-width: 520px) {
    .realisations-hero {
        padding: 45px 20px 30px;
    }

    .gallery-section {
        padding: 25px 15px 40px;
    }

    .gallery-filters {
        justify-content: flex-start;
        gap: 8px;
        margin-bottom: 24px;
    }

    .filter-btn {
        padding: 9px 12px;
        font-size: 12px;
    }

    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .gallery-item h2 {
        font-size: 16px;
    }

    .gallery-contact {
        margin: 0 15px;
        padding: 35px 20px;
    }

    .lightbox {
        padding: 55px 15px;
    }

    .lightbox-prev { left: 8px; }
    .lightbox-next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-item {
        animation: none;
    }

    .photo-button img {
        transition: none;
    }
}