/* CMS / Page Builder YouTube click-to-load facade */

.youtube-facade {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* Hide raw iframes until upgrade removes them */
.youtube-facade:not(.youtube-facade--ready):not(.youtube-facade--playing) > iframe {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    border: 0 !important;
}

.youtube-facade__trigger {
    position: relative;
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    line-height: 0;
}

.youtube-facade__thumb {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0 auto;
}

.youtube-facade__play {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    z-index: 2;
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 72px !important;
    height: 72px !important;
    margin: -36px 0 0 -36px !important;
    border-radius: 50%;
    background: rgba(84, 131, 53, 0.92) !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    pointer-events: none;
}

.youtube-facade__play-icon {
    display: block;
    width: 28px;
    height: 28px;
    margin-left: 4px;
    fill: #fff;
}

.youtube-facade__trigger:hover .youtube-facade__play,
.youtube-facade__trigger:focus .youtube-facade__play {
    background: rgba(70, 107, 43, 0.95) !important;
}

.youtube-facade__iframe {
    display: block;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    aspect-ratio: 16 / 9;
    height: auto;
    min-height: 315px;
    border: 0;
}

.youtube-facade--playing {
    line-height: 0;
}
