@charset "utf-8";

[data-lightbox-gallery] figure,
[data-lightbox-gallery] img{
    cursor:pointer;
}

.gallery-lightbox{
    width:100vw;
    height:100vh;
    position:fixed;
    top:0;
    left:0;
    background:rgba(0,0,0,.85);
    display:flex;
    justify-content:center;
    align-items:center;
    z-index:999999;
    overflow:hidden;
    overscroll-behavior:contain;
}

.gallery-box{
    width:min(90vw,900px);
    max-height:90vh;
    display:flex;
    flex-direction:column;
    gap:12px;
}

.gallery-toolbar{
    width:100%;
    display:flex;
    justify-content:flex-start;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
}

.gallery-toolbar-btn,
.gallery-counter{
    min-width:40px;
    height:40px;
    padding:8px;
    box-sizing:border-box;
    display:flex;
    justify-content:center;
    align-items:center;
    background:#000;
    color:#fff;
    border-radius:5px;
    cursor:pointer;
    user-select:none;
    -webkit-user-select:none;
}

.gallery-toolbar-btn img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
    pointer-events:none;
}

.gallery-counter{
    padding:0 14px;
    cursor:default;
    font-size:14px;
}

.gallery-slider-wrap{
    width:100%;
    border-radius:6px;
    background:#000;
    overflow:hidden;
}

.gallery-slider{
    width:100%;
    padding-top:56.25%;
    position:relative;
    cursor:grab;
    user-select:none;
    -webkit-user-select:none;
    touch-action:pan-y;
    overflow:hidden;
    background:#000;
}

.gallery-slider:active{
    cursor:grabbing;
}

.gallery-slide{
    position:absolute;
    top:0;
    right:0;
    left:0;
    bottom:0;
    display:none;
    overflow:hidden;
    background:#000;
}

.gallery-slide.is-active{
    display:block;
}

.gallery-slide img{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
    background:#000;
    user-select:none;
    -webkit-user-select:none;
    -webkit-user-drag:none;
    pointer-events:auto;
    transform-origin:center center;
    transition:transform .18s ease;
    will-change:transform;
}

.gallery-slider.is-panning .gallery-slide img,
.gallery-slider.is-zoomed .gallery-slide img{
    transition:none;
}

.gallery-nav{
    position:absolute;
    top:50%;
    transform:translateY(-50%);
    width:50px;
    height:50px;
    display:flex;
    justify-content:center;
    align-items:center;
    background:rgba(0,0,0,.55);
    color:#fff;
    border-radius:50%;
    cursor:pointer;
    user-select:none;
    font-size:30px;
    font-weight:bold;
    transition:.3s;
    z-index:10;
}

.gallery-prev{
    left:15px;
}

.gallery-next{
    right:15px;
}

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

.gallery-nav.is-disabled{
    opacity:.3;
    pointer-events:none;
    cursor:default;
}

.gallery-thumbs{
    width:100%;
    max-width:100%;
    padding:0 .5rem;
    display:flex;
    gap:10px;
    box-sizing:border-box;
    overflow-x:auto;
    overflow-y:hidden;
    scroll-behavior:smooth;
    scroll-snap-type:x mandatory;
    cursor:grab;
    user-select:none;
    direction:ltr;
    touch-action:pan-x;
    -webkit-overflow-scrolling:touch;
}

.gallery-thumbs.is-dragging{
    cursor:grabbing;
    scroll-behavior:auto;
}

.gallery-thumb-item{
    width:120px;
    height:68px;
    min-width:120px;
    border-radius:4px;
    overflow:hidden;
    cursor:pointer;
    transition:.3s;
    box-sizing:border-box;
    flex-shrink:0;
    scroll-snap-align:center;
}

.gallery-thumb-item img{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    pointer-events:none;
}

.gallery-thumb-item.is-active{
    border:3px solid yellow;
}

.gallery-thumb-item:hover{
    border-color:#fff;
}

.gallery-lightbox.is-fullscreen{
    width:100vw !important;
    height:100vh !important;
    background:#000 !important;
    align-items:stretch !important;
}

.gallery-lightbox.is-fullscreen .gallery-box{
    width:100vw !important;
    max-width:100vw !important;
    height:100vh !important;
    max-height:100vh !important;
    padding:0 !important;
    gap:0 !important;
}

.gallery-lightbox.is-fullscreen .gallery-toolbar{
    position:absolute !important;
    top:18px !important;
    right:22px !important;
    width:auto !important;
    z-index:100 !important;
}

.gallery-lightbox.is-fullscreen .gallery-slider-wrap{
    width:100vw !important;
    height:calc(100vh - 105px) !important;
    border-radius:0 !important;
    background:#000 !important;
    overflow:hidden !important;
}

.gallery-lightbox.is-fullscreen .gallery-slider{
    width:100% !important;
    height:100% !important;
    padding-top:0 !important;
    overflow:hidden !important;
    touch-action:none;
    overscroll-behavior:none;
}

.gallery-lightbox.is-fullscreen .gallery-slide{
    width:100% !important;
    height:100% !important;
    overflow:hidden !important;
}

.gallery-lightbox.is-fullscreen .gallery-slide img{
    width:100% !important;
    height:100% !important;
    object-fit:contain !important;
}

.gallery-lightbox.is-fullscreen .gallery-thumbs{
    width:100vw !important;
    max-width:100vw !important;
    height:105px !important;
    padding:10px 16px !important;
    background:rgba(0,0,0,.8) !important;
    align-items:center !important;
}

.gallery-zoom-controls{
    display:flex;
    align-items:center;
    gap:6px;
}

.gallery-zoom-percent{
    min-width:58px;
    height:40px;
    padding:0 10px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#000;
    color:#fff;
    border-radius:5px;
    font-size:13px;
    cursor:pointer;
    user-select:none;
}

.gallery-toolbar-btn.is-disabled{
    opacity:.35;
    pointer-events:none;
}

.gallery-slider.is-zoomed{
    cursor:grab;
    touch-action:none;
    overflow:hidden;
}

.gallery-slider.is-panning{
    cursor:grabbing;
}

@media (max-width:768px){
    .gallery-box{
        width:100vw;
        max-height:100vh;
        gap:8px;
        padding:10px;
        box-sizing:border-box;
    }

    .gallery-toolbar{
        gap:8px;
    }

    .gallery-toolbar-btn,
    .gallery-counter,
    .gallery-zoom-percent{
        height:36px;
        min-width:36px;
    }

    .gallery-thumb-item{
        width:96px;
        height:54px;
        min-width:96px;
    }
}
