/* ==========================================================================
   Lightbox — full-screen image viewer (public site + CMS)
   ========================================================================== */

[data-lightbox] {
    cursor: zoom-in;
}

html.lightbox-open {
    overflow: hidden;
}

.lightbox {
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    overflow: hidden;
}

.lightbox::backdrop {
    background: rgba(20, 20, 20, 0.92);
}

.lightbox[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    animation: lightbox-in 0.2s ease;
}

@keyframes lightbox-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox__figure {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 64px 88px;
}

.lightbox__image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    opacity: 0;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
    transition: opacity 0.25s ease;
}

.lightbox__image.is-loaded {
    opacity: 1;
}

.lightbox__counter {
    position: absolute;
    left: 50%;
    bottom: 22px;
    transform: translateX(-50%);
    margin: 0;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: rgba(243, 239, 232, 0.8);
}

.lightbox__btn {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(243, 239, 232, 0.1);
    color: #f3efe8;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.lightbox__btn:hover,
.lightbox__btn:focus-visible {
    background: rgba(243, 239, 232, 0.24);
    outline: none;
}

.lightbox__btn svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.lightbox__close {
    top: 16px;
    right: 16px;
}

.lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__nav--prev {
    left: 20px;
}

.lightbox__nav--next {
    right: 20px;
}

.lightbox.is-single .lightbox__nav {
    display: none;
}

@media (max-width: 640px) {
    .lightbox__figure {
        padding: 64px 12px;
    }

    .lightbox__nav {
        top: auto;
        bottom: 10px;
        transform: none;
    }
}
