.nxb-gallery {
    --nxb-gallery-gap: 1rem;
    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin-block: 2rem;
}

.nxb-gallery__viewport {
    display: grid;
    grid-template-columns: repeat(var(--nxb-gallery-columns, 3), minmax(0, 1fr));
    gap: var(--nxb-gallery-gap);
    min-width: 0;
}

.nxb-gallery__item,
.nxb-gallery__link {
    display: block;
    min-width: 0;
}

.nxb-gallery__link {
    position: relative;
    overflow: hidden;
    background: #e5e7eb;
    color: inherit;
}

.nxb-gallery__link:focus-visible {
    z-index: 2;
    outline: 3px solid #172554;
    outline-offset: 3px;
}

.nxb-gallery__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform .25s ease, opacity .25s ease;
}

.nxb-gallery__link:hover .nxb-gallery__image,
.nxb-gallery__link:focus-visible .nxb-gallery__image {
    opacity: .9;
    transform: scale(1.025);
}

.nxb-gallery--carousel {
    padding-bottom: 3.5rem;
}

.nxb-gallery--carousel .nxb-gallery__viewport.slick-initialized {
    display: block;
    margin-inline: calc(-.5 * var(--nxb-gallery-gap));
}

.nxb-gallery--carousel .slick-list {
    overflow: hidden;
}

.nxb-gallery--carousel .slick-track {
    display: flex;
    align-items: stretch;
}

.nxb-gallery--carousel .slick-slide {
    box-sizing: border-box;
    min-width: 0;
    height: auto;
    padding-inline: calc(.5 * var(--nxb-gallery-gap));
}

.nxb-gallery--carousel .slick-slide > div,
.nxb-gallery--carousel .slick-slide .nxb-gallery__item {
    height: 100%;
}

.nxb-gallery__controls {
    display: none;
}

.nxb-gallery__controls[hidden] {
    display: none !important;
}

.nxb-gallery.is-enhanced .nxb-gallery__controls {
    display: block;
}

.nxb-gallery__arrow,
.nxb-gallery__toggle,
.nxb-gallery__dot,
.nxb-gallery__lightbox-close,
.nxb-gallery__lightbox-arrow {
    border: 1px solid rgba(255, 255, 255, .75);
    background: rgba(17, 24, 39, .82);
    color: #fff;
    cursor: pointer;
}

.nxb-gallery__arrow:focus-visible,
.nxb-gallery__toggle:focus-visible,
.nxb-gallery__dot:focus-visible,
.nxb-gallery__lightbox-close:focus-visible,
.nxb-gallery__lightbox-arrow:focus-visible {
    outline: 3px solid #f59e0b;
    outline-offset: 3px;
}

.nxb-gallery__arrow {
    position: absolute;
    z-index: 4;
    top: calc(50% - 1.75rem);
    display: grid;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
    place-items: center;
    transform: translateY(-50%);
}

.nxb-gallery__arrow--previous { left: .75rem; }
.nxb-gallery__arrow--next { right: .75rem; }

.nxb-gallery__arrow > span,
.nxb-gallery__lightbox-arrow > span {
    display: block;
    box-sizing: border-box;
    width: .75rem;
    height: .75rem;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
}

.nxb-gallery__arrow--previous > span,
.nxb-gallery__lightbox-arrow--previous > span {
    transform: translateX(.12rem) rotate(-135deg);
}

.nxb-gallery__arrow--next > span,
.nxb-gallery__lightbox-arrow--next > span {
    transform: translateX(-.12rem) rotate(45deg);
}

.nxb-gallery__dots {
    position: absolute;
    right: 50%;
    bottom: .25rem;
    transform: translateX(50%);
}

.nxb-gallery__dots-list {
    display: flex;
    gap: .35rem;
    align-items: center;
    padding: .35rem .5rem;
    margin: 0;
    border-radius: 999px;
    background: rgba(17, 24, 39, .82);
    list-style: none;
}

.nxb-gallery__dots-list li {
    padding: 0;
    margin: 0;
}

.nxb-gallery__dot {
    display: grid;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    place-items: center;
    background: transparent;
}

.nxb-gallery__dot > span {
    display: block;
    width: .6rem;
    height: .6rem;
    border: 2px solid #fff;
    border-radius: 50%;
}

.nxb-gallery__dot[aria-current="true"] > span,
.nxb-gallery__dots-list .slick-active .nxb-gallery__dot > span {
    background: #fff;
}

.nxb-gallery__toggle {
    position: absolute;
    bottom: .25rem;
    left: .25rem;
    display: grid;
    min-width: 2.5rem;
    min-height: 2.5rem;
    padding: .45rem;
    border-radius: 50%;
    place-items: center;
}

.nxb-gallery__lightbox {
    width: min(94vw, 90rem);
    max-width: none;
    height: min(92vh, 60rem);
    max-height: none;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
}

.nxb-gallery__lightbox:not([open]) {
    display: none;
}

.nxb-gallery__lightbox::backdrop {
    background: rgba(0, 0, 0, .88);
}

.nxb-gallery__lightbox-panel {
    position: relative;
    display: grid;
    width: 100%;
    height: 100%;
    grid-template-columns: 4rem minmax(0, 1fr) 4rem;
    grid-template-rows: minmax(0, 1fr) auto;
    align-items: center;
}

.nxb-gallery__lightbox-figure {
    display: grid;
    min-width: 0;
    max-height: 100%;
    margin: 0;
    place-items: center;
}

.nxb-gallery__lightbox-image {
    display: block;
    max-width: 100%;
    max-height: calc(92vh - 5rem);
    object-fit: contain;
}

