/*
 * Klassen des alten Themes, die in gespeicherten Inhalten stehen (HTML in Absätzen, Medien-Text, core/html).
 * Nur was in den Inhalten tatsächlich vorkommt (Zählung 21.10.2026, docs/phase-3-plan.md). Entfällt,
 * sobald die Inhalte bereinigt sind.
 */

/* Links als Button: .cta (schwarz), .cta.green (grün) wie blocks/button.css; dazu nur der Knopf „Mehr anzeigen“ der
 * Auswahl (button.cta). Absende-Knöpfe der Formulare tragen auch .cta, haben aber eigene Regeln (formular.css, kontakt*.css).
 * Stapelkontext am Elternelement (wie .wp-block-button): der versetzte Rahmen (z-index −1) liegt dann hinter
 * der Fläche des Links, aber vor dem Hintergrund der Sektion. Am Link selbst läge er über der Fläche. */
:has(> a.cta),
.wp-block-verdure-auswahl__mehr {
	isolation: isolate;
}

a.cta,
.wp-block-verdure-auswahl__mehr > button.cta {
	position: relative;
	display: inline-block;
	padding: 18px 78px 18px 28px;
	border: 2px solid transparent;
	background-color: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: 2.4px;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	font-family: inherit;
	transition: background-color var(--wp--custom--transition), color var(--wp--custom--transition);
}

/* Pfeil nach unten (alt .cta.has-arrow-down, z. B. „Mehr anzeigen“) */
.wp-block-verdure-auswahl__mehr > button.cta.has-arrow-down::before {
	transform: translateY(-50%) rotate(90deg);
}

a.cta.green,
.wp-block-verdure-auswahl__mehr > button.cta.green {
	background-color: var(--wp--preset--color--gruen);
	color: var(--wp--preset--color--schwarz);
}

a.cta::before,
.wp-block-verdure-auswahl__mehr > button.cta::before {
	content: "";
	position: absolute;
	top: 50%;
	right: 30px;
	width: 21px;
	height: 21px;
	background-color: currentColor;
	-webkit-mask: url(../icons/pfeil-rechts.svg) center / contain no-repeat;
	mask: url(../icons/pfeil-rechts.svg) center / contain no-repeat;
	transform: translateY(-50%);
}

a.cta::after,
.wp-block-verdure-auswahl__mehr > button.cta::after {
	content: "";
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: -1;
	width: 100%;
	height: 100%;
	box-shadow: inset 0 0 0 3px var(--wp--preset--color--schwarz);
	background-color: var(--wp--preset--color--weiss);
	transition: top var(--wp--custom--transition), left var(--wp--custom--transition);
}

a.cta:hover,
.wp-block-verdure-auswahl__mehr > button.cta:hover,
a.cta:focus-visible,
.wp-block-verdure-auswahl__mehr > button.cta:focus-visible {
	background-color: transparent;
	color: var(--wp--preset--color--schwarz);
}

a.cta:hover::after,
.wp-block-verdure-auswahl__mehr > button.cta:hover::after,
a.cta:focus-visible::after,
.wp-block-verdure-auswahl__mehr > button.cta:focus-visible::after {
	top: 0;
	left: 0;
}

a.cta.green:hover::after,
.wp-block-verdure-auswahl__mehr > button.cta.green:hover::after,
a.cta.green:focus-visible::after,
.wp-block-verdure-auswahl__mehr > button.cta.green:focus-visible::after {
	box-shadow: inset 0 0 0 3px var(--wp--preset--color--gruen);
}

/* Pfeil beim Überfahren grün, auch beim grünen Link (alt cta_before) */
a.cta:is(:hover, :focus-visible)::before,
.wp-block-verdure-auswahl__mehr > button.cta:is(:hover, :focus-visible)::before {
	background-color: var(--wp--preset--color--gruen);
}

/* Grüner Link in grau hinterlegten Gruppen (alt .container--gray .cta.green): ohne versetzten Rahmen, grüner Rand;
 * beim Überfahren weiße Fläche, schwarzer Rand, ohne Übergang. */
.is-style-grau-hinterlegt a.cta.green {
	border-color: var(--wp--preset--color--gruen);
	transition: none;
}

.is-style-grau-hinterlegt a.cta.green::after {
	content: none;
}

.is-style-grau-hinterlegt a.cta.green:is(:hover, :focus-visible) {
	border-color: var(--wp--preset--color--schwarz);
	background-color: var(--wp--preset--color--weiss);
}

