.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 { margin: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: var(--gallery-image-aspect, 4 / 3);
    object-fit: cover;
    transition: transform .25s ease, opacity .25s ease;
}

a.nxb-gallery__link:hover .nxb-gallery__image,
a.nxb-gallery__link:focus-visible .nxb-gallery__image {
    opacity: .4;
    transform: scale(1.05);
}

.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;
}

html:has(.nxb-gallery__lightbox[open]),body:has(.nxb-gallery__lightbox[open]) { overflow:hidden; }
.nxb-gallery__lightbox { width:100vw; max-width:none; height:100dvh; max-height:none; margin:0; padding:50px 0; border:0; background:transparent; color:#fff; overflow:auto; }
.nxb-gallery__lightbox:not([open]) { display:none; }
.nxb-gallery__lightbox::backdrop { background:rgba(0,0,0,.75); }
.nxb-gallery__lightbox-panel { display:flex; align-items:center; width:100%; min-height:100%; }
.nxb-gallery__lightbox-figure { position:relative; flex:none; width:100%; aspect-ratio:16 / 9; margin:0; }
.nxb-gallery__lightbox-image { position:absolute; inset:0; display:block; width:auto; height:auto; max-width:100%; max-height:100%; margin:auto; object-fit:contain; border-radius:2px; }
.nxb-gallery__lightbox-caption { position:absolute; top:100%; width:100%; padding:8px; text-align:center; }
.nxb-gallery__lightbox-caption:empty { display:none; }
.nxb-gallery__lightbox-close { position:fixed; z-index:3; top:0; right:0; width:50px; height:50px; padding:0; border:0; border-radius:0 0 0 5px; background:#fff; color:var(--site-primary); font:35px/50px TenbySymbols; }
.nxb-gallery__lightbox-arrow { position:fixed; z-index:2; top:50%; width:100px; height:75vh; padding:0; border:0; border-radius:0; transform:translateY(-50%); background:transparent; color:var(--site-primary); opacity:.5; transition:opacity .15s ease; }
.nxb-gallery__lightbox-arrow:is(:hover,:focus) { opacity:.9; }
.nxb-gallery__lightbox-arrow--previous { left:0; }
.nxb-gallery__lightbox-arrow--next { right:0; }
.nxb-gallery__lightbox-arrow > span { position:absolute; top:50%; display:block; width:40px; height:40px; border:0; transform:translateY(-50%); background:#fff; font:20px/40px TenbySymbols; text-align:center; }
.nxb-gallery__lightbox-arrow--previous > span { left:0; border-radius:0 5px 5px 0; }
.nxb-gallery__lightbox-arrow--next > span { right:0; border-radius:5px 0 0 5px; }
.nxb-gallery__lightbox-arrow--previous > span::before { content:'\f282'; }
.nxb-gallery__lightbox-arrow--next > span::before { content:'\f284'; }
@media(min-width:1350px) { .nxb-gallery__lightbox { padding:50px; } }

.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; }

}

@media (prefers-reduced-motion: reduce) {
    .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 { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; width:100%; }
.nxb-gallery__video-frame { width:100%; }
.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%; 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; }
