/* ==========================================================================
   Bestattungsinstitut Eberhardt — Kopfzeile, Menü, Fußzeile
   Kopf- und Fußzeile sind „seitenübergreifende Inhalte“ (Theme → Inhalte):
   Elementgruppen „- Kopfzeile -“ und „- Fußzeile -“ mit normalen Elementen.
   Maße aus dem Figma-Entwurf (Komponenten „navigation-bar“, „cta-24-7“, „cta-soforthilfe“,
   „cta-qa“, „phone-overlay“, „footer“, Rahmen „burger-menu-open“).
   ========================================================================== */

/* ------------------------------------------------------------------ Kopfzeile
   Unterseiten: Leiste 109 px, Grund #e8ece6, Schatten 0 4 10 / 3 %; Logo 204 × 83 bei x = 80, y = 14;
   Kopfknöpfe 55 × 55 (Abstand 12) bei y = 28, Menüsymbol 55 × 55, 41 px rechts daneben, Rand 80 px.
   Startseite: Leiste durchsichtig über dem Kopfvideo, Logo 291 × 118 bei x = 200, y = 51. */
header {
	position: relative;
	z-index: 30;
	background: var(--gruen);
	box-shadow: 0 4px 10px rgb(0 0 0 / 0.03);
}
/* Unterseiten mit Kopfbild: Die Leiste liegt über dem Bild (Bild beginnt im Entwurf bei y = 0) */
body:has(main .Kopfbild) header { position: absolute; inset: 0 0 auto; }
body.SeiteStart header {
	position: absolute;
	inset: 0 0 auto;
	background: none;
	box-shadow: none;
}

.Kopfzeile {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	height: 109px;
	padding: 0 80px;

	& > * { margin: 0; }
	& .Logo {
		margin-top: 14px;
		& a { display: block; }
		& img { width: 204px; height: auto; }
	}
	& .Kopfknöpfe { margin: 28px 41px 0 auto; }
	& .nav-wrapper { margin-top: 28px; }
}
body.SeiteStart .Kopfzeile .Logo {
	margin: 51px 0 0 120px;
	& img { width: 291px; }
}

/* Kopfknöpfe: 24/7 (Grund #edebe7, Symbol + „24/7“), Soforthilfe (#fffefb), FAQ (#f4efe8);
   Rahmen 1 px anthrazit, Schatten 0 2 8 gold / 8 %, Inter 700 12, Laufweite 0,3 px, gold.
   Überfahren: Grund gold, Schrift und Symbol weiß. */
