/*
 * Landingpage-Abschnitte (docs/landingpages-scroll.md, Bausteine 3 bis 11; Patterns verdure/lp-* im Site-Plugin).
 * Geladen, sobald eine Gruppe mit einem der Stile is-style-lp-* gerendert wird (functions.php). Werte aus der Referenz
 * docs/referenz/landingpages/landingpage-webdesign.html, Farben, Button und Raster im Website-Stand (Entscheidung 6).
 */

/* ---------------------------------------------------------------- Gemeinsam */

:where(.is-style-lp-einstieg, .is-style-lp-warum, .is-style-lp-haltung, .is-style-lp-vertiefung, .is-style-lp-faq, .is-style-lp-leistungen) {
	--lp-abstand: clamp(100px, 14vw, 200px);
	/* Gemeinsames Raster: Die rechte Spalte (Warum, Haltung, Vertiefung, FAQ) beginnt an der Linie des Einstiegstexts.
	   Im Einstieg teilen sich Bild (mit Überstand bis zum Bildschirmrand) und Text den Platz je zur Hälfte, wie im
	   ursprünglichen Entwurf; der Text ist also (Inhaltsbreite minus Einstiegsabstand plus Bildüberstand) / 2 breit und
	   endet an der rechten Inhaltskante. Die anderen Abschnitte nehmen dieselbe Breite für ihre rechte Spalte. */
	--lp-spalten-abstand: clamp(48px, 7vw, 96px);
	--lp-einstieg-abstand: clamp(48px, 7vw, 112px);
	--lp-bild-ueberstand: min(400px, max(var(--wp--style--root--padding-left, 20px), (100vw - var(--wp--style--global--content-size, 1170px)) / 2));
	--lp-spalte-rechts: calc((100% - var(--lp-einstieg-abstand) + var(--lp-bild-ueberstand)) / 2);
	--lp-mitlaufend-oben: calc(var(--wp-admin--admin-bar--height, 0px) + var(--vd-kopf-sichtbar, 0px) + var(--vd-sprung-hoehe, 0px) + 24px);
}

.wp-block-group.is-style-lp-einstieg,
.wp-block-group.is-style-lp-warum,
.wp-block-group.is-style-lp-haltung,
.wp-block-group.is-style-lp-vertiefung,
.wp-block-group.is-style-lp-faq,
.wp-block-group.is-style-lp-leistungen {
	margin-block-start: var(--lp-abstand);
}

/* Der Einstieg folgt direkt auf das Sprungmenü */
.wp-block-group.is-style-lp-einstieg {
	--lp-abstand: clamp(100px, 12vw, 180px);
}

/* Die letzte Gruppe vor dem Fuß (FAQ, Vertiefung) mit Abstand nach unten */
.wp-block-group:is(.is-style-lp-faq, .is-style-lp-vertiefung):last-child {
	margin-block-end: var(--lp-abstand);
}

