/*! ============================================================
   Copyright © 2026 SAA Graphics ApS. Alle rettigheder forbeholdes.
   saagraphics.com

   Koden ligger frit læsbar, fordi den kører i browseren.
   Det gør den ikke fri at bruge. Kopiering, ændring og
   videredistribution kræver skriftlig tilladelse.
   ============================================================ */

.customGallery {
    --color-text-light:       #f7f3f3;
    --color-text-outline:     #000;
    --color-frame:            #4e3556;
    --color-frame-mat:        #14111f;
    --color-frame-cast-shadow: rgb(0 0 0 / 0.6);
    --color-shade:            rgb(0 0 0 / 0.6);
    --color-focus-dark:       #000;

    --font-interface: "Kanit", sans-serif;

    --font-size-large: 2rem;
}

.customGallery {
    --menu-font-size:         clamp(1rem, 1.7cqi, var(--font-size-large));
    --menu-spacing:           clamp(0.5rem, 1.5cqi, 1.5rem);
    --target-size:            max(44px, 2.75rem);
    --icon-size:              round(clamp(1.5rem, 2.5cqi, 3rem), 2px);
    --control-size:           max(var(--target-size), var(--icon-size));
    --image-arrow-size:       clamp(var(--target-size), 4cqi, 4rem);
    --thumbnail-min-width:    round(up, (var(--target-size) - 2 * var(--thumbnail-frame-width)) * 16 / 9, 1px);
    --thumbnail-width:        max(var(--thumbnail-min-width), round(16cqi, 1px));
    --thumbnail-frame-gap:        0px;
    --thumbnail-frame-line:       2px;
    --thumbnail-frame-style:      solid;
    --thumbnail-frame-color:      var(--color-frame);
    --thumbnail-frame-background: none;
    --thumbnail-frame-shadow:     none;
    --thumbnail-frame-inner-line: none;
    --thumbnail-frame-width:      calc(var(--thumbnail-frame-gap) + var(--thumbnail-frame-line));
    --image-frame-space:          0px;
    --image-frame-band-top:       transparent, transparent;
    --image-frame-band-bottom:    var(--image-frame-band-top);
    --color-current-mark:         var(--color-text-light);

    --color-frame-light:      color-mix(in oklab, var(--color-frame), white 22%);
    --color-frame-side:       color-mix(in oklab, var(--color-frame), white 10%);
    --color-frame-shade:      color-mix(in oklab, var(--color-frame), black 25%);
    --color-frame-dark:       color-mix(in oklab, var(--color-frame), black 45%);
    --color-frame-lip:        color-mix(in oklab, var(--color-frame), white 40%);
    --color-frame-mat-light:  color-mix(in oklab, var(--color-frame-mat), white 5%);
    --color-frame-edge:       color-mix(in oklab, var(--color-frame-mat), black 45%);
    --thumbnail-gap:          var(--focus-ring-space);
    --strip-thumbnail-count:  6;
    --overview-columns:       4;
    --fade-duration:          1s;
    --controls-fade-duration: 0.3s;
    --focus-ring-space:       4px;

    --text-glow-size:         calc(var(--menu-font-size) * 0.3);
    --icon-glow-size:         calc(var(--menu-font-size) * 0.2);
    --icon-glow:              drop-shadow(0 0 1px var(--color-text-outline)) drop-shadow(0 0 var(--icon-glow-size) var(--color-text-outline));
    --icon-brightness:        1.08;

    display: grid;
    place-items: center;
}

.customGallery [hidden] {
    display: none;
}

