/*!
 * Switcher Extended (plg_system_switcherextended) 1.2.1 — One 26 Studio — GPL-2.0-or-later
 * Every rule is scoped to the element root (.uk-switcher-extended), except the lightbox rules (.uk-lightbox.us-lightbox, 1.2.1) and the
 * `.uk-lightbox .us-count` rule: UIkit appends the lightbox panel to <body>, outside the element.
 */

.uk-switcher-extended {
    --us-thumb-size: 80px;
    --us-gap: 10px;
    --us-bg: #ffffff;
    --us-focus-color: #1e87f0;
    --us-active-color: var(--us-focus-color);
    --us-radius: 4px;
    --us-ratio: auto;
    --us-play-color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: var(--us-gap);
}

/* ---- Main area ------------------------------------------------------------------------------- */

.uk-switcher-extended .us-stage {
    min-width: 0;
}

.uk-switcher-extended .el-main {
    margin: 0;
    padding: 0;
    list-style: none;
}

.uk-switcher-extended .el-main > .el-item {
    position: relative;
    background: var(--us-bg);
    border-radius: var(--us-radius);
    overflow: hidden;
}

.uk-switcher-extended.us-has-ratio .el-main > .el-item {
    aspect-ratio: var(--us-ratio);
}

.uk-switcher-extended .us-main-link {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: inherit;
    border-radius: inherit;
}

.uk-switcher-extended.us-zoom .us-main-link:not(.us-is-video) {
    cursor: zoom-in;
}

.uk-switcher-extended .us-main-link picture {
    display: contents;
}

.uk-switcher-extended .us-main-link img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
}

.uk-switcher-extended.us-has-ratio .us-main-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ---- Thumbnail strip ------------------------------------------------------------------------- */

.uk-switcher-extended .us-nav {
    display: flex;
    flex-wrap: wrap;
    gap: var(--us-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.uk-switcher-extended .us-nav > * {
    padding-left: 0;
    margin: 0;
}

.uk-switcher-extended .us-thumb {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: var(--us-thumb-size);
    height: var(--us-thumb-size);
    overflow: hidden;
    background: var(--us-bg);
    border-radius: var(--us-radius);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.1s ease-in-out, opacity 0.1s ease-in-out;
}

.uk-switcher-extended .us-nav > :not(.uk-active) > .us-thumb {
    opacity: 0.75;
}

.uk-switcher-extended .us-nav > :not(.uk-active) > .us-thumb:hover {
    opacity: 1;
}

.uk-switcher-extended .us-nav > .uk-active > .us-thumb {
    box-shadow: 0 0 0 2px var(--us-active-color);
}

/* UIkit thumbnav themes add an ::after overlay; the strip uses opacity instead. */
.uk-switcher-extended .us-thumb::after {
    display: none;
}

.uk-switcher-extended .us-thumb picture {
    display: contents;
}

.uk-switcher-extended .us-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uk-switcher-extended.us-thumb-contain .us-thumb img {
    object-fit: contain;
}

/* ---- Focus (keyboard) -------------------------------------------------------------------------- */

.uk-switcher-extended .us-thumb:focus-visible,
.uk-switcher-extended .us-main-link:focus-visible {
    outline: 2px solid var(--us-focus-color);
    outline-offset: 2px;
}

.uk-switcher-extended .us-main-link:focus-visible {
    outline-offset: -2px;
}

/* ---- Video items ------------------------------------------------------------------------------- */

.uk-switcher-extended .us-video-tile {
    display: block;
    width: 100%;
    height: 100%;
    min-height: 120px;
    background: #222;
}

.uk-switcher-extended .us-thumb .us-video-tile {
    min-height: 0;
}

.uk-switcher-extended .us-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--us-play-color);
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.5));
    pointer-events: none;
}

/* ---- In-gallery player (1.2.0) ----------------------------------------------------------------
 * Built by the script over the poster, which stays in the DOM (LCP image, reserves the box): the
 * player is absolutely positioned inside the slide, so the layout never shifts.
 */
.uk-switcher-extended:not(.us-has-ratio) .el-main > .us-video-item .us-video-tile {
    aspect-ratio: 16 / 9;
}

.uk-switcher-extended .us-player {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: var(--us-bg);
}

