/* ROS REAL – Baustein landing (Design v46). Markup + CSS des Kartenflugs (Auftrag BM1).
   Verhalten (Scroll-Flug, Startbild, Pinch, Live-Zahl) baut BM2 in assets/js/landing.js.
   Nur Tokens aus main.css, keine Hex-Werte. Ausnahme: Schatten schwebender Elemente
   0 10px 36px rgba(22,32,58,.36) (Übergabe 5.14). */

/* ===== Flug-Gerüst ===== */
.flug {
	position: relative;
	--flug-hoehe: 440vh; /* Scrollstrecke – BM2 liest sie über diese Variable aus */
}

/* Karte vollflächig fest im Hintergrund. maplibre-gl.css setzt .maplibregl-map auf
   position:relative – sticky deshalb über den .maplibregl-map-Selektor absichern. */
.flug__karte,
.flug__karte.maplibregl-map {
	position: sticky;
	top: 0;
	width: 100%;
	height: 100vh;
	height: 100dvh;
	background: var(--kartengrund);
}

/* Unsichtbare Scrollstrecke: bestimmt die Länge des Flugs. */
.flug__strecke {
	position: relative;
	margin-top: -100vh;
	margin-top: -100dvh;
	height: var(--flug-hoehe);
	pointer-events: none;
}

/* ===== Stufen (.fov) ===== */
.fov {
	position: fixed;
	inset: 0;
	z-index: 20;
	opacity: 0;
	pointer-events: none;
	transition: opacity .4s ease;
}
.fov.an { opacity: 1; }

/* Ohne JavaScript bzw. bevor der Flug bereit ist: erste Stufe sichtbar. */
.fov[data-fov="0,0.2"] { opacity: 1; }
.flug-bereit .fov { opacity: 0; }
.flug-bereit .fov.an { opacity: 1; }

/* Titel und Satz der ersten Stufe. */
.fov-mitte {
	position: absolute;
	left: var(--rand);
	bottom: clamp(96px, 14vh, 190px);
	max-width: min(620px, 78vw);
}
.fov-mitte h1 {
	margin: 0;
	font: 400 var(--g2)/var(--zh-titel) var(--serif);
	color: var(--papier);
}
.fov-mitte p {
	margin: 12px 0 0;
	font: 400 var(--g6)/1.6 var(--serif);
	color: color-mix(in srgb, var(--papier) 72%, transparent);
}

/* Zweite Stufe. */
.fov-unten {
	position: absolute;
	left: var(--rand);
	bottom: clamp(96px, 14vh, 190px);
	max-width: min(620px, 78vw);
}
.fov-unten h2 {
	margin: 0;
	font: 400 var(--g3)/var(--zh-titel) var(--serif);
	color: var(--papier);
}
.fov-unten .klein {
	margin: 14px 0 0;
	color: color-mix(in srgb, var(--papier) 72%, transparent);
}

/* Scroll-Hinweis der ersten Stufe. */
.flughinweis {
	position: absolute;
	left: var(--rand);
	bottom: calc(58px + env(safe-area-inset-bottom));
	margin: 0;
	font: 400 var(--t4)/1.6 var(--sans);
	letter-spacing: .18em;
	text-transform: uppercase;
	color: color-mix(in srgb, var(--papier) 72%, transparent);
}

/* ===== Filterleiste .lbar ===== */
.lbar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(58px + env(safe-area-inset-bottom));
	z-index: 35;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 0;
	width: max-content;
	max-width: calc(100vw - 32px);
	margin: 0 auto;
	padding: 6px 6px 6px 22px;
	background: var(--papier);
	box-shadow: 0 10px 36px rgba(22, 32, 58, .36);
	/* Bis zur Klasse .bereit (BM2) nicht bedienbar und halbtransparent. */
	opacity: .5;
	pointer-events: none;
	transition: opacity .4s ease;
}
.lbar.bereit {
	opacity: 1;
	pointer-events: auto;
}

.lbar .gruppe {
	display: flex;
	align-items: center;
	padding: 0 22px;
	border-left: 1px solid var(--linie);
}
.lbar .gruppe:first-child {
	padding-left: 0;
	border-left: 0;
}
.lbar .gruppe.reihe2 { gap: 16px; }

.lbar .klein { margin-right: 10px; }

.lbar .rselect { min-width: 0; }
.lbar .rselect > button {
	font-size: var(--t2);
	color: var(--grau);
}

