/*
 * Bausteine der codegefuehrten Seiten. Markup: inc/bausteine.php.
 *
 * Farbwelt Rot/Weiss/Schwarz nach dem Akademie-Logo. Gerechnete Kontraste
 * (WCAG-2.1-Formel, Nachweis: python3 bin/check-contrast.py):
 *   Weiss auf Satzweiss-Rot #C1272D ............. 5.84:1  (Buttons)
 *   Dunkelrot #A51F26 auf Weiss ................. 7.44:1  (Links, Eyebrow)
 *   Dunkelrot #A51F26 auf Warmgrau #F6F3F2 ...... 6.74:1
 *   Weiss auf Tiefschwarz #141414 ............... 18.4:1
 *   Hellrot #F28B8B auf Tiefschwarz ............. 7.76:1  (Akzente im dunklen Band)
 * Satzweiss-Rot auf Schwarz erreicht nur 3.15:1 - dort deshalb nie als Text,
 * nur als Flaeche/Linie (>= 3:1 fuer Grafik, WCAG 1.4.11).
 *
 * Regel aus satzweiss-com, gilt hier genauso: KEINE Schrift direkt auf Fotos.
 */

.sw-sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* --- Header ------------------------------------------------------------- */

.site-header {
	border-top: 6px solid var(--wp--preset--color--brand);
}

.swa-logo {
	display: inline-block;
	line-height: 0;
}

.swa-logo img {
	width: clamp(200px, 30vw, 280px);
	height: auto;
}

/* --- Baender ------------------------------------------------------------ */

.sw-band {
	padding: clamp(2.5rem, 6vw, 5rem) var(--wp--style--root--padding-right, 1.5rem);
	margin-block-start: 0;
}

.sw-band--surface {
	background-color: var(--wp--preset--color--surface);
}

.sw-band--dark {
	background-color: var(--wp--preset--color--secondary);
	color: #ffffff;
	position: relative;
	overflow: hidden;
}

/* Rote Schraege als Bildmarke, angelehnt an die Chevron-Form im Logo.
   Rein dekorativ (Pseudo-Element, nicht vorgelesen). */
.sw-band--dark::before {
	content: "";
	position: absolute;
	inset: 0 -3.5rem 0 auto;
	width: 5rem;
	background: var(--wp--preset--color--brand);
	transform: skewX(-18deg);
	opacity: 0.9;
	pointer-events: none;
}

.sw-band--dark > * {
	position: relative;
}

.sw-band--dark h1,
.sw-band--dark h2,
.sw-band--dark h3,
.sw-band--dark h4,
.sw-band--dark p,
.sw-band--dark li,
.sw-band--dark td,
.sw-band--dark th {
	color: #ffffff;
}

.sw-band--dark a:where(:not(.wp-element-button)) {
	color: #ffffff;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 0.2em;
}

.sw-band--dark .sw-eyebrow {
	color: var(--wp--preset--color--brand-light);
}

/* Mobil kein Platz neben dem Text - Schraege ausblenden. */
@media (max-width: 781px) {
	.sw-band--dark::before {
		display: none;
	}
}

.sw-band__inner > p,
.sw-band__inner > ul,
.sw-band__inner > h2,
.sw-band__inner > h3 {
	max-width: 48rem;
}

/* Buttons auf Schwarz: weisser Ring, damit die Begrenzung traegt (1.4.11). */
.sw-band--dark .wp-block-button:not(.is-style-outline) .wp-block-button__link {
	box-shadow: 0 0 0 2px #ffffff;
}

.sw-band--dark .wp-block-button.is-style-outline .wp-block-button__link {
	color: #ffffff;
	border: 2px solid #ffffff;
	background-color: transparent;
}

.is-style-outline .wp-block-button__link {
	border: 2px solid currentColor;
	color: var(--wp--preset--color--contrast);
	background-color: transparent;
}

