/* North Alliance: infinite loop gallery + lightbox. Everything is scoped to .na-gal / .na-gal-lb */

.na-gal {
    --na-gal-accent: #ee5300;
    /* The photos are portrait 3:4; a landscape crop cuts off the gutter line at the top */
    --na-gal-ratio: 3 / 4;
    --na-gal-gap: 24px;
    --na-gal-w: min(calc((100% - 2 * var(--na-gal-gap)) / 3), 54vh);
    --na-gal-dim-scale: 0.9;
    --na-gal-dim-opacity: 0.42;
    --na-gal-speed: 0.55s;

    position: relative;
    box-sizing: border-box;
    width: 100%;
    margin: 0;
    padding: 90px 0;
    overflow: hidden;
    background: #121212;
    color: #ffffff;
    font-family: 'Inter Tight', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.na-gal *,
.na-gal *::before,
.na-gal *::after {
    box-sizing: border-box;
}

/* Heading: mirrors the site's T396 section headers (label left, title from ~1/3) */
.na-gal__head {
    display: grid;
    grid-template-columns: 33.6% minmax(0, 1fr);
    align-items: start;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 40px;
}

.na-gal__label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 12px;
    font-weight: 300;
    line-height: 1.1;
    letter-spacing: 0;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.6);
}

.na-gal__label::before {
    content: "";
    flex: 0 0 4px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: var(--na-gal-accent);
}

.na-gal__title {
    max-width: 560px;
    margin: 0;
    padding: 0;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 36px;
    font-weight: 500;
    line-height: 1.1;
    letter-spacing: 0;
    text-transform: uppercase;
    color: #ffffff;
}