.customGallery-heading {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.customGallery :focus-visible {
    outline: 2px solid var(--color-text-light);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px var(--color-focus-dark);
}

.customGallery-stage {
    container-type: inline-size;
    width: min(100%, 1920px);
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
        "slideshow"
        "controls"
        "thumbnails";
}

.customGallery-overview-placeholder {
    grid-area: thumbnails;
    align-self: start;
    justify-self: center;
    display: grid;
    grid-template-columns: repeat(var(--overview-columns), auto);
    gap: var(--thumbnail-gap);
    padding-bottom: var(--menu-spacing);
    visibility: hidden;
    pointer-events: none;
}

.customGallery-overview-placeholder-cell {
    box-sizing: content-box;
    width: var(--thumbnail-width);
    aspect-ratio: 16 / 9;
    border: var(--thumbnail-frame-width) solid transparent;
}

.customGallery-slideshow {
    grid-area: slideshow;
    display: grid;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    isolation: isolate;
    touch-action: pan-y;
    user-select: none;
    -webkit-user-select: none;
}

.customGallery-slideshow:focus-visible {
    outline: 2px solid transparent;
    outline-offset: -2px;
    box-shadow: none;
}

.customGallery-slideshow::after {
    content: "";
    grid-area: 1 / 1;
    z-index: 3;
    pointer-events: none;
}

.customGallery-slideshow:focus-visible::after {
    box-shadow:
        inset 0 0 0 3px var(--color-text-light),
        inset 0 0 0 6px var(--color-focus-dark);
}

.customGallery-slide {
    grid-area: 1 / 1;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
}

.customGallery-slide-previous {
    z-index: 1;
    opacity: 1;
}

.customGallery-slide-active {
    z-index: 2;
    opacity: 1;
    transition: opacity var(--fade-duration);
}

.customGallery-image-arrow {
    z-index: 3;
    display: none;
    align-self: center;
    margin-inline: var(--menu-spacing);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
}

.customGallery-image-arrow-previous {
    grid-area: slideshow;
    justify-self: start;
}

.customGallery-image-arrow-next {
    grid-area: slideshow;
    justify-self: end;
}

.customGallery-image-arrow img {
    display: block;
    width: var(--image-arrow-size);
    height: var(--image-arrow-size);
}

.customGallery-image-arrow-next img,
.customGallery-strip-arrow-next img {
    transform: scaleX(-1);
}

@media (hover: hover) and (pointer: fine) {
    .customGallery-image-arrow {
        display: block;
        opacity: 0;
        pointer-events: none;
    }

    .customGallery-image-arrow-visible,
    .customGallery-image-arrow:focus-visible {
        opacity: 0.85;
        pointer-events: auto;
        transition: opacity var(--controls-fade-duration);
    }

    .customGallery-image-arrow-visible:hover,
    .customGallery-image-arrow:focus-visible {
        opacity: 1;
    }
}

.customGallery-controls {
    grid-area: controls;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: var(--menu-spacing);
    padding: var(--menu-spacing);
}

.customGallery-gallery-choice,
.customGallery-controls-center {
    display: flex;
    align-items: center;
    gap: max(0px, var(--menu-spacing) - (var(--control-size) - var(--icon-size)));
}

.customGallery-gallery-choice {
    justify-self: start;
}

.customGallery-controls-stacked {
    grid-template-columns: auto;
    justify-content: center;
}

.customGallery-controls-stacked .customGallery-gallery-choice {
    justify-self: center;
}

.customGallery-icon-button {
    position: relative;
    display: grid;
    place-items: center;
    min-width: var(--target-size);
    min-height: var(--target-size);
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    opacity: 0.85;
}

.customGallery-icon-button:hover,
.customGallery-icon-button:focus-visible {
    opacity: 1;
}

.customGallery-icon-image {
    display: block;
    width: var(--icon-size);
    height: var(--icon-size);
    object-fit: contain;
}

.customGallery-icon-image,
.customGallery-image-arrow img,
.customGallery-icon-button[aria-pressed="true"]::after {
    filter: brightness(var(--icon-brightness)) var(--icon-glow);
}

.customGallery-gallery-choice .customGallery-icon-image {
    filter: var(--icon-glow);
}

.customGallery-icon-button[aria-pressed="true"]::after {
    content: "";
    position: absolute;
    inset-inline: calc((100% - var(--icon-size)) / 2);
    top: calc(50% + var(--icon-size) / 2);
    height: calc(var(--icon-size) / 4);
    background: url("../images/uiux/icons/customGallery-selected-mark.png") center / contain no-repeat;
}

.customGallery-counter {
    display: grid;
    color: var(--color-text-light);
    font-family: var(--font-interface);
    font-size: var(--menu-font-size);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    text-align: center;
    text-shadow:
        -1px   -1px   0   var(--color-text-outline),
         1px   -1px   0   var(--color-text-outline),
        -1px    1px   0   var(--color-text-outline),
         1px    1px   0   var(--color-text-outline),
         0     -1px   0   var(--color-text-outline),
         0      1px   0   var(--color-text-outline),
        -1px    0     0   var(--color-text-outline),
         1px    0     0   var(--color-text-outline),
        -2px    0     1px var(--color-text-outline),
         2px    0     1px var(--color-text-outline),
         0     -2px   1px var(--color-text-outline),
         0      2px   1px var(--color-text-outline),
        -1.5px -1.5px 1px var(--color-text-outline),
         1.5px -1.5px 1px var(--color-text-outline),
        -1.5px  1.5px 1px var(--color-text-outline),
         1.5px  1.5px 1px var(--color-text-outline),
         0      0     2px var(--color-text-outline),
         0      0     3px var(--color-text-outline),
         0      0     4px var(--color-text-outline),
         0      0     var(--text-glow-size) var(--color-text-outline),
         0      0     var(--text-glow-size) var(--color-text-outline);
}

.customGallery-counter-text,
.customGallery-counter-sizer {
    grid-area: 1 / 1;
}

.customGallery-counter-sizer {
    visibility: hidden;
}

.customGallery-strip {
    grid-area: thumbnails;
    align-self: start;
    z-index: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--menu-spacing);
    padding: 0 var(--menu-spacing) var(--menu-spacing);
}