.is-style-outline .wp-block-button__link:hover,
.is-style-outline .wp-block-button__link:focus-visible {
	color: #ffffff;
	background-color: var(--wp--preset--color--accent);
	border-color: var(--wp--preset--color--accent);
}

/* --- Hero --------------------------------------------------------------- */

.sw-band--hero {
	background-color: #ffffff;
	border-bottom: 1px solid var(--wp--preset--color--surface);
}

.sw-hero {
	gap: clamp(1.5rem, 5vw, 4rem);
	margin-block: 0;
}

.sw-hero h1 {
	font-family: "Saar 1450 Headline", "Saar 1450 Text", sans-serif;
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.08;
	font-size: clamp(2.25rem, 1.4rem + 3.2vw, 3.75rem);
	color: var(--wp--preset--color--contrast);
}

/* Hervorgehobener Teil der h1 in Rot. Gross-Schrift, 5.84:1 auf Weiss. */
.sw-hero h1 .rot {
	color: var(--wp--preset--color--brand);
}

.sw-hero__text--allein {
	max-width: 52rem;
}

.sw-lead {
	font-size: var(--wp--preset--font-size--large);
	line-height: 1.55;
	color: var(--wp--preset--color--muted);
}

.sw-band--dark .sw-lead {
	color: #ffffff;
}

.sw-eyebrow {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
}

.sw-eyebrow::before {
	content: "";
	display: inline-block;
	width: 2rem;
	height: 3px;
	margin-right: 0.75rem;
	vertical-align: middle;
	background: var(--wp--preset--color--brand);
}

/* Hero-Bild mit versetzter roter Flaeche dahinter (dekorativ). */
.sw-hero__bild {
	margin: 0;
	position: relative;
	isolation: isolate;
}

.sw-hero__bild::before {
	content: "";
	position: absolute;
	inset: 1.25rem -1.25rem -1.25rem 1.25rem;
	background: var(--wp--preset--color--brand);
	border-radius: 4px;
	z-index: -1;
}

.sw-hero__bild img,
.sw-bild-platzhalter {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 4px;
	display: block;
}

.sw-band--hero .ankernav {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--wp--preset--color--surface);
}

/* --- Bild-Platzhalter ---------------------------------------------------- */

/* Fehlt ein Bild, steht ein beschriftetes Feld da - kein Blindfoto, das man
   versehentlich fuer echt halten koennte. */
.sw-bild-platzhalter {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	text-align: center;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
	background:
		repeating-linear-gradient(-45deg, transparent 0 14px, rgba(193, 39, 45, 0.07) 14px 28px),
		var(--wp--preset--color--surface);
	border: 2px dashed var(--wp--preset--color--muted);
}

/* --- Kennzahlen ---------------------------------------------------------- */

.sw-kennzahlen {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 1.5rem 2.5rem;
}

.sw-kennzahlen > * {
	margin-block: 0;
	padding-left: 1rem;
	border-left: 3px solid var(--wp--preset--color--brand-light);
}

.sw-kennzahl__zahl {
	margin: 0;
	font-family: "Saar 1450 Headline", "Saar 1450 Text", sans-serif;
	font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
	line-height: 1.1;
}

.sw-kennzahl__label {
	margin: 0.25rem 0 0;
	font-size: 1rem;
}

/* --- Karten -------------------------------------------------------------- */

.sw-kartenraster {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
	gap: 1.5rem;
}

.sw-kartenraster > * {
	margin-block: 0;
}

.sw-card {
	position: relative;
	padding: 1.5rem 1.5rem 1.75rem;
	border: 1px solid #d9d4d3;
	border-top: 4px solid var(--wp--preset--color--brand);
	border-radius: 4px;
	background-color: #ffffff;
	height: 100%;
	/* Lange Komposita (Barrierefreiheitsstaerkungsgesetz) in schmalen Karten. */
	hyphens: auto;
	overflow-wrap: break-word;
}

