/* ─── Overlay ─── */
#lb_overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    z-index: 9999;
    display: flex;
    /* JS change en flex */
    align-items: center;
    justify-content: center;
    flex-direction: column;
    clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
}

#lb_overlay.open {
    clip-path: polygon(0 0, 100% 0, 100% 100%, 0% 100%);
}

/* ─── Image principale ─── */
#lb_img_wrap {
    position: relative;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

#lb_img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, .6);
    transition: opacity .25s ease;
}

#lb_img.fade {
    opacity: 0;
}

/* ─── Boutons prev / next ─── */
.lb_nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, .15);
    border: none;
    color: #fff;
    font-size: 18px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .2s;
    z-index: 10000;
}

.lb_nav:hover {
    background: rgba(255, 255, 255, .32);
}

#lb_prev {
    left: 16px;
}

#lb_next {
    right: 16px;
}

/* ─── Bouton fermer ─── */
#lb_close {
    position: fixed;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, .15);
    border: none;
    color: var(--white);
    font-size: 18px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    transition: background .2s;
    z-index: 10000;
}

#lb_close:hover {
    background: rgba(255, 255, 255, .32);
}

/* ─── Compteur ─── */
#lb_counter {
    color: rgba(255, 255, 255, .7);
    font-size: 14px;
    margin-top: 14px;
    font-family: sans-serif;
    letter-spacing: .04em;
}

/* ─── Thumbnails ─── */
#lb_thumbs {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 90vw;
}

.lb_thumb {
    width: 60px;
    height: 45px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    opacity: .5;
    transition: opacity .2s, outline .2s;
    outline: 2px solid transparent;
}

.lb_thumb.active {
    opacity: 1;
    outline: 2px solid #fff;
}

/* ─── Swipe hint sur mobile ─── */
@media (max-width: 600px) {
    .lb_nav {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }

    #lb_prev {
        left: 8px;
    }

    #lb_next {
        right: 8px;
    }
}