/* ============================================================
   HeimatMacher Hero mit Video  —  Frontend + Editor
   ============================================================ */

.hmhv {
	/* Fallbacks, falls Inline-Variablen fehlen */
	--hmhv-focus-x: 0%;
	--hmhv-focus-y: 50%;
	--hmhv-img-ratio: 3.03;
	--hmhv-min-h: 420px;
	--hmhv-box-w: 35%;
	--hmhv-box-right: 7%;
	--hmhv-box-top: 25%;
	--hmhv-radius: 10px;
	--hmhv-frame-w: 8px;
	--hmhv-frame-c: #fff;
	--hmhv-accent: #ff6900;
	--hmhv-video-ratio: 16 / 9;

	position: relative;
	width: 100%;
	overflow: hidden;
	isolation: isolate;
}

/* --- Hintergrundgrafik ------------------------------------- */

.hmhv__bg {
	position: relative;
	width: 100%;
	aspect-ratio: var(--hmhv-img-ratio);
	min-height: var(--hmhv-min-h);
	margin: 0;
	background: #e9edf2;
}

.hmhv__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Bild wird bei Bedarf rechts beschnitten – das Herz-Motiv bleibt links stehen */
	object-position: var(--hmhv-focus-x) var(--hmhv-focus-y);
}

/* --- Video-Fenster ----------------------------------------- */

.hmhv__box {
	position: absolute;
	top: var(--hmhv-box-top);
	right: var(--hmhv-box-right);
	width: var(--hmhv-box-w);
	z-index: 2;
}

.hmhv__frame {
	position: relative;
	width: 100%;
	aspect-ratio: var(--hmhv-video-ratio);
	overflow: hidden;
	border-radius: var(--hmhv-radius);
	background: #10161d;
	border: var(--hmhv-frame-w) solid var(--hmhv-frame-c);
	box-sizing: border-box;
}

.hmhv--shadow .hmhv__frame {
	box-shadow: 0 18px 44px rgba(16, 22, 29, 0.35), 0 3px 10px rgba(16, 22, 29, 0.2);
}

.hmhv__poster {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.hmhv__poster--empty {
	background:
		radial-gradient(120% 120% at 70% 20%, #1d2b3a 0%, #10161d 70%);
}

/* Play-Button --------------------------------------------- */

.hmhv__play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0;
	margin: 0;
	border: 0;
	background: linear-gradient(180deg, rgba(16, 22, 29, 0) 40%, rgba(16, 22, 29, 0.35) 100%);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: background 0.2s ease;
}

.hmhv__play:hover,
.hmhv__play:focus-visible {
	background: linear-gradient(180deg, rgba(16, 22, 29, 0.15) 0%, rgba(16, 22, 29, 0.45) 100%);
}

.hmhv__play:focus-visible {
	outline: 3px solid var(--hmhv-accent);
	outline-offset: -3px;
}

.hmhv__play-icon {
	display: block;
	width: clamp(48px, 18%, 84px);
	aspect-ratio: 1;
	filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.45));
	transition: transform 0.2s ease;
}

.hmhv__play-icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.hmhv__play-bg {
	fill: var(--hmhv-accent);
}

.hmhv__play-tri {
	fill: #fff;
}

.hmhv__play:hover .hmhv__play-icon,
.hmhv__play:focus-visible .hmhv__play-icon {
	transform: scale(1.08);
}

/* Eingebettetes Video ------------------------------------- */

.hmhv__frame iframe,
.hmhv__frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	background: #000;
}

/* Bildunterschrift & Hinweis ------------------------------ */

.hmhv__caption,
.hmhv__note {
	margin: 0.5em 0 0;
	color: #1b2733;
	font-size: 0.8125rem;
	line-height: 1.4;
	text-shadow: 0 1px 2px rgba(255, 255, 255, 0.7);
}

.hmhv__caption {
	font-weight: 600;
	font-size: 0.9375rem;
}

.hmhv__note {
	opacity: 0.75;
}

/* --- Responsiv: unter 900px wird gestapelt ----------------- */

@media (max-width: 900px) {
	.hmhv__bg {
		aspect-ratio: 16 / 9;
		min-height: 0;
	}

	.hmhv__box {
		position: static;
		width: 100%;
		padding: 0 clamp(16px, 5vw, 32px) clamp(16px, 5vw, 32px);
		box-sizing: border-box;
		margin-top: clamp(-40px, -6vw, -16px);
	}

	.hmhv__caption,
	.hmhv__note {
		text-shadow: none;
	}
}

@media (max-width: 600px) {
	.hmhv__bg {
		aspect-ratio: 3 / 2;
	}
}

/* --- Reduzierte Bewegung ----------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.hmhv__play,
	.hmhv__play-icon {
		transition: none;
	}
}
