/**
 * YouTube Lazy Load Simple - Clean Version
 */

/* Wrapper - completely transparent to layout */
.ytls-wrapper {
    position: relative;
    display: block;
    width: 100%;
    line-height: 0;
}

/* Thumbnail - force 16:9 aspect ratio and crop to fit */
.ytls-thumbnail {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Play button */
.ytls-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 48px;
    background-color: rgba(255, 0, 0, 0.8);
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
    z-index: 10;
}

/* Play button triangle */
.ytls-play-button::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 52%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 10px 0 10px 16px;
    border-color: transparent transparent transparent #fff;
}

/* Play button hover */
.ytls-wrapper:hover .ytls-play-button {
    background-color: rgba(255, 0, 0, 1);
}

/* Loading state */
.ytls-wrapper.loading {
    pointer-events: none;
}

/* After video loads - hide thumbnail */
.ytls-wrapper.loaded .ytls-thumbnail,
.ytls-wrapper.loaded .ytls-play-button {
    display: none;
}

/* Iframe takes full space */
.ytls-wrapper iframe {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: none;
}

/* Mobile - remove hover */
@media (max-width: 767px) {
    .ytls-play-button {
        transition: none;
    }
}

/* Accessibility */
.ytls-wrapper:focus {
    outline: 2px solid #4A90E2;
    outline-offset: 2px;
}

/* Blog post fix - prevent iframe collapse after video loads */
.single-post .ytls-wrapper.loaded {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    height: 0;
}

.single-post .ytls-wrapper.loaded iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}