.bv-hero-lightbox-trigger {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: zoom-in;
}

.bv-hero-lightbox-trigger:focus-visible,
.organization-gallery-lightbox button:focus-visible {
    outline: 2px solid var(--bv-accent);
    outline-offset: 4px;
}

.organization-gallery-lightbox {
    width: min(100% - 2rem, 1040px); max-width: none; max-height: min(90vh, 900px);
    padding: 0; border: 1px solid var(--bv-border-soft); border-radius: var(--bv-card-radius);
    background: var(--bv-card-bg); color: var(--bv-text-primary);
}
.organization-gallery-lightbox::backdrop { background: rgba(0, 0, 0, .82); }
.organization-gallery-lightbox [hidden] { display: none; }
.organization-gallery-lightbox__viewport {
    position: relative; display: grid; place-items: center; min-height: min(72vh, 720px);
    padding: 3.5rem 4.5rem 4.5rem;
}
.organization-gallery-lightbox__image-wrap {
    position: relative; display: inline-flex; align-items: center; justify-content: center; max-width: 100%; max-height: 100%;
}
.organization-gallery-lightbox__image {
    max-width: 100%; max-height: min(65vh, 660px); object-fit: contain;
}
.organization-gallery-lightbox__close,
.organization-gallery-lightbox__nav { border: 0; background: var(--bv-card-bg); color: var(--bv-heading-color); cursor: pointer; }
.organization-gallery-lightbox__close { position: absolute; top: 1rem; right: 1rem; width: 2.5rem; height: 2.5rem; border-radius: 50%; font-size: 1.5rem; }
.organization-gallery-lightbox__nav { position: absolute; top: 50%; transform: translateY(-50%); }
.organization-gallery-lightbox__nav--previous { left: -5rem; }
.organization-gallery-lightbox__nav--next { right: -5rem; }
.organization-gallery-lightbox__caption,
.organization-gallery-lightbox__credit,
.organization-gallery-lightbox__counter {
    position: absolute; bottom: 1rem; margin: 0; color: var(--bv-text-secondary);
}
.organization-gallery-lightbox__caption { left: 1.5rem; bottom: 2.75rem; max-width: calc(100% - 10rem); }
.organization-gallery-lightbox__credit { left: 1.5rem; max-width: calc(100% - 10rem); }
.organization-gallery-lightbox__counter { right: 1.5rem; }

@media (max-width: 1024px) {
    .organization-gallery-lightbox {
        width: min(calc(100vw - 1.5rem), 760px); max-height: calc(100vh - 1.5rem); max-height: calc(100dvh - 1.5rem);
        overflow-x: hidden; overflow-y: auto;
    }
    .organization-gallery-lightbox__viewport { min-height: 0; padding: 3.25rem 3.75rem 4.5rem; }
    .organization-gallery-lightbox__image { max-width: 100%; max-height: calc(100vh - 9rem); max-height: calc(100dvh - 9rem); }
    .organization-gallery-lightbox__nav--previous { left: -.75rem; }
    .organization-gallery-lightbox__nav--next { right: -.75rem; }
}

@media (max-width: 768px) {
    .organization-gallery-lightbox {
        width: calc(100vw - 1rem); width: calc(100dvw - 1rem);
        max-height: calc(100vh - 1rem); max-height: calc(100dvh - 1rem);
    }
    .organization-gallery-lightbox__viewport {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-content: center;
        align-items: center;
        justify-items: stretch;
        column-gap: 1rem;
        row-gap: .35rem;
        min-height: 0;
        padding:
            calc(env(safe-area-inset-top) + 40px)
            calc(env(safe-area-inset-right) + 1rem)
            calc(env(safe-area-inset-bottom) + 1rem)
            calc(env(safe-area-inset-left) + 1rem);
    }
    .organization-gallery-lightbox__image-wrap {
        display: grid;
        grid-column: 1 / -1;
        grid-template-columns: auto auto;
        justify-content: center;
        column-gap: 2rem;
        row-gap: 1rem;
        width: 100%;
        margin-bottom: .75rem;
    }
    .organization-gallery-lightbox__image {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: center;
        max-height: calc(100vh - 13rem); max-height: calc(100dvh - 13rem);
        max-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 13rem);
    }
    .organization-gallery-lightbox__close { top: calc(env(safe-area-inset-top) + 1rem); right: calc(env(safe-area-inset-right) + 1rem); }
    .organization-gallery-lightbox__nav { position: static; display: grid; grid-row: 2; width: 2.5rem; height: 2.5rem; place-items: center; transform: none; }
    .organization-gallery-lightbox__nav--previous { grid-column: 1; justify-self: center; }
    .organization-gallery-lightbox__nav--next { grid-column: 2; justify-self: center; }
    .organization-gallery-lightbox__caption,
    .organization-gallery-lightbox__credit,
    .organization-gallery-lightbox__counter { position: static; max-width: none; margin: 0; }
    .organization-gallery-lightbox__caption { grid-column: 1 / -1; }
    .organization-gallery-lightbox__credit { grid-column: 1; }
    .organization-gallery-lightbox__counter { grid-column: 2; }
}
