/* Обкладинка відео YouTube (inc/yt-facade.php): вигляд плеєра YouTube у стані «не запущено».
   Розміри, відступи, шрифти й кольори зняті з самого плеєра (ширина ≥ 480 px — звичайний режим,
   вужче — «малий» режим плеєра). Кадр — object-fit: cover, як у плеєрі: пропорції не змінюються. */

.pg-yt {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #000;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    cursor: pointer;
    container-type: inline-size;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 260ms ease;
}
.pg-yt.is-leaving { opacity: 0; pointer-events: none; }

.pg-yt__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% 50%;
    display: block;
}

/* Затемнення верхньої смуги під назвою (70 px), як у плеєрі */
.pg-yt__shade {
    position: absolute;
    inset: 0 0 auto;
    height: 70px;
    pointer-events: none;
    background: linear-gradient(rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0));
}

.pg-yt a { color: #fff; text-decoration: none; }

.pg-yt__top {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 52px;
}
.pg-yt__avatar {
    position: absolute;
    left: 30px;
    top: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
}
.pg-yt__avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pg-yt__titles {
    position: absolute;
    left: 78px;
    right: 36px;
    top: 0;
}
.pg-yt__titles--noavatar { left: 26px; }
.pg-yt__title {
    display: block;
    padding-top: 10px;
    font-size: 20px;
    font-weight: 700;
    line-height: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip; /* плеєр обрізає довгу назву без «…» */
}
.pg-yt__channel {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 13.2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pg-yt__play {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 72px;
    height: 72px;
    margin: -36px 0 0 -36px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
}
.pg-yt__play svg { width: 100%; height: 100%; display: block; }
.pg-yt__play:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 16px; }

.pg-yt__share {
    position: absolute;
    left: 30px;
    bottom: 12px;
    width: 56px;
    height: 48px;
    padding: 4px 0;
    box-sizing: border-box;
    border-radius: 48px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
}
.pg-yt__share-btn { width: 40px; height: 40px; display: grid; place-items: center; }
.pg-yt__share-btn svg { width: 24px; height: 24px; display: block; }

.pg-yt__watch {
    position: absolute;
    right: 30px;
    bottom: 12px;
    height: 48px;
    padding: 0 24px;
    box-sizing: border-box;
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 18px;
    font-weight: 400;
    line-height: 48px;
    white-space: nowrap;
}
.pg-yt__logo { width: 90px; height: 20px; display: block; }

/* Малий режим плеєра (вузький блок — телефон) */
@container (max-width: 480px) {
    .pg-yt__avatar { left: 16px; }
    .pg-yt__titles { left: 64px; right: 12px; }
    .pg-yt__titles--noavatar { left: 12px; }
    .pg-yt__title { font-size: 18px; line-height: 26px; }
    .pg-yt__share { left: 12px; bottom: 2px; }
    .pg-yt__watch { right: 12px; bottom: 6px; height: 40px; padding: 0 20px; }
}

/* Справжній плеєр після натискання — з'являється під обкладинкою, обкладинка плавно зникає */
.pg-yt-frame { opacity: 0; transition: opacity 260ms ease; }
.pg-yt-frame.is-ready { opacity: 1; }

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