/*
 * Privacy-friendly YouTube facade.
 * Self-contained: no dependency on any theme framework (Bootstrap, Tailwind).
 */

.yt-facade {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
}

.yt-facade--portrait {
    aspect-ratio: 9 / 16;
}

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

.yt-facade__thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.yt-facade__thumb--placeholder {
    background: linear-gradient(135deg, #1f1f1f 0%, #3a3a3a 100%);
}

/* YouTube-style play button (cf. lite-youtube-embed) */
.yt-facade__play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    filter: grayscale(80%);
    transition: filter 0.2s ease, transform 0.2s ease;
}

.yt-facade__play-bg {
    fill: #f00;
    fill-opacity: 0.9;
}

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

.yt-facade__link:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

/* Consent overlay */
.yt-facade__consent {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    justify-content: safe center; /* avoid clipping on very small tiles */
    gap: 0.4rem;
    padding: 0.75rem;
    overflow-y: auto;
    scrollbar-width: thin;
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    text-align: center;
    font-size: 0.8125rem;
    line-height: 1.35;
}

.yt-facade__consent[hidden] {
    display: none;
}

.yt-facade__consent p {
    margin: 0;
}

.yt-facade__consent-title {
    font-weight: 700;
}

.yt-facade__consent-hint {
    font-size: 0.6875rem;
    opacity: 0.75;
}

.yt-facade__consent-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.yt-facade__btn {
    border: 0;
    border-radius: 0.25rem;
    padding: 0.4rem 0.9rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.yt-facade__btn--accept {
    background: #f00;
    color: #fff;
}

.yt-facade__btn--accept:hover,
.yt-facade__btn--accept:focus-visible {
    background: #c00;
}

.yt-facade__btn--cancel {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.6);
}

.yt-facade__btn--cancel:hover,
.yt-facade__btn--cancel:focus-visible {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

/* Loaded state */
.yt-facade--playing iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