.Kopfknöpfe .rte {
	display: flex;
	gap: 12px;
	& > p { margin: 0; }
	& a {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		width: 55px;
		height: 55px;
		border: 1px solid var(--anthrazit);
		box-shadow: 0 2px 8px rgb(179 143 88 / 0.08);
		color: var(--gold);
		font-size: 12px;
		font-weight: 700;
		line-height: 14.5px;
		letter-spacing: 0.3px;
		text-align: center;
		text-decoration: none;
		hyphens: manual;
		&:hover, &:focus-visible { background-color: var(--gold) !important; color: var(--weiss); text-decoration: none; }
	}
	& a.Soforthilfe { background: #fffefb; padding: 0 4px; }
	& a.FAQ { background: var(--beige); }
	& a.Rund24 {
		background: var(--grau);
		line-height: 21.6px;
		&::before {
			content: '';
			width: 20px;
			height: 20px;
			margin-top: -2px;
			background: currentColor;
			-webkit-mask: url('../img/telefon.svg') center / contain no-repeat;
			mask: url('../img/telefon.svg') center / contain no-repeat;
		}
		& .Nummer { display: none; }
	}
}

/* Telefon-Hinweis beim Überfahren/Fokus (Komponente „phone-overlay“, 190 × 55):
   Grund #edebe7, Rahmen anthrazit, Schatten 0 4 12 / 15 %, oben Symbol + „24/7“ (13/700),
   darunter die Nummer (Inter 700 12, anthrazit). */
@media (hover: hover) and (min-width: 768px) {
	.Kopfknöpfe .rte a.Rund24 .Nummer {
		position: absolute;
		top: calc(100% + 8px);
		left: 50%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 190px;
		height: 55px;
		border: 1px solid var(--anthrazit);
		background: var(--grau);
		box-shadow: 0 4px 12px rgb(0 0 0 / 0.15);
		color: var(--anthrazit);
		font-size: 12px;
		line-height: 14.5px;
		letter-spacing: 0;
		white-space: nowrap;
		opacity: 0;
		visibility: hidden;
		translate: -50% -4px;
		transition: opacity 0.2s ease, translate 0.2s ease, visibility 0s linear 0.2s;
		&::before {
			content: '24/7';
			display: flex;
			align-items: center;
			gap: 8px;
			color: var(--gold);
			font-size: 13px;
			line-height: 15.7px;
			padding-left: 28px;
			background: url('../img/telefon.svg') left center / 20px 20px no-repeat;
		}
	}
	.Kopfknöpfe .rte a.Rund24:is(:hover, :focus-visible) .Nummer {
		opacity: 1;
		visibility: visible;
		translate: -50% 0;
		transition: opacity 0.2s ease, translate 0.2s ease;
	}
}

/* ------------------------------------------------------------------ Menü
   Barrierefreie Kern-Navigation (mod_navigation_accessible), auf allen Breiten hinter dem
   Menüsymbol (55 × 55, Grund #afb192, Rahmen anthrazit, Ecken 1 px, drei weiße Striche 25 × 22,
   Strich 4 px). Geöffnet: Vollbild-Ebene #afb192, zwei Spalten (x = 120 und 740, Breite 580),
   Einträge Dancing Script 600 42/50.4 anthrazit, Abstand 40 px, erste Zeile bei y = 242;
   Schließen-Zeichen (weißes X, 20 × 20, Strich 4 px) an der Stelle des Menüsymbols. */
body { --nav-breakpoint: 99999px; }
body.navigation-open { overflow: hidden; }

.nav-wrapper .nav-burger {
	position: relative;
	z-index: 40;
	display: block;
	width: 55px;
	height: 55px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--anthrazit);
	border-radius: 1px;
	background: var(--oliv);
	cursor: pointer;

	& .nav-burger__inner { display: none !important; }
	&::before {
		content: '';
		position: absolute;
		left: 14px;
		top: 15px;
		width: 25px;
		height: 22px;
		background:
			linear-gradient(#fff, #fff) 0 0 / 25px 4px no-repeat,
			linear-gradient(#fff, #fff) 0 9px / 25px 4px no-repeat,
			linear-gradient(#fff, #fff) 0 18px / 25px 4px no-repeat;
		border-radius: 2px;
		transition: transform 0.3s ease;
	}
	&:hover::before { transform: scale(1.08); }

	&.is-active {
		border-color: transparent;
		background: none;
		&::before {
			left: 7px; top: 7px; width: 40px; height: 40px;
			background: url('../img/schliessen.svg') center / 40px no-repeat;
		}
	}
}

body .navigation-main {
	--nav-mobile-background: var(--oliv);
	--nav-mobile-color: var(--anthrazit);
	--nav-mobile-active-color: var(--anthrazit);
	--nav-mobile-active-background: transparent;
	--nav-mobile-separator-color: transparent;
	--nav-mobile-padding: 0;
	--nav-mobile-backdrop-height: 0px;
}
body.nav-is-mobile header .navigation-main,
header .navigation-main {
	position: fixed;
	inset: 0;
	z-index: 35;
	overflow-y: auto;
	padding: 242px max(var(--rand-seite), calc((100vw - 1200px) / 2)) 80px;
	background: var(--oliv);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0s linear 0.4s;
	&.is-active { opacity: 1; visibility: visible; transition: opacity 0.4s ease; }
	@media (prefers-reduced-motion: reduce) { transition: none; &.is-active { transition: none; } }

	& a.skip-link:not(:focus) {
		position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
	}
	& ul.level_1 {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 580px));
		grid-template-rows: repeat(3, auto);
		grid-auto-flow: column;
		column-gap: 40px;
		row-gap: 40px;
		max-width: 1200px;
		margin: 0;
		padding: 0;
		list-style: none;
		& > li { padding: 0; border: 0; }
		& > li > :is(a, strong) {
			display: inline-block;
			width: auto;
			padding: 0 !important;
			margin: 0;
			font-family: var(--schreibschrift);
			font-size: 42px;
			font-weight: 600;
			line-height: 50.4px;
			color: var(--anthrazit) !important;
			background: none !important;
			text-decoration: none;
			&:hover, &:focus-visible { color: var(--weiss) !important; }
		}
		& > li > strong { color: var(--weiss) !important; }
	}
	& .btn-toggle-submenu { display: none !important; }

	@media (max-width: 767px) {
		padding-top: 150px;
		& ul.level_1 { grid-template-columns: 1fr; grid-auto-flow: row; row-gap: 24px; }
		& ul.level_1 > li > :is(a, strong) { font-size: 34px; line-height: 1.2; }
	}
}
/* Geöffnet: Logo und Kopfknöpfe liegen über der Ebene (wie im Rahmen „burger-menu-open“).
   Das Menümodul selbst darf keine eigene Ebene bilden, sonst verdeckt es Logo und Knöpfe. */
header .nav-wrapper { position: static !important; z-index: auto !important; }
.nav-wrapper .nav-burger { z-index: 45; }
body.navigation-open .Kopfzeile :is(.Logo, .Kopfknöpfe) { position: relative; z-index: 40; }
body.navigation-open header { box-shadow: none; }

/* ------------------------------------------------------------------ Kopfzeile schmal */
@media (max-width: 1023px) {
	.Kopfzeile { padding: 0 var(--rand-seite); }
	body.SeiteStart .Kopfzeile .Logo { margin: 24px 0 0; & img { width: 220px; } }
}
@media (max-width: 599px) {
	.Kopfzeile {
		height: 76px;
		& .Logo { margin-top: 14px; & img { width: 120px; } }
		& .Kopfknöpfe { margin: 16px 8px 0 auto; }
		& .nav-wrapper { margin-top: 16px; }
	}
	body.SeiteStart .Kopfzeile .Logo { margin-top: 14px; & img { width: 120px; } }
	.Kopfknöpfe .rte { gap: 6px; & a { width: 44px; height: 44px; font-size: 10px; line-height: 12px; letter-spacing: 0; } }
	.Kopfknöpfe .rte a.Rund24 { line-height: 16px; &::before { width: 16px; height: 16px; margin-top: 0; } }
	.nav-wrapper .nav-burger { width: 44px; height: 44px; &::before { left: 9px; top: 10px; transform: scale(0.88); } }
	.nav-wrapper .nav-burger.is-active::before { left: 2px; top: 2px; transform: none; }
	header .navigation-main { padding-top: 120px; }
}

/* ------------------------------------------------------------------ Fußzeile
   Komponente „footer“ (365 px): Grund #afb192, Innenabstand 80/80/48/80. Oben Linie 4 px #8b7d3c
   über die volle Breite (1280), 56 px darunter Kontakt (Inter 17/20.6, #faf8f5 / 90 %, Zeilenabstand 12)
   bei x = 200 und Logo 291 × 118 bei x = 924; unten Trennlinie anthrazit / 10 % und Kontakt · Impressum ·
   Datenschutz (Inter 14, anthrazit / 50 %, Abstand 20) bei x = 200, 16 px unter der Trennlinie. */
footer { background: var(--oliv); }
.Fußzeile {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas: "kontakt logo" "links links";
	max-width: 1440px;
	margin: 0 auto;
	padding: 80px 80px 48px;

	&::before {
		content: '';
		grid-column: 1 / -1;
		grid-row: 1;
		align-self: start;
		height: 4px;
		background: var(--oliv-linie);
	}
	& > * { margin: 0; }
	& .FußzeileKontakt { grid-area: kontakt; margin: 56px 0 0 120px; }
	& .FußzeileLogo { grid-area: logo; margin: 47px 145px 0 0; justify-self: end; & img { width: 291px; height: auto; } }
	& .FußzeileLinks {
		grid-area: links;
		margin-top: 39px;
		padding: 16px 0 0 120px;
		border-top: 1px solid rgb(87 87 86 / 0.1);
	}
	& .content-image a:hover img { opacity: 0.85; }
}
.Fußzeile { grid-template-rows: auto auto; }
.Fußzeile::before { grid-area: 1 / 1 / 2 / 3; }
.FußzeileKontakt .rte {
	color: rgb(250 248 245 / 0.9);
	font-size: 17px;
	line-height: 20.6px;
	& > * + * { margin-top: 12px; }
	& a { color: inherit; font-weight: 400; text-decoration: none; }
	& a:hover { text-decoration: underline; }
}
.FußzeileLinks .rte {
	display: flex;
	flex-wrap: wrap;
	column-gap: 20px;
	font-size: 14px;
	line-height: 16.9px;
	& > * + * { margin-top: 0; }
	& a { color: rgb(87 87 86 / 0.5); font-weight: 400; text-decoration: none; }
	& a:hover { color: var(--anthrazit); text-decoration: underline; }
}

@media (max-width: 1023px) {
	.Fußzeile {
		padding: 64px var(--rand-seite) 40px;
		& .FußzeileKontakt { margin-left: 0; }
		& .FußzeileLogo { margin-right: 0; }
		& .FußzeileLinks { padding-left: 0; }
	}
}
@media (max-width: 699px) {
	.Fußzeile {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas: "linie" "logo" "kontakt" "links";
		&::before { grid-area: linie; }
		& .FußzeileLogo { justify-self: start; margin: 40px 0 0; & img { width: 220px; } }
		& .FußzeileKontakt { margin-top: 32px; }
		& .FußzeileLinks { margin-top: 32px; }
	}
}