.nxb-gallery__lightbox-caption {
    max-width: 60rem;
    padding-top: .75rem;
    text-align: center;
}

.nxb-gallery__lightbox-caption:empty {
    display: none;
}

.nxb-gallery__lightbox-close {
    position: absolute;
    z-index: 2;
    top: .5rem;
    right: .5rem;
    display: grid;
    width: 2.75rem;
    height: 2.75rem;
    padding: 0;
    border-radius: 50%;
    place-items: center;
    font-size: 2rem;
    line-height: 1;
}

.nxb-gallery__lightbox-arrow {
    display: grid;
    width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
    place-items: center;
}

.nxb-gallery__lightbox-arrow--previous { justify-self: start; }
.nxb-gallery__lightbox-arrow--next { justify-self: end; }

.nxb-gallery__lightbox-position {
    grid-column: 1 / -1;
    margin: .75rem 0 0;
    text-align: center;
}

.nxb-gallery__visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media (max-width: 1199px) {
    .nxb-gallery__viewport {
        grid-template-columns: repeat(var(--nxb-gallery-large-columns, 4), minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .nxb-gallery__viewport {
        grid-template-columns: repeat(var(--nxb-gallery-tablet-columns, 3), minmax(0, 1fr));
    }
}

@media (max-width: 574px) {
    .nxb-gallery__viewport { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 575px) and (max-width: 767px) {
    .nxb-gallery__viewport { grid-template-columns: repeat(var(--nxb-gallery-small-columns, 2), minmax(0, 1fr)); }
}

@media (max-width: 767px) {
    .nxb-gallery__viewport {
        min-width: 0;
    }

    .nxb-gallery__arrow {
        width: 2.5rem;
        height: 2.5rem;
    }

    .nxb-gallery__arrow--previous { left: .35rem; }
    .nxb-gallery__arrow--next { right: .35rem; }

    .nxb-gallery__lightbox-panel {
        grid-template-columns: 3rem minmax(0, 1fr) 3rem;
    }

    .nxb-gallery__lightbox-arrow {
        width: 2.5rem;
        height: 2.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .nxb-gallery__image,
    .nxb-gallery .slick-track,
    .nxb-gallery .slick-slide {
        transition-duration: 0ms !important;
    }
}
.nxb-gallery--thumbnails { margin: 0; padding-bottom: 0; }
.nxb-gallery--thumbnails .nxb-gallery__link { display: flex; aspect-ratio: 1.45; background: #fff; align-items: center; justify-content: center; }
.nxb-gallery--thumbnails .nxb-gallery__image { width: 100%; height: 100%; object-fit: contain; }
.nxb-gallery__thumbnails { display: flex; gap: 18px; margin-top: 22px; }
.nxb-gallery__thumbnails button { flex: 1; min-width: 0; max-width: 210px; padding: 10px; border: 1px solid #ddd; background: #fff; cursor: pointer; }
.nxb-gallery__thumbnails button[aria-pressed=true] { border: 2px solid var(--site-primary); padding: 9px; }
.nxb-gallery__thumbnails img { width: 100%; height: auto; aspect-ratio: 1.45; object-fit: contain; }
.nxb-gallery__thumbnails button:focus-visible { outline: 3px solid #173454; outline-offset: 4px; }

.nxb-gallery__link--video { min-height: 120px; }
.nxb-gallery__link--video::before { content: ""; position: absolute; inset: 0; z-index: 1; background: #000; opacity: .25; transition: opacity .3s ease; }
.nxb-gallery__link--video:hover::before, .nxb-gallery__link--video:focus-visible::before { opacity: .5; }
.nxb-gallery__link--video:hover .nxb-gallery__image, .nxb-gallery__link--video:focus-visible .nxb-gallery__image { opacity: 1; transform: scale(1.05); }
.nxb-gallery__play { position: absolute; top: 50%; left: 50%; z-index: 2; transform: translate(-50%, -50%); width: 30px; height: 38.4px; background: #fff; clip-path: polygon(0 0, 100% 50%, 0 100%); font-size: 0; }
.nxb-gallery__item { position: relative; }
.nxb-gallery__item > figcaption { position: absolute; bottom: 0; left: 0; z-index: 3; max-width: 100%; margin: 0; padding: 5px 10px 7px; color: #fff; background: #0009; font-size: 85%; font-style: italic; line-height: 24px; opacity: .8; pointer-events: none; }
@media (min-width: 992px) { .nxb-gallery__play { width: 40px; height: 51.2px; } }
@media (min-width: 1200px) { .nxb-gallery__play { width: 50px; height: 64px; } }
.nxb-gallery__lightbox-figure { grid-column: 2; grid-row: 1; }
.nxb-gallery__lightbox [hidden] { display: none !important; }
.nxb-gallery__lightbox-video { width: min(100%, 72rem); }
.nxb-gallery__lightbox-figure:has(.nxb-gallery__lightbox-video:not([hidden])) { width: 100%; }
.nxb-gallery__video-frame:empty { display: none; }
.nxb-gallery__video-frame :is(iframe, video) { display: block; width: 100%; max-height: calc(92vh - 8rem); aspect-ratio: 16 / 9; border: 0; background: #000; }
.nxb-gallery__video-fallback { padding: 2rem; text-align: center; background: #222; }
.nxb-gallery__video-fallback :is(a, button) { display: inline-block; margin: .5rem; padding: .65rem 1rem; border: 1px solid #fff; color: #fff; background: transparent; font: inherit; cursor: pointer; }
