/* ── Lightbox ──────────────────────────────────────────────── */

/* Backdrop */
.lightbox-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.25s ease;
    cursor: pointer;
}

.lightbox-backdrop.lightbox--open {
    opacity: 1;
}

/* Modal wrapper */
.lightbox-modal {
    position: fixed;
    inset: 0;
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: none;
}

.lightbox-modal.lightbox--open {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

/* Image stage */
.lightbox-stage {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: calc(100vw - 8rem);
    max-height: calc(100vh - 4rem);
}

@media (max-width: 640px) {
    .lightbox-stage {
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 6rem);
    }
}

/* Image */
.lightbox-img {
    display: block;
    max-width: 100%;
    max-height: calc(100vh - 8rem);
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.5);
    transition: opacity 0.2s ease;
}

/* Caption */
.lightbox-caption {
    margin-top: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    text-align: center;
    max-width: 60ch;
}

/* Counter */
.lightbox-counter {
    margin-top: 0.375rem;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.05em;
}

/* Close button */
.lightbox-close {
    position: fixed;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

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

.lightbox-close:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Nav buttons */
.lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1002;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: background 0.15s ease, transform 0.15s ease;
}

.lightbox-nav--prev { left: 1rem; }
.lightbox-nav--next { right: 1rem; }

.lightbox-nav:hover {
    background: rgba(255, 255, 255, 0.22);
}

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

.lightbox-nav:focus-visible {
    outline: 2px solid white;
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .lightbox-nav--prev { left: 0.375rem; width: 2.25rem; height: 2.25rem; }
    .lightbox-nav--next { right: 0.375rem; width: 2.25rem; height: 2.25rem; }
}
