/* Click to load YouTube facade (include/youtubeFacade.php). */
.yt-facade {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.yt-facade__thumb,
.yt-facade__frame,
.yt-facade.is-loaded iframe {
    position: absolute;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    border: 0;
    margin: 0;
}

.yt-facade__thumb {
    object-fit: cover;
}

/* YouTube's hqdefault image is 4:3 with black bars above and below the 16:9 frame.
   Making the image a third taller than the box and centering it crops the bars off. */
.yt-facade .yt-facade__thumb {
    top: -16.67%;
    height: 133.34% !important;
}

.yt-facade__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
}

.yt-facade__icon {
    width: 76px;
    height: 54px;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.35));
    transition: transform 0.15s ease;
}

.yt-facade__icon-bg {
    fill: #f00;
    transition: fill 0.15s ease;
}

.yt-facade__icon-arrow {
    fill: #fff;
}

.yt-facade__play:hover .yt-facade__icon-bg,
.yt-facade__play:focus-visible .yt-facade__icon-bg {
    fill: #cc0000;
}

.yt-facade__play:hover .yt-facade__icon {
    transform: scale(1.06);
}

.yt-facade__play:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -6px;
    box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.6);
}

.yt-facade__fallback {
    position: absolute;
    left: 12px;
    bottom: 12px;
    color: #fff;
}

/* Video section block: same sizes as the iframes they replace
   (resources/assets/styles/templates/_video-section.scss). */
.action-card-v2 .yt-facade {
    aspect-ratio: auto;
    height: 320px;
}

.action-card .yt-facade {
    aspect-ratio: auto;
    height: 326px;
    border-radius: 10px;
}

.vb-action-card .yt-facade {
    aspect-ratio: auto;
    height: 370px;
}

@media (max-width: 1025px) {
    .action-card-v2 .yt-facade {
        height: 220px;
    }
}

@media (max-width: 991.98px) {
    .vb-action-card .yt-facade {
        height: 220px;
    }
}

@media (max-width: 767.98px) {
    .action-card .yt-facade {
        height: 210px;
    }
}

@media (max-width: 575.98px) {
    .vb-action-card .yt-facade {
        height: 200px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yt-facade__icon,
    .yt-facade__icon-bg {
        transition: none;
    }
}