.sw-band--light .sw-card {
	background-color: #ffffff;
}

.sw-band--surface .sw-card {
	background-color: #ffffff;
}

.sw-card > h3,
.sw-card > h4 {
	margin-top: 0;
	font-size: var(--wp--preset--font-size--large);
}

.sw-card__nr {
	margin: 0 0 0.25rem;
	font-family: "Saar 1450 Headline", "Saar 1450 Text", sans-serif;
	font-size: 2rem;
	line-height: 1;
	color: var(--wp--preset--color--brand);
}

.sw-card__link {
	font-weight: 700;
}

.sw-card__link a::after {
	content: " \2192";
}

/* Merkmale eines Kurses als kleine Chips (Dauer, Format, Gruppe). */
.sw-chips {
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.sw-chips li {
	margin: 0;
	padding: 0.15rem 0.6rem;
	font-size: 0.8125rem;
	font-weight: 600;
	border: 1px solid var(--wp--preset--color--muted);
	border-radius: 999px;
	background: #ffffff;
}

.sw-meta {
	margin: 0 0 0.25rem;
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}

/* Karten im dunklen Band: dunkle Flaeche, weisse Schrift (18:1). */
.sw-band--dark .sw-card {
	background-color: #222222;
	border-color: #4a4a4a;
	border-top-color: var(--wp--preset--color--brand);
}

.sw-band--dark .sw-card__nr {
	color: var(--wp--preset--color--brand-light);
}

.sw-band--dark .sw-chips li {
	background: transparent;
	border-color: #ffffff;
}

/* --- Zweispaltige Abschnitte --------------------------------------------- */

.sw-spalten {
	gap: clamp(1.5rem, 4vw, 3.5rem);
}

/* Liste mit roten Haken statt Punkten (Inhalt bleibt eine echte Liste). */
.sw-haken {
	list-style: none;
	padding-left: 0;
}

.sw-haken li {
	position: relative;
	padding-left: 2rem;
	margin-bottom: 0.6rem;
}

.sw-haken li::before {
	content: "";
	position: absolute;
	left: 0.2rem;
	top: 0.35em;
	width: 0.55rem;
	height: 0.95rem;
	border: solid var(--wp--preset--color--brand);
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.sw-band--dark .sw-haken li::before {
	border-color: var(--wp--preset--color--brand-light);
}

/* --- Personen ------------------------------------------------------------ */

.sw-person img,
.sw-person .sw-bild-platzhalter {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 4px;
}

.sw-person .wp-block-image,
.sw-person .sw-bild-platzhalter-wrap {
	margin: 0 0 1rem;
	max-width: 16rem;
}

.sw-person h3 {
	margin-bottom: 0;
}

.sw-person__rolle {
	margin-top: 0.25rem;
	font-weight: 600;
	color: var(--wp--preset--color--primary);
}

/* --- Kundenliste --------------------------------------------------------- */

.sw-kundenliste {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.75rem 2rem;
}

.sw-kundenliste li {
	margin: 0;
	padding: 0.75rem 0;
	border-bottom: 1px solid #d9d4d3;
	font-weight: 600;
}

/* --- Termine-Tabelle ----------------------------------------------------- */

.wp-block-table.sw-termine {
	margin-inline: 0;
	width: 100%;
	overflow-x: auto;
}

.sw-termine table {
	width: 100%;
	border-collapse: collapse;
}

.sw-termine th,
.sw-termine td {
	padding: 0.75rem 1rem;
	text-align: left;
	vertical-align: top;
	border: 0;
	border-bottom: 1px solid #d9d4d3;
}

.sw-termine thead th {
	background: var(--wp--preset--color--secondary);
	color: #ffffff;
	font-weight: 700;
	border-bottom: 3px solid var(--wp--preset--color--brand);
}

.sw-termine tbody tr:nth-child(even) {
	background: var(--wp--preset--color--surface);
}

.sw-termine figcaption {
	margin-top: 0.75rem;
	text-align: left;
}

/* --- Siegel/Badge -------------------------------------------------------- */

.sw-siegel img,
.sw-siegel .sw-bild-platzhalter-wrap {
	max-width: 180px;
	height: auto;
}

.sw-siegel .sw-bild-platzhalter {
	aspect-ratio: 1 / 1;
}

/* --- Kontakt / Formular -------------------------------------------------- */

.sw-kontakt-telefon {
	font-family: "Saar 1450 Headline", "Saar 1450 Text", sans-serif;
	font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
	margin: 0;
}

.sw-form {
	max-width: 40rem;
}

.sw-form__feld {
	margin: 0 0 1.25rem;
}

.sw-form label {
	display: block;
	margin-bottom: 0.375rem;
	font-weight: 600;
}

.sw-form input[type="text"],
.sw-form input[type="email"],
.sw-form input[type="tel"],
.sw-form input[type="number"],
.sw-form select,
.sw-form textarea {
	width: 100%;
	padding: 0.75rem;
	font: inherit;
	color: var(--wp--preset--color--contrast);
	background-color: #ffffff;
	border: 2px solid var(--wp--preset--color--muted);
	border-radius: 4px;
}

.sw-form [aria-invalid="true"] {
	border-color: var(--wp--preset--color--brand);
}

.sw-form__feld--haken {
	display: grid;
	grid-template-columns: auto 1fr;
	column-gap: 0.75rem;
	align-items: start;
}

.sw-form__feld--haken .sw-form__meldung {
	grid-column: 1 / -1;
}

.sw-form__feld--haken input[type="checkbox"] {
	width: 1.5rem;
	height: 1.5rem;
	margin-top: 0.125rem;
	accent-color: var(--wp--preset--color--brand);
}

.sw-form__feld--haken label {
	margin: 0;
	font-weight: 400;
}

.sw-form__meldung {
	margin: 0 0 0.375rem;
	color: var(--wp--preset--color--primary);
}

.sw-form__fehler,
.sw-form--ok {
	margin: 0 0 1.5rem;
	padding: 1rem 1.25rem;
	border-left: 4px solid var(--wp--preset--color--brand);
	background-color: var(--wp--preset--color--surface);
}

.sw-form--ok {
	border-left-color: var(--wp--preset--color--contrast);
}

.sw-form__fehler h3,
.sw-form--ok h3 {
	margin-top: 0;
}

.sw-form__hinweis {
	font-size: 0.9375rem;
	color: var(--wp--preset--color--muted);
}

.sw-form__fang {
	position: absolute;
	left: -10000px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.sw-form button.wp-element-button {
	cursor: pointer;
	border: 0;
	font: inherit;
	font-weight: 600;
}

/* --- Blog ---------------------------------------------------------------- */

.sw-verwandt {
	margin-top: 3rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--wp--preset--color--muted);
}

.sw-verwandt ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wp-block-post-template .sw-card {
	height: 100%;
}

.wp-block-post-title a {
	text-decoration-thickness: 2px;
}

/* --- Footer -------------------------------------------------------------- */

/* Kein weisser Spalt zwischen dem letzten (dunklen) Band und dem Footer. */
.wp-site-blocks > footer,
.wp-site-blocks > main + footer,
main.wp-block-group + .wp-block-template-part {
	margin-block-start: 0;
}

main .entry-content > .sw-band:last-child,
main .wp-block-post-content > .sw-band:last-child {
	margin-block-end: 0;
}

.site-footer {
	border-top: 6px solid var(--wp--preset--color--brand);
}

.site-footer,
.site-footer p,
.site-footer h2 {
	color: #ffffff;
}

.site-footer a {
	color: #ffffff;
}

.site-footer .wp-block-navigation a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.site-footer .swa-footer-klein {
	color: #d4d4d4;
}
