/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(20, 18, 15, 0.94);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px 80px;
}

.lightbox[hidden] {
    display: none;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-stage {
    margin: 0;
    max-width: 1200px;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
}

.lightbox-stage img {
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-stage figcaption {
    font-family: var(--body);
    color: rgba(250, 244, 234, 0.86);
    font-size: 0.92rem;
    letter-spacing: 0.04em;
    text-align: center;
    font-style: italic;
    max-width: 60ch;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    background: rgba(250, 244, 234, 0.12);
    border: 1px solid rgba(250, 244, 234, 0.4);
    color: #faf4ea;
    cursor: pointer;
    line-height: 1;
    transition: background-color 0.25s ease;
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: rgba(250, 244, 234, 0.28);
}

.lightbox-close {
    top: 18px;
    right: 18px;
    width: 46px;
    height: 46px;
    font-size: 1.7rem;
}

.lightbox-nav {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 62px;
    font-size: 1.9rem;
}

.lightbox-nav.prev { left: 18px; }
.lightbox-nav.next { right: 18px; }

.lightbox-counter {
    position: absolute;
    bottom: 26px;
    left: 0;
    right: 0;
    text-align: center;
    font-family: var(--body);
    color: rgba(250, 244, 234, 0.7);
    font-size: 0.8rem;
    letter-spacing: 3px;
}

/* On phones the side arrows steal too much of the photo — swipe instead,
   and drop the controls to the bottom where thumbs actually reach. */
@media (max-width: 640px) {
    .lightbox {
        padding: 56px 10px 92px;
    }

    .lightbox-stage img {
        max-height: 68vh;
    }

    .lightbox-nav {
        top: auto;
        bottom: 20px;
        transform: none;
        width: 64px;
        height: 48px;
    }

    .lightbox-nav.prev { left: 24px; }
    .lightbox-nav.next { right: 24px; }

    .lightbox-counter {
        bottom: 34px;
    }
}
