/* Theme Part M25 - Hero */

section.m25_hero {
	/* Heading white, eyebrow red, body white only inside the hero */
	--h_color: #fff;
	--h_sub_color: #F02A34;
	--font_color: #fff;
	position: relative;
	min-height: 852px;            /* Figma: hero below the 35px topbar down to y 852 */
	padding: 257px 0 130px;       /* Figma: subtitle centre at y 267, title line box at y 280 */
	color: #fff;
	background: #123157;
	overflow: hidden;
}

/* Hero zieht sich unter den fixierten Header (Konvention 5.7) */
main > section.m25_hero:first-child {
	margin-top: calc(var(--btw_header_height, 0px) * -1);
}

/* Hintergrundbild */
section.m25_hero .m25_hero_bg {
	position: absolute;
	inset: 0;
	z-index: 0;
}

section.m25_hero .m25_hero_bg :is(img, video) {
	width: 100%;
	height: 100%;
	object-position: 50% 28%;
	transform: scale(1.04);
	animation: m25HeroZoom 1.8s cubic-bezier(.2, .7, .2, 1) forwards;
}

/* Video above the photo: invisible until it actually plays (it loads only
   after the page, see m25_hero.js), then it fades in over the photo */
section.m25_hero .m25_hero_bg .m25_hero_video {
	position: absolute;
	/* 1px narrower than the photo below (which fills the edge): the browser
	   counts the later video as a new "largest paint" (LCP) only if it is
	   larger, so the photo stays the LCP element */
	inset: 0 1px;
	width: calc(100% - 2px);
	opacity: 0;
	transition: opacity .8s ease;
}

section.m25_hero .m25_hero_bg .m25_hero_video.is_playing {
	opacity: 1;
}

/* Navy gradient: from the left into the text (lighter than Figma, the photo
   shows more), from the right behind the social icons (a bright light in the
   photo/video sat right behind them), from the top (white text below the
   header) and from the bottom. White text keeps at least 3:1 (large) /
   4.5:1 (lead) on 95 % of the pixels behind it, measured 992-1920 px. */
section.m25_hero .m25_hero_bg::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		linear-gradient(90deg, rgba(18, 49, 87, .95) 0%, rgba(18, 49, 87, .7) 30%, rgba(18, 49, 87, 0) 56%),
		linear-gradient(270deg, rgba(18, 49, 87, .75) 0%, rgba(18, 49, 87, .45) 12%, rgba(18, 49, 87, 0) 32%),
		linear-gradient(180deg, rgba(18, 49, 87, .8) 0%, rgba(18, 49, 87, .45) 20%, rgba(18, 49, 87, 0) 45%),
		linear-gradient(180deg, rgba(18, 49, 87, 0) 50%, #123157 100%);
}

/* 992-1199: the text column takes half the width, the gradient from the left
   reaches further into it (lead 4.5:1). Not on the start page: its players
   stand right next to the text there. */
