/*
 * Globale Stile, im Frontend und im Editor geladen
 * (JD_Theme_Setup::enqueue_styles()).
 */

/*
 * Icons für Buttons und Absätze (Lucide, ISC-Lizenz).
 *
 * Das Panel „Icon“ im Editor (src/editor/block-icon.js) setzt die Klassen
 * `has-icon has-icon-<slug>`. Jede Klasse liefert ihr SVG als `--jd-icon`, das
 * als CSS-Maske gezeichnet wird. Neues Icon: hier ergänzen und in ICONS in
 * src/editor/block-icon.js eintragen.
 */

.has-icon-clock {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpath d='M12 6v6l4 2'/%3E%3C/svg%3E");
}

.has-icon-phone {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384'/%3E%3C/svg%3E");
}

.has-icon-calendar {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 2v4'/%3E%3Cpath d='M16 2v4'/%3E%3Crect width='18' height='18' x='3' y='4' rx='2'/%3E%3Cpath d='M3 10h18'/%3E%3C/svg%3E");
}

.has-icon-mail {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7'/%3E%3Crect x='2' y='4' width='20' height='16' rx='2'/%3E%3C/svg%3E");
}

.has-icon-map-pin {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0'/%3E%3Ccircle cx='12' cy='10' r='3'/%3E%3C/svg%3E");
}

.has-icon-arrow-right {
	--jd-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E");
}

/*
 * Absatz mit Icon: Icon vor dem Text, in Primärfarbe.
 * Andere Farbe über `--jd-icon-color` am Absatz oder einem Elternelement.
 */
p.has-icon::before {
	content: "";
	display: inline-block;
	width: 1.125em;
	height: 1.125em;
	margin-right: 0.5em;
	vertical-align: -0.2em;
	background-color: var(--jd-icon-color, var(--wp--preset--color--primary));
	mask: var(--jd-icon) center / contain no-repeat;
}

/*
 * Sichtbarkeit: als „Zusätzliche CSS-Klasse“ an einem Block.
 * Die Grenze 1024 px entspricht dem Umschalten der Navigation.
 */
@media (max-width: 1023px) {

	.is-hidden-mobile {
		display: none !important;
	}
}

@media (min-width: 1024px) {

	.is-hidden-desktop {
		display: none !important;
	}
}

/*
 * Versatz: als „Zusätzliche CSS-Klasse“ `is-staggered` ab 782 px um
 * 7.5 rem nach unten versetzt (z. B. zweite Spalte in „Unsere Leistungen“).
 * Darunter, wenn Spalten untereinander stehen, ohne Versatz.
 */
@media (min-width: 782px) {

	.is-staggered {
		padding-top: 7.5rem;
	}
}

/*
 * Gleich hohe Zeilen: als „Zusätzliche CSS-Klasse“ `has-equal-rows` an einer
 * Gruppe mit Raster-Layout. Alle Zeilen werden so hoch wie die höchste,
 * z. B. Kacheln in „Leistungen als Kacheln“.
 */
.has-equal-rows.is-layout-grid {
	grid-auto-rows: 1fr;
}

/*
 * Letzter Block füllt die Resthöhe: als „Zusätzliche CSS-Klasse“
 * `has-stretch-last` an einer Spalte mit mehreren Karten untereinander. Die
 * Spalte wird so hoch wie ihre Nachbarspalte, die letzte Karte wächst mit,
 * z. B. Telefon und Öffnungszeiten neben dem Formular in „Schreiben Sie uns“.
 */
.wp-block-column.has-stretch-last {
	display: flex;
	flex-direction: column;
}

.wp-block-column.has-stretch-last > * {
	height: auto;
}

.wp-block-column.has-stretch-last > :last-child {
	flex-grow: 1;
}

/*
 * Der Footer schließt direkt an den Inhalt an: WordPress setzt zwischen
 * Header, Inhalt und Footer sonst den globalen Block-Abstand.
 */
.wp-site-blocks > footer {
	margin-block-start: 0;
}

/* Header (patterns/header.php) */
.jd-infobar a {
	text-decoration: none;
}

.jd-infobar a:hover,
.jd-infobar a:focus-visible {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Mobil: Seitenname links, alles Weitere rechts zusammen. */
@media (max-width: 1023px) {

	.jd-header .wp-block-group.alignwide > :first-child {
		margin-right: auto;
	}
}

/* Footer (patterns/footer.php) */
.jd-footer__brand {
	flex: 1 1 17rem;
	max-width: 26.25rem;
}

/* Mobil: alles untereinander, rechtliche Links über dem Copyright. */
@media (max-width: 1023px) {

	.jd-footer__columns.is-layout-flex {
		flex-direction: column;
		align-items: flex-start;
	}

	.jd-footer__brand {
		flex: none;
	}

	.jd-footer__bottom.is-layout-flex {
		flex-direction: column-reverse;
		align-items: flex-start;
	}

	.jd-footer__legal.is-layout-flex {
		flex-direction: column;
		align-items: flex-start;
	}
}
