.component-background-video-wrapper > .component-wrapper {
    display: grid;
    grid-template-areas: "same";
    isolation: isolate;
}

.component-background-video-wrapper > .component-wrapper > * {
    grid-area: same;
}

.component-background-video-wrapper :where( .background-video) {
    background: #eee;
    overflow: hidden;
    padding: 0;
    position: relative;
    container: video-container / size;
}

.component-background-video-wrapper :where( .background-video > iframe) {
    box-sizing: border-box;
    left: 50%;
    min-height: 100%;
    min-width: 100%;
    transform: translate(-50%, -50%);
    position: absolute;
    top: 50%;
    width: 100%;
    aspect-ratio: 16 / 9;
    height: auto;
}

.component-background-video-wrapper > .component-wrapper > .region {
    z-index: 2;
    width: 100%;
}

/* This stops black bars from appearing because the video can't fill the area properly */
@container video-container (aspect-ratio < 16 / 9) {
    .component-background-video-wrapper :where( .background-video > iframe) {
        min-width: 200dvw;
    }
}
