/* Structured page content rendered from JSON block documents. */

.page-content {
    --page-measure-inset: max(2px, calc((100% - var(--prose-measure, 52rem)) / 2));
    width: 100%;
    text-align: left;
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: flex-start;
}

.page-content > .page-richtext,
.page-content > .page-list,
.page-content > .page-quote,
.page-content > .page-callout,
.page-content > .page-divider,
.page-content > .page-heading,
.page-content > .page-paragraph,
.page-content > .page-figure {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
}

.page-content > .page-richtext,
.page-content > .page-list,
.page-content > .page-quote,
.page-content > .page-callout,
.page-content > .page-heading,
.page-content > .page-paragraph {
    /* Full row so prose cannot sit beside the gallery; measure is centered inside. */
    flex: 0 0 100%;
    max-width: none;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: var(--content-type-block-gap, 14px);
    padding: 0;
    box-sizing: border-box;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-radius: 0;
}

/* Dim hugs the readable measure, not the full content column. */
.page-box .page-content > .page-richtext,
.page-box .page-content > .page-heading,
.page-box .page-content > .page-paragraph,
.page-box .page-content > .page-list,
.page-box .page-content > .page-quote,
.page-box .page-content > .page-callout,
.info-lightbox-text .page-content > .page-richtext,
.info-lightbox-text .page-content > .page-heading,
.info-lightbox-text .page-content > .page-paragraph,
.info-lightbox-text .page-content > .page-list,
.info-lightbox-text .page-content > .page-quote,
.info-lightbox-text .page-content > .page-callout {
    max-width: var(--prose-measure, min(70ch, 52rem));
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding: var(--content-panel-pad-y, 12px) var(--content-panel-pad-x, 16px);
    border-radius: var(--content-panel-radius, 10px);
    border: var(--content-panel-border-width, 0) solid var(--content-panel-border, transparent);
    background: var(--content-panel-fill, var(--panel-fill));
    -webkit-backdrop-filter: blur(var(--content-panel-blur, var(--panel-blur, 5px)));
    backdrop-filter: blur(var(--content-panel-blur, var(--panel-blur, 5px)));
    box-sizing: border-box;
}

.page-box .page-content > .page-list,
.info-lightbox-text .page-content > .page-list {
    padding-left: calc(var(--content-panel-pad-x, 16px) + 1.2rem);
}

.page-box .page-content > .page-quote,
.page-box .page-content > .page-callout,
.info-lightbox-text .page-content > .page-quote,
.info-lightbox-text .page-content > .page-callout {
    padding-left: calc(var(--content-panel-pad-x, 16px) + 2px);
    padding-right: var(--content-panel-pad-x, 16px);
}

.page-content::after {
    content: "";
    display: table;
    clear: both;
}

