.gallery-lightbox {
    box-sizing: border-box;
    width: min(1200px,calc(100% - 40px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 12px 22px 16px;
    background: #101010;
    color: #f5f5f5;
    border: 1px solid #303030;
    border-radius: 14px;
    box-shadow: 0 24px 80px #000a;
    overflow: auto;
    overscroll-behavior: contain;
}

.gallery-lightbox .lb-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.gallery-lightbox .lb-count {
    font-size: .82rem;
    color: #aaa;
    font-variant-numeric: tabular-nums;
    letter-spacing: .08em;
    padding-left: 4px;
}

.gallery-lightbox button {
    box-sizing: border-box;
    font: inherit;
    cursor: pointer;
    color: #f2f2f2;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 10px;
    padding: 0;
    display: grid;
    place-items: center;
    flex: none;
    width: 48px;
    height: 48px;
    min-width: 48px;
    min-height: 48px;
    line-height: 1;
    transition: background .16s,color .16s,border-color .16s;
    touch-action: manipulation;
}

.gallery-lightbox button svg {
    display: block;
    width: 24px;
    height: 24px;
    flex: none;
    pointer-events: none;
}

.gallery-lightbox button:focus-visible {
    outline: 2px solid var(--accent,#ed1728);
    outline-offset: 2px;
}

.gallery-lightbox .lb-stage {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0,1fr);
    align-items: center;
    isolation: isolate;
    touch-action: pan-y;
}

.gallery-lightbox .lb-image {
    display: block;
    grid-area: 1/1;
    width: 100%;
    height: clamp(120px,calc(100vh - 250px),780px);
    height: clamp(120px,calc(100dvh - 250px),780px);
    object-fit: contain;
    border-radius: 5px;
}

.gallery-lightbox .lb-prev,.gallery-lightbox .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1;
    background: rgba(15,15,15,.78);
    border-color: #ffffff24;
    box-shadow: 0 2px 12px #0005;
    border-radius: 50%;
}

.gallery-lightbox .lb-prev {
    left: 8px;
}

.gallery-lightbox .lb-next {
    right: 8px;
}

.gallery-lightbox .lb-caption {
    text-align: center;
    padding: 14px 8px 12px;
}

.gallery-lightbox .lb-caption h2 {
    color: #fff;
    font-size: clamp(1rem,2vw,1.25rem);
    line-height: 1.3;
    margin: 0 0 4px;
    letter-spacing: normal;
}

.gallery-lightbox .lb-caption p {
    color: #b4b4b4;
    font-size: .86rem;
    line-height: 1.45;
    margin: 0;
}

.gallery-lightbox .lb-thumbs {
    position: relative;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding: 5px 3px 6px;
    scrollbar-width: none;
    border-top: 1px solid #ffffff0f;
}

.gallery-lightbox .lb-thumbs::-webkit-scrollbar {
    display: none;
}

.gallery-lightbox .lb-thumbs button {
    width: 90px;
    height: 68px;
    min-width: 90px;
    min-height: 68px;
    border-radius: 6px;
    border: 2px solid transparent;
    overflow: hidden;
    opacity: .58;
    background: #202020;
}

.gallery-lightbox .lb-thumbs button[aria-current="true"] {
    border-color: #c72434;
    opacity: 1;
}

.gallery-lightbox .lb-thumbs img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 3px;
}

