/* ========================================
   WATCH NOW MODAL
   Vimeo player dialog. Wide cut plays 16:9,
   mobile cut plays 9:16 (see js/watch-modal.js
   for version selection). Vanilla CSS only.
   ======================================== */

.watch-modal {
    position: fixed;
    inset: 0;
    z-index: 400;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 1rem;

    pointer-events: none;
}

.watch-modal.open {
    pointer-events: auto;
}

.watch-modal[hidden] {
    display: none;
}

/* ---------- Cascade slides ----------
   nav-style wipe: back leads, front lands last,
   then the front resolves into the dim scrim. */

.watch-slide {
    position: fixed;
    inset: 0;

    transform: translateX(105%);

    transition:
        transform .55s cubic-bezier(.22, 1, .36, 1);

    pointer-events: none;
}

.watch-slide-3 {
    background: #38bdf8;

    transition-delay: .14s;
}

.watch-slide-2 {
    background: #0ea5e9;

    transition-delay: .07s;
}

.watch-slide-1 {
    background: #0284c7;

    transition-property: transform, background-color;
    transition-duration: .55s, .3s;
    transition-timing-function:
        cubic-bezier(.22, 1, .36, 1), ease;
    transition-delay: 0s, 0s;
}

.watch-modal.open .watch-slide {
    transform: translateX(0);
}

.watch-modal.open .watch-slide-3 {
    transition-delay: 0s;
}

.watch-modal.open .watch-slide-2 {
    transition-delay: .07s;
}

.watch-modal.open .watch-slide-1 {
    transition-delay: .14s, .55s;
    background-color: rgba(0, 0, 0, .78);
}

.watch-modal-inner {
    position: relative;

    width: min(960px, 94vw);
    max-height: 92vh;

    overflow: auto;

    background: #000000;

    border-radius: 16px;

    box-shadow:
        0 30px 80px rgba(0, 0, 0, .6);

    opacity: 0;

    transform:
        scale(.92)
        translateY(12px);

    transition:
        opacity .3s ease,
        transform .35s cubic-bezier(.22, 1, .36, 1);
    transition-delay: 0s;
}

.watch-modal.open .watch-modal-inner {
    opacity: 1;

    transform: none;

    transition-delay: .35s;
}

.watch-modal-close {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 2;

    width: 44px;
    height: 44px;

    border: 2px solid #ffffff;
    border-radius: 50%;

    background: #ffffff;
    color: #111111;

    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, .55);

    cursor: pointer;
}

.watch-modal-close:hover {
    background: #004a98;
    border-color: #004a98;
    color: #ffffff;
}

.watch-modal-title {
    position: absolute;

    width: 1px;
    height: 1px;

    overflow: hidden;

    clip: rect(0 0 0 0);
    clip-path: inset(50%);

    white-space: nowrap;
}

.watch-modal-player iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000000;
}

/* Portrait cut: tall player, fitted to viewport. */

.watch-modal-inner.is-portrait {
    width: auto;
}

.watch-modal-inner.is-portrait .watch-modal-player iframe {
    width: auto;
    max-width: 92vw;
    height: min(80vh, 720px);
    aspect-ratio: 9 / 16;
    margin: 0 auto;
}

@media (prefers-reduced-motion: reduce) {
    .watch-modal,
    .watch-modal-inner,
    .watch-slide {
        transition: none;
    }
}