.page-richtext {
    width: 100%;
    max-width: var(--prose-measure, min(70ch, 52rem));
    margin: 0 auto var(--content-type-block-gap, 14px);
    padding: 2px;
    box-sizing: border-box;
    text-align: left;
    line-height: var(--content-type-line-height, 1.2);
    color: var(--role-body, var(--color-text-muted, #dddddd));
}

.page-richtext h1,
.page-richtext h2,
.page-richtext h3,
.page-richtext h4,
.page-richtext p,
.page-richtext pre.page-text-code,
.page-richtext p.page-text-small,
.page-richtext li {
    text-align: left;
}

.page-richtext .page-align-center,
.page-richtext h1.page-align-center,
.page-richtext h2.page-align-center,
.page-richtext h3.page-align-center,
.page-richtext h4.page-align-center,
.page-richtext p.page-align-center,
.page-richtext pre.page-text-code.page-align-center,
.page-richtext p.page-text-small.page-align-center {
    text-align: center;
}

.page-richtext .page-align-right,
.page-richtext h1.page-align-right,
.page-richtext h2.page-align-right,
.page-richtext h3.page-align-right,
.page-richtext h4.page-align-right,
.page-richtext p.page-align-right,
.page-richtext pre.page-text-code.page-align-right,
.page-richtext p.page-text-small.page-align-right {
    text-align: right;
}

.page-richtext .page-align-left,
.page-richtext h1.page-align-left,
.page-richtext h2.page-align-left,
.page-richtext h3.page-align-left,
.page-richtext h4.page-align-left,
.page-richtext p.page-align-left,
.page-richtext pre.page-text-code.page-align-left,
.page-richtext p.page-text-small.page-align-left {
    text-align: left;
}

.page-richtext h1 {
    color: var(--role-heading, var(--primary-color));
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 calc(var(--content-type-block-gap, 10px) + 2px);
    text-shadow: 0 0 10px var(--primary-a30);
}

.page-richtext h2 {
    color: var(--role-heading, var(--primary-color));
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 var(--content-type-block-gap, 10px);
}

.page-richtext h3 {
    color: var(--role-heading, var(--primary-color));
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 calc(var(--content-type-block-gap, 10px) - 2px);
}

.page-richtext h4 {
    color: var(--role-heading-sub, var(--secondary-color));
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 calc(var(--content-type-block-gap, 10px) - 2px);
}

.page-richtext p.page-text-small {
    font-size: 13px;
    line-height: calc(var(--content-type-line-height, 1.2) - 0.1);
    margin: 0 0 var(--content-type-block-gap, 10px);
    color: var(--role-muted, var(--color-text-muted));
}

.page-richtext pre.page-text-code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 13px;
    line-height: calc(var(--content-type-line-height, 1.2) - 0.15);
    color: #e8e8e8;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 10px 12px;
    margin: 0 0 var(--content-type-block-gap, 10px);
    white-space: pre-wrap;
    overflow-x: auto;
}

.page-richtext code {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 4px;
}

.page-richtext p {
    margin: 0 0 var(--content-type-block-gap, 10px);
}

.page-richtext ul,
.page-richtext ol {
    margin: 0 0 var(--content-type-block-gap, 10px);
    padding-left: 1.2rem;
    color: var(--role-body, var(--color-text-muted));
}

.page-richtext blockquote {
    margin: 0 0 var(--content-type-block-gap, 10px);
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 3px solid var(--role-blockquote, var(--primary-color));
    color: var(--role-muted, var(--color-text-muted));
}

.page-richtext hr {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    margin: var(--content-type-block-gap, 10px) 0;
}

.page-picture {
    --pw-num: 1;
    --pw-den: 1;
    margin: 0;
    overflow: hidden;
    box-sizing: border-box;
}

.page-picture--flow-row,
.page-picture--flow-row-end {
    flex: 0 0 calc(100% * var(--pw-num) / var(--pw-den));
    max-width: calc(100% * var(--pw-num) / var(--pw-den));
    min-width: 0;
    padding: 2px;
    box-sizing: border-box;
}

.page-picture--flow-row-end {
    margin-left: auto;
}

.page-picture--flow-row-center {
    flex: 0 0 100%;
    max-width: 100%;
    min-width: 0;
    padding: 2px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.page-picture--flow-row-center .page-picture-media,
.page-picture--flow-row-center .page-picture-body {
    width: calc(100% * var(--pw-num) / var(--pw-den));
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.page-picture--flow-row-center .page-picture-body {
    text-align: center;
}

.page-picture--flow-wrap-left,
.page-picture--flow-wrap-right,
.page-picture--flow-beside-left,
.page-picture--flow-beside-right {
    flex: 0 0 100%;
    max-width: 100%;
}

.page-picture--flow-row .page-picture-body,
.page-picture--flow-row-end .page-picture-body {
    margin: 0;
    text-align: center;
}

.page-picture-body .page-align-center,
.page-picture-body h1.page-align-center,
.page-picture-body h2.page-align-center,
.page-picture-body h3.page-align-center,
.page-picture-body h4.page-align-center,
.page-picture-body p.page-align-center,
.page-picture-body pre.page-text-code.page-align-center,
.page-picture-body p.page-text-small.page-align-center {
    text-align: center;
}

.page-picture-body .page-align-right,
.page-picture-body h1.page-align-right,
.page-picture-body h2.page-align-right,
.page-picture-body h3.page-align-right,
.page-picture-body h4.page-align-right,
.page-picture-body p.page-align-right,
.page-picture-body pre.page-text-code.page-align-right,
.page-picture-body p.page-text-small.page-align-right {
    text-align: right;
}

.page-picture-body .page-align-left,
.page-picture-body h1.page-align-left,
.page-picture-body h2.page-align-left,
.page-picture-body h3.page-align-left,
.page-picture-body h4.page-align-left,
.page-picture-body p.page-align-left,
.page-picture-body pre.page-text-code.page-align-left,
.page-picture-body p.page-text-small.page-align-left {
    text-align: left;
}

.page-picture--flow-row .page-picture-media,
.page-picture--flow-row-end .page-picture-media {
    margin: 0;
    padding: 0;
}

.page-picture--flow-beside-left,
.page-picture--flow-beside-right {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    text-align: left;
}

.page-picture--flow-beside-right {
    flex-direction: row-reverse;
}

.page-picture--flow-beside-left .page-picture-media,
.page-picture--flow-beside-right .page-picture-media {
    flex: 0 0 calc(100% * var(--pw-num) / var(--pw-den));
    max-width: calc(100% * var(--pw-num) / var(--pw-den));
    margin: 0;
}

.page-picture--flow-beside-left .page-picture-body,
.page-picture--flow-beside-right .page-picture-body {
    flex: 1 1 auto;
    min-width: 0;
}

.page-picture--flow-wrap-left .page-picture-media,
.page-picture--flow-wrap-right .page-picture-media {
    max-width: min(100%, calc(100% * var(--pw-num) / var(--pw-den)));
    margin-bottom: 8px;
}

.page-picture--flow-wrap-left .page-picture-media {
    float: left;
    margin: 0 12px 8px 0;
}

.page-picture--flow-wrap-right .page-picture-media {
    float: right;
    margin: 0 0 8px 12px;
}

.page-picture::after {
    content: "";
    display: table;
    clear: both;
}

.page-picture-media {
    margin: 0;
    padding: 0;
}

.page-picture-media img,
.page-picture-media video {
    display: block;
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
    margin: 0;
    padding: 0;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.page-box .page-picture-media img,
.page-box .page-picture-media video,
.info-lightbox-text .page-picture-media img,
.info-lightbox-text .page-picture-media video {
    width: 100%;
    max-width: 100%;
    max-height: none;
    margin: 0;
}

.page-picture-body {
    text-align: left;
    line-height: 1.6;
    color: var(--color-text-muted, #dddddd);
    margin: 0;
    padding: 2px;
    box-sizing: border-box;
}

.page-picture-body h1,
.page-picture-body h2,
.page-picture-body h3,
.page-picture-body h4 {
    color: var(--primary-color);
    font-weight: 700;
}

.page-picture-body h1 {
    font-size: 20px;
}

.page-picture-body h2 {
    font-size: 18px;
}

.page-picture-body h3 {
    font-size: 16px;
}

.page-picture-body h4 {
    font-size: 15px;
}

.page-picture-body h1,
.page-picture-body h2,
.page-picture-body h3,
.page-picture-body h4,
.page-picture-body p,
.page-picture-body pre.page-text-code,
.page-picture-body p.page-text-small {
    text-align: inherit;
    margin: 0;
    padding: 0;
}

.page-picture-body h4 + p,
.page-picture-body h3 + p,
.page-picture-body h2 + p,
.page-picture-body h1 + p {
    margin-top: 2px;
}

.page-picture-body pre.page-text-code,
.page-picture-body code {
    font-family: Consolas, "Courier New", monospace;
}

.page-picture-body pre.page-text-code {
    font-size: 13px;
    line-height: 1.45;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 10px;
    white-space: pre-wrap;
    overflow-x: auto;
}

.page-picture-body p.page-text-small {
    font-size: 13px;
}

.page-picture-body code {
    font-size: 0.92em;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    padding: 1px 4px;
}

.page-heading {
    color: var(--primary-color);
    font-weight: 700;
    margin: 0 0 12px;
    text-align: center;
}

.page-heading--2 {
    font-size: 18px;
    text-shadow: 0 0 10px var(--primary-a30);
}

.page-heading--3 {
    font-size: 16px;
}

.page-heading--4 {
    font-size: 15px;
    color: var(--secondary-color);
}

.page-paragraph {
    margin: 0 0 12px;
    line-height: 1.6;
    color: var(--color-text-muted, #dddddd);
    text-align: center;
}

.page-list {
    margin: 0 auto 14px;
    padding-left: 1.2rem;
    max-width: var(--prose-measure, min(70ch, 52rem));
    color: var(--color-text-muted, #dddddd);
    text-align: left;
}

.page-list li + li {
    margin-top: 6px;
}

.page-quote {
    margin: 0 auto 14px;
    max-width: var(--prose-measure, min(70ch, 52rem));
    padding: 12px 14px;
    border-left: 3px solid var(--role-blockquote, var(--primary-color));
    background: color-mix(in srgb, var(--role-blockquote, var(--primary-color)) 8%, transparent);
    border-radius: 10px;
    color: var(--role-muted, var(--color-text-muted, #dddddd));
    text-align: left;
}

.page-quote p {
    margin: 0;
}

.page-quote-attribution {
    margin-top: 8px;
    font-size: 13px;
    color: var(--role-heading-sub, var(--secondary-color));
}

.page-figure {
    margin: 0 auto 14px;
}

.page-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.35);
}

.page-caption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--secondary-color);
    text-align: center;
}

.page-image--inline {
    max-width: min(100%, 280px);
}

.page-image--feature {
    max-width: min(100%, 420px);
}

.page-image--wide,
.page-image--banner {
    max-width: 100%;
}

.page-image--banner img {
    width: 100%;
    max-height: min(48vh, 360px);
    object-fit: cover;
}

.page-image--float-left,
.page-image--float-right {
    max-width: min(46%, 220px);
    margin-bottom: 10px;
}

.page-image--float-left {
    float: left;
    margin-right: 14px;
}

.page-image--float-right {
    float: right;
    margin-left: 14px;
}

.page-divider {
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
    margin: 18px auto;
    max-width: 12rem;
}

.page-callout {
    margin: 0 auto 14px;
    max-width: var(--prose-measure, min(70ch, 52rem));
    padding: 12px 14px;
    border-radius: 10px;
    text-align: left;
}

.page-callout p {
    margin: 0;
    line-height: 1.55;
}

.page-callout--note {
    background: var(--primary-a10);
    border: 1px solid var(--primary-a24);
    color: var(--color-text-muted, #dddddd);
}

.page-callout--tip {
    background: rgba(76, 175, 80, 0.12);
    border: 1px solid rgba(76, 175, 80, 0.28);
    color: #d8f5d3;
}

.page-content a,
.page-richtext a,
.page-picture-body a {
    color: var(--color-link, var(--primary-color));
    text-decoration: underline;
    text-underline-offset: 2px;
}

.page-content a:hover,
.page-richtext a:hover,
.page-picture-body a:hover {
    color: var(--color-link-hover, var(--color-link, var(--primary-color)));
}

.page-content a:visited,
.page-richtext a:visited,
.page-picture-body a:visited {
    color: var(--color-link-visited, var(--secondary-color));
}

.page-box .page-content,
.info-lightbox-text .page-content {
    padding: 2px;
    margin: 0;
    box-sizing: border-box;
    text-align: left;
}

.page-box .page-picture-body h1,
.page-box .page-picture-body h2,
.page-box .page-picture-body h3,
.page-box .page-picture-body h4,
.page-box .page-picture-body p {
    margin-top: 0;
    margin-bottom: 0;
}

@media (max-width: 767px) {
    .page-picture--flow-row,
    .page-picture--flow-row-end {
        flex: 0 0 100%;
        max-width: 100%;
        margin-left: 0;
    }

    .page-picture--flow-row-center .page-picture-media,
    .page-picture--flow-row-center .page-picture-body {
        width: 100%;
    }

    .page-picture--flow-beside-left,
    .page-picture--flow-beside-right {
        flex-direction: column;
    }

    .page-picture--flow-beside-left .page-picture-media,
    .page-picture--flow-beside-right .page-picture-media {
        flex: 0 0 auto;
        max-width: 100%;
    }

    .page-picture--flow-wrap-left .page-picture-media,
    .page-picture--flow-wrap-right .page-picture-media,
    .page-image--float-left,
    .page-image--float-right {
        float: none;
        max-width: 100%;
        margin-left: auto;
        margin-right: auto;
    }
}

.page-content > .page-gallery {
    flex: 0 0 100%;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 18px;
    padding: var(--content-panel-pad-y, 12px) var(--content-panel-pad-x, 12px);
    border-radius: var(--content-panel-radius, 10px);
    border: var(--content-panel-border-width, 0) solid var(--content-panel-border, transparent);
    background: var(--content-panel-fill, var(--panel-fill));
    -webkit-backdrop-filter: blur(var(--content-panel-blur, var(--panel-blur, 5px)));
    backdrop-filter: blur(var(--content-panel-blur, var(--panel-blur, 5px)));
}

.page-gallery-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.page-gallery-item {
    margin: 0;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
    /* Cards already sit on a dimmed gallery panel; light accent wash only. */
    background: var(--primary-a05);
    border: 1px solid var(--primary-a20);
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.page-gallery-item:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-a30);
}

.page-gallery-media {
    display: block;
    position: relative;
    overflow: hidden;
}

.page-gallery-item img,
.page-gallery-item video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.page-gallery-item:hover img,
.page-gallery-item:hover video {
    transform: scale(1.03);
}

.page-gallery-item--video .page-gallery-video-play {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
    pointer-events: none;
}

/* Grid: native photo ratios; last incomplete row stays centered.
   Optional --page-gallery-columns caps how many sit in one row. */
.page-gallery--grid .page-gallery-item {
    flex: 1 1 220px;
    width: auto;
    max-width: 320px;
}

.page-gallery--grid.page-gallery--cols .page-gallery-grid {
    display: grid;
    grid-template-columns: repeat(var(--page-gallery-columns, 4), minmax(0, 1fr));
    justify-content: center;
    align-items: start;
}

.page-gallery--grid.page-gallery--cols .page-gallery-item {
    flex: none;
    width: auto;
    max-width: none;
    min-width: 0;
}

.page-gallery--grid .page-gallery-item img,
.page-gallery--grid .page-gallery-item video {
    width: 100%;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.page-gallery--grid .page-gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 28px 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.3;
    text-align: left;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .page-gallery--grid .page-gallery-item figcaption {
        opacity: 0;
        transform: translateY(6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .page-gallery--grid .page-gallery-item:hover figcaption,
    .page-gallery--grid .page-gallery-item:focus-visible figcaption,
    .page-gallery--grid .page-gallery-item:focus-within figcaption {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 520px) {
    .page-gallery--grid .page-gallery-item {
        flex: 1 1 100%;
        max-width: 100%;
    }

    .page-gallery--grid.page-gallery--cols .page-gallery-grid {
        grid-template-columns: 1fr;
    }
}

/* List: editorial rows — square thumb + name. */
.page-gallery--list .page-gallery-grid {
    flex-direction: column;
    flex-wrap: nowrap;
    align-items: stretch;
    justify-content: flex-start;
    gap: 10px;
}

.page-gallery--list .page-gallery-item {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    flex: 0 0 auto;
    width: 100%;
    max-width: none;
}

.page-gallery--list .page-gallery-media {
    flex: 0 0 168px;
    width: 168px;
    height: 168px;
}

.page-gallery--list .page-gallery-item figcaption {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    padding: 14px 18px;
    font-size: 1.05rem;
    line-height: 1.35;
    color: var(--color-text, #f2f2f2);
    text-align: left;
}

@media (max-width: 520px) {
    .page-gallery--list .page-gallery-item {
        flex-direction: column;
    }

    .page-gallery--list .page-gallery-media {
        flex: none;
        width: 100%;
        height: auto;
        aspect-ratio: 16 / 9;
    }

    .page-gallery--list .page-gallery-item img,
    .page-gallery--list .page-gallery-item video {
        position: absolute;
        inset: 0;
        width: auto;
        height: auto;
        max-width: none;
        max-height: none;
    }
}

/* Carousel: snap-scroll hero with neighbor peek, dots, and prev/next. */
.page-gallery--carousel {
    position: relative;
}

.page-gallery--carousel .page-gallery-carousel-stage {
    position: relative;
}

.page-gallery--carousel .page-gallery-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 11%;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    padding-block: 4px;
}

.page-gallery--carousel .page-gallery-grid::-webkit-scrollbar {
    display: none;
}

.page-gallery--carousel .page-gallery-item {
    flex: 0 0 78%;
    width: 78%;
    max-width: 78%;
    scroll-snap-align: center;
    scroll-snap-stop: always;
}

.page-gallery--carousel .page-gallery-item img,
.page-gallery--carousel .page-gallery-item video {
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: min(58vh, 520px);
    margin-inline: auto;
    object-fit: contain;
}

.page-gallery--carousel .page-gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 28px 12px 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-size: 0.85rem;
    line-height: 1.3;
    text-align: left;
    pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
    .page-gallery--carousel .page-gallery-item figcaption {
        opacity: 0;
        transform: translateY(6px);
        transition: opacity 0.2s ease, transform 0.2s ease;
    }

    .page-gallery--carousel .page-gallery-item:hover figcaption,
    .page-gallery--carousel .page-gallery-item:focus-visible figcaption,
    .page-gallery--carousel .page-gallery-item:focus-within figcaption {
        opacity: 1;
        transform: none;
    }
}

.page-gallery-carousel-nav {
    position: absolute;
    top: 50%;
    z-index: 3;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.page-gallery-carousel-prev {
    left: 6px;
}

.page-gallery-carousel-next {
    right: 6px;
}

@media (hover: hover) {
    .page-gallery-carousel-nav:hover {
        background: var(--primary-a35);
        box-shadow: 0 0 12px var(--primary-color);
        color: var(--primary-color);
    }
}

.page-gallery-carousel-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
}

.page-gallery-carousel-dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 1px solid var(--primary-a35, rgba(255, 255, 255, 0.45));
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.page-gallery-carousel-dot[aria-current="true"] {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.page-gallery--carousel-single .page-gallery-carousel-nav,
.page-gallery--carousel-single .page-gallery-carousel-dots {
    display: none;
}

.page-gallery--carousel-single .page-gallery-item {
    flex-basis: 100%;
    width: 100%;
    max-width: 100%;
}

@media (max-width: 520px) {
    .page-gallery--carousel .page-gallery-grid {
        scroll-padding-inline: 7%;
    }

    .page-gallery--carousel .page-gallery-item {
        flex-basis: 86%;
        width: 86%;
        max-width: 86%;
    }
}

/* Animated: one full-width frame; JS wipes to the next item.
   The viewport is sized to the active photo’s ratio (capped by max-height)
   so images fill the frame without cropping. */
.page-gallery--animated .page-gallery-animated-viewport {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 160px;
    max-height: min(58vh, 560px);
    margin-inline: auto;
    overflow: hidden;
    background: #000;
    border-radius: 8px;
}

.page-gallery--animated .page-gallery-item {
    position: absolute;
    inset: 0;
    flex: none;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 0;
}

.page-gallery--animated .page-gallery-item.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

.page-gallery--animated .page-gallery-item.is-incoming {
    opacity: 1;
    pointer-events: none;
    z-index: 2;
}

.page-gallery--animated .page-gallery-media {
    position: absolute;
    inset: 0;
    height: auto;
}

.page-gallery--animated .page-gallery-item img,
.page-gallery--animated .page-gallery-item video,
.page-box .page-gallery--animated .page-gallery-item img,
.page-box .page-gallery--animated .page-gallery-item video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    object-fit: contain;
    object-position: center;
    transition: none;
}

.page-gallery--animated .page-gallery-item:hover img,
.page-gallery--animated .page-gallery-item:hover video {
    transform: none;
}

.page-gallery--animated .page-gallery-item figcaption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    margin: 0;
    padding: 28px 14px 12px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    color: #fff;
    font-size: 0.9rem;
    line-height: 1.3;
    text-align: left;
    pointer-events: none;
}

.page-gallery-animated-fx {
    position: absolute;
    inset: 0;
    z-index: 4;
    pointer-events: none;
}

.page-gallery-animated-fx svg {
    display: block;
    width: 100%;
    height: 100%;
}

.page-gallery-animated-tiles {
    position: absolute;
    inset: 0;
    z-index: 4;
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: repeat(4, 1fr);
    pointer-events: none;
}

.page-gallery-animated-tiles span {
    display: block;
    background-repeat: no-repeat;
    opacity: 1;
}

@keyframes bp-gallery-push-left-out { to { transform: translateX(-100%); } }
@keyframes bp-gallery-push-left-in { from { transform: translateX(100%); } to { transform: none; } }
@keyframes bp-gallery-push-right-out { to { transform: translateX(100%); } }
@keyframes bp-gallery-push-right-in { from { transform: translateX(-100%); } to { transform: none; } }
@keyframes bp-gallery-push-up-out { to { transform: translateY(-100%); } }
@keyframes bp-gallery-push-up-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes bp-gallery-push-down-out { to { transform: translateY(100%); } }
@keyframes bp-gallery-push-down-in { from { transform: translateY(-100%); } to { transform: none; } }
@keyframes bp-gallery-blend-in { from { opacity: 0; } to { opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .page-gallery-item img,
    .page-gallery-item video,
    .page-gallery--grid .page-gallery-item figcaption,
    .page-gallery--carousel .page-gallery-item figcaption,
    .page-gallery--animated .page-gallery-item figcaption {
        transition: none;
    }

    .page-gallery--carousel .page-gallery-grid {
        scroll-behavior: auto;
    }

    .page-gallery-item:hover img,
    .page-gallery-item:hover video {
        transform: none;
    }
}

.page-gallery-preview-hint {
    margin: 0;
    padding: 12px;
    color: var(--color-text-muted, #dddddd);
    font-size: 0.9rem;
    border: 1px dashed var(--primary-a35);
    border-radius: 8px;
}
