/* Neutralise the theme's video wrappers so our responsive box gets a real
   width and does not collapse to 0 (shrink-to-fit / padding-hack wrappers). */
figure.video {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

figure.video .video-embed {
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
}

/* The content element + gallery wrappers around the video may center
   (.ce-center), float or shrink-wrap, collapsing the responsive box to 0
   width. Force the whole chain inside a frame that contains our video to
   full-width block. Scoped via :has() so image galleries stay untouched. */
.frame:has(.youtube-consent) .ce-textpic,
.frame:has(.youtube-consent) .ce-gallery,
.frame:has(.youtube-consent) .ce-outer,
.frame:has(.youtube-consent) .ce-inner,
.frame:has(.youtube-consent) .ce-row,
.frame:has(.youtube-consent) .ce-column {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    float: none !important;
    margin: 0 !important;
    text-align: left !important;
}

.youtube-consent {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #000;
    border-radius: 4px;
}

/* Fallback for browsers without aspect-ratio support */
@supports not (aspect-ratio: 16 / 9) {
    .youtube-consent::before {
        content: "";
        display: block;
        padding-top: 56.25%;
    }
}

.youtube-consent__trigger {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 1rem;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    text-align: center;
    cursor: pointer;
}

.youtube-consent__thumb {
    position: absolute;
    inset: 0;
    z-index: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.6);
}

.youtube-consent__thumb--missing {
    background: #1a1a1a;
}

.youtube-consent__play {
    position: relative;
    z-index: 2;
    width: 68px;
    height: 48px;
    border-radius: 14px;
    background: rgba(0, 0, 0, 0.55);
    transition: background 0.2s ease;
}

.youtube-consent__play::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 19px;
    border-color: transparent transparent transparent #fff;
}

.youtube-consent__trigger:hover .youtube-consent__play,
.youtube-consent__trigger:focus-visible .youtube-consent__play {
    background: #f00;
}

.youtube-consent__notice {
    position: relative;
    z-index: 2;
    max-width: 46ch;
    margin-top: 1rem;
    font-size: 0.8rem;
    line-height: 1.45;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.85);
}

.youtube-consent__cta {
    display: inline-block;
    margin-top: 0.6rem;
    padding: 0.4rem 0.9rem;
    border-radius: 4px;
    background: #f00;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
}

.youtube-consent__iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}