:is(.is-style-lp-einstieg, .is-style-lp-warum, .is-style-lp-haltung, .is-style-lp-vertiefung, .is-style-lp-faq, .is-style-lp-leistungen) h2 {
	margin: 0;
	font-size: clamp(36px, 4.2vw, 60px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -1.13px;
	/* Lange Wörter in schmalen Spalten (z. B. „klimafreundlichen“) mit Trennstrich statt mitten im Wort umbrechen */
	-webkit-hyphens: auto;
	hyphens: auto;
	hyphenate-limit-chars: 10 4 4;
}

:is(.is-style-lp-einstieg, .is-style-lp-warum, .is-style-lp-vertiefung) h3 {
	margin: 0 0 12px;
	font-size: clamp(22px, 2vw, 28px);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -0.5px;
}

.lp-einleitung {
	font-size: clamp(20px, 1.8vw, 26px);
	font-weight: 500;
	line-height: 1.4;
}

/* Zwei Spalten 2 : 3 im gemeinsamen Raster (Warum, Haltung, FAQ; Vertiefung und Einstieg siehe dort) */
@media (min-width: 782px) {
	.wp-block-columns.lp-zwei-spalten {
		column-gap: var(--lp-spalten-abstand);
	}

	.wp-block-columns.lp-zwei-spalten > .wp-block-column:first-child {
		flex: 1 1 0;
	}

	.wp-block-columns.lp-zwei-spalten > .wp-block-column:last-child {
		flex: 0 0 var(--lp-spalte-rechts);
	}
}

/* Mitlaufende Überschriften (Warum, Facetten, FAQ): kleben unter Kopfzeile und Sprungmenü, unter 960 px nicht */
@media (min-width: 960px) {
	.wp-block-columns:has(> .lp-mitlaufend) {
		align-items: flex-start;
	}

	.wp-block-column.lp-mitlaufend {
		position: sticky;
		top: var(--lp-mitlaufend-oben);
		align-self: flex-start;
		transition: top 0.25s ease-out;
	}
}

/* Link mit Pfeil und grüner Unterstreichung (Box im Einstieg, Kundenstimme) */
.lp-pfeillink a {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	color: inherit;
	font-size: 16px;
	font-weight: 600;
	text-decoration: underline 3px var(--wp--preset--color--gruen);
	text-underline-offset: 6px;
}

.lp-pfeillink a::after {
	content: "";
	flex: none;
	width: 16px;
	height: 16px;
	background-color: currentColor;
	-webkit-mask: url(../../../icons/pfeil-rechts.svg) center / contain no-repeat;
	mask: url(../../../icons/pfeil-rechts.svg) center / contain no-repeat;
}

/* ---------------------------------------------------------------- 3 Einstieg */

.is-style-lp-einstieg .lp-einstieg__spalten {
	align-items: flex-start;
	column-gap: var(--lp-einstieg-abstand);
}

.is-style-lp-einstieg .lp-einstieg__bild {
	margin: 0;
}

.is-style-lp-einstieg .lp-einstieg__bild img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

@media (min-width: 960px) {
	.is-style-lp-einstieg .lp-einstieg__bildspalte {
		flex: 1 1 0;
		/* Bild bis zum linken Bildschirmrand, höchstens 400 px über die Inhaltskante hinaus */
		margin-left: calc(-1 * var(--lp-bild-ueberstand));
	}

	/* Text auf der gemeinsamen Rasterlinie; das Bild füllt den Rest bis zum Bildschirmrand */
	.is-style-lp-einstieg .wp-block-columns.lp-einstieg__spalten > .wp-block-column.lp-einstieg__text {
		flex: 0 0 var(--lp-spalte-rechts);
	}

	/* Oberkante der H2 bündig mit dem Bild */
	.is-style-lp-einstieg .lp-einstieg__text > h2:first-child {
		margin-top: -0.17em;
	}
}

.is-style-lp-einstieg .lp-einstieg__text > h2 {
	margin-bottom: 40px;
}

.is-style-lp-einstieg .lp-einstieg__text > p {
	margin: 0 0 24px;
}

.is-style-lp-einstieg .lp-einstieg__text > p:not(.lp-einleitung) {
	margin-bottom: 48px;
}

.is-style-lp-einstieg .lp-box {
	padding: clamp(28px, 3.5vw, 48px);
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--hellgrau);
}

.is-style-lp-einstieg .lp-box > * {
	margin-block: 0;
}

.is-style-lp-einstieg .lp-box > * + * {
	margin-top: 12px;
}

.is-style-lp-einstieg .lp-box > .lp-pfeillink {
	margin-top: 20px;
}

.is-style-lp-einstieg .lp-box :is(h3, a) {
	color: var(--wp--preset--color--hellgrau);
}

.is-style-lp-einstieg .lp-box a:focus-visible {
	outline: 2px solid var(--wp--preset--color--gruen);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------- 4 Warum VERDURE */

.is-style-lp-warum .lp-warum__liste > .lp-warum__punkt {
	margin: 0;
	padding: 40px 0;
	border-bottom: 1px solid var(--wp--preset--color--linie);
}

.is-style-lp-warum .lp-warum__liste > .lp-warum__punkt:first-child {
	padding-top: 0;
}

.is-style-lp-warum .lp-warum__liste > .lp-warum__punkt:last-child {
	padding-bottom: 0;
	border-bottom: 0;
}

.is-style-lp-warum .lp-warum__punkt.lp-warum__punkt > p {
	margin: 0;
}

/* ---------------------------------------------------------------- 5 Leistungen (schwarz, Karten bis 1920 px) */

.wp-block-group.is-style-lp-leistungen {
	padding-block: clamp(80px, 10vw, 160px);
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--hellgrau);
}

.is-style-lp-leistungen > h2 {
	max-width: 14em;
	margin-bottom: 72px;
	color: var(--wp--preset--color--hellgrau);
}

/* Schmale H2 links an der Inhaltskante statt mittig (das Raster „constrained“ zentriert jedes schmalere Kind) */
.wp-block-group.is-layout-constrained:is(.is-style-lp-leistungen, .is-style-lp-vertiefung) > h2.wp-block-heading {
	margin-right: auto !important;
	margin-left: max(0px, (100% - var(--wp--style--global--content-size, 1170px)) / 2) !important;
}