.customGallery-strip-track {
    --strip-step: calc(var(--thumbnail-width) + 2 * var(--thumbnail-frame-width) + var(--thumbnail-gap));
    --strip-space: calc(100cqi - 2 * var(--control-size) - 4 * var(--menu-spacing) + var(--thumbnail-gap) - 2 * var(--focus-ring-space));

    position: relative;
    flex: none;
    box-sizing: content-box;
    width: calc(min(var(--strip-thumbnail-count) * var(--strip-step), round(down, var(--strip-space), var(--strip-step))) - var(--thumbnail-gap));
    padding: var(--focus-ring-space);
    scroll-padding-inline: var(--focus-ring-space);
    display: flex;
    gap: var(--thumbnail-gap);
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.customGallery-strip-track::-webkit-scrollbar {
    display: none;
}

.customGallery-overview {
    grid-area: thumbnails;
    align-self: start;
    justify-self: center;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(var(--overview-columns), auto);
    gap: var(--thumbnail-gap);
    padding-bottom: var(--menu-spacing);
}

.customGallery-thumbnail {
    flex: none;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    scroll-snap-align: start;
}

.customGallery-thumbnail-image {
    display: block;
    box-sizing: content-box;
    width: var(--thumbnail-width);
    height: auto;
    aspect-ratio: auto 16 / 9;
    padding: var(--thumbnail-frame-gap);
    border-width: var(--thumbnail-frame-line);
    border-style: var(--thumbnail-frame-style);
    border-color: var(--thumbnail-frame-color);
    background: var(--thumbnail-frame-background);
    box-shadow: var(--thumbnail-frame-shadow);
    outline: var(--thumbnail-frame-inner-line);
    outline-offset: calc(-1 * var(--thumbnail-frame-width));
    color: transparent;
}

.customGallery-thumbnail:hover .customGallery-thumbnail-image {
    opacity: 0.8;
}

.customGallery-thumbnail[aria-current="true"] .customGallery-thumbnail-image {
    border-color: var(--color-current-mark);
    background: var(--color-current-mark);
    box-shadow: none;
    outline: none;
}

.customGallery-current-lighter {
    --thumbnail-dim-filter: saturate(0.6) brightness(0.8);
}

.customGallery-current-grayscale {
    --thumbnail-dim-filter: grayscale(1);
}

.customGallery-current-faded {
    --thumbnail-dim-filter: saturate(0.3) contrast(0.75) brightness(1.08);
}

:is(.customGallery-current-lighter, .customGallery-current-grayscale, .customGallery-current-faded) .customGallery-thumbnail-image {
    filter: var(--thumbnail-dim-filter);
    transition: filter var(--controls-fade-duration);
}

:is(.customGallery-current-lighter, .customGallery-current-grayscale, .customGallery-current-faded) :is(.customGallery-thumbnail[aria-current="true"], .customGallery-thumbnail:hover, .customGallery-thumbnail:focus-visible) .customGallery-thumbnail-image {
    filter: none;
}

:is(.customGallery-current-lighter, .customGallery-current-grayscale, .customGallery-current-faded) .customGallery-thumbnail[aria-current="true"] .customGallery-thumbnail-image {
    border-color: var(--thumbnail-frame-color);
    background: var(--thumbnail-frame-background);
    box-shadow: var(--thumbnail-frame-shadow);
    outline: var(--thumbnail-frame-inner-line);
}

@media (orientation: landscape) and (not (pointer: coarse)), (orientation: landscape) and (height >= 40rem) {

    .customGallery {
        --thumbnail-width: max(var(--thumbnail-min-width), round(10cqi, 1px));

        min-height: 100svh;
    }

    .customGallery-stage {
        width: min(100% - 2 * var(--image-frame-space), 1920px, (100svh - 2 * var(--image-frame-space)) * 16 / 9);
        position: relative;
        isolation: isolate;
        aspect-ratio: 16 / 9;
        grid-template-rows: minmax(0, 1fr) calc(3 * var(--menu-spacing)) auto auto;
        grid-template-areas:
            "overview"
            "overview"
            "strip"
            "controls";
    }

    .customGallery-slideshow,
    .customGallery-image-arrow-previous,
    .customGallery-image-arrow-next {
        grid-area: 1 / 1 / -1 / -1;
    }

    .customGallery-overview-placeholder {
        display: none;
    }

    .customGallery-stage::before {
        content: "";
        grid-area: 2 / 1 / -1 / -1;
        z-index: 1;
        background: linear-gradient(to top, var(--color-shade), transparent);
        pointer-events: none;
    }

    .customGallery-strip {
        grid-area: strip;
        padding-bottom: 0;
    }

    .customGallery-overview {
        grid-area: overview;
        align-self: center;
        max-height: 100%;
        overflow-y: auto;
        padding: var(--focus-ring-space);
    }

    .customGallery-stage::before,
    .customGallery-controls,
    .customGallery-strip,
    .customGallery-overview {
        opacity: 0;
        pointer-events: none;
        transition: opacity var(--controls-fade-duration);
    }

    .customGallery-controls-visible .customGallery-stage::before,
    .customGallery-controls-visible .customGallery-controls,
    .customGallery-controls-visible .customGallery-strip,
    .customGallery-controls-visible .customGallery-overview {
        opacity: 1;
    }

    .customGallery-controls-visible .customGallery-controls,
    .customGallery-controls-visible .customGallery-strip,
    .customGallery-controls-visible .customGallery-overview {
        pointer-events: auto;
    }
}

.customGallery-frame-simple {
    --image-frame-space: 8px;
    --image-frame-band-top: var(--color-frame) 0 2px, transparent 2px;
}

.customGallery-frame-double {
    --thumbnail-frame-gap:   2px;
    --thumbnail-frame-line:  3px;
    --thumbnail-frame-style: double;
    --image-frame-space:     13px;
    --image-frame-band-top:  var(--color-frame) 0 2px, transparent 2px 4px, var(--color-frame) 4px 6px, transparent 6px;
}

.customGallery-frame-triple {
    --thumbnail-frame-gap:        5px;
    --thumbnail-frame-line:       1px;
    --thumbnail-frame-background: var(--color-frame-mat);
    --thumbnail-frame-shadow:     inset 0 0 0 1px var(--color-frame-mat), inset 0 0 0 3px var(--color-frame);
    --thumbnail-frame-inner-line: 1px solid var(--color-frame);
    --image-frame-space:          17px;
    --image-frame-band-top:
        var(--color-frame) 0 1px, var(--color-frame-mat) 1px 4px,
        var(--color-frame) 4px 7px, var(--color-frame-mat) 7px 10px,
        var(--color-frame) 10px 11px, var(--color-frame-mat) 11px;
}

.customGallery-frame-passepartout {
    --thumbnail-frame-gap:        4px;
    --thumbnail-frame-line:       1px;
    --thumbnail-frame-background: var(--color-frame-mat-light);
    --thumbnail-frame-inner-line: 1px solid var(--color-frame-lip);
    --image-frame-space:          26px;
    --image-frame-band-top:
        var(--color-frame-dark) 0 3px, var(--color-frame-light) 3px 7px,
        var(--color-frame-edge) 7px 8px, var(--color-frame-mat-light) 8px 24px,
        var(--color-frame-edge) 24px 25px, var(--color-frame-lip) 25px;
    --image-frame-band-bottom:
        var(--color-frame-light) 0 3px, var(--color-frame-dark) 3px 7px,
        var(--color-frame-edge) 7px 8px, var(--color-frame-mat-light) 8px 24px,
        var(--color-frame-edge) 24px 25px, var(--color-frame-lip) 25px;
}

.customGallery-frame-profile {
    --thumbnail-frame-gap:        1px;
    --thumbnail-frame-line:       3px;
    --thumbnail-frame-color:      var(--color-frame-light) var(--color-frame-shade) var(--color-frame-dark) var(--color-frame-side);
    --thumbnail-frame-background: var(--color-frame-mat);
    --thumbnail-frame-shadow:     inset 0 1px 2px rgb(0 0 0 / 0.8);
    --image-frame-space:          23px;
    --image-frame-band-top:
        var(--color-frame-light) 0 12px,
        color-mix(in oklab, var(--color-frame-mat), black 70%) 12px, var(--color-frame-mat) 18px 22px,
        var(--color-frame-lip) 22px;
    --image-frame-band-bottom:
        var(--color-frame-dark) 0 12px, var(--color-frame-mat) 12px 22px,
        var(--color-frame-lip) 22px;
    --profile-frame-width:        12px;
    --profile-cast-shadow:        0 14px 34px;
    --profile-mat-shadow:         0 3px 7px;
}

.customGallery-frame-profile-light {
    --thumbnail-frame-gap:        1px;
    --thumbnail-frame-line:       2px;
    --thumbnail-frame-color:      var(--color-frame-light) var(--color-frame-shade) var(--color-frame-dark) var(--color-frame-side);
    --thumbnail-frame-background: var(--color-frame-mat);
    --thumbnail-frame-shadow:     inset 0 1px 1px rgb(0 0 0 / 0.8);
    --image-frame-space:          12px;
    --image-frame-band-top:
        var(--color-frame-light) 0 6px,
        color-mix(in oklab, var(--color-frame-mat), black 70%) 6px, var(--color-frame-mat) 9px 11px,
        var(--color-frame-lip) 11px;
    --image-frame-band-bottom:
        var(--color-frame-dark) 0 6px, var(--color-frame-mat) 6px 11px,
        var(--color-frame-lip) 11px;
    --profile-frame-width:        6px;
    --profile-cast-shadow:        0 8px 20px;
    --profile-mat-shadow:         0 2px 4px;
}

.customGallery-frame-none {
    --thumbnail-frame-color: transparent;
}

.customGallery-colors-gold {
    --color-frame:     #c9a227;
    --color-frame-mat: #1a1405;
}

.customGallery-colors-silver {
    --color-frame:     #a7a9ac;
    --color-frame-mat: #15161a;
}

.customGallery-colors-mahogany {
    --color-frame:     #6b2a17;
    --color-frame-mat: #140a07;
}

.customGallery-colors-walnut {
    --color-frame:     #6e4524;
    --color-frame-mat: #120c07;
}

.customGallery-colors-white {
    --color-frame:     #f3f0ea;
    --color-frame-mat: #14111f;
}

.customGallery-mark-dark {
    --color-current-mark: var(--color-focus-dark);
}

@media (orientation: landscape) and (not (pointer: coarse)), (orientation: landscape) and (height >= 40rem) {

    .customGallery-frame-simple .customGallery-stage {
        outline: 2px solid var(--color-frame);
        outline-offset: 6px;
    }

    .customGallery-frame-double .customGallery-stage {
        outline: 6px double var(--color-frame);
        outline-offset: 7px;
    }

    .customGallery-frame-triple .customGallery-stage {
        box-shadow:
            0 0 0  6px var(--color-frame-mat),
            0 0 0  7px var(--color-frame),
            0 0 0 10px var(--color-frame-mat),
            0 0 0 13px var(--color-frame),
            0 0 0 16px var(--color-frame-mat),
            0 0 0 17px var(--color-frame),
            0 10px 30px 17px var(--color-frame-cast-shadow);
    }

    .customGallery-frame-passepartout .customGallery-stage {
        box-shadow:
            0 0 0  1px var(--color-frame-lip),
            0 0 0  2px var(--color-frame-edge),
            0 0 0 18px var(--color-frame-mat-light),
            0 0 0 19px var(--color-frame-edge),
            0 12px 32px 26px var(--color-frame-cast-shadow);
        outline: 7px groove var(--color-frame);
        outline-offset: 19px;
    }

    :is(.customGallery-frame-profile, .customGallery-frame-profile-light) .customGallery-stage::after {
        content: "";
        position: absolute;
        z-index: -1;
        inset: calc(-1 * var(--image-frame-space));
        border: var(--profile-frame-width) solid;
        border-color: var(--color-frame-light) var(--color-frame-shade) var(--color-frame-dark) var(--color-frame-side);
        background: var(--color-frame-mat);
        box-shadow:
            var(--profile-cast-shadow) var(--color-frame-cast-shadow),
            inset var(--profile-mat-shadow) rgb(0 0 0 / 0.85);
        outline: 1px solid var(--color-frame-lip);
        outline-offset: calc(-1 * var(--image-frame-space));
        pointer-events: none;
    }
}

@media (orientation: portrait), (pointer: coarse) and (orientation: landscape) and (height < 40rem) {

    .customGallery-slideshow {
        margin: var(--image-frame-space);
    }

    .customGallery-frame-simple .customGallery-slideshow {
        outline: 2px solid var(--color-frame);
        outline-offset: 6px;
    }

    .customGallery-frame-double .customGallery-slideshow {
        outline: 6px double var(--color-frame);
        outline-offset: 7px;
    }

    .customGallery-frame-triple .customGallery-slideshow {
        box-shadow:
            0 0 0  6px var(--color-frame-mat),
            0 0 0  7px var(--color-frame),
            0 0 0 10px var(--color-frame-mat),
            0 0 0 13px var(--color-frame),
            0 0 0 16px var(--color-frame-mat),
            0 0 0 17px var(--color-frame),
            0 10px 30px 17px var(--color-frame-cast-shadow);
    }

    .customGallery-frame-passepartout .customGallery-slideshow {
        box-shadow:
            0 0 0  1px var(--color-frame-lip),
            0 0 0  2px var(--color-frame-edge),
            0 0 0 18px var(--color-frame-mat-light),
            0 0 0 19px var(--color-frame-edge),
            0 12px 32px 26px var(--color-frame-cast-shadow);
        outline: 7px groove var(--color-frame);
        outline-offset: 19px;
    }

    :is(.customGallery-frame-profile, .customGallery-frame-profile-light) .customGallery-stage::before {
        content: "";
        grid-area: slideshow;
        border: var(--profile-frame-width) solid;
        border-color: var(--color-frame-light) var(--color-frame-shade) var(--color-frame-dark) var(--color-frame-side);
        background: var(--color-frame-mat);
        box-shadow:
            var(--profile-cast-shadow) var(--color-frame-cast-shadow),
            inset var(--profile-mat-shadow) rgb(0 0 0 / 0.85);
        outline: 1px solid var(--color-frame-lip);
        outline-offset: calc(-1 * var(--image-frame-space));
        pointer-events: none;
    }
}

@media (pointer: coarse) and (orientation: landscape) and (height < 40rem) {

    .customGallery {
        --thumbnail-width: var(--thumbnail-min-width);
    }

    .customGallery-stage {
        --slide-width: min(100% - 2 * var(--image-frame-space), (100svh - 2 * clamp(0.75rem, 4svh, 1.5rem) - 2 * var(--image-frame-space) - 2 * var(--control-size) - 4 * var(--menu-spacing) - 2 * var(--focus-ring-space)) * 16 / 9);
        position: relative;
    }

    .customGallery-slideshow {
        justify-self: center;
        width: var(--slide-width);
    }

    :is(.customGallery-frame-profile, .customGallery-frame-profile-light) .customGallery-stage::before {
        justify-self: center;
        width: calc(var(--slide-width) + 2 * var(--image-frame-space));
    }

    .customGallery-overview-placeholder {
        display: none;
    }

    .customGallery-overview {
        grid-area: slideshow;
        position: absolute;
        z-index: 3;
        top: var(--image-frame-space);
        inset-inline: 0;
        margin-inline: auto;
        box-sizing: border-box;
        width: var(--slide-width);
        height: calc(100% - 2 * var(--image-frame-space));
        overflow-y: auto;
        align-content: center;
        padding: var(--focus-ring-space);
    }
}

@media (prefers-reduced-motion: reduce) {
    .customGallery {
        --fade-duration: 0s;
        --controls-fade-duration: 0s;
    }
}