/* Lightbox only */

body.lb-open {
    overflow: hidden;
}

.lightbox[hidden] {
    display: none;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.92);
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.lightbox-panel {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    padding: 18px;
}

.lightbox-figure {
    margin: 0;
    min-width: 0;
    width: 100%;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.lightbox-image {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    display: block;
    background: #111;
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.lightbox-caption {
    max-width: min(1100px, 92vw);
    color: rgba(255, 255, 255, 0.72);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(0, 0, 0, 0.35);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-size: 28px;
    line-height: 1;
}

.lightbox-close {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 26px;
}

.lightbox-prev,
.lightbox-next {
    justify-self: center;
}

.lightbox-prev:disabled,
.lightbox-next:disabled {
    opacity: 0.35;
    cursor: default;
}

.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.9);
    outline-offset: 4px;
}

@media (max-width: 520px) {
    .lightbox-panel {
        padding: 12px;
        grid-template-columns: 1fr;
    }

    .lightbox-image {
        max-height: 72vh;
    }

    .lightbox-prev,
    .lightbox-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 2;
    }

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

    .lightbox-close {
        top: 12px;
        right: 12px;
    }
}
