/* Image viewer for events (and anything else marked with data-lightbox). */
a[data-lightbox] {
    color: inherit;
    text-decoration: none;
    cursor: zoom-in;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2100;
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    justify-items: center;
    gap: 14px;
    padding: clamp(14px, 3vw, 40px);
    background: rgba(3, 17, 45, 0.9);
    backdrop-filter: blur(6px);
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility 0s linear .25s;
}

.lightbox.is-open {
    opacity: 1;
    visibility: visible;
    transition: opacity .25s ease;
}

.lightbox-stage {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}

.lightbox-image {
    display: block;
    max-width: min(100%, 1100px);
    max-height: 100%;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.7);
    object-fit: contain;
    transform: scale(0.96);
    transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1);
}

.lightbox.is-open .lightbox-image {
    transform: scale(1);
}

.lightbox-caption {
    max-width: 760px;
    padding: 12px 22px;
    border-radius: 16px;
    background: #fff;
    color: #0d2456;
    text-align: center;
}

.lightbox-caption strong {
    display: block;
    font-family: Manrope, Inter, sans-serif;
    font-size: clamp(16px, 1.6vw, 20px);
    font-weight: 800;
    line-height: 1.25;
}

.lightbox-caption span {
    display: block;
    margin-top: 4px;
    color: #5d6d84;
    font-size: 13.5px;
    font-weight: 600;
}

.lightbox-caption span:empty {
    display: none;
}

.lightbox-close,
.lightbox-nav {
    position: absolute;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #0d2456;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 14px 28px -14px rgba(0, 0, 0, 0.6);
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.lightbox-close {
    top: clamp(12px, 2vw, 26px);
    right: clamp(12px, 2vw, 26px);
}

.lightbox-nav {
    top: 50%;
    margin-top: -23px;
}

.lightbox-nav--prev {
    left: clamp(10px, 2vw, 26px);
}

.lightbox-nav--next {
    right: clamp(10px, 2vw, 26px);
}

.lightbox-close:hover,
.lightbox-nav:hover {
    background: #d91f2d;
    color: #fff;
    transform: scale(1.06);
}

.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
    outline: 3px solid #7fb0ff;
    outline-offset: 3px;
}

.lightbox-nav[hidden] {
    display: none;
}

body.lightbox-open {
    overflow: hidden;
}

@media (max-width: 620px) {
    .lightbox-nav {
        top: auto;
        bottom: clamp(14px, 4vw, 24px);
        margin-top: 0;
    }

    .lightbox-nav--prev {
        left: 14px;
    }

    .lightbox-nav--next {
        right: 14px;
    }

    .lightbox-caption {
        margin: 0 60px 4px;
        padding: 10px 14px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lightbox,
    .lightbox-image {
        transition: none;
    }
}
