/* ============================================================
   Video facade — poster + play button standing in for a
   YouTube iframe until the visitor presses play.

   Markup: inc/class-video-facade.php
   Behaviour: assets/js/video-facade.js
   ============================================================ */

.video-facade {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
}

/* Inside the video grids the wrapper already establishes the 16:9 box,
   so fill it exactly the way the injected iframe will. */
.how-to-videos__embed .video-facade,
.category-videos__embed .video-facade {
    position: absolute;
    inset: 0;
    aspect-ratio: auto;
}

/* Scoped under .video-facade so the reset outranks Storefront's generic
   `button` styling (background, padding, shadows) wherever it loads. */
.video-facade .video-facade__button {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: #000;
    color: inherit;
    font: inherit;
    line-height: 0;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    -webkit-appearance: none;
    appearance: none;
}

.video-facade .video-facade__button:hover,
.video-facade .video-facade__button:active,
.video-facade .video-facade__button:focus {
    background: #000;
    box-shadow: none;
}

.video-facade__poster {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 0;
}

.video-facade__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 48px;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: transform 0.15s ease;
}

.video-facade__play svg {
    display: block;
    width: 100%;
    height: 100%;
}

.video-facade__play-bg {
    /* Matches the red badge YouTube's own cued player shows, so the grid
       looks the same as it did with 25 live iframes. */
    fill: #ff0000;
}

.video-facade__button:hover .video-facade__play,
.video-facade__button:focus-visible .video-facade__play {
    transform: translate(-50%, -50%) scale(1.08);
}

.video-facade__button:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
    .video-facade__play {
        transition: none;
    }
}

@media screen and (max-width: 600px) {
    .video-facade__play {
        width: 54px;
        height: 38px;
    }
}