@media(hover:hover) {
    .gallery-lightbox .lb-prev:hover,.gallery-lightbox .lb-next:hover {
        background: #39151c;
        color: #fff;
        border-color: var(--accent,#ed1728);
    }

    .gallery-lightbox .lb-thumbs button:hover {
        opacity: 1;
    }
}

@media(max-width:600px) {
    .gallery-lightbox {
        width: calc(100% - 12px);
        max-height: calc(100vh - 12px);
        max-height: calc(100dvh - 12px);
        padding: 8px 8px 10px;
        border-radius: 10px;
    }

    .gallery-lightbox .lb-top {
        margin-bottom: 6px;
    }

    .gallery-lightbox .lb-prev,.gallery-lightbox .lb-next {
        width: 48px;
        height: 48px;
        min-width: 48px;
        min-height: 48px;
    }

    .gallery-lightbox .lb-prev {
        left: 4px;
    }

    .gallery-lightbox .lb-next {
        right: 4px;
    }

    .gallery-lightbox .lb-image {
        height: clamp(120px,calc(100dvh - 265px),650px);
    }

    .gallery-lightbox .lb-thumbs button {
        width: 70px;
        height: 54px;
        min-width: 70px;
        min-height: 54px;
    }

    .gallery-lightbox .lb-caption {
        padding: 10px 4px;
    }

    .gallery-lightbox .lb-caption p {
        font-size: .82rem;
    }
}

@media(prefers-reduced-motion:reduce) {
    .gallery-lightbox button {
        transition: none;
    }
}

.gallery-lightbox .lb-thumbs {
    user-select: none;
    -webkit-user-select: none;
}

.gallery-lightbox .lb-thumbs img {
    -webkit-user-drag: none;
}

@media(hover:hover) and (pointer:fine) {
    .gallery-lightbox .lb-thumbs,.gallery-lightbox .lb-thumbs button {
        cursor: grab;
    }

    .gallery-lightbox .lb-thumbs.is-dragging,.gallery-lightbox .lb-thumbs.is-dragging button {
        cursor: grabbing;
    }

    .gallery-lightbox .lb-thumbs.is-dragging {
        scroll-behavior: auto;
    }

    .gallery-lightbox .lb-thumbs button:hover {
        border-color: var(--accent,#ed1728);
    }
}

.gallery-grid[hidden],#gallery-inline[hidden] {
    display: none !important;
}

.gallery-section {
    padding: clamp(42px,5vw,78px) 0 0;
    background: url("../img/gallery-background.webp?v=160") center center/cover no-repeat,#fff;
    color: #171717;
}

.gallery-section .section-head h2 {
    color: #171717;
}

.gallery-section .section-head p {
    color: #444;
}

.gallery-embedded.gallery-lightbox {
    width: 100%;
    max-height: none;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    overflow: visible;
    overscroll-behavior: auto;
    padding: 0 0 24px;
}

.gallery-embedded .lb-top {
    width: min(1200px,calc(100% - 48px));
    margin: 0 auto 10px;
}

.gallery-embedded .lb-stage {
    --gallery-photo-width: min(78vw,1100px, 52.941vw, 596.79px);
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0,1fr) minmax(0,var(--gallery-photo-width)) minmax(0,1fr);
    align-items: center;
}

.gallery-embedded .lb-image {
    width: 100%;
    height: clamp(260px,55vw,620px);
    object-fit: contain;
    cursor: default;
}

.gallery-embedded .lb-prev,.gallery-embedded .lb-next {
    position: relative;
    inset: auto;
    transform: none;
    grid-row: 1;
}

.gallery-embedded .lb-prev {
    grid-column: 1;
}

.gallery-embedded .lb-next {
    grid-column: 3;
}

.gallery-embedded .lb-caption {
    min-height: 90px;
    box-sizing: border-box;
    padding-inline: 24px;
}

.gallery-embedded .lb-thumbs {
    margin-inline: clamp(12px,3vw,48px);
    overscroll-behavior-y: auto;
}

.gallery-section .gallery-grid:not([hidden]) {
    padding-bottom: 24px;
}

@media(max-width:600px) {
    .gallery-section {
        background-image: url("../img/gallery-background-768.webp?v=160");
    }

    .gallery-embedded .lb-stage {
        display: grid;
        grid-template-columns: 1fr;
    }

    .gallery-embedded .lb-image {
        
        height: clamp(220px,82vw,380px);
    }

    .gallery-embedded .lb-prev,.gallery-embedded .lb-next {
        
        grid-column: 1;
    }

    .gallery-embedded .lb-prev {
        left: 8px;
    }

    .gallery-embedded .lb-next {
        right: 8px;
    }

    .gallery-embedded .lb-caption {
        min-height: 100px;
    }
}

.gallery-embedded.gallery-lightbox {
    color: #171717;
}

.gallery-embedded .lb-count {
    color: #555;
}

.gallery-embedded .lb-caption h2 {
    color: #171717;
}

.gallery-embedded .lb-caption p {
    color: #444;
}

.gallery-embedded .lb-prev,.gallery-embedded .lb-next {
    background: #fff;
    color: #262626;
    border-color: #d5d5d5;
    box-shadow: 0 2px 10px #00000012;
}

.gallery-embedded .lb-thumbs {
    border-top-color: #00000012;
}

