/* ---------------------------------------------------------------------------
   Click-to-load YouTube facade.  Self-contained: no dependency on promo.css
   tokens or on a page's own style block, so the same markup drops into the
   .hl-promo pages and the affiliate pages alike.

   Why a facade and not a plain <iframe>: a YouTube iframe pulls ~500KB+ and
   several third-party connections on load.  These sit near the top of landing
   pages that already have an eager hero image, so we render a thumbnail and
   only build the iframe once the visitor actually clicks play.
   --------------------------------------------------------------------------- */

.hlv {
    position: relative;
    width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.22);
    aspect-ratio: 16 / 9;
}

/* Shorts and other vertical uploads. */
.hlv.hlv-vertical {
    aspect-ratio: 9 / 16;
    max-width: 340px;
}

.hlv iframe,
.hlv .hlv-facade {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hlv .hlv-facade {
    display: block;
    padding: 0;
    margin: 0;
    cursor: pointer;
    background: #000;
    appearance: none;
}

.hlv .hlv-thumb {
    width: 100%;
    height: 100%;
    /* YouTube serves 16:9 thumbnails even for vertical Shorts, so cover-crop
       rather than letterbox inside the 9:16 frame. */
    object-fit: cover;
    display: block;
    transition: transform .35s ease, opacity .35s ease;
}

.hlv .hlv-facade:hover .hlv-thumb,
.hlv .hlv-facade:focus-visible .hlv-thumb {
    transform: scale(1.03);
    opacity: .85;
}

/* Play button */
.hlv .hlv-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 76px;
    height: 54px;
    border-radius: 12px;
    background: rgba(18,18,18,.78);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .18s ease, transform .18s ease;
    pointer-events: none;
}

.hlv .hlv-play svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }

.hlv .hlv-facade:hover .hlv-play,
.hlv .hlv-facade:focus-visible .hlv-play {
    background: #f00;
    transform: translate(-50%, -50%) scale(1.06);
}

.hlv .hlv-facade:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

/* Caption strip across the bottom of the facade, so the visitor knows what
   they are about to play before the player chrome exists. */
.hlv .hlv-label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 34px 16px 14px;
    background: linear-gradient(to top, rgba(0,0,0,.82), rgba(0,0,0,0));
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .hlv .hlv-thumb,
    .hlv .hlv-play { transition: none; }
    .hlv .hlv-facade:hover .hlv-thumb { transform: none; }
}
