/* ══════════════════════════════════════════════
   DARKGROUND COFFEE — lightbox.css
   Standalone lightbox styles
   DevPanicZone | vanilla CSS, no dependencies
   ══════════════════════════════════════════════ */

/* ── Dialog reset + overlay ── */
.lightbox {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: rgba(10, 5, 2, 0.92);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Native <dialog> backdrop */
.lightbox::backdrop {
    background: transparent;
}

/* Hidden until open */
.lightbox:not([open]) {
    display: none;
}

/* ── Figure ── */
.lightbox-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    max-width: min(90vw, 1200px);
    max-height: 90vh;
}

.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 2px;
}

/* ── Caption ── */
.lightbox-caption {
    font-family: var(--body-font, system-ui, sans-serif);
    font-size: 0.85rem;
    color: rgba(242, 233, 208, 0.6);
    letter-spacing: 0.05em;
    text-align: center;
}

/* ── Buttons ── */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: fixed;
    background: none;
    border: none;
    color: rgba(242, 233, 208, 0.6);
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
    padding: 0.5rem;
    transition: color 0.2s, transform 0.2s;
    z-index: 10;
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    color: #f2e9d0;
}

/* Close — top right */
.lightbox-close {
    top: 1.5rem;
    right: 1.5rem;
    font-size: 1.4rem;
}

.lightbox-close:hover {
    transform: rotate(90deg);
}

/* Prev / Next — vertically centered */
.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
}

.lightbox-prev {
    left: 1.5rem;
}

.lightbox-next {
    right: 1.5rem;
}

.lightbox-prev:hover {
    transform: translateY(-50%) translateX(-3px);
}

.lightbox-next:hover {
    transform: translateY(-50%) translateX(3px);
}

/* ── Focus styles ── */
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    outline: 2px solid var(--karamell, #c8a96e);
    outline-offset: 4px;
    border-radius: 2px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }

    .lightbox-prev,
    .lightbox-next {
        font-size: 2rem;
    }
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {

    .lightbox-close,
    .lightbox-prev,
    .lightbox-next {
        transition: none;
    }
}