/* =============================================================
   Screenshot Lightbox — Overlay + Zoom + Gallery
   ============================================================= */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

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

.lightbox-image {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: default;
}

.lightbox-overlay.active .lightbox-image {
    transform: scale(1);
}

.lightbox-caption {
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    background: rgba(0,0,0,0.5);
    padding: 8px 20px;
    border-radius: 100px;
    white-space: nowrap;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); }

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.lightbox-nav:hover { background: rgba(255,255,255,0.2); }
.lightbox-nav.prev { left: 24px; }
.lightbox-nav.next { right: 24px; }

.lightbox-counter {
    position: absolute;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Hide nav when single image */
.lightbox-overlay[data-count="1"] .lightbox-nav,
.lightbox-overlay[data-count="1"] .lightbox-counter { display: none; }

/* ── Lazy loading placeholder ──────────────────────────────── */
.screenshot-lazy {
    background: rgba(255,255,255,0.04);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.screenshot-lazy::before {
    content: '';
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent, #3B82F6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.screenshot-lazy.loaded::before { display: none; }
.screenshot-lazy.loaded { min-height: auto; background: transparent; }

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ── Mobile adjustments ────────────────────────────────────── */
@media (max-width: 640px) {
    .lightbox-image {
        max-width: 96vw;
        max-height: 70vh;
        border-radius: 8px;
    }

    .lightbox-nav { width: 40px; height: 40px; font-size: 22px; }
    .lightbox-nav.prev { left: 8px; }
    .lightbox-nav.next { right: 8px; }
    .lightbox-close { top: 12px; right: 12px; }
    .lightbox-caption { font-size: 0.8rem; bottom: 16px; }
}