.na-gal__text {
    max-width: 520px;
    margin: 20px 0 0;
    padding: 0;
    font-family: 'Inter Tight', Arial, sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

/* Slider */
.na-gal__slider {
    position: relative;
    max-width: 1320px;
    margin: 56px auto 0;
    padding: 0 40px;
    outline: none;
}

.na-gal__slider:focus-visible {
    outline: 2px solid var(--na-gal-accent);
    outline-offset: 8px;
}

/* Without JS the strip is a plain scroll-snap row */
.na-gal__viewport {
    position: relative;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}

.na-gal__viewport::-webkit-scrollbar {
    display: none;
}

.na-gal__slider.is-ready .na-gal__viewport {
    overflow: hidden;
    scroll-snap-type: none;
    touch-action: pan-y;
    cursor: grab;
}

.na-gal__slider.is-dragging .na-gal__viewport {
    cursor: grabbing;
}

.na-gal__track {
    position: relative;
    display: flex;
    gap: var(--na-gal-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.na-gal__slider.is-ready .na-gal__track {
    will-change: transform;
}

.na-gal__slide {
    position: relative;
    flex: 0 0 var(--na-gal-w);
    min-width: 0;
    margin: 0;
    padding: 0;
    scroll-snap-align: center;
}

.na-gal__card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: var(--na-gal-ratio);
    margin: 0;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 8px;
    background: #1e1e1e;
    color: inherit;
    font: inherit;
    cursor: zoom-in;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

@supports not (aspect-ratio: 1 / 1) {
    .na-gal__card::before {
        content: "";
        display: block;
        padding-top: 133.3333%;
    }
}

.na-gal__slider.is-ready .na-gal__card {
    transform: scale(var(--na-gal-dim-scale));
    opacity: var(--na-gal-dim-opacity);
    transition: transform var(--na-gal-speed) cubic-bezier(.22, .61, .36, 1),
        opacity var(--na-gal-speed) ease;
}

.na-gal__slider.is-ready .is-active .na-gal__card {
    transform: none;
    opacity: 1;
}

.na-gal__slider.is-dragging .na-gal__card {
    cursor: grabbing;
}

.na-gal__card:focus {
    outline: none;
}

.na-gal__card:focus-visible {
    outline: 2px solid var(--na-gal-accent);
    outline-offset: -2px;
}

.na-gal__card img {
    position: absolute;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    margin: 0;
    object-fit: cover;
    object-position: center;
    border: 0;
    pointer-events: none;
    -webkit-user-drag: none;
    transition: transform 0.6s ease;
}

.na-gal__zoom {
    position: absolute;
    right: 14px;
    bottom: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(18, 18, 18, 0.6);
    color: #ffffff;
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.na-gal__zoom svg {
    display: block;
    width: 18px;
    height: 18px;
}

.na-gal__slider.is-ready .is-active .na-gal__card:focus-visible .na-gal__zoom {
    opacity: 1;
}

@media (hover: hover) {
    .na-gal__slider.is-ready .is-active .na-gal__card:hover img {
        transform: scale(1.03);
    }

    .na-gal__slider.is-ready .is-active .na-gal__card:hover .na-gal__zoom {
        opacity: 1;
    }

    .na-gal__slider.is-ready:not(.is-dragging) .na-gal__slide:not(.is-active) .na-gal__card:hover {
        opacity: 0.7;
    }
}

/* Controls: counter, progress, buttons */
.na-gal__controls {
    display: flex;
    align-items: center;
    gap: 24px;
    margin-top: 32px;
}

.na-gal__counter {
    flex: 0 0 auto;
    margin: 0;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 20px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    color: #ffffff;
}

.na-gal__total {
    color: rgba(255, 255, 255, 0.45);
}

.na-gal__progress {
    position: relative;
    flex: 1 1 auto;
    min-width: 40px;
    height: 2px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.15);
}

.na-gal__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background: var(--na-gal-accent);
    transition: width var(--na-gal-speed) ease;
}

.na-gal__btns {
    display: flex;
    flex: 0 0 auto;
    gap: 10px;
}

.na-gal__btn,
.na-gal-lb__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 48px;
    height: 48px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    background: transparent;
    color: #ffffff;
    font: inherit;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.na-gal__btn svg,
.na-gal-lb__btn svg {
    display: block;
    width: 20px;
    height: 20px;
    pointer-events: none;
}

.na-gal__btn:focus,
.na-gal-lb__btn:focus {
    outline: none;
}

.na-gal__btn:focus-visible,
.na-gal-lb__btn:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

@media (hover: hover) {
    .na-gal__btn:hover,
    .na-gal-lb__btn:hover {
        border-color: var(--na-gal-accent, #ee5300);
        background: var(--na-gal-accent, #ee5300);
    }
}

.na-gal__btn:active,
.na-gal-lb__btn:active {
    border-color: var(--na-gal-accent, #ee5300);
    background: var(--na-gal-accent, #ee5300);
}

.na-gal__icon-play,
.na-gal__slider.is-paused .na-gal__icon-pause {
    display: none !important;
}

.na-gal__slider.is-paused .na-gal__icon-play {
    display: block !important;
}

/* The play/pause and arrow controls are useless without JS */
.na-gal__slider:not(.is-ready) .na-gal__btns,
.na-gal__slider:not(.is-ready) .na-gal__progress {
    visibility: hidden;
}

.na-gal__sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0 0 0 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

@media screen and (max-width: 1599px) {
    .na-gal__label {
        font-size: 10px;
    }

    .na-gal__title {
        max-width: 440px;
        font-size: 28px;
    }
}

/* Tablet: active slide centered, neighbours peeking, slider edge to edge */
@media screen and (max-width: 960px) {
    .na-gal {
        --na-gal-gap: 16px;
        --na-gal-w: 46%;
        padding: 72px 0;
    }

    .na-gal__head {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 12px;
        padding: 0 20px;
    }

    .na-gal__title {
        font-size: 24px;
    }

    .na-gal__slider {
        margin-top: 40px;
        padding: 0;
    }

    .na-gal__slider:focus-visible {
        outline-offset: 2px;
    }

    .na-gal__controls {
        padding: 0 20px;
    }
}

@media screen and (max-width: 640px) {
    .na-gal {
        --na-gal-gap: 12px;
        --na-gal-w: 76%;
        --na-gal-dim-scale: 0.92;
        --na-gal-dim-opacity: 0.5;
        padding: 60px 0;
    }

    .na-gal__label {
        font-size: 12px;
    }

    .na-gal__title {
        font-size: 22px;
    }

    .na-gal__text {
        margin-top: 14px;
        font-size: 15px;
    }

    .na-gal__slider {
        margin-top: 32px;
    }

    .na-gal__controls {
        gap: 16px;
        margin-top: 24px;
    }

    .na-gal__counter {
        font-size: 18px;
    }

    .na-gal__btns {
        gap: 8px;
    }

    .na-gal__btn {
        width: 44px;
        height: 44px;
    }

    .na-gal__zoom {
        display: none;
    }
}

/* Lightbox (appended to <body>) */
html.na-gal-locked,
html.na-gal-locked body {
    overflow: hidden !important;
}

.na-gal-lb {
    --na-gal-accent: #ee5300;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 10000100;
    box-sizing: border-box;
    background: rgba(10, 10, 10, 0.96);
    color: #ffffff;
    font-family: 'Inter Tight', Arial, sans-serif;
    opacity: 0;
    transition: opacity 0.25s ease;
    touch-action: none;
    overscroll-behavior: contain;
    -webkit-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.na-gal-lb *,
.na-gal-lb *::before,
.na-gal-lb *::after {
    box-sizing: border-box;
}

.na-gal-lb[hidden] {
    display: none !important;
}

.na-gal-lb.is-open {
    opacity: 1;
}

.na-gal-lb__stage {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 76px 96px 72px;
}

.na-gal-lb__img {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    min-width: 0;
    margin: 0;
    object-fit: contain;
    border-radius: 4px;
    -webkit-user-drag: none;
    transition: opacity 0.2s ease, transform 0.25s ease;
}

.na-gal-lb__img.is-loading {
    opacity: 0;
}

.na-gal-lb__counter {
    position: absolute;
    top: 28px;
    left: 32px;
    font-family: 'Oswald', Arial, sans-serif;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    font-variant-numeric: tabular-nums;
}

.na-gal-lb__caption {
    position: absolute;
    right: 96px;
    bottom: 24px;
    left: 96px;
    margin: 0;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: rgba(255, 255, 255, 0.7);
}

.na-gal-lb__btn {
    position: absolute;
    background: rgba(18, 18, 18, 0.55);
}

.na-gal-lb__close {
    top: 16px;
    right: 20px;
}

.na-gal-lb__prev,
.na-gal-lb__next {
    top: 50%;
    width: 56px;
    height: 56px;
    margin-top: -28px;
}

.na-gal-lb__prev {
    left: 24px;
}

.na-gal-lb__next {
    right: 24px;
}

@media screen and (max-width: 640px) {
    .na-gal-lb__stage {
        padding: 68px 8px 84px;
    }

    .na-gal-lb__counter {
        top: 26px;
        left: 20px;
    }

    .na-gal-lb__close {
        top: 12px;
        right: 12px;
    }

    .na-gal-lb__prev,
    .na-gal-lb__next {
        top: auto;
        bottom: 16px;
        width: 48px;
        height: 48px;
        margin-top: 0;
    }

    .na-gal-lb__prev {
        left: 16px;
    }

    .na-gal-lb__next {
        right: 16px;
    }

    .na-gal-lb__caption {
        right: 76px;
        bottom: 32px;
        left: 76px;
        font-size: 13px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .na-gal__slider.is-ready .na-gal__card,
    .na-gal__card img,
    .na-gal__bar,
    .na-gal__zoom,
    .na-gal-lb,
    .na-gal-lb__img {
        transition: none !important;
    }
}
