.cms-video {
    margin: 0 0 var(--space-xl);
}

.cms-video__frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 0;
    padding-bottom: 56.25%;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--color-primary);
}

.cms-video__poster,
.cms-video__frame iframe,
.cms-video__player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    max-width: 100%;
    border: 0;
}

.cms-video__poster {
    object-fit: cover;
}

.cms-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 4.5rem;
    height: 4.5rem;
    min-width: 4.5rem;
    min-height: 4.5rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface);
    transform: translate(-50%, -50%);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.cms-video__play:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.cms-video__glyph {
    display: block;
    width: 0;
    height: 0;
    margin-left: 0.25rem;
    border-style: solid;
    border-width: 0.7rem 0 0.7rem 1.15rem;
    border-color: transparent transparent transparent var(--color-primary);
}

.cms-video__expand {
    position: absolute;
    z-index: 1;
    right: 0.75rem;
    bottom: 0.75rem;
}

.video-expand {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: var(--color-surface);
    color: var(--color-primary);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.video-expand:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.video-expand__icon {
    display: block;
    width: 1.25rem;
    height: 1.25rem;
}

dialog.video-stage:modal {
    position: fixed;
    inset: 0;
    box-sizing: border-box;
    width: 100%;
    height: 100svh;
    max-width: none;
    max-height: none;
    margin: 0;
    padding:
        var(--safe-top)
        env(safe-area-inset-right, 0px)
        var(--safe-bottom)
        env(safe-area-inset-left, 0px);
    border: 0;
    background: #000;
    overflow: hidden;
}

.video-stage::backdrop {
    background: #000;
}

.video-stage__fit {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    container-type: size;
}

.video-stage__player {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: #000;
}

@supports (width: 1cqw) {
    .video-stage__player {
        width: min(100cqw, calc(100cqh * 16 / 9));
        height: min(100cqh, calc(100cqw * 9 / 16));
        aspect-ratio: auto;
    }
}

.video-stage__close {
    position: absolute;
    z-index: 1;
    top: calc(var(--safe-top) + var(--space-sm));
    right: calc(env(safe-area-inset-right, 0px) + var(--space-sm));
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 0;
    background: transparent;
    color: var(--color-text-on-dark);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.video-stage__close:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

@media (max-width: 767px) {
    .cms-video {
        margin-bottom: var(--space-lg);
    }
}
