/**
 * Make remote-video Cover backgrounds crop like native image/video media.
 * Core's embedded Vimeo/YouTube background is an iframe, so object-fit does
 * not apply. Container query units let the 16:9 player cover any Cover ratio.
 */
.wp-block-cover > .wp-block-cover__embed-background {
	container-type: size;
	height: 100%;
	inset: 0;
	overflow: hidden;
	position: absolute;
	width: 100%;
	z-index: 0;
}

.wp-block-cover > .wp-block-cover__embed-background > iframe {
	border: 0;
	height: max(100cqh, calc(100cqw * 9 / 16));
	left: 50%;
	max-width: none;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: max(100cqw, calc(100cqh * 16 / 9));
}

/* Fallback for browsers without container query units. */
@supports not (width: 100cqw) {
	@media (max-width: 781px) {
		.wp-block-cover.has-aspect-ratio > .wp-block-cover__embed-background > iframe {
			height: 100%;
			width: 133.333%;
		}
	}
}