@media(hover:hover) {
    .gallery-embedded .lb-prev:hover,.gallery-embedded .lb-next:hover {
        background: #39151c;
        border-color: var(--accent,#ed1728);
    }
}

.gallery-embedded .lb-stage {
    height: clamp(260px,55vw,620px);
    grid-template-rows: minmax(0,1fr);
}

.gallery-embedded .lb-image {
    width: auto;
    
    max-height: 100%;
    align-self: center;
    border-radius: 12px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
}

.gallery-embedded .lb-prev,.gallery-embedded .lb-next {
    background: #171717;
    color: #fff;
    border-color: #171717;
    box-shadow: 0 3px 12px #0002;
}

.gallery-embedded .lb-thumbs button {
    opacity: 1;
    background: transparent;
    border-color: transparent;
}

.gallery-embedded .lb-thumbs button[aria-current="true"] {
    border-color: var(--accent,#ed1728);
}

.gallery-embedded .lb-thumbs img {
    opacity: 1;
    filter: none;
}

.gallery-embedded .lb-count {
    color: #333;
}

@media(hover:hover) {
    .gallery-embedded .lb-prev:hover,.gallery-embedded .lb-next:hover {
        background: var(--teal,#b20d20);
        color: #fff;
        border-color: var(--teal,#b20d20);
    }

    .gallery-embedded .lb-thumbs button:hover {
        border-color: var(--accent,#ed1728);
    }

    .gallery-embedded .lb-thumbs:not(.is-dragging) button:hover {
        box-shadow: 0 2px 6px #0002;
    }
}

@media(max-width:600px) {
    .gallery-embedded .lb-stage {
        height: clamp(220px,82vw,380px);
    }

    .gallery-embedded .lb-image {
        width: auto;
        max-width: 100%;
        max-height: 100%;
        border-radius: 10px;
    }
}

.gallery-embedded .lb-stage {
    width: min(1200px,calc(100% - 72px));
    margin-inline: auto;
    grid-template-columns: 48px minmax(0,1fr) 48px;
    grid-template-rows: auto;
    column-gap: 16px;
}

.gallery-embedded .lb-image {
    grid-area: 1/2;
    width: min(100%,826px);
    height: auto;
    aspect-ratio: 4/3;
    max-width: 100%;
    max-height: none;
    object-fit: cover;
    display: block;
    justify-self: center;
}

.gallery-embedded .lb-prev {
    justify-self: start;
}

.gallery-embedded .lb-next {
    justify-self: end;
}

@media(max-width:1000px) {
    .gallery-embedded .lb-stage {
        width: calc(100% - 48px);
    }
}

@media(max-width:760px) {
    .gallery-embedded .lb-stage {
        width: calc(100% - 36px);
    }
}

@media(max-width:600px) {
    .gallery-embedded .lb-stage {
        grid-template-columns: minmax(0,1fr);
        column-gap: 0;
        height: auto;
    }

    .gallery-embedded .lb-image {
        grid-area: 1/1;
        width: 100%;
        height: auto;
        max-height: none;
    }

    .gallery-embedded .lb-prev,.gallery-embedded .lb-next {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .gallery-embedded .lb-prev {
        left: 0;
        right: auto;
        justify-self: start;
    }

    .gallery-embedded .lb-next {
        right: 0;
        left: auto;
        justify-self: end;
    }
}

.gallery-embedded .lb-thumbs {
    width: min(1200px,calc(100% - 72px));
    box-sizing: border-box;
    margin-inline: auto;
    padding: 16px 10px 18px;
    border-top: 0;
    gap: 10px;
    margin-top: 16px;
}

.gallery-embedded .lb-thumbs button {
    border: 0;
    border-radius: 7px;
    transition: transform .18s ease,box-shadow .18s ease;
    box-shadow: none;
}

.gallery-embedded .lb-thumbs img {
    border-radius: 7px;
}

.gallery-embedded .lb-thumbs button[aria-current="true"] {
    transform: translateY(-6px);
    box-shadow: 0 7px 12px #0005;
    border: 0;
}

@media(hover:hover) {
    .gallery-embedded .lb-thumbs:not(.is-dragging) button:not([aria-current="true"]):hover {
        transform: translateY(-2px);
        box-shadow: 0 3px 7px #0002;
    }

    .gallery-embedded .lb-thumbs:not(.is-dragging) button[aria-current="true"]:hover {
        box-shadow: 0 7px 12px #0005;
    }
}

@media(max-width:1000px) {
    .gallery-embedded .lb-thumbs {
        width: calc(100% - 48px);
    }
}

@media(max-width:760px) {
    .gallery-embedded .lb-thumbs {
        width: calc(100% - 36px);
    }
}

@media(max-width:600px) {
    .gallery-embedded .lb-thumbs button[aria-current="true"] {
        transform: translateY(-4px);
    }
}

@media(prefers-reduced-motion:reduce) {
    .gallery-embedded .lb-thumbs button {
        transition: none;
    }
}

@media(max-width:600px) {
    .gallery-section {
        background-size: 100% auto;
        background-position: center top;
        background-repeat: no-repeat;
    }
}

.gallery-embedded .lb-stage {
    grid-template-columns: minmax(48px,1fr) minmax(0,min(826px,calc(100% - 112px))) minmax(48px,1fr);
    column-gap: 0;
    height: auto;
}

.gallery-embedded .lb-photo-frame {
    position: relative;
    grid-area: 1/2;
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 12px 32px #0003;
    background: #fff;
}

.gallery-embedded .lb-photo-frame .lb-image {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
    border-radius: 0;
    box-shadow: none;
}

.gallery-embedded .lb-prev,.gallery-embedded .lb-next {
    justify-self: center;
    align-self: center;
}

.gallery-embedded .lb-caption {
    position: absolute;
    inset: auto 0 0;
    min-height: 0;
    text-align: left;
    padding: 46px 24px 20px;
    background: linear-gradient(transparent,rgba(0,0,0,.78));
    color: #fff;
    pointer-events: none;
}

.gallery-embedded .lb-caption h2 {
    color: #fff;
    border-left: 3px solid var(--accent,#ed1728);
    padding-left: 12px;
    margin: 0 0 5px;
}

.gallery-embedded .lb-caption p {
    color: #fff;
    padding-left: 15px;
    text-shadow: none;
}

@media(max-width:600px) {
    .gallery-embedded .lb-stage {
        grid-template-columns: minmax(36px,1fr) minmax(0,calc(100% - 72px)) minmax(36px,1fr);
    }

    .gallery-embedded .lb-photo-frame {
        grid-area: 1/2;
        border-radius: 12px;
    }

    .gallery-embedded .lb-prev,.gallery-embedded .lb-next {
        position: relative;
        inset: auto;
        transform: none;
        grid-area: 1/1;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        justify-self: center;
    }

    .gallery-embedded .lb-next {
        grid-area: 1/3;
    }

    .gallery-embedded .lb-prev svg,.gallery-embedded .lb-next svg {
        width: 20px;
        height: 20px;
    }

    .gallery-embedded .lb-caption {
        padding: 26px 10px 10px;
    }

    .gallery-embedded .lb-caption h2 {
        font-size: .88rem;
        padding-left: 7px;
    }

    .gallery-embedded .lb-caption p {
        font-size: .7rem;
        padding-left: 10px;
        line-height: 1.25;
    }
}

.gallery-embedded .lb-caption {
    background: none;
    padding: 18px 24px 20px;
}

.gallery-embedded .lb-caption-copy {
    padding-left: 12px;
}

.gallery-embedded .lb-caption h2,.gallery-embedded .lb-caption p {
    border: 0;
    padding-left: 0;
    
}

.gallery-embedded .lb-caption p {
    -webkit-text-stroke: 0;
}

#gallery-viewer {
    user-select: none;
    -webkit-user-select: none;
}

#gallery-viewer img {
    -webkit-user-drag: none;
    -webkit-touch-callout: none;
}

@media(max-width:600px) {
    .gallery-embedded .lb-caption {
        padding: 10px;
    }

    .gallery-embedded .lb-caption-copy {
        padding-left: 7px;
    }
}

.gallery-embedded .lb-caption {
    background: linear-gradient(90deg,rgba(0,0,0,.72) 0%,rgba(0,0,0,.72) 65%,rgba(0,0,0,.48) 100%);
    padding: 14px 24px 16px;
}

.gallery-embedded .lb-caption h2,.gallery-embedded .lb-caption p {
    color: #fff;
    text-shadow: none;
    -webkit-text-stroke: 0;
}

.gallery-embedded .lb-caption-copy {
    border-left: 3px solid var(--accent,#ed1728);
}

@media(max-width:600px) {
    .gallery-embedded .lb-caption {
        padding: 8px 10px;
        background: rgba(0,0,0,.72);
    }
}

@media(max-width:600px) {
    .gallery-embedded .lb-thumbs {
        margin-top: 12px;
    }
}

.gallery-embedded .lb-photo-frame .lb-image {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.gallery-embedded .lb-caption {
    z-index: 1;
}
