/**
 * Module: article_youtube
 * Privacy-friendly YouTube embed for article pages
 */

/* ============================================
   ARTICLE YOUTUBE VIDEO
   ============================================ */

.t1-youtube {
    margin: 2rem 0;
}

.t1-youtube__container {
    position: relative;
    width: 100%;
    background: var(--ink);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
}

/* Aspect ratios */
.t1-youtube--16-9 .t1-youtube__container {
    aspect-ratio: 16 / 9;
}

.t1-youtube--4-3 .t1-youtube__container {
    aspect-ratio: 4 / 3;
}

.t1-youtube--1-1 .t1-youtube__container {
    aspect-ratio: 1 / 1;
}

/* Max width variants */
.t1-youtube--large {
    max-width: 800px;
}

.t1-youtube--medium {
    max-width: 640px;
}

/* Thumbnail */
.t1-youtube__thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Overlay */
.t1-youtube__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    background: rgba(0, 0, 0, 0.3);
    transition: background 0.2s;
}

.t1-youtube__container:hover .t1-youtube__overlay {
    background: rgba(0, 0, 0, 0.5);
}

/* Play button */
.t1-youtube__play {
    width: 68px;
    height: 48px;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.2s, opacity 0.2s;
}

.t1-youtube__container:hover .t1-youtube__play {
    transform: scale(1.1);
}

.t1-youtube__play-bg {
    transition: fill 0.2s, fill-opacity 0.2s;
}

.t1-youtube__container:hover .t1-youtube__play-bg {
    fill: #ff0000;
    fill-opacity: 1;
}

/* Privacy notice */
.t1-youtube__notice {
    margin: 0;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    text-align: center;
    max-width: 90%;
}

/* Loaded state (iframe) */
.t1-youtube__iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.t1-youtube__container--loaded {
    cursor: default;
}

/* Focus styles for accessibility */
.t1-youtube__container:focus {
    outline: 3px solid var(--jade);
    outline-offset: 2px;
}

.t1-youtube__container:focus:not(:focus-visible) {
    outline: none;
}

/* ========================================
   LIGHT THEME OVERRIDE
   ======================================== */

.t1-youtube--light .t1-youtube__container {
    background: white;
    border: 1px solid rgba(26, 29, 33, 0.08);
}

.t1-youtube--light .t1-youtube__container:focus {
    outline-color: var(--jade);
}