.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;
}

.gallery-lightbox-open { overflow: hidden; }

.nxb-gallery__lightbox {
    position: fixed;
    inset: 0;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 50px;
    border: 0;
    overflow: hidden;
    background: transparent;
    color: #fff;
}

.nxb-gallery__lightbox:not([open]) { display: none; }
.nxb-gallery__lightbox::backdrop { background: rgba(0, 0, 0, .75); }

.nxb-gallery__lightbox-panel {
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.nxb-gallery__lightbox-figure {
    display: flex;
    width: 100%;
    height: min(calc((100vw - 100px) * .5625), calc(100dvh - 100px));
    margin: 0;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.nxb-gallery__lightbox-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    pointer-events: auto;
}

.nxb-gallery__lightbox-caption,
.nxb-gallery__lightbox-position {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.nxb-gallery__lightbox-close {
    position: fixed;
    z-index: 2;
    top: 0;
    right: 0;
    display: grid;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #fff;
    place-items: center;
    font-size: 0;
    font-weight: 300;
    line-height: 1;
}

.nxb-gallery__lightbox-arrow {
    position: fixed;
    top: 50%;
    display: grid;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    color: var(--site-primary);
    opacity: .5;
    transform: translateY(-50%);
    place-items: center;
}

.nxb-gallery__lightbox-arrow:is(:hover,:focus-visible) { opacity: 1; }
.nxb-gallery__lightbox-arrow--previous { left: 0; }
.nxb-gallery__lightbox-arrow--next { right: 0; }
.nxb-gallery__lightbox-arrow > span { width: 0; height: 0; border: 4px solid transparent; transform: none; }
.nxb-gallery__lightbox-arrow--previous > span { border-left: 0; border-right-color: currentColor; }
.nxb-gallery__lightbox-arrow--next > span { border-right: 0; border-left-color: currentColor; }

.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-tablet-columns, 3), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .nxb-gallery__viewport {
        grid-template-columns: minmax(0, 1fr);
    }

    .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__lightbox-close::before,.nxb-gallery__lightbox-close::after {
    content: '';
    position: absolute;
    width: 26px;
    height: 3px;
    background: currentColor;
    transform: rotate(45deg);
}
.nxb-gallery__lightbox-close::after { transform: rotate(-45deg); }
@media (max-width:1349px) {
    .nxb-gallery__lightbox { padding: 50px 0; }
    .nxb-gallery__lightbox-figure { height: min(calc(100vw * .5625), calc(100dvh - 100px)); }
    .nxb-gallery__lightbox-close { color: var(--site-primary); background: #fff; box-shadow: 0 0 15px rgb(0 0 0 / 15%); }
}