/* Galerie consolidée de la fiche d'un bien */

.photo-count {
    color: var(--muted, #6b7785);
    font-size: 14px;
    font-weight: 700;
}

.property-gallery {
    margin-top: 20px;
}

.gallery-main {
    position: relative;
    min-height: 420px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border-radius: 14px;
    background: #111820;
}

.gallery-main-button {
    width: 100%;
    height: 560px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.gallery-main-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    font-size: 38px;
    line-height: 1;
    cursor: pointer;
    transform: translateY(-50%);
}

.gallery-nav:hover {
    background: rgba(0, 0, 0, .78);
}

.gallery-prev { left: 16px; }
.gallery-next { right: 16px; }

.gallery-counter {
    position: absolute;
    right: 16px;
    bottom: 14px;
    z-index: 3;
    padding: 6px 10px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .65);
    font-size: 13px;
    font-weight: 800;
}

.gallery-meta {
    min-height: 48px;
    padding: 12px 2px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    color: var(--muted, #6b7785);
    font-size: 13px;
}

.gallery-meta strong {
    color: var(--ink, #18212b);
}

.gallery-thumbnails {
    display: flex;
    gap: 10px;
    padding: 4px 0 10px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
}

.gallery-thumbnail {
    position: relative;
    flex: 0 0 150px;
    width: 150px;
    height: 105px;
    padding: 0;
    overflow: hidden;
    border: 3px solid transparent;
    border-radius: 9px;
    background: #e9eef2;
    cursor: pointer;
    scroll-snap-align: center;
}

.gallery-thumbnail.is-active {
    border-color: var(--brand, #184e77);
}

.gallery-thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-thumbnail span {
    position: absolute;
    left: 6px;
    bottom: 6px;
    padding: 3px 6px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .65);
    font-size: 10px;
    font-weight: 800;
}

.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: grid;
    place-items: center;
    padding: 36px 84px;
    background: rgba(0, 0, 0, .92);
}

.photo-lightbox[hidden] {
    display: none;
}

.lightbox-image {
    display: block;
    max-width: 94vw;
    max-height: 86vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .5);
}

.lightbox-close,
.lightbox-nav {
    position: fixed;
    z-index: 2001;
    border: 0;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    cursor: pointer;
}

.lightbox-close {
    top: 18px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 34px;
}

.lightbox-nav {
    top: 50%;
    width: 54px;
    height: 70px;
    border-radius: 10px;
    font-size: 42px;
    transform: translateY(-50%);
}

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

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(255, 255, 255, .28);
}

.lightbox-caption {
    position: fixed;
    left: 50%;
    bottom: 18px;
    max-width: 80vw;
    padding: 8px 13px;
    border-radius: 999px;
    color: #fff;
    background: rgba(0, 0, 0, .62);
    font-size: 13px;
    transform: translateX(-50%);
}

body.modal-open {
    overflow: hidden;
}

@media (max-width: 850px) {
    .gallery-main-button {
        height: 420px;
    }

    .gallery-meta {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
    }
}

@media (max-width: 600px) {
    .gallery-main {
        min-height: 260px;
    }

    .gallery-main-button {
        height: 300px;
    }

    .gallery-nav {
        width: 40px;
        height: 40px;
        font-size: 31px;
    }

    .gallery-thumbnail {
        flex-basis: 112px;
        width: 112px;
        height: 78px;
    }

    .photo-lightbox {
        padding: 64px 12px;
    }

    .lightbox-nav {
        width: 42px;
        height: 58px;
    }

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