.is-style-lp-leistungen :focus-visible {
	outline: 2px solid var(--wp--preset--color--gruen);
	outline-offset: 3px;
}

.wp-block-group.is-style-lp-leistungen > .wp-block-group.lp-leistungen__raster {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	box-sizing: border-box;
	max-width: 1920px;
	margin-inline: auto;
	padding-inline: clamp(20px, 3vw, 40px);
}

.lp-leistungen__raster.lp-leistungen__raster > * {
	margin: 0;
}

.lp-karte {
	display: flex;
	flex-direction: column;
	gap: 20px;
	padding: 32px 28px 36px;
	border: 1px solid var(--wp--preset--color--strichel);
}

.lp-karte.lp-karte > * {
	margin: 0;
}

.lp-karte .lp-karte__icon img {
	display: block;
	width: 48px;
	height: 48px;
}

.lp-karte h3 {
	margin: 0;
	color: var(--wp--preset--color--hellgrau);
	font-size: 22px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: -0.3px;
}

.lp-karte p {
	font-size: 18px;
	line-height: 1.5;
}

.lp-leistungen__technik {
	display: flex;
	flex-wrap: wrap;
	grid-column: 1 / -1;
	align-items: center;
	gap: 24px 48px;
	margin-top: 40px;
	padding-top: 40px;
	border-top: 1px solid var(--wp--preset--color--strichel);
}

.lp-leistungen__technik.lp-leistungen__technik > * {
	margin: 0;
}

.lp-leistungen__technik > p {
	flex: 1 1 420px;
	min-width: 0;
}

.lp-leistungen__technik img {
	display: block;
	width: auto;
	height: 52px;
}

/* Aktionskarte: 6 px grüner Rahmen, grünes Pfeilfeld unten rechts, die ganze Karte ist der Link */
.lp-aktionskarte {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 24px;
	box-sizing: border-box;
	min-height: 260px;
	padding: 28px;
	border: 6px solid var(--wp--preset--color--gruen);
}

.lp-aktionskarte.lp-aktionskarte > * {
	margin: 0;
}

.lp-aktionskarte::after {
	content: "";
	position: absolute;
	right: -6px;
	bottom: -6px;
	width: 64px;
	height: 64px;
	background: var(--wp--preset--color--gruen);
	pointer-events: none;
}

.lp-aktionskarte::before {
	content: "";
	position: absolute;
	right: 14px;
	bottom: 14px;
	z-index: 1;
	width: 24px;
	height: 24px;
	background-color: var(--wp--preset--color--schwarz);
	-webkit-mask: url(../../../icons/pfeil-rechts.svg) center / contain no-repeat;
	mask: url(../../../icons/pfeil-rechts.svg) center / contain no-repeat;
	pointer-events: none;
}

.lp-aktionskarte__frage {
	font-size: 26px;
	font-weight: 600;
	line-height: 1.25;
}

.lp-aktionskarte__link {
	padding-right: 72px;
	font-size: 16px;
	font-weight: 500;
}

.lp-aktionskarte__link a {
	color: inherit;
	text-decoration: none;
}

/* Klickfläche über die ganze Karte */
.lp-aktionskarte__link a::after {
	content: "";
	position: absolute;
	inset: -6px;
}

