/* ==========================================================
   WEB360 — Shared Gallery Lightbox (Universal Showcase Gallery)
   Namespaced .glb-* — independent of any gallery grid CSS, so a
   single file serves every renderer (universal + template overrides).
   Loaded once per page via galleryLightboxAssets() (section_helpers.php).
   ========================================================== */

.glb-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(8, 10, 16, 0.92);
    backdrop-filter: blur(2px);
}
.glb-overlay.is-open { display: flex; }

/* Stage scrolls vertically so even very tall website screenshots
   can be viewed in full (scroll), not cropped. */
.glb-stage {
    max-width: 94vw;
    max-height: 90vh;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    border-radius: 8px;
}
.glb-img {
    display: block;
    max-width: min(1100px, 94vw);
    width: auto;
    height: auto;
    background: #000;
}

.glb-caption {
    position: fixed;
    left: 0; right: 0; bottom: 18px;
    text-align: center;
    color: #e5e7eb;
    font-size: 0.9rem;
    padding: 0 16px;
    pointer-events: none;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}
.glb-counter {
    position: fixed;
    top: 16px; left: 16px;
    color: #cbd5e1;
    font-size: 0.8rem;
    font-weight: 600;
}

.glb-btn {
    position: fixed;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    width: 48px; height: 48px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    transition: background 0.15s ease;
}
.glb-btn:hover { background: rgba(255, 255, 255, 0.22); }
.glb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.glb-close { top: 14px; right: 16px; }
.glb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.glb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.glb-prev[hidden], .glb-next[hidden] { display: none; }

/* Video player inside the stage — first-class, same viewer as images. */
.glb-video {
    display: block;
    border: 0;
    width: min(1100px, 94vw);
    aspect-ratio: 16 / 9;
    max-height: 90vh;
    background: #000;
}
/* Self-hosted <video> (video_source = upload) reuses .glb-video sizing; keep the
   whole frame visible inside the fixed box (no crop). iframe path is unchanged. */
video.glb-video {
    object-fit: contain;
}
.glb-video-msg {
    color: #e5e7eb;
    font-size: 0.9rem;
    padding: 48px 24px;
    text-align: center;
}

/* Clickable thumbnails: image items (img[data-glb]) AND video tiles ([data-glb-video]). */
img[data-glb],
[data-glb-video] { cursor: zoom-in; }

@media (max-width: 576px) {
    .glb-btn { width: 40px; height: 40px; font-size: 1.2rem; }
    .glb-prev { left: 6px; }
    .glb-next { right: 6px; }
    .glb-stage { max-width: 100vw; }
}
