/* Unified Lightbox Modal (Single Progressive Media + Profile Gallery) */

.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--dur-base) var(--ease-out-expo), visibility var(--dur-base) ease;
}

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

.lightbox-overlay.is-dragging .lightbox-content,
.lightbox-overlay.is-dragging .lightbox-backdrop,
.lightbox-overlay.is-dragging .lightbox-card {
    transition: none;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(6, 9, 18, 0.90);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    transition: opacity var(--dur-base) var(--ease-out-expo);
}

.lightbox-content {
    position: relative;
    z-index: 2;
    max-width: min(92vw, 1080px);
    max-height: 92dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: scale(0.95) translateY(10px);
    transition: transform 0.28s var(--ease-out-expo);
}

.lightbox-overlay.active .lightbox-content {
    transform: scale(1) translateY(0);
}

.lightbox-topbar {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.lightbox-counter {
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 2px;
    color: rgba(244, 246, 255, 0.88);
    padding: 5px 12px;
    border-radius: var(--radius-full);
    background: rgba(255, 255, 255, 0.09);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.lightbox-top-actions {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.lightbox-hd-badge {
    font-size: 0.72rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: var(--radius-full);
    background: rgba(79, 105, 242, 0.28);
    border: 1px solid rgba(129, 152, 255, 0.45);
}

.lightbox-hd-badge[hidden],
.lightbox-zoom-btn[hidden] {
    display: none;
}

.lightbox-zoom-btn {
    width: 2.5rem;
    height: 2.5rem;
    font-family: 'Space Grotesk', system-ui, sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.lightbox-zoom-btn.is-active {
    background: rgba(79, 105, 242, 0.55);
    border-color: var(--color-brand-blue);
}

.lightbox-close-btn,
.lightbox-nav-btn {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.24);
}

.lightbox-close-btn {
    width: 2.5rem;
    height: 2.5rem;
}

.lightbox-close-btn svg {
    width: 1.15rem;
    height: 1.15rem;
}

.lightbox-close-btn:hover,
.lightbox-nav-btn:hover {
    background: rgba(79, 105, 242, 0.45);
    border-color: var(--color-brand-blue);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    z-index: 12;
}

.lightbox-nav-btn:hover {
    transform: translateY(-50%) scale(1.08);
}

.lightbox-nav-btn svg {
    width: 20px;
    height: 20px;
}

.lightbox-prev-btn { left: -60px; }
.lightbox-next-btn { right: -60px; }

.lightbox-nav-btn[hidden],
.lightbox-counter[hidden] {
    display: none;
}

@media (max-width: 900px) {
    .lightbox-nav-btn {
        width: 38px;
        height: 38px;
        background: rgba(9, 12, 24, 0.72);
    }
    .lightbox-prev-btn { left: 10px; }
    .lightbox-next-btn { right: 10px; }
}

.lightbox-card {
    background: #101526;
    padding: 10px 10px 14px;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 26px 64px rgba(0, 0, 0, 0.80);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform var(--dur-base) var(--ease-out-expo);
}

html[data-theme="light"] .lightbox-card {
    background: #fbfdff;
    border-color: rgba(14, 42, 74, 0.18);
    box-shadow: 0 24px 60px rgba(6, 14, 28, 0.45);
}

.lightbox-media-wrapper {
    position: relative;
    max-width: 85vw;
    max-height: min(74dvh, 680px);
    overflow: hidden;
    border-radius: 10px;
    background: #070a15;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: none;
}

.lightbox-img,
.lightbox-video {
    max-width: 85vw;
    max-height: min(74dvh, 680px);
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
}

.lightbox-img {
    cursor: zoom-in;
    transition: transform 0.26s var(--ease-out-expo);
}

.lightbox-img.is-zoomed {
    transform: scale(2);
    cursor: zoom-out;
}

.lightbox-img[hidden],
.lightbox-video[hidden] {
    display: none;
}

.lightbox-caption {
    margin-top: 0.75rem;
    color: #f4f6ff;
    font-family: 'Playfair Display', Georgia, serif;
    font-style: italic;
    font-size: clamp(0.92rem, 1.35vw, 1.18rem);
    font-weight: 600;
    text-align: center;
    max-width: 720px;
    line-height: 1.45;
    padding: 0 6px;
}

html[data-theme="light"] .lightbox-caption {
    color: #0e1e33;
}

.lightbox-caption:empty {
    display: none;
}
