.studio-kiwi-hero-video {
	--studio-kiwi-hero-aspect: 1.77777778;
	background: var(--studio-kiwi-color-ink, #1f1f1f);
	container-type: size;
	height: min(56.25vw, calc(100vh - var(--studio-kiwi-header-current-height, 117px)));
	height: min(56.25vw, calc(100svh - var(--studio-kiwi-header-current-height, 117px)));
	max-height: min(var(--studio-kiwi-hero-editor-max, 999999px), calc(100svh - var(--studio-kiwi-header-current-height, 117px)));
	overflow: hidden;
	position: relative;
	width: 100%;
}

@supports (height: 100dvh) {
	.studio-kiwi-hero-video {
		height: min(56.25vw, calc(100dvh - var(--studio-kiwi-header-current-height, 117px)));
		max-height: min(var(--studio-kiwi-hero-editor-max, 999999px), calc(100dvh - var(--studio-kiwi-header-current-height, 117px)));
	}
}

.studio-kiwi-hero-video[data-sized="1"] { height: var(--studio-kiwi-hero-height); }

.studio-kiwi-hero-video__media,
.studio-kiwi-hero-video__poster,
.studio-kiwi-hero-video__overlay {
	inset: 0;
	position: absolute;
}

.studio-kiwi-hero-video__media {
	opacity: 0;
	transition: opacity 400ms ease;
	z-index: 1;
}

.studio-kiwi-hero-video.is-ready .studio-kiwi-hero-video__media { opacity: 1; }

.studio-kiwi-hero-video__poster {
	background-color: var(--studio-kiwi-color-ink, #1f1f1f);
	background-position: center center;
	background-repeat: no-repeat;
	background-size: cover;
	opacity: 1;
	transition: opacity 400ms ease;
	z-index: 2;
}

.studio-kiwi-hero-video.is-ready .studio-kiwi-hero-video__poster { opacity: 0; }

.studio-kiwi-hero-video__overlay {
	background: rgba(0, 0, 0, 0.36);
	pointer-events: none;
	z-index: 3;
}

.studio-kiwi-hero-video__video {
	height: 100%;
	inset: 0;
	object-fit: contain;
	object-position: center center;
	position: absolute;
	width: 100%;
}

.studio-kiwi-hero-video.is-cover .studio-kiwi-hero-video__video { object-fit: cover; }

.studio-kiwi-hero-video__iframe {
	border: 0;
	height: 100%;
	left: 50%;
	pointer-events: none;
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	width: 100%;
}

.studio-kiwi-hero-video.is-cover .studio-kiwi-hero-video__iframe {
	height: max(100%, calc(100vw / var(--studio-kiwi-hero-aspect)));
	min-height: 100%;
	min-width: 100%;
	width: max(100%, calc(100vh * var(--studio-kiwi-hero-aspect)));
}

@supports (width: 1cqw) {
	.studio-kiwi-hero-video.is-cover .studio-kiwi-hero-video__iframe {
		height: max(100cqh, calc(100cqw / var(--studio-kiwi-hero-aspect)));
		width: max(100cqw, calc(100cqh * var(--studio-kiwi-hero-aspect)));
	}
}

.studio-kiwi-hero-video--center-top .studio-kiwi-hero-video__video { object-position: center top; }
.studio-kiwi-hero-video--center-bottom .studio-kiwi-hero-video__video { object-position: center bottom; }
.studio-kiwi-hero-video--left-center .studio-kiwi-hero-video__video { object-position: left center; }
.studio-kiwi-hero-video--right-center .studio-kiwi-hero-video__video { object-position: right center; }
.studio-kiwi-hero-video--center-top .studio-kiwi-hero-video__poster { background-position: center top; }
.studio-kiwi-hero-video--center-bottom .studio-kiwi-hero-video__poster { background-position: center bottom; }
.studio-kiwi-hero-video--left-center .studio-kiwi-hero-video__poster { background-position: left center; }
.studio-kiwi-hero-video--right-center .studio-kiwi-hero-video__poster { background-position: right center; }
.studio-kiwi-hero-video--center-top .studio-kiwi-hero-video__iframe { top: 0; transform: translateX(-50%); }
.studio-kiwi-hero-video--center-bottom .studio-kiwi-hero-video__iframe { bottom: 0; top: auto; transform: translateX(-50%); }
.studio-kiwi-hero-video--left-center .studio-kiwi-hero-video__iframe { left: 0; transform: translateY(-50%); }
.studio-kiwi-hero-video--right-center .studio-kiwi-hero-video__iframe { left: auto; right: 0; transform: translateY(-50%); }

@media (prefers-reduced-motion: reduce) {
	.studio-kiwi-hero-video__media { display: none; }
	.studio-kiwi-hero-video__poster { opacity: 1; transition: none; }
}
