.afhv-root .afhv-trigger {
    position: fixed;
    /* BigFormat keeps its 220px navigation visible on desktop. */
    left: 240px;
    bottom: max(20px, env(safe-area-inset-bottom));
    z-index: 998;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    max-width: min(300px, calc(100vw - 40px));
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .55);
    border-radius: 4px;
    background: #141c31;
    color: #fff;
    font: 600 15px/1.3 system-ui, -apple-system, sans-serif;
    letter-spacing: .01em;
    box-shadow: 0 6px 22px rgba(0, 0, 0, .25);
    cursor: pointer;
}

.afhv-root .afhv-trigger:hover { background: #24334f; }
.afhv-root .afhv-trigger:focus-visible,
.afhv-root .afhv-close:focus-visible { outline: 3px solid #f6d478; outline-offset: 3px; }
.afhv-root .afhv-trigger span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.afhv-root .afhv-dialog {
    width: min(960px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: #101522;
    color: #fff;
    box-shadow: 0 18px 64px rgba(0, 0, 0, .55);
    overflow: auto;
}

.afhv-root .afhv-dialog::backdrop { background: rgba(5, 9, 19, .78); }
.afhv-root .afhv-panel { padding: 14px; }
.afhv-root .afhv-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.afhv-root .afhv-top h2 { margin: 0; color: #fff; font: 600 clamp(17px, 2.6vw, 23px)/1.35 system-ui, -apple-system, sans-serif; }
.afhv-root .afhv-close { flex: 0 0 44px; width: 44px; height: 44px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 4px; background: transparent; color: #fff; font: 400 30px/1 system-ui, sans-serif; cursor: pointer; }
.afhv-root .afhv-player { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.afhv-root .afhv-player iframe,
.afhv-root .afhv-player video { display: block; width: 100%; height: 100%; border: 0; background: #000; }
.afhv-root .afhv-noscript { position: fixed; left: 240px; bottom: 20px; z-index: 998; padding: 12px 16px; background: #141c31; color: #fff; }

/* Only the direct homepage uses the mixed video/photo stage. */
body.afhv-inline-home #controls-wrapper,
body.afhv-inline-home #supersized,
body.afhv-inline-home #slide-list,
body.afhv-inline-home #prevthumb,
body.afhv-inline-home #nextthumb,
body.afhv-inline-home #thumb-tray,
body.afhv-inline-home #progress-back { display: none !important; }

body.afhv-inline-home .afhv-inline-stage {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: var(--afhv-sidebar, 220px);
    z-index: 0;
    box-sizing: border-box;
    padding: 0;
    overflow: hidden;
    background: #090b10;
    transition: left 160ms ease;
}

body.afhv-inline-home.admin-bar .afhv-inline-stage { top: 32px; }
body.afhv-inline-home .afhv-slides { position: absolute; inset: 0; }
body.afhv-inline-home .afhv-slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-sizing: border-box;
    background: #090b10;
    opacity: 1;
}
body.afhv-inline-home .afhv-slide[hidden] { display: none !important; }
/* Supersized fade: the opaque old frame stays below an incoming frame whose
   opacity alone rises from 0 to 1. The controller uses the theme's easeOutQuad. */
body.afhv-inline-home .afhv-slide.is-active { z-index: 1; }
body.afhv-inline-home .afhv-slide.is-outgoing { z-index: 0; pointer-events: none; }
body.afhv-inline-home .afhv-photo { background: #111; }
body.afhv-inline-home .afhv-slide[data-kind="youtube"] { padding: 24px 24px 72px; }
body.afhv-inline-home .afhv-inline-player {
    width: min(100%, calc((100vh - 96px) * 16 / 9));
    width: min(100%, calc((100dvh - 96px) * 16 / 9));
    aspect-ratio: 16 / 9;
    min-height: 200px;
    flex: 0 1 auto;
    background: #000;
}

body.afhv-inline-home.admin-bar .afhv-inline-player {
    width: min(100%, calc((100vh - 128px) * 16 / 9));
    width: min(100%, calc((100dvh - 128px) * 16 / 9));
}

body.afhv-inline-home .afhv-inline-player iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    background: #000;
}

body.afhv-inline-home .afhv-photo-link { display: block; width: 100%; height: 100%; }
body.afhv-inline-home .afhv-photo img { display: block; width: 100%; height: 100%; object-fit: contain; border: 0; }
/* The single native caption ID inherits BigFormat's fonts, sizes, placement,
   line backgrounds, and small blue .button. Do not style the parent as a box. */
body.afhv-inline-home #afhv-caption-container,
body.afhv-inline-home #slidecaption { position: absolute; inset: 0; pointer-events: none; }
body.afhv-inline-home #afhv-caption-container { z-index: 2; }
body.afhv-inline-home #slidecaption .caption { background: transparent; padding: 0; border: 0; }
body.afhv-inline-home #slidecaption .caption[hidden] { display: none !important; }
body.afhv-inline-home #slidecaption .caption:not(.Top):not(.Bottom) { top: 50% !important; transform: translateY(-50%); }
body.afhv-inline-home #slidecaption .captionbutton a { pointer-events: auto; }

/* Native artwork and geometry, with unique IDs so legacy Supersized listeners
   cannot bind the mixed slideshow or cover its YouTube player. */
body.afhv-inline-home .afhv-nav-arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; display: grid; place-items: center; width: 65px; height: 80px; margin: 0; padding: 0; border: 0; background: transparent; opacity: .75; cursor: pointer; }
body.afhv-inline-home .afhv-nav-arrow img { width: 20px; height: 36px; max-width: none; border: 0; }
body.afhv-inline-home .afhv-nav-arrow img,
body.afhv-inline-home .afhv-sidebar-controls img { filter: brightness(0) invert(1); }
body.afhv-inline-home .afhv-prev { left: var(--afhv-prev-offset, 25px); }
body.afhv-inline-home .afhv-next { right: 20px; }
body.afhv-inline-home .afhv-nav-arrow:hover { opacity: 1; }
body.afhv-inline-home .afhv-sidebar-controls { position: absolute; left: 0; bottom: 0; width: 160px; height: 110px; z-index: 10; opacity: .85; }
body.afhv-inline-home .afhv-sidebar-controls[hidden] { display: none !important; }
body.afhv-inline-home .afhv-sidebar-controls button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; margin: 0; border: 0; background: transparent; cursor: pointer; opacity: .5; }
body.afhv-inline-home .afhv-sidebar-controls button:hover { opacity: 1; }
body.afhv-inline-home [data-afhv-counter] { position: absolute; bottom: 58px; left: 55px; color: #fff; font-size: 12px; line-height: 32px; white-space: nowrap; text-align: center; }
body.afhv-inline-home #afhv-play-button { bottom: 58.5px; left: 85px; }
body.afhv-inline-home #afhv-play-button img { width: 34px; height: 34px; border: 0; max-width: none; }
body.afhv-inline-home #afhv-tray-button { bottom: 59.5px; left: 124px; }
body.afhv-inline-home #afhv-tray-button img { width: 22px; height: 6px; border: 0; max-width: none; }
body.afhv-inline-home #afhv-slide-list { position: absolute; top: 15px; right: 15px; z-index: 4; display: flex; gap: 5px; }
body.afhv-inline-home #afhv-slide-list button { display: block; box-sizing: content-box; width: 12px; height: 12px; padding: 0; margin: 0; border: 1px solid rgba(255, 255, 255, .7); border-radius: 50%; background: var(--afhv-dot-image) no-repeat 0 -24px; background-color: rgba(255, 255, 255, .4); cursor: pointer; }
body.afhv-inline-home #afhv-slide-list button:hover { background-position: 0 -12px; }
body.afhv-inline-home #afhv-slide-list button[aria-current="true"] { background-position: 0 0; background-color: #fff; }
body.afhv-inline-home #afhv-thumb-tray { position: absolute; left: 0; right: 0; bottom: 0; height: 108px; z-index: 5; background: var(--afhv-tray-image); }
body.afhv-inline-home #afhv-thumb-tray[hidden] { display: none !important; }
body.afhv-inline-home .afhv-thumb-scroll { display: flex; justify-content: safe center; width: calc(100% - 80px); height: 108px; margin: 0 40px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
body.afhv-inline-home .afhv-thumb-scroll::-webkit-scrollbar { display: none; }
body.afhv-inline-home [data-afhv-thumb] { flex: 0 0 150px; width: 150px; height: 108px; position: relative; overflow: hidden; padding: 0; margin: 0; border: 0; background: #111; cursor: pointer; }
body.afhv-inline-home [data-afhv-thumb] img { display: block; width: 200px; height: auto; max-width: none; opacity: .5; border: 0; }
body.afhv-inline-home [data-afhv-thumb]:hover img,
body.afhv-inline-home [data-afhv-thumb][aria-current="true"] img { opacity: 1; }
body.afhv-inline-home [data-afhv-thumb] span { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; text-shadow: 0 1px 5px #000; }
body.afhv-inline-home [data-afhv-thumb-back],
body.afhv-inline-home [data-afhv-thumb-forward] { position: absolute; top: 0; bottom: 0; width: 40px; padding: 0; margin: 0; border: 0; z-index: 1; background: rgba(0, 0, 0, .35); cursor: pointer; }
body.afhv-inline-home [data-afhv-thumb-back] { left: 0; }
body.afhv-inline-home [data-afhv-thumb-forward] { right: 0; }
body.afhv-inline-home [data-afhv-thumb-back] img,
body.afhv-inline-home [data-afhv-thumb-forward] img { max-width: none; border: 0; }
body.afhv-inline-home #afhv-progress-back { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; z-index: 6; overflow: hidden; background: var(--afhv-progress-back-image) repeat-x; }
body.afhv-inline-home [data-afhv-progress] { height: 3px; width: 100%; transform: scaleX(0); transform-origin: left; background: var(--afhv-progress-bar-image) repeat-x; }
body.afhv-inline-home [data-controls="0"] .afhv-nav-arrow,
body.afhv-inline-home [data-controls="0"] #afhv-slide-list,
body.afhv-inline-home [data-controls="0"] #afhv-thumb-tray,
body.afhv-inline-home [data-progress-enabled="0"] #afhv-progress-back { display: none !important; }
body.afhv-inline-home .afhv-nav-arrow:focus-visible,
body.afhv-inline-home .afhv-sidebar-controls button:focus-visible,
body.afhv-inline-home #afhv-slide-list button:focus-visible,
body.afhv-inline-home #afhv-thumb-tray button:focus-visible,
body.afhv-inline-home #slidecaption .button:focus-visible { outline: 3px solid #f6d478; outline-offset: 3px; }
body.afhv-inline-home .afhv-nav-arrow:disabled,
body.afhv-inline-home .afhv-sidebar-controls button:disabled,
body.afhv-inline-home #afhv-slide-list button:disabled,
body.afhv-inline-home #afhv-thumb-tray button:disabled { opacity: .3; cursor: default; }
body.afhv-inline-home .afhv-slideshow-status { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

@media (max-width: 782px) {
    body.afhv-inline-home.admin-bar .afhv-inline-stage { top: 46px; }
    body.afhv-inline-home.admin-bar .afhv-inline-player {
        width: min(100%, calc((100vh - 142px) * 16 / 9));
        width: min(100%, calc((100dvh - 142px) * 16 / 9));
    }
}

@media (max-width: 767px) {
    /* Keep mobile navigation, video, and the existing notice in reading order. */
    body.afhv-inline-home #top_panel { position: relative !important; }
    body.afhv-inline-home #wrapper {
        height: auto !important;
        min-height: 0 !important;
        margin-left: 0 !important;
    }
    body.afhv-inline-home .afhv-inline-stage,
    body.afhv-inline-home.admin-bar .afhv-inline-stage {
        position: relative;
        inset: auto;
        width: 100%;
        padding: 0;
        overflow: visible;
    }
    body.afhv-inline-home .afhv-slides { position: relative; inset: auto; width: 100%; aspect-ratio: 16 / 10; min-height: 248px; }
    body.afhv-inline-home .afhv-slide[data-kind="youtube"] { padding: 12px; }
    body.afhv-inline-home .afhv-inline-player,
    body.afhv-inline-home.admin-bar .afhv-inline-player {
        width: 100%;
        aspect-ratio: 16 / 9;
        min-height: 200px;
    }
    body.afhv-inline-home #afhv-caption-container { bottom: auto; height: max(248px, 62.5vw); }
    body.afhv-inline-home #slidecaption .caption:not(.Top):not(.Bottom) { top: auto !important; transform: none; }
    body.afhv-inline-home .afhv-nav-arrow { top: max(124px, 31.25vw); width: 44px; height: 64px; }
    body.afhv-inline-home .afhv-prev { left: 10px; }
    body.afhv-inline-home .afhv-next { right: 10px; }
    body.afhv-inline-home .afhv-sidebar-controls { position: relative; width: 180px; height: 70px; margin: 0 12px; }
    body.afhv-inline-home [data-afhv-counter] { bottom: 20px; left: 16px; }
    body.afhv-inline-home #afhv-play-button { bottom: 14px; left: 70px; }
    body.afhv-inline-home #afhv-tray-button { bottom: 14px; left: 120px; }
    body.afhv-inline-home #afhv-slide-list { display: none; }
    body.afhv-inline-home #afhv-thumb-tray { position: relative; bottom: auto; }
}

@media (prefers-reduced-motion: reduce) {
    body.afhv-inline-home .afhv-inline-stage { transition: none; }
}

@media (max-width: 600px) {
    .afhv-root .afhv-trigger { left: auto; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); max-width: calc(100vw - 24px); }
    .afhv-root .afhv-noscript { left: auto; right: 12px; bottom: 12px; }
    .afhv-root .afhv-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
    .afhv-root .afhv-panel { padding: 10px; }
}
