/* ===========================================================================
   M25 — Hero (WKN-Wohnbau Child) — Figma 13:6
   =========================================================================== */

.m25_hero {
	position: relative;
	width: 100%;
	/* Viewport minus tatsaechliche Header-Hoehe (per JS auf --m25-header-h
	   gesetzt; siehe m25_hero.js). Fallback 132px Desktop / 112px Tablet. */
	height: calc(100dvh - var(--m25-header-h, 132px));
	min-height: 800px;
	overflow: hidden;
	color: #fff;
	background: #20232b;
	display: flex;
	align-items: end;
}

@media (max-width: 1024px) {
	.m25_hero { height: calc(100dvh - var(--m25-header-h, 112px)); }
}

.m25_hero_background {
	position: absolute;
	inset: 0;
	z-index: 1;
}

.m25_hero_image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Hintergrund-Video liegt deckungsgleich ueber dem Bild. Das Bild bleibt als
   Poster/Fallback bestehen und wird nie entfernt — laeuft das Video nicht
   (Codec, Datensparmodus, Mobil, reduced motion), sieht der Nutzer schlicht
   weiter das Bild. Eingeblendet wird erst bei 'playing' via .is-playing. */
.m25_hero_video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	opacity: 0;
	transition: opacity 0.6s ease;
	pointer-events: none;
}

.m25_hero_video.is-playing {
	opacity: 1;
}

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

.m25_hero_background::after {
	content: '';
	position: absolute;
	inset: 0;
	/* Horizontaler Verlauf: links stark abdunkeln (Lese-Kontrast fuer Title/Text),
	   rechts transparent, damit das Bild dort klar durchkommt. */
	background: linear-gradient(
		to right,
		rgba(10, 37, 64, 0.95) 0%,
		rgba(10, 37, 64, 0.6) 45%,
		rgba(10, 37, 64, 0.05) 75%,
		rgba(10, 37, 64, 0) 100%
	);
	pointer-events: none;
}

/* Pause-/Play-Button fuer das Hintergrundvideo. Direktes Kind der Section (nicht
   von .m25_hero_background), damit z-index 3 wirklich gegen .m25_hero_content
   (z-index 2) zaehlt — sonst liegt der Button unter dem Content und ist nicht
   klickbar. Oben rechts, weil der Content unten sitzt (align-items: end). */
.m25_hero_video_toggle {
	position: absolute;
	z-index: 3;
	right: 24px;
	top: 24px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.6);
	background: rgba(10, 37, 64, 0.65);
	color: #fff;
	cursor: pointer;
	transition: background 0.2s ease;
}

.m25_hero_video_toggle[hidden] {
	display: none;
}

.m25_hero_video_toggle:hover {
	background: #ec7328;
}

.m25_hero_video_toggle:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}

.m25_hero_video_toggle svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Label nur fuer Screenreader — der Button zeigt visuell das Icon. */
.m25_hero_video_toggle_label {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* aria-pressed="true" = laeuft -> Pause anbieten. false = pausiert -> Play. */
.m25_hero_video_toggle[aria-pressed='true'] .m25_hero_video_icon_play,
.m25_hero_video_toggle[aria-pressed='false'] .m25_hero_video_icon_pause {
	display: none;
}

/* Ladezustand: zwischen Klick und erstem Frame kann bei grossen Dateien viel
   Zeit vergehen. Ohne Rueckmeldung wirkt der Button defekt. */
.m25_hero_video_toggle.is-loading .m25_hero_video_icon_play,
.m25_hero_video_toggle.is-loading .m25_hero_video_icon_pause {
	display: none;
}

.m25_hero_video_toggle.is-loading::after {
	content: '';
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: m25_video_spin 0.8s linear infinite;
}

@keyframes m25_video_spin {
	to { transform: rotate(360deg); }
}

/* Ohne Animation bleibt ein statischer Ring — der Button sieht trotzdem
   erkennbar "beschaeftigt" aus. */
@media (prefers-reduced-motion: reduce) {
	.m25_hero_video_toggle.is-loading::after {
		animation: none;
	}
}

.m25_hero_content {
	position: relative;
	z-index: 2;
	width: 100%;
}

/* Hero topline = BtW-rendered .m25_untertitel — styled globally in project.css.
   Override colors here so the tag is readable on the dark hero background. */
section.m25_hero .m25_untertitel {
	background: rgba(236, 115, 40, 0.15);
	color: #fff;
}

.m25_hero_text_title_link_container {
    max-width: 750px;
}

.m25_titel_container h1 {
	color: #fff;
}

.m25_hero_text_container {
	max-width: 500px;
	margin-top: 53px;
}

.m25_hero_text_container * {
	color: #fff;
}

.m25_link_container .button p {
	color: #fff;
}

.m25_links_container.mM_links {
    margin-top: 120px;
}

.m25_scroll_indicator_wrapper {
	display: flex;
	justify-content: center;
	justify-self: end;
	align-items: center;
	width: 66px;
	height: 66px;
	background: #ec7328;
	border: none;
	cursor: pointer;
	margin-top: 62px;
}

.m25_scroll_indicator_wrapper img {
	width: 23px;
	height: 13px;
	transform: rotate(90deg);
	transition: transform 0.2s ease;
}

/* Hover: Pfeil bobt leicht hoch und runter (rotate(90deg) bleibt, Y wird animiert). */
@keyframes m25_arrow_bob {
	0%, 100% { transform: rotate(90deg) translateX(0); }
	50%      { transform: rotate(90deg) translateX(4px); }
}

.m25_scroll_indicator_wrapper:hover img,
.m25_scroll_indicator_wrapper:focus-visible img {
	animation: m25_arrow_bob 0.9s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
	.m25_scroll_indicator_wrapper:hover img,
	.m25_scroll_indicator_wrapper:focus-visible img {
		animation: none;
	}
}

@media (max-width: 767px) {
	.m25_hero {
		height: auto !important;
		min-height: unset;
		flex-direction: column-reverse;
	}

	.m25_hero_background {
		position: relative;
		height: 500px;
	}

	.m25_hero_background::after {
		background: linear-gradient(
			to bottom,
			#20232b 0%,
			transparent 100%
		);
	}

	.m25_scroll_indicator_wrapper {
		display: none;
	}

	/* Mobil (column-reverse) liegt der Bildbereich unten, der Text oben —
	   Button deshalb nach unten rechts in die Bildflaeche. */
	.m25_hero_video_toggle {
		top: auto;
		bottom: 16px;
		right: 16px;
	}

	.m25_hero_content {
		padding-top: 55px;
		margin-bottom: -200px;
	}

	section.m25_hero .m25_untertitel {
		flex-direction: column;
		align-items: start;
		background: none;
		padding: 0;
	}

	.m25_hero_text_container {
		margin-top: 19px;
	}

	.m25_links_container .mM_links {
		margin-top: 52px;
	}
}
