/* =============================================
   LIGHTBOX — full size image viewer
   ============================================= */

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

.lightbox::backdrop {
    background: rgba(4, 9, 35, 0.96);
}

.lightbox[open] {
    animation: lightbox-enter 0.22s ease-out both;
}

.lightbox[open]::backdrop {
    animation: lightbox-fade 0.22s ease-out both;
}

.lightbox.is-closing,
.lightbox.is-closing::backdrop {
    animation: lightbox-fade 0.16s ease-in reverse both;
}

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

@keyframes lightbox-enter {
    from { opacity: 0; transform: scale(0.985); }
    to   { opacity: 1; transform: none; }
}

.lightbox__inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 64px 16px 18px;
}

/* Stage ---------------------------------------------------- */

.lightbox__stage {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.lightbox__img {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

.lightbox__stage.is-zoomable .lightbox__img {
    cursor: zoom-in;
}

.lightbox__stage.is-zoomed {
    display: block;
    overflow: auto;
    cursor: grab;
    overscroll-behavior: contain;
}

.lightbox__stage.is-zoomed .lightbox__img {
    max-width: none;
    max-height: none;
    margin: 0 auto;
    cursor: zoom-out;
    border-radius: 0;
}

.lightbox__stage.is-dragging {
    cursor: grabbing;
}

.lightbox__stage.is-loading .lightbox__img {
    opacity: 0.35;
}

/* Caption -------------------------------------------------- */

.lightbox__meta {
    flex: none;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 16px;
    text-align: center;
}

.lightbox__caption {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
}

.lightbox__counter {
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
}

/* Buttons -------------------------------------------------- */

.lightbox__btn {
    position: absolute;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 9999px;
    background: rgba(12, 20, 55, 0.7);
    color: #ffffff;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.lightbox__btn:hover {
    background: rgba(0, 115, 230, 0.85);
    border-color: rgba(255, 255, 255, 0.35);
}

.lightbox__btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 3px;
}

.lightbox__btn svg {
    width: 20px;
    height: 20px;
}

.lightbox__btn[hidden] {
    display: none;
}

.lightbox__close {
    top: 14px;
    right: 16px;
    z-index: 3;
}

.lightbox__zoom {
    top: 14px;
    right: 70px;
    z-index: 3;
}

.lightbox__icon--out {
    display: none;
}

.lightbox.is-zoomed .lightbox__icon--in {
    display: none;
}

.lightbox.is-zoomed .lightbox__icon--out {
    display: block;
}

.lightbox__nav--prev {
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__nav--next {
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.lightbox__nav--prev:hover,
.lightbox__nav--next:hover {
    transform: translateY(-50%) scale(1.06);
}

/* While zoomed the picture owns the screen. */
.lightbox.is-zoomed .lightbox__nav--prev,
.lightbox.is-zoomed .lightbox__nav--next {
    display: none;
}

@media (max-width: 767px) {
    .lightbox__inner {
        padding: 56px 10px 14px;
    }

    .lightbox__nav--prev,
    .lightbox__nav--next {
        top: auto;
        bottom: 14px;
        transform: none;
    }

    .lightbox__nav--prev:hover,
    .lightbox__nav--next:hover {
        transform: scale(1.06);
    }

    .lightbox__meta {
        padding-bottom: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox[open],
    .lightbox[open]::backdrop,
    .lightbox.is-closing,
    .lightbox.is-closing::backdrop {
        animation-duration: 0.01ms;
    }

    .lightbox__btn {
        transition: none;
    }
}
