﻿.lightbox:not([open]) .lightbox-stage,
.lightbox:not([open]) .lightbox-nav,
.lightbox:not([open]) .lightbox-close {
    display: none;
    pointer-events: none
}

.lightbox {
    position: fixed;
    inset: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: visible
}

    .lightbox::backdrop {
        background: rgba(0,0,0,.9);
        cursor: zoom-out
    }

.lightbox-stage {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1
}

#lightbox-img {
    position: relative;
    z-index: 2;
    display: block;
    max-width: 95vw;
    max-height: 90vh;
    border-radius: 16px;
    transform-origin: 50% 50%;
    will-change: transform;
    user-select: none;
    cursor: zoom-in;
    opacity: 0;
    transition: opacity .2s ease;
    -webkit-user-drag: none;
    user-select: none;
    touch-action: none;
}

    #lightbox-img.is-visible {
        opacity: 1
    }

    #lightbox-img.is-zoomed {
        cursor: grab
    }

        #lightbox-img.is-zoomed.dragging {
            cursor: grabbing
        }

.lightbox-nav, .lightbox-close {
    position: fixed;
    z-index: 1001;
    pointer-events: auto;
    opacity: 1;
    transition: opacity .15s ease
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    background: rgba(0,0,0,.45);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer
}

    .lightbox-nav:hover {
        background: rgba(0,0,0,.6)
    }

    .lightbox-nav.prev {
        left: 10px
    }

    .lightbox-nav.next {
        right: 10px
    }

.lightbox-close {
    top: 10px;
    right: 10px;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 0;
    color: #fff;
    background: rgba(0,0,0,.45);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer
}

    .lightbox-close:hover {
        background: rgba(0,0,0,.6)
    }

body.lightbox-zoomed .lightbox-nav, body.lightbox-zoomed .lightbox-close {
    opacity: 0;
    pointer-events: none
}

body.lightbox-zoomed.chrome-active .lightbox-nav, body.lightbox-zoomed.chrome-active .lightbox-close {
    opacity: 1;
    pointer-events: auto
}

body.modal-open {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    overflow: hidden
}


.lightbox:not([open]) .meta-toggle,
.lightbox:not([open]) .meta-panel {
    display: none;
    pointer-events: none
}

.meta-toggle {
    position: fixed;
    left: 12px;
    bottom: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 0;
    cursor: pointer;
    background: rgba(0,0,0,.45);
    color: #fff;
    font-weight: 700;
}

    .meta-toggle:hover {
        background: rgba(0,0,0,.6)
    }

.meta-panel {
    position: fixed;
    left: 60px;
    bottom: 12px;
    z-index: 1000;
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: .75rem .9rem;
    border-radius: 12px;
    font-size: .9rem;
    line-height: 1.35;
    max-width: min(420px, 90vw);
    backdrop-filter: blur(4px);
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .15s ease, transform .15s ease;
    pointer-events: none;
}

    .meta-panel.shown {
        opacity: 1;
        transform: translateY(0);
        pointer-events: auto
    }

    .meta-panel .kv {
        display: flex;
        gap: .5rem;
        margin: .15rem 0;
    }

    .meta-panel .k {
        color: #cbd5e1;
        min-width: 92px;
        flex: 0 0 auto
    }

    .meta-panel .v {
        color: #fff
    }

body.lightbox-zoomed .meta-toggle,
body.lightbox-zoomed .meta-panel {
    opacity: 0;
    pointer-events: none
}

body.lightbox-zoomed.chrome-active .meta-toggle,
body.lightbox-zoomed.chrome-active .meta-panel {
    opacity: 1;
    pointer-events: auto
}