/* Home-only floating video list and native player dialog. */
.homeVideos {
    --video-launcher-size: 90px;
    --video-edge: 24px;
    --video-right: max(var(--video-edge), env(safe-area-inset-right, 0px));
    --video-bottom: max(var(--video-edge), env(safe-area-inset-bottom, 0px));
    position: fixed;
    right: var(--video-right);
    bottom: var(--video-bottom);
    z-index: 120;
    box-sizing: border-box;
    width: var(--video-launcher-size);
    margin: 0;
    padding: 0;
}
.homeVideos * { box-sizing: border-box; }
.homeVideos[hidden],
.homeVideos__panel[hidden] { display: none; }
body.active .homeVideos { visibility: hidden; pointer-events: none; }
.homeVideos__launcher {
    display: block;
    width: var(--video-launcher-size);
    height: var(--video-launcher-size);
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}
.homeVideos__launcher img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: contain;
    animation: homeVideoFloat 3.2s ease-in-out infinite;
}
.homeVideos__launcher:hover img,
.homeVideos__launcher:focus-visible img { animation-play-state: paused; }
.homeVideos[data-list-state]:not([data-list-state="closed"]) .homeVideos__launcher {
    visibility: hidden;
    pointer-events: none;
}
.homeVideos[data-list-state]:not([data-list-state="closed"]) .homeVideos__launcher img {
    animation-play-state: paused;
}
@keyframes homeVideoFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}
.homeVideos button:focus-visible {
    outline: 3px solid #0055a5;
    outline-offset: 4px;
}
.homeVideos__panel {
    position: absolute;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: min(400px, calc(100vw - var(--video-right) - var(--video-edge)));
    max-height: calc(100vh - var(--video-bottom) - var(--video-edge));
    max-height: calc(100dvh - var(--video-bottom) - var(--video-edge));
    padding: 22px;
    overflow: hidden;
    border: 2px solid #62b5ba;
    border-radius: 24px;
    background: #eff7f8;
    box-shadow: 0 8px 32px rgba(0, 45, 65, .16);
    color: #161616;
    transform-origin: bottom right;
}
.homeVideos__panel[data-state="closing"] { pointer-events: none; }
.homeVideos__panelHeader {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}
.homeVideos__panelHeader h2 {
    margin: 0;
    color: #62b5ba;
    font-size: 32px;
    font-weight: 700;
    line-height: 1.25;
}
.homeVideos__panelClose {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #bdbdbd;
    color: #fff;
    font: inherit;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.homeVideos__panelClose:hover { background: #999; }
.homeVideos__list {
    display: flex;
    flex-direction: column;
    gap: 28px;
    width: 100%;
    min-height: 0;
    margin: 0;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    list-style: none;
}
.homeVideos__item { flex: 0 0 auto; min-width: 0; }
.homeVideos__card {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: #161616;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.homeVideos .homeVideos__card:focus-visible { outline-offset: -3px; }
.homeVideos__thumbnail {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    background: #102b49;
}
.homeVideos__thumbnail img {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
}
.homeVideos__play {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    background: rgba(0, 0, 0, .08);
}
.homeVideos__play::before {
    content: '';
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(0, 53, 150, .9);
}
.homeVideos__play::after {
    content: '';
    position: absolute;
    margin-left: 4px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 18px solid #fff;
}
.homeVideos__card:hover .homeVideos__play { background: rgba(0, 0, 0, .2); }
.homeVideos__title {
    display: block;
    padding-top: 12px;
    color: #161616;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.45;
    overflow-wrap: anywhere;
}
@media (min-width: 901px) {
    /* Reserve the heading, captions and gaps so three 16:9 cards fit vertically. */
    .homeVideos__panel {
        width: min(280px, calc((100vh - var(--video-bottom) - var(--video-edge) - 128px) * 16 / 27));
        width: min(280px, calc((100dvh - var(--video-bottom) - var(--video-edge) - 128px) * 16 / 27));
        gap: 12px;
        padding: 14px;
    }
    .homeVideos__panelHeader h2 { font-size: 24px; }
    .homeVideos__panelClose {
        flex-basis: 36px;
        width: 36px;
        height: 36px;
        font-size: 20px;
    }
    .homeVideos__list { gap: 12px; }
    .homeVideos__thumbnail { border-radius: 10px 10px 0 0; }
    .homeVideos__play::before { width: 40px; height: 40px; }
    .homeVideos__play::after {
        border-top-width: 7px;
        border-bottom-width: 7px;
        border-left-width: 12px;
    }
    .homeVideos__title {
        padding-top: 6px;
        font-size: 14px;
        line-height: 1.4;
    }
}
.videoLightbox {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: min(1280px, calc(100% - 32px), calc((100vh - 136px) * 16 / 9));
    width: min(1280px, calc(100% - 32px), calc((100dvh - 136px) * 16 / 9));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: visible;
    overscroll-behavior: contain;
    border: 0;
    background: transparent;
    color: #fff;
    transform-origin: top left;
}
.videoLightbox * { box-sizing: border-box; }
.videoLightbox:not([open]) { display: none; }
.videoLightbox[open] {
    display: grid;
    grid-template-rows: 44px auto 44px;
    gap: 8px;
}
.videoLightbox::backdrop { background: rgba(0, 12, 30, .88); opacity: 0; }
.videoLightbox[data-state="opening"]::backdrop,
.videoLightbox[data-state="open"]::backdrop { opacity: 1; }
.videoLightbox :is(button, input):focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}
.videoLightbox__close {
    justify-self: end;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: rgba(0, 0, 0, .3);
    color: #fff;
    font: inherit;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
}
.videoLightbox__close:hover { background: rgba(255, 255, 255, .15); }
.videoLightbox__player {
    position: relative;
    width: 100%;
    min-width: 0;
    aspect-ratio: 16 / 9;
    background: #000;
    box-shadow: 0 16px 64px rgba(0, 0, 0, .35);
}
.videoLightbox__player iframe,
.videoLightbox__poster {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    border: 0;
}
.videoLightbox__poster { object-fit: contain; }
.videoLightbox__preference {
    display: flex;
    align-items: center;
    gap: 10px;
    width: fit-content;
    min-height: 44px;
    color: #fff;
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}
.videoLightbox__preference input {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #20b5bd;
    cursor: pointer;
}
@media (max-width: 768px) {
    .homeVideos { --video-launcher-size: 72px; --video-edge: 16px; }
    .homeVideos__panel { padding: 20px; }
    .homeVideos__panelHeader h2 { font-size: 28px; }
    .homeVideos__title { font-size: 18px; }
}
@media (prefers-reduced-motion: reduce) {
    .homeVideos__launcher img { animation: none; }
}
/* This stylesheet is home-only; remove the legacy 360px floor on small screens. */
@media (max-width: 359px) {
    html,
    body.index-page,
    .index-page #header,
    .index-page #Footer { min-width: 0; }
}
