/* =============================================================================
   Lite YouTube Embed + video player
   ============================================================================= */

.lite-youtube {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #000;
    background-position: center center;
    background-size: cover;
    background-repeat: no-repeat;
    cursor: pointer;
    overflow: hidden;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    contain: content;
}

.lite-youtube::before {
    content: "";
    display: block;
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, transparent 35%, transparent 65%, rgba(0, 0, 0, 0.55) 100%);
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: 1;
}

.lite-youtube:hover::before {
    opacity: 0.7;
}

/* Play button */
.lite-youtube__button {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 88px;
    height: 62px;
    margin-top: -31px;
    margin-left: -44px;
    padding: 0;
    background-color: var(--color-accent);
    border: none;
    border-radius: 14px;
    cursor: pointer;
    z-index: 2;
    transition: transform var(--transition-normal), background-color var(--transition-normal), box-shadow var(--transition-normal);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.lite-youtube__button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 14px 0 14px 22px;
    border-color: transparent transparent transparent #fff;
    transform: translate(-40%, -50%);
}

.lite-youtube:hover .lite-youtube__button,
.lite-youtube:focus-within .lite-youtube__button {
    transform: scale(1.08);
    background-color: #cc0000;
    box-shadow: 0 12px 40px rgba(255, 0, 0, 0.4);
}

/* Title overlay */
.lite-youtube__title {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: var(--space-4) var(--space-5);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 500;
    z-index: 2;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* Activated state — iframe loaded */
.lite-youtube.lyt-activated {
    cursor: unset;
}

.lite-youtube.lyt-activated::before,
.lite-youtube.lyt-activated > .lite-youtube__button,
.lite-youtube.lyt-activated > .lite-youtube__title {
    opacity: 0;
    pointer-events: none;
}

.lite-youtube iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Loading spinner (shown when iframe is loading) */
.lite-youtube.is-loading .lite-youtube__button::before {
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    animation: lite-yt-spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes lite-yt-spin {
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* --- Video lightbox modal -------------------------------------------------- */
.video-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    background-color: rgba(0, 0, 0, 0.92);
    z-index: var(--z-modal);
    opacity: 0;
    transition: opacity var(--transition-normal);
}

.video-lightbox.is-open {
    display: flex;
    opacity: 1;
}

.video-lightbox__inner {
    position: relative;
    width: 100%;
    max-width: 1280px;
    aspect-ratio: 16 / 9;
}

.video-lightbox__close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 0;
    color: #fff;
    cursor: pointer;
    font-size: 2rem;
    line-height: 1;
}

.video-lightbox__close:hover {
    color: var(--color-accent);
}

.video-lightbox iframe {
    width: 100%;
    height: 100%;
    border: 0;
    border-radius: var(--border-radius-lg);
}
