/* =========================================
   Lightbox – Full-screen image viewer
   ========================================= */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.lightbox-overlay.is-active {
    opacity: 1;
    visibility: visible;
}

/* Close button */
.lightbox-close {
    position: absolute;
    top: 1.2rem;
    right: 1.2rem;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-size: 1.4rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Image container */
.lightbox-img-wrap {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    overflow: visible;
    touch-action: none;
    cursor: zoom-in;
}

.lightbox-img-wrap.is-zoomed {
    cursor: zoom-out;
}

.lightbox-img-wrap.is-dragging {
    cursor: grabbing;
}

.lightbox-img-wrap img {
    display: block;
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    transition: transform 0.25s cubic-bezier(0.25, 1, 0.5, 1);
}

.lightbox-overlay.is-wide-media .lightbox-img-wrap,
.lightbox-overlay.is-wide-media .lightbox-img-wrap img {
    max-width: min(76vw, 1120px);
    max-height: 72vh;
}

.lightbox-overlay.is-wide-media .lightbox-img-wrap,
.lightbox-overlay.is-wide-media .lightbox-img-wrap.is-zoomed,
.lightbox-overlay.is-wide-media .lightbox-img-wrap.is-dragging {
    cursor: default;
}

.lightbox-img-wrap.is-dragging img {
    transition: none;
}

/* Raise custom cursor above lightbox when open */
body.lightbox-open .cursor,
body.lightbox-open .cursor-follower {
    z-index: 10002;
}

/* SP: disable default touch behaviors inside lightbox */
.lightbox-overlay {
    touch-action: none;
    -webkit-touch-callout: none;
}

@media (max-width: 768px) {
    .lightbox-close {
        top: env(safe-area-inset-top, 0.8rem);
        right: 0.8rem;
    }

    .lightbox-img-wrap {
        max-width: 96vw;
        max-height: 88vh;
    }

    .lightbox-img-wrap img {
        max-width: 96vw;
        max-height: 88vh;
    }

    .lightbox-overlay.is-wide-media .lightbox-img-wrap,
    .lightbox-overlay.is-wide-media .lightbox-img-wrap img {
        max-width: 92vw;
        max-height: 72vh;
    }
}