.lbar .prim {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 4px;
	min-height: 44px;
	padding: 0 20px;
	background: var(--blau);
	color: var(--papier);
	border: 0;
	border-radius: 0;
	font: 400 var(--t2)/1.6 var(--sans);
	text-decoration: none;
	cursor: pointer;
	white-space: nowrap;
}
.lbar .prim:hover { opacity: .9; }
.lbar .prim:disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* ===== Ohne JavaScript ===== */
.flug__hinweis {
	position: fixed;
	left: 50%;
	top: 50%;
	z-index: 20;
	margin: 0;
	max-width: min(480px, 86vw);
	text-align: center;
	font: 400 var(--t1)/1.6 var(--sans);
	color: var(--papier);
	transform: translate(-50%, -50%);
}
.flug__hinweis a {
	color: var(--papier);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: var(--unterstrich-abstand);
}

/* ===== Touch ===== */
body.landing { touch-action: pan-y; }

/* ===== Responsiv ===== */
@media (max-width: 767px) {
	.fov-mitte,
	.fov-unten {
		left: 18px;
		right: 18px;
		max-width: none;
		bottom: clamp(120px, 20vh, 200px);
	}
	.fov-unten .klein { display: none; }

	.lbar {
		left: 0;
		right: 0;
		bottom: calc(60px + env(safe-area-inset-bottom));
		width: auto;
		max-width: none;
		flex-wrap: wrap;
		gap: 10px 14px;
		padding: 10px 14px;
	}
	.lbar .gruppe {
		padding: 0;
		border-left: 0;
	}
	.lbar .gruppe:not(.reihe2) { display: none; }
	.lbar .prim {
		flex: 1 1 100%;
		margin-left: 0;
		min-height: 44px;
		padding: 0 16px;
		font-size: var(--t3);
	}
}

@media (max-height: 500px) {
	.fov-mitte h1 { font-size: var(--g5); }
	.fov-mitte p,
	.fov-unten .klein { display: none; }
	.fov-mitte,
	.fov-unten { bottom: clamp(80px, 18vh, 120px); }
	.lbar { padding: 8px 12px; }
}

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

/* ===== Korrektur K1 (Messrunde 1, BS – Claude, 22.09.) ===== */
/* Nr 12: Unterzeile auf der Startseite auch am Handy (nur bei sehr niedrigem Fenster weg).
   Nr 10: Texte und Filterleiste stehen über dem höheren Handy-Fuß (© · Links in 2 Reihen · Kartennachweis). */
@media (max-width: 767px) {
	.fov-mitte,
	.fov-unten { bottom: calc(214px + env(safe-area-inset-bottom)); }
	.flughinweis { bottom: calc(178px + env(safe-area-inset-bottom)); }
	.lbar { bottom: calc(172px + env(safe-area-inset-bottom)); }
}

/* ===== K2 – Messrunde 2 (Claude, 22.09.) =====
   Nr 61: Kartennachweis steht in einer Zeile über der Fußzeile; Filterleiste und Scroll-Hinweis
   sitzen darüber (--nachweis-h misst landing.js). Der Nachweis ist länger als im Prototyp
   (Rechtstext), darum nicht mittig in der Fußzeile.
   Nr 62/63: Filterleiste wie Prototyp – ab 768 mit Bezirk (608 breit), am Handy eine Zeile.
   Nr 60/65: Landing-Fuß am Handy eine Zeile, 44 hoch (Links waagrecht wischbar, alle erreichbar);
   Titel und Leiste wieder auf den Prototyp-Abständen. */
.lbar .gruppe { align-items: center; }
@media (min-width: 768px) {
	.lbar { bottom: calc(44px + var(--nachweis-h, 16px) + 14px + env(safe-area-inset-bottom)); }
	.flughinweis { bottom: calc(58px + env(safe-area-inset-bottom)); }
	.lbar button:not(.prim),
	.lbar .rselect > button { min-height: 40px; }
}
@media (max-width: 767px) {
	.fov-mitte,
	.fov-unten { bottom: clamp(120px, 20vh, 200px); }
	.flughinweis { bottom: calc(44px + var(--nachweis-h, 16px) + 14px + env(safe-area-inset-bottom)); }
	.lbar {
		bottom: calc(44px + var(--nachweis-h, 16px) + env(safe-area-inset-bottom));
		flex-wrap: nowrap;
	}
	.lbar .prim {
		flex: none;
		width: auto;
		margin-left: auto;
		padding: 0 16px;
		font-size: var(--t3);
	}
}
@media (max-height: 500px) {
	.fov-mitte h1 { font-size: clamp(23px, 1.9vw, 28px); }
	.fov-mitte,
	.fov-unten { bottom: clamp(80px, 18vh, 120px); }
}