@media all and (min-width: 992px) and (max-width: 1199px) {
	body:not(.home) section.m25_hero .m25_hero_bg::after {
		background:
			linear-gradient(90deg, rgba(18, 49, 87, .95) 0%, rgba(18, 49, 87, .78) 40%, rgba(18, 49, 87, 0) 68%),
			linear-gradient(270deg, rgba(18, 49, 87, .75) 0%, rgba(18, 49, 87, .45) 12%, rgba(18, 49, 87, 0) 32%),
			linear-gradient(180deg, rgba(18, 49, 87, .8) 0%, rgba(18, 49, 87, .45) 20%, rgba(18, 49, 87, 0) 45%),
			linear-gradient(180deg, rgba(18, 49, 87, 0) 50%, #123157 100%);
	}
}

/* Container bleibt voller, zentrierter Block (Theme-Container) */
section.m25_hero .mM_container {
	position: relative;
	z-index: 2;
}

section.m25_hero .m25_hero_content {
	max-width: 560px;
}

/* Eyebrow: eine Zeile, Abstand zum Titel */
section.m25_hero .m25_untertitel_container {
	margin: 0;
}

section.m25_hero .m25_untertitel {
	max-width: none;
	margin: 0 0 3px 8px;          /* Figma: 3px above the title, indented to x 225 */
}

/* Titel: Umbruch über max-width (kein <br>) */
section.m25_hero .m25_titel_container {
	margin: 0;
}

section.m25_hero .m25_titel_container :is(h1, .h1) {
	max-width: 9em;
	margin: 0;
}

section.m25_hero .m25_hero_text {
	max-width: 519px;
	margin-top: 16px;             /* Figma: title ends at 420, text line box at 436 */
}

section.m25_hero .m25_hero_text p {
	max-width: none;
	margin: 0;
}

section.m25_hero .m25_links_container {
	margin-top: 36px;
}

/* Right column: social from Figma y 385 = 128px below the container top
   (padding 257), the KI badge at the bottom. One column, so a low text block
   puts the badge below the icons instead of onto them. */
section.m25_hero .m25_hero_aside {
	position: absolute;
	top: 128px;
	right: 0;
	bottom: 28px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 24px;
	z-index: 2;
}

/* Too low for both: they run below the column instead of being squeezed */
section.m25_hero .m25_hero_aside > * {
	flex-shrink: 0;
}

/* Badge only (no social links): bottom right as before */
section.m25_hero .m25_hero_aside:not(:has(.m25_hero_social)) {
	top: auto;
}

section.m25_hero .m25_hero_social {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

section.m25_hero .m25_slab_icon {
	position: relative;
	display: inline-flex;
	width: 44px;
	height: 44px;
}

section.m25_hero .m25_slab_frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	fill: rgba(255, 255, 255, .08);
	stroke: rgba(255, 255, 255, .35);
	stroke-width: 1px;
	transition: fill .25s ease, stroke .25s ease;
}

@media (hover: hover) {
	section.m25_hero .m25_slab_icon:hover .m25_slab_frame {
		fill: var(--btw_red);
		stroke: var(--btw_red);
	}
}

/* Glyph = 20x20 icon box at its Figma position inside the 44px slab
   (x 11, y 12.15). Coloured via fill, which inherits into the sprite clone. */
section.m25_hero .m25_slab_i {
	position: absolute;
	left: 11px;
	top: 12px;
	width: 20px;
	height: 20px;
	fill: #fff;
}

/* Pause/play for the background video: a button in the style of the social
   slabs (m25_hero.js switches icon and label) */
section.m25_hero button.m25_slab_icon {
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

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

section.m25_hero .m25_video_toggle .m25_icon_play,
section.m25_hero .m25_video_toggle.is_paused .m25_icon_pause {
	display: none;
}

section.m25_hero .m25_video_toggle.is_paused .m25_icon_play {
	display: inline;
}

/* KI-Badge unten rechts */
section.m25_hero .m25_hero_ki {
	margin-top: auto;
}

/* Option "Ganzes Bild rechts" (field m25_bild_rechts, club feedback 2026-11-13):
   the photo keeps its proportions at the full hero height on the right, so
   nobody in it is cut off; its left part fades into the navy section, which
   continues under the text (the photo looks wider than it is). Below 992px
   the photo fills the hero as usual. */
section.m25_hero.m25_bild_rechts .m25_hero_bg {
	display: flex;
	justify-content: flex-end;
	overflow: hidden;
	background-color: #123157;
}

section.m25_hero.m25_bild_rechts .m25_hero_bg img {
	flex: 0 0 auto;
	width: auto;
	min-width: 55%;              /* wide screens: never a small photo in a big navy area */
	max-width: 62%;              /* the text column stays navy */
	height: 100%;
	/* top-aligned: on wide screens the photo is scaled up and cropped; heads sit
	   high in group photos, so only the bottom (legs) may go (User 16.11.) */
	object-position: 50% 0;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 30%);
	mask-image: linear-gradient(90deg, transparent 0, #000 30%);
}

/* The text stands on navy, so the photo only needs navy at the top (white
   navigation) and a little at the bottom, not the full hero gradient */
body section.m25_hero.m25_bild_rechts .m25_hero_bg::after {   /* body: beats the 992-1199 gradient above */
	background:
		linear-gradient(180deg, rgba(18, 49, 87, .75) 0%, rgba(18, 49, 87, .35) 18%, rgba(18, 49, 87, 0) 36%),
		linear-gradient(180deg, rgba(18, 49, 87, 0) 70%, rgba(18, 49, 87, .55) 100%);
}

@keyframes m25HeroZoom {
	to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
	section.m25_hero .m25_hero_bg :is(img, video) { animation: none; transform: none; }
	section.m25_hero .m25_hero_bg .m25_hero_video { transition: none; }
}

/* ---- Tablet ---- */
@media all and (max-width: 991px) {
	/* Content 16px below the (unscrolled) header, which holds the big crest
	   here; the fallback keeps the old 150px */
	section.m25_hero {
		min-height: 0;
		padding: calc(var(--btw_header_height, 134px) + 70px) 0 90px;
	}
	/* Photo moved 80px to the left, but never further than its right edge:
	   100% = the full overhang, so max() never leaves a strip without photo
	   on the right (a fixed -80px did on wide, low heroes) */
	section.m25_hero .m25_hero_bg :is(img, video) { object-position: max(-80px, 100%) 40%; }
	section.m25_hero.m25_bild_rechts .m25_hero_bg {
		display: block;
	}
	/* Below 992px the photo lies behind the text again: the full hero gradient */
	body section.m25_hero.m25_bild_rechts .m25_hero_bg::after {
		background:
			linear-gradient(225deg, rgba(18, 49, 87, .55) 0%, rgba(18, 49, 87, 0) 50%),
			linear-gradient(180deg, rgba(18, 49, 87, .72) 0%, rgba(18, 49, 87, .86) 50%, #123157 100%);
	}
	section.m25_hero.m25_bild_rechts .m25_hero_bg img {
		width: 100%;
		min-width: 0;
		max-width: none;
		-webkit-mask-image: none;
		mask-image: none;
	}
	/* Navy from the top, plus from the top right corner a bit further down:
	   burger and the right end of the white text lines sit on the photo there */
	section.m25_hero .m25_hero_bg::after {
		background:
			linear-gradient(225deg, rgba(18, 49, 87, .55) 0%, rgba(18, 49, 87, 0) 50%),
			linear-gradient(180deg, rgba(18, 49, 87, .72) 0%, rgba(18, 49, 87, .86) 50%, #123157 100%);
	}
	section.m25_hero .m25_hero_aside {
		position: static;
		display: block;
	}
	section.m25_hero .m25_hero_social {
		flex-direction: row;
		margin-top: 32px;
	}
	section.m25_hero .m25_hero_ki {
		margin-top: 28px;
	}
	/* The badge sits left in the flow: its info box opens to the right */
	section.m25_hero .m25_hero_ki .tg_ki_pop {
		left: 0;
		right: auto;
	}
}

/* ---- Mobile ---- */
@media all and (max-width: 767px) {
	section.m25_hero {
		min-height: 0;
		padding: calc(var(--btw_header_height, 134px) + 116px) 0 120px;
	}

	section.m25_hero .m25_hero_bg :is(img, video) { object-position: max(-150px, 100%) 40%; }
}

/* Option "Bildausschnitt mobil: Motiv rechts" (field m25_bild_mobil, User 16.11.):
   where the photo fills the hero (below 992px) its right edge stays in view,
   for photos whose people stand on the right (e.g. Herren 1 on /unser-team/) */
@media all and (max-width: 991px) {
	section.m25_hero.m25_bild_mobil_rechts .m25_hero_bg :is(img, video) { object-position: 100% 40%; }
}

@media all and (max-width: 575px) {
	section.m25_hero { padding: calc(var(--btw_header_height, 104px) + 70px) 0 64px; }
	section.m25_hero .m25_titel_container :is(h1, .h1) { max-width: 100%; }
	section.m25_hero .m25_hero_content { max-width: 100%; }
}

/* Very narrow screens: the longest word („NIEDERBAYERISCH.“) still fits the line */
@media all and (max-width: 359px) {
	section.m25_hero .m25_titel_container :is(h1, .h1) { font-size: 2.375rem; }
}

/* ---- Start page: the three players fully in view at every width, above the text ----
   Photo tg-hero-startseite.jpg (1920 x 1141): players at 32-67 % of the width, heads at
   29 %, knees at 80 % of the height. Desktop: the group moves right, next to the text
   (the left part stays navy through the gradient). Burger widths: the photo is a band on
   top with the players below the header, the text starts at their legs. */
@media all and (min-width: 992px) and (max-width: 1199px) {
	body.home section.m25_hero .m25_hero_bg :is(img, video) { object-position: calc(50% + 50vw - 268px) 28%; }
	body.home section.m25_hero .m25_hero_text { max-width: 440px; }
}

@media all and (min-width: 1200px) and (max-width: 1399px) {
	body.home section.m25_hero .m25_hero_bg :is(img, video) { object-position: calc(50% + 290px) 28%; }
}

@media all and (min-width: 1400px) and (max-width: 1539px) {
	body.home section.m25_hero .m25_hero_bg :is(img, video) { object-position: calc(50% + 200px) 28%; }
}

@media all and (min-width: 1540px) {
	body.home section.m25_hero .m25_hero_bg :is(img, video) { object-position: calc(50% + 18vw - 110px) 28%; }
}

@media all and (max-width: 991px) {
	body.home section.m25_hero {
		--m25_bild_h: clamp(600px, 80vw, 720px);
		padding-top: calc(var(--m25_bild_h) * .74);
		/* At least the photo height from the first paint on: the long page is painted
		   while the hero text is still loading, the photo would be cut off then and the
		   later video would count as the larger element (LCP, Lighthouse 16.11.) */
		min-height: var(--m25_bild_h);
	}
	body.home section.m25_hero .m25_hero_bg {
		bottom: auto;
		height: var(--m25_bild_h);
	}
	body.home section.m25_hero .m25_hero_bg :is(img, video) { object-position: 50% 0; }
	body.home section.m25_hero .m25_hero_bg::after {
		background:
			linear-gradient(180deg, rgba(18, 49, 87, .8) 0%, rgba(18, 49, 87, .45) 12%, rgba(18, 49, 87, 0) 28%),
			linear-gradient(180deg, rgba(18, 49, 87, 0) 55%, #123157 92%);
	}
}

@media all and (max-width: 575px) {
	body.home section.m25_hero { --m25_bild_h: clamp(510px, 140vw, 600px); }
}

/* ---- Variante "Unterseite" (prototype page hero, e.g. Partner) ----
   567px below the 35px topbar, content 165px below the topbar, title in the
   H2 size, no social links. */
section.m25_hero.m25_variante_unterseite {
	min-height: 602px;
	/* 20px more room below the navigation (club feedback 2026-11-13; was 200px) */
	padding: 220px 0 72px;
}

section.m25_hero.m25_variante_unterseite .m25_hero_content {
	max-width: 640px;
}

section.m25_hero.m25_variante_unterseite .m25_untertitel {
	margin: 0 0 16px;
}

/* Same sizes as the theme H2 (Theme-Optionen, steps at 1600 / 1200 / 768) */
section.m25_hero.m25_variante_unterseite .m25_titel_container :is(h1, .h1) {
	max-width: var(--m25_titel_w, none);
	font-size: 3.75rem;
	line-height: 0.834;
}

section.m25_hero.m25_variante_unterseite .m25_hero_text {
	max-width: 482px;
	margin-top: 20px;
}

section.m25_hero.m25_variante_unterseite .m25_links_container {
	margin-top: 34px;
}

/* Key figures below the text (prototype "Mannschaften": 64px figures, 82px apart) */
section.m25_hero .m25_kennzahlen {
	display: flex;
	flex-wrap: wrap;
	gap: 24px 82px;
	margin: 40px 0 0;
	padding: 0;
	list-style: none;
}

section.m25_hero .m25_kennzahl {
	display: flex;
	flex-direction: column;
	gap: 17px;
	margin: 0;
	padding: 0;
}

section.m25_hero .m25_kennzahl::before {
	content: none;
}

section.m25_hero .m25_kennzahl_zahl {
	font-family: var(--h_font_family, var(--font_family));
	font-weight: 900;
	font-size: 4rem;                /* 64px */
	line-height: .875;
	font-variant-numeric: tabular-nums;
	font-variation-settings: "slnt" -7;
}

section.m25_hero .m25_kennzahl_label {
	line-height: 24px;
	white-space: nowrap;
	--font_color: rgba(255, 255, 255, .5);
}

@media all and (max-width: 1599px) {
	section.m25_hero.m25_variante_unterseite .m25_titel_container :is(h1, .h1) { font-size: 3.25rem; }
}

@media all and (max-width: 1199px) {
	section.m25_hero.m25_variante_unterseite .m25_titel_container :is(h1, .h1) { font-size: 2.75rem; }
	/* "Ganzes Bild rechts": the right half only, the text column is wide here */
	section.m25_hero.m25_bild_rechts .m25_hero_bg img {
		min-width: 50%;
		max-width: 50%;
	}
}

/* Burger widths: the eyebrow 60px below the crest (it ends 15px above the
   header's bottom edge; 40px until 2026-11-13); a fixed 160/140px left only 15-18px */
@media all and (max-width: 991px) {
	/* "Ganzes Bild rechts" fills the hero again (after the 1199px rule above) */
	section.m25_hero.m25_bild_rechts .m25_hero_bg img {
		min-width: 0;
		max-width: none;
	}
	section.m25_hero.m25_variante_unterseite {
		min-height: 540px;
		padding: calc(var(--btw_header_height, 160px) + 45px) 0 64px;
	}
}

@media all and (max-width: 767px) {
	section.m25_hero.m25_variante_unterseite .m25_titel_container :is(h1, .h1) { font-size: 2.25rem; }
}

@media all and (max-width: 575px) {
	section.m25_hero.m25_variante_unterseite {
		min-height: 0;
		padding: calc(var(--btw_header_height, 137px) + 45px) 0 56px;
	}
}

@media all and (max-width: 359px) {
	section.m25_hero.m25_variante_unterseite .m25_titel_container :is(h1, .h1) { font-size: 2rem; }
}

/* Key figures */
@media all and (max-width: 1399px) {
	section.m25_hero .m25_kennzahlen { gap: 24px 60px; }
	section.m25_hero .m25_kennzahl_zahl { font-size: 3.25rem; }
}

@media all and (max-width: 1199px) {
	section.m25_hero .m25_kennzahlen { gap: 24px 52px; }
	section.m25_hero .m25_kennzahl_zahl { font-size: 2.5rem; }
}

@media all and (max-width: 991px) {
	section.m25_hero .m25_kennzahlen { gap: 24px 40px; }
}

@media all and (max-width: 575px) {
	section.m25_hero .m25_kennzahl { flex: 0 0 calc(50% - 20px); gap: 12px; }
	section.m25_hero .m25_kennzahl_label { white-space: normal; }
}

/* Narrow screens: long buttons may wrap, with room above and below (as m26/m37) */
@media all and (max-width: 375px) {
	section.m25_hero .m25_links_container .mM_button {
		height: auto;
		min-height: 54px;
		padding-top: 14px;
		padding-bottom: 12px;
		white-space: normal;
		text-align: left;
	}
}

/* Subpage without photo (prototype "Impressum", "Datenschutz"): plain navy, lower */
section.m25_hero.m25_variante_unterseite.m25_ohne_bild {
	min-height: 455px;
	padding-bottom: 64px;
}

@media all and (max-width: 991px) {
	/* Without a lead the plain hero would be mostly empty on small screens */
	section.m25_hero.m25_variante_unterseite.m25_ohne_bild {
		min-height: 0;
	}
}
