/**
 * Lite YouTube Embed
 * Lightweight YouTube video embeds with facade pattern
 * Loads iframe only on click to save bandwidth and improve performance
 * 
 * Usage:
 * <div class="lite-youtube" data-id="VIDEO_ID"></div>
 */

.lite-youtube {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    cursor: pointer;
    background-color: #000;
}

.lite-youtube::before {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52,7.74c-0.78-2.93-2.49-5.41-5.42-6.19C55.79,.13,34,0,34,0S12.21,.13,6.9,1.55 C3.97,2.33,2.27,4.81,1.48,7.74C0.06,13.05,0,24,0,24s0.06,10.95,1.48,16.26c0.78,2.93,2.49,5.41,5.42,6.19 C12.21,47.87,34,48,34,48s21.79-0.13,27.1-1.55c2.93-0.78,4.64-3.26,5.42-6.19C67.94,34.95,68,24,68,24S67.94,13.05,66.52,7.74z" fill="%23f00"></path><path d="M 45,24 27,14 27,34" fill="%23fff"></path></svg>') center/68px 48px no-repeat;
}

.lite-youtube::after {
    content: attr(data-title);
    display: block;
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.7);
    padding: 8px 12px;
    font-size: 14px;
    border-radius: 4px;
    opacity: 0;
    transition: opacity 0.3s;
}

.lite-youtube:hover::after {
    opacity: 1;
}

.lite-youtube > img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.lite-youtube > iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Play button overlay */
.lite-youtube-playbtn {
    width: 68px;
    height: 48px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1;
    background-color: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
}

.lite-youtube-playbtn::before {
    content: '';
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.lite-youtube:hover .lite-youtube-playbtn::before {
    border-color: transparent transparent transparent #f00;
}
