/* ============================================================
   youtube-facade.css — YouTube click-to-load facade (2026-11-24)
   Стили фасада: превью-картинка + кнопка ▶ вместо встраиваемого
   плеера. Геометрия = оригинальному iframe (16/9, max 560px) →
   без CLS. Печать: плеер/фасад не нужны на бумаге.
   UTF-8 (через <link>, REDESIGN2026 §0.3).
   ============================================================ */

.yt-facade {
    position: relative;
    display: block;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 16 / 9;
    margin: 14px 0;
    border-radius: var(--radius-md, 8px);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-sm, 0 1px 2px rgba(0, 0, 0, 0.05));
}

.yt-facade__link {
    position: absolute;
    inset: 0;
    display: block;
    cursor: pointer;
    text-decoration: none;
    outline: none;
}

.yt-facade__thumb {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* hqdefault 480x360 (4:3 с полосами) → кроп 16:9 */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.yt-facade__thumb--loaded {
    opacity: 1;
}

.yt-facade__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 68px;
    height: 48px;
    transform: translate(-50%, -50%);
    border-radius: 12px;
    background: #f03; /* фирменный красный YouTube */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    pointer-events: none; /* клик ловит .yt-facade__link */
    transition: transform 0.15s ease, background 0.15s ease;
}

/* белый треугольник Play */
.yt-facade__play::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 54%;
    transform: translate(-50%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #fff;
}

.yt-facade__link:hover .yt-facade__play,
.yt-facade__link:focus-visible .yt-facade__play {
    transform: translate(-50%, -50%) scale(1.08);
    background: #e00;
}

.yt-facade__link:focus-visible {
    box-shadow: 0 0 0 3px rgba(206, 33, 14, 0.25); /* brand focus-ring */
}

/* подгруженный по клику плеер занимает место фасада 1:1 */
.yt-facade__frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

@media (prefers-reduced-motion: reduce) {
    .yt-facade__thumb,
    .yt-facade__play {
        transition: none;
    }
    .yt-facade__link:hover .yt-facade__play,
    .yt-facade__link:focus-visible .yt-facade__play {
        transform: translate(-50%, -50%);
    }
}

@media print {
    .yt-facade {
        display: none;
    }
}
