.ap-video {
    --ap-video-accent: #5f9ea0;
    position: relative;
    width: 100%;
    margin: 24px 0 32px;
    background: #000;
    overflow: hidden;
}

.ap-video.ap-video--slider {
    margin: 0;
}

#slider.ap-video-slider-host,
#slider.ap-video-slider-host .slider-box {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
}

.ap-video::before {
    display: block;
    padding-top: 56.25%;
    content: "";
}

.ap-video__preview,
.ap-video__frame,
.ap-video__media {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ap-video__preview {
    display: block;
    padding: 0;
    border: 0;
    color: #fff;
    background: #181818;
    cursor: pointer;
    font: inherit;
    text-align: left;
    touch-action: manipulation;
}

.ap-video__preview[hidden] {
    display: none;
}

.ap-video__poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ap-video__shade {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.28);
    transition: background-color 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.ap-video__play {
    position: absolute;
    top: 50%;
    left: 50%;
    display: grid;
    width: 64px;
    height: 64px;
    place-items: center;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--ap-video-accent);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.32);
    transform: translate(-50%, -50%);
    transition: transform 300ms cubic-bezier(0.32, 0.72, 0, 1), background-color 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.ap-video__play > span {
    display: block;
    width: 0;
    height: 0;
    margin-left: 4px;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
}

.ap-video__label {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 24px;
    text-align: center;
    text-shadow: 0 2px 8px #000;
}

.ap-video__preview:hover .ap-video__shade {
    background: rgba(0, 0, 0, 0.18);
}

.ap-video__preview:hover .ap-video__play {
    transform: translate(-50%, -50%) scale(1.06);
}

.ap-video__preview:active .ap-video__play {
    transform: translate(-50%, -50%) scale(0.98);
}

.ap-video__preview:focus {
    outline: 4px solid var(--ap-video-accent);
    outline-offset: 4px;
}

.ap-video__frame,
.ap-video__media {
    display: block;
    border: 0;
    background: #000;
}

.ap-video__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    padding: 8px 12px;
    border: 0;
    color: #fff;
    background: #181818;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
    transition: background-color 300ms cubic-bezier(0.32, 0.72, 0, 1), transform 300ms cubic-bezier(0.32, 0.72, 0, 1);
}

.ap-video__close:hover {
    background: #272727;
}

.ap-video__close:active {
    transform: translateY(1px);
}

.ap-video__close:focus {
    outline: 4px solid var(--ap-video-accent);
    outline-offset: 2px;
}

.ap-video__error {
    position: absolute;
    right: 16px;
    bottom: 16px;
    left: 16px;
    z-index: 2;
    margin: 0;
    padding: 12px 16px;
    color: #fff;
    background: #181818;
    font-size: 14px;
    line-height: 20px;
    text-align: center;
}

@media (max-width: 640px) {
    .ap-video {
        margin: 16px 0 24px;
    }

    .ap-video__play {
        width: 48px;
        height: 48px;
    }

    .ap-video__play > span {
        border-top-width: 8px;
        border-bottom-width: 8px;
        border-left-width: 12px;
    }

    .ap-video__label {
        right: 12px;
        bottom: 8px;
        left: 12px;
        font-size: 14px;
        line-height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ap-video__shade,
    .ap-video__play,
    .ap-video__close {
        transition: none;
    }
}
