/* Shared image lightbox — used by both the public website and the dashboard */

img.jch-zoomable {
    cursor: zoom-in;
}

.jch-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(9, 12, 20, .92);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, visibility .2s ease;
    overscroll-behavior: contain;
}

.jch-lightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.jch-lightbox__img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .55);
    transform: scale(.96);
    transition: transform .2s ease;
    touch-action: pan-x pan-y pinch-zoom;
}

.jch-lightbox.is-open .jch-lightbox__img {
    transform: scale(1);
}

.jch-lightbox__close {
    position: absolute;
    top: max(.75rem, env(safe-area-inset-top));
    right: .75rem;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, .14);
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.jch-lightbox__close:hover {
    background: rgba(255, 255, 255, .26);
}

.jch-lightbox__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: max(.9rem, env(safe-area-inset-bottom));
    padding: 0 3rem;
    text-align: center;
    font-size: .9rem;
    color: rgba(255, 255, 255, .82);
}

body.jch-lightbox-open {
    overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {

    .jch-lightbox,
    .jch-lightbox__img {
        transition: none;
    }
}