@media (max-width: 767px) {
	a.cta,
	.wp-block-verdure-auswahl__mehr > button.cta {
		box-sizing: border-box;
		display: block;
		width: 100%;
		padding: 15px 40px 15px 15px;
		font-size: 12px;
	}

	a.cta::before,
	.wp-block-verdure-auswahl__mehr > button.cta::before {
		right: 15px;
	}
}

/* Sichtbarkeit (_helpers.scss) */
.visible-laptop-up {
	display: none !important;
}

.visible-md {
	display: none !important;
}

@media (min-width: 960px) {
	.visible-laptop-up {
		display: block !important;
	}

	.visible-laptop-down {
		display: none !important;
	}
}

@media (min-width: 1025px) {
	.hidden-md {
		display: none !important;
	}

	.visible-md {
		display: block !important;
	}
}

/* Abstände und Breiten (_helpers.scss; Werte wie im kompilierten CSS des alten Themes, nicht wie Bootstrap).
 * p-2/p-md-4 mit !important, weil Gruppen sonst ihren Innenabstand aus theme.json behalten. */
.mb-0 { margin-bottom: 0 !important; }
.mt-0 { margin-top: 0 !important; }
.m-0 { margin: 0 !important; }
.p-2 { padding: 32px !important; }
.w-100 { width: 100% !important; }

@media (min-width: 960px) {
	.p-md-4 { padding: 64px !important; }
	.w-100 { max-width: 100% !important; }
}

/* Spalten bis 1025 px umgekehrt untereinander (alt .mobile-reverse, z. B. Kopf der Whitepaper-Seite: Bild unter dem Text) */
@media (max-width: 1025px) {
	.wp-block-columns.mobile-reverse {
		flex-direction: column-reverse;
	}
}

/* Box um HubSpot-Formulare (alt .verdure-hubspot-form): schwarze Fläche, Einleitung fett. Das Formular selbst lädt
 * HubSpot von außen (lokal gesperrt); seine Felder sind hier nicht nachgebaut, siehe docs/vor-staging.md. */
.verdure-hubspot-form {
	padding: 40px 30px;
	background: var(--wp--preset--color--schwarz);
	color: var(--wp--preset--color--weiss);
}

.verdure-hubspot-form p {
	font-size: 1.4rem;
	font-weight: 500;
}

@media (min-width: 1025px) {
	.verdure-hubspot-form {
		padding: 40px;
	}
}

/* Typografie (_typo.scss) */
/* Titel im Text (alt .like-title, z. B. /maschinenbau): 28/35 px, der nächste Absatz direkt darunter */
p.like-title {
	margin-bottom: 0;
	font-size: 28px;
	font-weight: 600;
	line-height: 35px;
}

:where(.is-layout-flow, .is-layout-constrained) > p.like-title + * {
	margin-block-start: 0;
}

/* In Text-Bausteinen schlägt das die Regel „Absatz auf Absatz 1,5 em“ (theme.css), deshalb mit deren Selektor. */
.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > p.like-title + p {
	margin-block-start: 0;
}

/* Zeilen aus Bild, Titel und Text (/online-leadgenerierung-b2b, /maschinenbau): Alt stand das Bild in einem Absatz am
 * Zeilenanfang, nach dem Text folgten zwei leere Absätze (<p>&nbsp;</p>, je 32 px Zeile + 1,5 em), die der Konverter
 * nicht übernimmt. Die nächste Zeile (ausgerichtetes Bild und Titel) beginnt deshalb mit diesem Abstand: 1,5 em nach dem
 * Text plus zwei leere Absätze = 4,5 em + 64 px (145 px, mobil kleiner), Bild und Titel auf gleicher Höhe wie alt. */
.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > p + :is(.alignleft, .alignright):has(+ p.like-title),
.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > p + :is(.alignleft, .alignright) + p.like-title {
	margin-block-start: calc(4.5 * var(--wp--preset--font-size--paragraph) + 64px);
}

/* Bis 1025 px umfließt der Text ausgerichtete Bilder in Text-Bausteinen nicht (alt components/text.scss: float: none,
 * display: block bis $desktop). Das Bild steht dann über dem Titel, der Titel folgt mit Absatzabstand; der
 * Zeilenabstand von oben sitzt nur noch am Bild. */
@media (max-width: 1025px) {
	.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > .wp-block-image:is(.alignleft, .alignright) {
		float: none;
		margin-inline: 0;
	}

	.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > .wp-block-image:is(.alignleft, .alignright) + * {
		margin-block-start: calc(1.5 * var(--wp--preset--font-size--paragraph));
	}

	.verdure-bausteine :is(.wp-block-group.is-style-indented, .wp-block-group.alignwide) > p + :is(.alignleft, .alignright) + p.like-title {
		margin-block-start: calc(1.5 * var(--wp--preset--font-size--paragraph));
	}
}

