/* ── LIGHTBOX OVERLAY ─────────────────────────────────────────────────────── */

#hf-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
    background: rgba(4, 8, 16, 0.96);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#hf-lightbox.open {
    display: flex;
}

/* ── IMAGE STAGE ──────────────────────────────────────────────────────────── */
#hf-lb-stage {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    flex: 1;
    padding: 3rem 5rem;
    box-sizing: border-box;
    min-height: 0;
}

#hf-lb-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    box-shadow: 0 8px 48px rgba(0, 0, 0, 0.8);
    border: 1px solid var(--border, #1E2E38);
    transition: opacity 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}

#hf-lb-img.fade {
    opacity: 0;
}

/* ── NAV BUTTONS ──────────────────────────────────────────────────────────── */
.hf-lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(8, 12, 14, 0.7);
    border: 1px solid var(--border, #1E2E38);
    color: var(--muted, #7A9AAA);
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    flex-shrink: 0;
    padding: 0;
}

.hf-lb-nav:hover {
    background: var(--surfaceEl, #111C22);
    border-color: var(--phosphor, #00D68A);
    color: var(--phosphor, #00D68A);
}

.hf-lb-nav:disabled {
    opacity: 0.2;
    cursor: default;
    pointer-events: none;
}

#hf-lb-prev { left: 1rem; }
#hf-lb-next { right: 1rem; }

/* ── CLOSE BUTTON ─────────────────────────────────────────────────────────── */
#hf-lb-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(8, 12, 14, 0.7);
    border: 1px solid var(--border, #1E2E38);
    color: var(--muted, #7A9AAA);
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    padding: 0;
    z-index: 10;
}

#hf-lb-close:hover {
    background: var(--surfaceEl, #111C22);
    border-color: var(--rust, #E05A3A);
    color: var(--rust, #E05A3A);
}

/* ── CAPTION & COUNTER ────────────────────────────────────────────────────── */
#hf-lb-footer {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.5rem 1.25rem;
    box-sizing: border-box;
    flex-shrink: 0;
    gap: 1rem;
    border-top: 1px solid var(--border, #1E2E38);
}

#hf-lb-caption {
    font-family: var(--fontMono, monospace);
    font-size: 0.78rem;
    color: var(--muted, #7A9AAA);
    line-height: 1.5;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#hf-lb-counter {
    font-family: var(--fontMono, monospace);
    font-size: 0.72rem;
    color: var(--faint, #3A5060);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── CURSOR HINT ──────────────────────────────────────────────────────────── */
[data-lightbox] {
    cursor: zoom-in;
}

/* ── MOBILE ───────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    #hf-lb-stage {
        padding: 3.5rem 0.5rem 0.5rem;
    }

    #hf-lb-prev { left: 0.25rem; }
    #hf-lb-next { right: 0.25rem; }

    .hf-lb-nav {
        width: 2.25rem;
        height: 2.25rem;
    }

    #hf-lb-caption {
        font-size: 0.7rem;
    }
}