.uk-switcher-extended .us-player-media {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    object-fit: contain;
}

.uk-switcher-extended .us-has-player .us-play {
    display: none;
}

.uk-switcher-extended .us-sound {
    position: absolute;
    z-index: 2;
    right: 12px;
    bottom: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    cursor: pointer;
}

.uk-switcher-extended .us-sound:hover {
    background: rgba(0, 0, 0, 0.85);
}

.uk-switcher-extended .us-sound:focus-visible {
    outline: 2px solid var(--us-focus-color);
    outline-offset: 2px;
}

/* YouTube/Vimeo players have their own controls bottom-right; keep the button clear of them. */
.uk-switcher-extended .us-player:has(iframe) .us-sound {
    top: 12px;
    bottom: auto;
}

/* ---- Thumbnav on the left (640px and up; stacks below on phones) -------------------------------- */

@media (min-width: 640px) {
    .uk-switcher-extended.us-nav-left {
        flex-direction: row-reverse;
        align-items: flex-start;
    }

    .uk-switcher-extended.us-nav-left .us-stage {
        flex: 1 1 0;
    }

    .uk-switcher-extended.us-nav-left .us-nav {
        flex: none;
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: 70vh;
        overflow-y: auto;
        padding: 2px;
    }
}

/* ---- Lightbox caption counter --------------------------------------------------------------------
 * The UIkit lightbox panel is appended to <body>, so it cannot inherit the element root class.
 * Minimal, namespaced (.us-count is only ever emitted by this element's data-caption).
 */
.uk-lightbox .us-count {
    margin-left: 0.5em;
    opacity: 0.75;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ---- Lightbox slidenav vs. vertical thumbnav (1.2.1) --------------------------------------------
 * UIkit puts the vertical thumbnav (or dotnav) at center-right, on top of the "next" arrow, so the
 * arrow could not be clicked (1920px desktop: arrow x 1848 w 27 inside the thumbnav x 1775 w 100).
 * The script tags only panels opened by this element with .us-lightbox, the nav position
 * (.us-lb-nav-right|left|top|bottom), .us-lb-nav-vertical and the measured strip width --us-lb-nav-w.
 * The arrow on the same side as a vertical strip is moved inward by the strip width plus a gap and raised
 * above it; foreign lightboxes are untouched.
 */
.uk-lightbox.us-lightbox {
    --us-lb-gap: 10px;
}

.uk-lightbox.us-lightbox .uk-lightbox-slidenav {
    z-index: 2;
}

.uk-lightbox.us-lightbox.us-lb-nav-right.us-lb-nav-vertical .uk-lightbox-slidenav.uk-position-center-right {
    right: calc(var(--us-lb-nav-w, 100px) + var(--us-lb-gap));
}

.uk-lightbox.us-lightbox.us-lb-nav-left.us-lb-nav-vertical .uk-lightbox-slidenav.uk-position-center-left {
    left: calc(var(--us-lb-nav-w, 100px) + var(--us-lb-gap));
}

/* Horizontal strip at the top or bottom: arrows sit at the vertical centre, just keep them on top. */
.uk-lightbox.us-lightbox.us-lb-nav-top .uk-lightbox-slidenav,
.uk-lightbox.us-lightbox.us-lb-nav-bottom .uk-lightbox-slidenav {
    z-index: 2;
}

/* Phones: UIkit's thumbnails are large for a 360-640px screen; shrink them so the offset arrow keeps
 * room next to the image. --us-lb-nav-w is re-measured by the script at every slide. */
@media (max-width: 639px) {
    .uk-lightbox.us-lightbox .uk-lightbox-thumbnav-vertical > * > * {
        width: 48px;
        height: auto;
    }

    .uk-lightbox.us-lightbox {
        --us-lb-gap: 5px;
    }

    .uk-lightbox.us-lightbox.us-lb-nav-right.us-lb-nav-vertical .uk-lightbox-slidenav.uk-position-center-right {
        right: calc(var(--us-lb-nav-w, 58px) + var(--us-lb-gap));
    }

    .uk-lightbox.us-lightbox.us-lb-nav-left.us-lb-nav-vertical .uk-lightbox-slidenav.uk-position-center-left {
        left: calc(var(--us-lb-nav-w, 58px) + var(--us-lb-gap));
    }
}
