/* Prevent theme wrappers from shrinking iframe */
.faaaster-lazy-youtube,
.faaaster-lazy-youtube * {
    box-sizing: border-box;
}

/* Wrapper */
.faaaster-lazy-youtube {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    cursor: pointer;
    border-radius: 12px;
    display: block;
    width: 80%;
    max-width: 80%;
    margin: 20px 0;
}

/* Fix Blocksy: it adds max-width:100% to iframe */
.faaaster-lazy-youtube iframe {
    width: 100% !important;
    height: 100% !important;
    position: absolute;
    inset: 0;
    border: 0;
}

/* Preview image */
.faaaster-lazy-youtube img.preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Play button overlay */
.faaaster-lazy-youtube .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, .25);
    transition: background .2s;
    z-index: 9;
    /* Fix Blocksy stack order */
}

.faaaster-lazy-youtube:hover .overlay {
    background: rgba(0, 0, 0, .35);
}

/* Kill WP/Blocksy embed max-width constraints */
.wp-block-embed iframe,
.wp-block-embed__wrapper iframe {
    width: 100% !important;
    height: 100% !important;
}