/* ===== K3 (Thomas 22.09.): „Scrollen“ – schlank ===== */
/* Kein Kasten: kleine Versalzeile mittig über dem Fuß, darunter eine feine Linie, die nach
   unten läuft. Erscheint kurz nach dem Laden, verschwindet beim ersten Scrollen (.weg). */
.flughinweis {
	left: 50%;
	bottom: calc(44px + var(--nachweis-h, 0px) + 16px + env(safe-area-inset-bottom));
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	font-size: 12px;
	letter-spacing: .22em;
	color: color-mix(in srgb, var(--papier) 82%, transparent);
	transform: translate(-50%, 0);
	opacity: 0;
	animation: flughinweis-ein .6s ease 1s forwards;
	transition: opacity .35s ease, transform .35s ease;
	pointer-events: none;
	z-index: 3;
}
.flughinweis span { padding-left: .22em; text-shadow: 0 0 10px var(--kartengrund), 0 0 2px var(--kartengrund); }
/* Weicher Hof aus dem Kartengrund hinter Text und Linie (kein Kasten): Bezirksnamen und
   Straßen der Karte laufen darunter aus, der Hinweis bleibt überall lesbar. */
.flughinweis::before {
	content: "";
	position: absolute;
	inset: -26px -64px -18px;
	z-index: -1;
	background: radial-gradient(closest-side, color-mix(in srgb, var(--kartengrund) 92%, transparent) 35%, color-mix(in srgb, var(--kartengrund) 55%, transparent) 70%, transparent);
	pointer-events: none;
}
.flughinweis i {
	position: relative;
	display: block;
	width: 1px;
	height: 26px;
	overflow: hidden;
	background: color-mix(in srgb, var(--papier) 28%, transparent);
}
.flughinweis i::after {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: 1px;
	height: 12px;
	background: var(--papier);
	animation: flughinweis-lauf 1.8s cubic-bezier(.6, 0, .4, 1) 1.4s infinite;
	transform: translateY(-12px);
}
.flughinweis.zurueck { animation-delay: .1s; }
.flughinweis.weg {
	animation: none;
	opacity: 0;
	transform: translate(-50%, 8px);
}
@keyframes flughinweis-ein {
	from { opacity: 0; transform: translate(-50%, 8px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}
@keyframes flughinweis-lauf {
	0%   { transform: translateY(-12px); }
	70%  { transform: translateY(26px); }
	100% { transform: translateY(26px); }
}
/* Zweite Stufe hält Abstand zum mobilen Fußmenü. */
@media (min-width: 768px) and (max-width: 1020px) {
	.fov-unten { bottom: calc(clamp(96px, 14vh, 190px) + var(--nachweis-h, 0px)); }
}
@media (max-width: 767px) {
	.fov-unten { bottom: calc(44px + var(--nachweis-h, 0px) + 96px + env(safe-area-inset-bottom)); }
}
/* Mobil steht die Begrüßung im ruhigeren oberen Kartenbereich.
   svh hält sie auch beim Ein-/Ausblenden der Safari-Leisten an derselben Stelle.
   Kamera und Pins bleiben unverändert; die Stufe verschwindet wie bisher. */
@media (max-width: 1020px) {
	.fov-mitte {
		top: clamp(112px, 22vh, 210px);
		top: clamp(112px, 22svh, 210px);
		bottom: auto;
	}
}
@media (prefers-reduced-motion: reduce) {
	.flughinweis { animation: none; opacity: 1; }
	.flughinweis i::after { animation: none; transform: none; }
}

/* K3 Messrunde 3: Nutzung „Alle · Miete · Kauf“ in der Filterleiste auf Touch 44 × 44 anfassbar. */
@media (pointer: coarse) {
	.lbar button:not(.prim),
	.lbar .rselect > button { min-height: 44px; min-width: 44px; }
}

/* ===== Touch wie Google Maps (Thomas 23.09.) =====
   Am Touchgerät kein Scroll-Flug: Seite genau einen Bildschirm hoch, die Karte nimmt Ziehen,
   Pinch und Doppeltipp selbst an (landing.js, .flug--touch; MapLibre setzt touch-action auf der
   Kartenfläche). Hinweis „Ziehen und zoomen“ ohne Scroll-Strich. */
.flug.flug--touch { --flug-hoehe: 100vh; --flug-hoehe: 100dvh; }
.flug--touch .flughinweis i { display: none; }