.lp-aktionskarte:has(a:focus-visible) {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

.lp-aktionskarte__link a:focus-visible {
	outline: 0;
}

.is-style-lp-leistungen .lp-aktionskarte:has(a:focus-visible) {
	outline-color: var(--wp--preset--color--gruen);
}

/* Breite Aktionskarte am Ende der Vertiefung */
.lp-aktionskarte.lp-aktionskarte--breit {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 40px;
	min-height: 0;
	margin-top: 40px;
	padding: clamp(28px, 3vw, 40px) 104px clamp(28px, 3vw, 40px) clamp(28px, 4vw, 48px);
}

.lp-aktionskarte--breit .lp-aktionskarte__frage {
	font-size: clamp(24px, 2.4vw, 32px);
	line-height: 1.2;
}

.lp-aktionskarte--breit .lp-aktionskarte__link {
	padding-right: 0;
}

/* ---------------------------------------------------------------- 7 Haltung und Kundenstimme */

.is-style-lp-haltung > .lp-zwei-spalten {
	align-items: flex-start;
}

.is-style-lp-haltung .lp-zwei-spalten p {
	margin: 0 0 24px;
}

.is-style-lp-haltung .lp-zwei-spalten p:last-child {
	margin-bottom: 0;
}

/* Band mit Haarlinien: Formel „Menschen erreichen + Nutzer begeistern = Kunden gewinnen“ */
.wp-block-group.lp-haltung__band {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 32px clamp(24px, 3vw, 48px);
	margin-top: clamp(96px, 10vw, 144px);
	padding-block: clamp(56px, 6vw, 88px);
	border-top: 1px solid var(--wp--preset--color--linie);
	border-bottom: 1px solid var(--wp--preset--color--linie);
}

.lp-haltung__band.lp-haltung__band > * {
	margin: 0;
}

.lp-haltung__wert {
	min-width: 0;
}

.lp-haltung__wert.lp-haltung__wert > * {
	margin: 0;
}

/* Rechenzeichen zwischen den Werten: im Fluss vor dem 2. und 3. Wert, für Screenreader stumm */
.lp-haltung__band:not(.is-style-lp-werte) > .lp-haltung__wert + .lp-haltung__wert {
	display: grid;
	grid-template-columns: auto auto;
	align-items: center;
	column-gap: clamp(24px, 3vw, 48px);
}

.lp-haltung__band:not(.is-style-lp-werte) > .lp-haltung__wert + .lp-haltung__wert::before {
	content: "+" / "";
	grid-row: 1 / span 2;
	color: var(--wp--preset--color--grau);
	font-size: 80px;
	font-weight: 300;
	line-height: 0.8;
}

.lp-haltung__band:not(.is-style-lp-werte) > .lp-haltung__wert + .lp-haltung__wert:last-child::before {
	content: "=" / "";
}

.lp-haltung__band > .lp-haltung__wert > * {
	grid-column: 2;
}

.lp-haltung__titel {
	font-size: clamp(26px, 2.4vw, 36px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.8px;
}

.lp-haltung__wert > .lp-haltung__titel {
	margin-bottom: 16px;
}

/* Ergebnis der Formel grün unterstrichen */
.lp-haltung__band:not(.is-style-lp-werte) > .lp-haltung__wert:last-child .lp-haltung__titel {
	justify-self: start;
	padding-bottom: 6px;
	border-bottom: 5px solid var(--wp--preset--color--gruen);
}

.lp-haltung__text {
	color: var(--wp--preset--color--grau-dunkel);
	font-size: 16px;
	line-height: 1.5;
}

@media (min-width: 1024px) {
	.lp-haltung__text {
		white-space: nowrap;
	}
}

/* Werte-Dreiklang: Dachzeile im Band über den drei Punkten, ohne Rechenzeichen */
.lp-haltung__band.is-style-lp-werte > .is-style-dachzeile {
	flex: 1 0 100%;
	color: var(--wp--preset--color--grau-dunkel);
	font-size: 14px;
}

.wp-block-verdure-auswahl.lp-haltung__stimme {
	margin-top: clamp(96px, 10vw, 144px);
}

/* ---------------------------------------------------------------- 10 Vertiefung */

.is-style-lp-vertiefung > h2 {
	max-width: 15em;
	margin-bottom: 56px;
}

.is-style-lp-vertiefung > .lp-vertiefung__einleitung {
	margin-bottom: clamp(64px, 7vw, 96px);
}

.is-style-lp-vertiefung .lp-einleitung {
	margin: 0 0 32px;
	font-size: clamp(22px, 2.2vw, 28px);
	font-weight: 400;
	line-height: 1.3;
}

.is-style-lp-vertiefung .lp-vertiefung__einleitung p {
	margin: 0 0 20px;
}

.is-style-lp-vertiefung .lp-vertiefung__einleitung p:last-child {
	margin-bottom: 0;
}

.is-style-lp-vertiefung > .wp-block-columns.lp-vertiefung__gruppe {
	margin-block: 0;
	padding-block: 56px;
	border-top: 1px solid var(--wp--preset--color--linie);
}

@media (min-width: 782px) {
	.is-style-lp-vertiefung > :is(.lp-vertiefung__einleitung, .lp-vertiefung__gruppe) {
		column-gap: var(--lp-spalten-abstand);
	}

	.is-style-lp-vertiefung > :is(.lp-vertiefung__einleitung, .lp-vertiefung__gruppe) > .wp-block-column:first-child {
		flex: 1 1 0;
	}

	.is-style-lp-vertiefung > :is(.lp-vertiefung__einleitung, .lp-vertiefung__gruppe) > .wp-block-column:last-child {
		flex: 0 0 var(--lp-spalte-rechts);
	}
}

/* Teamfoto links im Sachtext-Abschnitt (Entscheidung 10.11.2026): 4:5 und ab 960 px wie das Einstiegsbild über die
   Inhaltskante bis zum Bildschirmrand (höchstens 400 px Überstand) */
.is-style-lp-vertiefung .lp-vertiefung__bild {
	margin: 0;
}

.is-style-lp-vertiefung .lp-vertiefung__bild img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

@media (min-width: 960px) {
	.is-style-lp-vertiefung .lp-vertiefung__bild {
		margin-left: calc(-1 * var(--lp-bild-ueberstand));
		/* gleiche Breite wie das Einstiegsbild: dort ist der Spaltenabstand etwas größer */
		margin-right: calc(var(--lp-einstieg-abstand) - var(--lp-spalten-abstand));
	}
}

/* Leere linke Spalte der Einleitung nur als Raster, mobil weg */
@media (max-width: 781px) {
	.is-style-lp-vertiefung > .lp-vertiefung__einleitung > .wp-block-column:empty {
		display: none;
	}
}

.lp-vertiefung__titel {
	margin: 0;
	font-size: clamp(28px, 2.8vw, 42px);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -1px;
}

/* „+“ vor der zweiten, „=“ vor der dritten Gruppe, wie die Formel; für Screenreader stumm */
.lp-vertiefung__gruppe ~ .lp-vertiefung__gruppe .lp-vertiefung__titel::before {
	content: "+ " / "";
	color: var(--wp--preset--color--grau);
	font-weight: 300;
}

.lp-vertiefung__gruppe ~ .lp-vertiefung__gruppe:not(:has(~ .lp-vertiefung__gruppe)) .lp-vertiefung__titel::before {
	content: "= " / "";
}

.lp-vertiefung__facetten {
	display: flex;
	flex-direction: column;
	gap: 48px;
}

.lp-vertiefung__facetten.lp-vertiefung__facetten > *,
.lp-facette.lp-facette > p {
	margin: 0;
}

/* Facetten mit mehreren Absätzen */
.lp-facette.lp-facette > p + p {
	margin-top: 1em;
}

/* ---------------------------------------------------------------- 11 Fragen und Antworten */

.is-style-lp-faq > .lp-zwei-spalten {
	align-items: flex-start;
}

.is-style-lp-faq .lp-mitlaufend > h2 {
	margin-bottom: 24px;
}

.is-style-lp-faq .lp-mitlaufend > p {
	margin: 0;
}

.is-style-lp-faq .lp-mitlaufend a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline 2px var(--wp--preset--color--gruen);
	text-underline-offset: 4px;
}

.is-style-lp-faq .lp-faq__bild {
	width: min(100%, 400px);
	margin: 48px 0 0;
}

.is-style-lp-faq .lp-faq__bild img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

.is-style-lp-faq .lp-faq__liste {
	border-top: 1px solid var(--wp--preset--color--linie);
}


/* Akkordeon auf Landingpages: feiner als details.css, Plus und Minus statt Pfeil */
.is-style-lp-faq .wp-block-details {
	margin: 0;
	border-top: 0;
	border-bottom: 1px solid var(--wp--preset--color--linie);
}

.is-style-lp-faq .wp-block-details summary {
	align-items: flex-start;
	gap: 24px;
	padding: 26px 0;
	font-size: 20px;
	font-weight: 600;
	line-height: 1.35;
	letter-spacing: normal;
}

.is-style-lp-faq .wp-block-details summary::after {
	width: 24px;
	height: 24px;
	margin-top: 2px;
	background: linear-gradient(currentColor, currentColor) center / 16px 2px no-repeat, linear-gradient(currentColor, currentColor) center / 2px 16px no-repeat;
	-webkit-mask: none;
	mask: none;
	transform: none;
}

.is-style-lp-faq .wp-block-details[open] summary::after {
	background: linear-gradient(currentColor, currentColor) center / 16px 2px no-repeat;
	transform: none;
}

.is-style-lp-faq .wp-block-details summary:focus-visible {
	outline: 2px solid var(--wp--preset--color--schwarz);
	outline-offset: 2px;
}

.is-style-lp-faq .wp-block-details > :not(summary) {
	max-width: 40em;
	margin: 0 0 28px;
	font-size: 18px;
	line-height: 1.5;
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-column.lp-mitlaufend {
		transition: none;
	}
}

/* Editor: nichts klebt */
.editor-styles-wrapper .wp-block-column.lp-mitlaufend {
	position: static;
}