/* Ausgerichtete Bilder im Text wie alt (.text__wrapper .alignleft): 1,5 em Abstand zum Text statt 2 em (Core) */
:is(.is-layout-flow, .is-layout-constrained) > .wp-block-image.alignleft {
	margin-inline-end: 1.5em;
}

:is(.is-layout-flow, .is-layout-constrained) > .wp-block-image.alignright {
	margin-inline-start: 1.5em;
}

/* Text neben links/rechts ausgerichteten Bildern beginnt wie alt auf Höhe der Bildoberkante (kein Blockabstand) */
:where(.is-layout-flow, .is-layout-constrained) > :is(.alignleft, .alignright) + * {
	margin-block-start: 0;
}

/* Schriftgröße „Mittel“ aus dem alten Editor (has-medium-font-size, 4 Seiten): theme.json kennt die Größe nicht,
 * sonst gälte der Core-Wert (20 px fließend, Zeilenhöhe 32 px). */
.has-medium-font-size {
	font-size: 20px !important;
	line-height: 166.667% !important;
}

@media (min-width: 960px) {
	.has-medium-font-size {
		font-size: 24px !important;
	}
}

/* Label über Überschriften (alt .breadcrumb-label, etwa im Kopf der Whitepaper-Seite): fett, Versalien */
.breadcrumb-label {
	display: inline-block;
	margin-block: 30px;
	color: var(--wp--preset--color--schwarz);
	font-size: 18px;
	font-weight: 600;
	line-height: 32px;
	letter-spacing: 0;
	text-transform: uppercase;
}

/* Überschrift in der Größe der Startseiten-H2 (alt .like-h2) */
.like-h2 {
	font-size: 30px;
	line-height: 1.2;
}

@media (min-width: 960px) {
	.breadcrumb-label {
		margin-block: 120px 40px;
	}

	.like-h2 {
		font-size: 74px;
		line-height: 70px;
		letter-spacing: -0.5px;
	}
}

.text--like-h3 {
	display: block;
	margin-bottom: 30px;
	font-size: var(--wp--preset--font-size--ueberschrift-3);
	font-weight: 600;
	line-height: 1.3;
}

.text--lg {
	font-weight: 500;
}

@media (max-width: 959px) {
	.text--lg,
	.text--lg p {
		line-height: 1.3;
	}
}

@media (min-width: 960px) {
	.text--like-h3 {
		line-height: 1.1;
	}
}

@media (min-width: 1025px) {
	.text--lg {
		max-width: 80%;
		font-size: 28px;
		line-height: 35px;
		letter-spacing: -0.5px;
	}
}

/* Icon-Zeilen auf Landingpages (blocks/media.scss) */
.wp-block-media-text.sales__icon-row {
	align-items: start;
}

.wp-block-media-text.sales__icon-row .wp-block-media-text__media {
	align-self: start;
}

.wp-block-media-text.sales__icon-row .wp-block-media-text__content {
	align-self: start;
	padding: 0;
}

.wp-block-media-text.sales__icon-row .wp-block-media-text__content p {
	margin-bottom: 0;
}

@media (max-width: 1024px) {
	.wp-block-media-text.sales__icon-row .wp-block-media-text__media {
		width: 60px;
		margin-bottom: 25px;
	}

	.wp-block-media-text.sales__icon-row--sm .wp-block-media-text__media {
		width: 48px;
		margin-bottom: 15px;
	}
}

@media (min-width: 1025px) {
	.wp-block-media-text.sales__icon-row {
		grid-template-columns: 64px auto !important;
		margin-bottom: 40px;
	}

	.wp-block-media-text.sales__icon-row--sm {
		grid-template-columns: 48px auto !important;
	}

	.wp-block-media-text.sales__icon-row .wp-block-media-text__content {
		padding-left: 32px;
	}

	.wp-block-media-text.sales__icon-row--sm .wp-block-media-text__content {
		padding-left: 41px;
	}
}

/* Terminbuchung (booking.dna.ax) als iframe in core/html, nach Freigabe im Borlabs-Platzhalter geladen.
 * Als Inline-Element griff margin-inline: auto der Inhaltsspalte nicht, der Rahmen saß links verschoben.
 * Unter 960 px stapelt die Buchungsseite Kalender und Zeiten untereinander und braucht rund 1.000 px; die im
 * Inhalt um 30 % verringerte Höhe (Nutzer, 22.10.2026) gilt nur darüber. */
iframe[src*="booking.dna.ax"] {
	display: block;
}

@media (max-width: 959px) {
	iframe[src*="booking.dna.ax"] {
		height: 1000px;
	}
}
