/*
 * SCHAFER TRAINING Modern
 * Sanfte Modernisierung: heller Kopf, Menü unter dem Logo, breites Banner,
 * grössere Schrift, dunkelblaue Fusszeile mit Dreiecken.
 */

/* ------------------------------------------------------------ Grundlagen */

html { scroll-behavior: smooth; }
body { margin: 0; -webkit-font-smoothing: antialiased; }
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; }
.wp-site-blocks > * { margin-block: 0; }
.stm-haupt { flex: 1 0 auto; }
img { max-width: 100%; height: auto; }
a { text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 2px solid var(--wp--preset--color--hellblau); outline-offset: 2px; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}

/* ------------------------------------------------------------ Kopf */

.stm-kopf {
	position: relative;
	z-index: 20;
	background: #fff;
	border-bottom: 1px solid #e3e7ec;
	box-shadow: 0 6px 14px -10px rgba(11, 74, 130, .35);
}
.stm-kopf__inhalt {
	box-sizing: border-box;
	max-width: 1108px;
	margin: 0 auto;
	padding: 34px 20px 0;
}
.stm-kopf .stm-logo { margin: 0; }
.stm-kopf .stm-logo a { display: inline-block; }
.stm-kopf .stm-logo img { display: block; width: 350px; max-width: 100%; height: auto; }

/* ------------------------------------------------------------ Menü Desktop */

.stm-menu { margin-top: 6px; }
.stm-menu ul { margin: 0; padding: 0; list-style: none; }
.stm-menu__knopf,
.stm-menu__auf { display: none; }

.stm-menu__liste { display: flex; flex-wrap: wrap; margin-left: -15px !important; }
.stm-menu__liste > li { position: relative; display: flex; align-items: stretch; }
.stm-menu__liste > li::after {
	content: "|";
	align-self: center;
	padding-top: 36px;
	color: #b3b8bf;
	font-weight: 300;
}
.stm-menu__liste > li > a {
	position: relative;
	display: block;
	padding: 50px 15px 16px;
	font-size: 17px;
	line-height: 1.2;
	color: #222;
	text-decoration: none;
	white-space: nowrap;
	transition: color .15s;
}
/* Dreiecke wie im bisherigen Menü und blauer Balken unter dem aktiven Punkt */
.stm-menu__liste > li > a::before {
	content: "";
	position: absolute;
	top: 0;
	left: 50%;
	width: 26px;
	height: 46px;
	margin-left: -13px;
	background: url(../images/nav_active.jpg) center top no-repeat;
	opacity: 0;
	transition: opacity .15s;
}
.stm-menu__liste > li > a::after {
	content: "";
	position: absolute;
	right: 15px;
	bottom: -1px;
	left: 15px;
	height: 3px;
	background: var(--wp--preset--color--blau);
	transform: scaleX(0);
	transition: transform .2s;
}
.stm-menu__liste > li > a:hover,
.stm-menu__liste > li.is-aktiv > a { color: var(--wp--preset--color--blau); }
.stm-menu__liste > li.is-aktiv > a::before { opacity: 1; }
.stm-menu__liste > li.is-aktiv > a::after,
.stm-menu__liste > li > a:hover::after { transform: scaleX(1); }

/* Unterseiten als Ausklappmenü */
.stm-menu__unter {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 30;
	min-width: 300px;
	padding: 8px 0 !important;
	background: #fff;
	border-top: 3px solid var(--wp--preset--color--blau);
	box-shadow: 0 12px 28px rgba(11, 74, 130, .18);
	border-radius: 0 0 6px 6px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .15s, transform .15s, visibility .15s;
}
.stm-menu__liste > li:hover > .stm-menu__unter,
.stm-menu__liste > li:focus-within > .stm-menu__unter {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.stm-menu__unter a {
	display: block;
	padding: 7px 20px;
	font-size: 16px;
	line-height: 1.3;
	color: #333;
	text-decoration: none;
}
.stm-menu__unter a:hover,
.stm-menu__unter li.is-aktiv > a { color: var(--wp--preset--color--blau); background: var(--wp--preset--color--hintergrund); }
.stm-menu__unter > li.has-kinder > a { font-weight: 700; color: var(--wp--preset--color--dunkelblau); }
.stm-menu__unter > li.has-kinder + li { margin-top: 6px; }
.stm-menu__unter .stm-menu__unter {
	position: static;
	min-width: 0;
	padding: 0 0 4px !important;
	border: 0;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}
.stm-menu__unter .stm-menu__unter a { padding-left: 36px; font-size: 15px; color: var(--wp--preset--color--grau); }
.stm-menu__unter .stm-menu__unter a:hover,
.stm-menu__unter .stm-menu__unter li.is-aktiv > a { color: var(--wp--preset--color--blau); }

/* ------------------------------------------------------------ Banner */

.stm-banner {
	margin: 26px 0 0 !important;
	background: var(--wp--preset--color--hintergrund);
}
.stm-banner img {
	display: block;
	width: 100%;
	max-width: 1320px;
	height: auto !important;
	margin: 0 auto;
	aspect-ratio: 935 / 228 !important;
	object-fit: cover;
	object-position: top;
}
@media (min-width: 1321px) {
	.stm-banner img {
		-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
		mask-image: linear-gradient(90deg, transparent 0, #000 60px, #000 calc(100% - 60px), transparent 100%);
	}
}

/* ------------------------------------------------------------ Inhalt */

.stm-inhalt {
	box-sizing: border-box;
	max-width: 1108px;
	margin: 0 auto !important;
	padding: 40px 20px 72px;
}
.stm-inhalt > * { margin-block: 0; }

.stm-titelzeile {
	margin-bottom: 28px !important;
	border-bottom: 1px solid var(--wp--preset--color--linie);
}
.stm-titelzeile h1 {
	display: inline-block;
	margin: 0 0 -1px;
	padding-bottom: 10px;
	font-size: var(--wp--preset--font-size--xx-large);
	line-height: 1.15;
	letter-spacing: -.01em;
	border-bottom: 4px solid var(--wp--preset--color--dunkelblau);
}

.wp-block-post-content > * { margin-block: 0 18px; }
.wp-block-post-content > :last-child { margin-bottom: 0; }
.wp-block-post-content > .wp-block-heading { margin: 30px 0 10px; }
.wp-block-post-content > .wp-block-heading:first-child { margin-top: 0; }
.wp-block-post-content :is(p, li) { max-width: 820px; }
.wp-block-post-content strong { color: var(--wp--preset--color--dunkelblau); }

/* Schriftgrössen aus dem Import (klein, gross, sehr gross) bleiben lesbar */
.wp-block-post-content .has-small-font-size { line-height: 1.5; }

/* Listen mit kleinen blauen Dreiecken */
.wp-block-post-content ul.wp-block-list { margin: 0 0 20px; padding: 0; }
.wp-block-post-content ul.wp-block-list > li {
	position: relative;
	margin: 0 0 6px;
	padding-left: 22px;
	list-style: none;
}
.wp-block-post-content ul.wp-block-list > li::before {
	content: "";
	position: absolute;
	top: .55em;
	left: 2px;
	border-top: 5px solid transparent;
	border-bottom: 5px solid transparent;
	border-left: 8px solid var(--wp--preset--color--blau);
}
.wp-block-post-content ul.wp-block-list ul { margin: 6px 0 0; padding: 0; }
.wp-block-post-content ol.wp-block-list { margin: 0 0 20px; padding-left: 24px; }
.wp-block-post-content ol.wp-block-list > li { margin: 0 0 10px; padding-left: 4px; }
.wp-block-post-content ol.wp-block-list > li::marker { color: var(--wp--preset--color--blau); font-weight: 700; }
.st-einzug { margin-left: 30px !important; }

.wp-block-post-content .wp-block-image img { border-radius: 6px; }
.wp-block-post-content .wp-block-separator { border: 0; border-top: 1px solid var(--wp--preset--color--linie); opacity: .6; }

/* Team Profil: Text links, Foto rechts */
.st-profil { gap: 40px !important; flex-wrap: nowrap !important; align-items: flex-start !important; margin-bottom: 36px !important; }
.st-profil > .wp-block-column:last-child { flex-shrink: 0; }
.st-profil .wp-block-image { margin: 4px 0 0; }
.st-profil .wp-block-image img { border-radius: 8px; box-shadow: 0 8px 22px rgba(11, 74, 130, .14); }
.st-profil p { margin: 0 0 14px; }

/* Referenzen: Logo und Adresse pro Firma */
.st-referenz {
	gap: 32px !important;
	align-items: center !important;
	margin: 0 !important;
	padding: 26px 0;
	border-bottom: 1px solid #dbe3ec;
}
.wp-block-post-content > .st-referenz:first-of-type,
.st-referenz:first-child { border-top: 1px solid #dbe3ec; }
.st-referenz > .wp-block-column:first-child { flex: 0 0 260px !important; }
.st-referenz .wp-block-image { margin: 0; }
.st-referenz .wp-block-image :is(a, figure) { display: block; }
.st-referenz .wp-block-image img { display: block; width: auto; max-width: 100%; max-height: 110px; border-radius: 0; }
.st-referenz p { margin: 0; font-size: var(--wp--preset--font-size--small); line-height: 1.5; }

/* Videos */
.wp-block-embed.is-type-video { max-width: 820px; }
.wp-block-embed.is-type-video iframe { border-radius: 8px; }

/* Tabellen */
.wp-block-table table { border-collapse: collapse; }
.wp-block-table :is(td, th) { padding: 8px 12px; border: 1px solid #dbe3ec; }

/* ------------------------------------------------------------ Kontaktformular */

.st-formular { max-width: 640px; }
.st-formular p { margin: 0 0 14px; }
.st-feld { display: flex; flex-direction: column; gap: 5px; }
.st-feld > label { font-size: var(--wp--preset--font-size--small); font-weight: 700; color: var(--wp--preset--color--dunkelblau); }
.st-feld input:not([type="checkbox"]),
.st-feld textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	font: inherit;
	font-size: 17px;
	color: inherit;
	background: #fff;
	border: 1px solid #c5d0dc;
	border-radius: 6px;
	transition: border-color .15s, box-shadow .15s;
}
.st-feld input:not([type="checkbox"]):focus,
.st-feld textarea:focus {
	border-color: var(--wp--preset--color--blau);
	outline: 0;
	box-shadow: 0 0 0 3px rgba(0, 113, 175, .15);
}
.st-feld--check { flex-direction: row; align-items: flex-start; gap: 10px; }
.st-feld--check input { margin-top: 6px; accent-color: var(--wp--preset--color--blau); }
.st-feld--check label { flex: 1; font-weight: 400; color: inherit; }
.st-feld--senden { margin-top: 8px !important; }
.st-feld button {
	align-self: flex-start;
	padding: 11px 26px;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	color: #fff;
	background: var(--wp--preset--color--blau);
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	transition: background .15s;
}
.st-feld button:hover { background: var(--wp--preset--color--dunkelblau); }
.st-falle { position: absolute; left: -9999px; }
.st-meldung { margin: 0 0 18px; padding: 12px 16px; border-left: 4px solid; border-radius: 4px; }
.st-meldung p { margin: 0; }
.st-meldung--ok { border-color: #2e8b57; background: #eef7f1; }
.st-meldung--fehler { border-color: #c00; background: #fdf0f0; }

/* ------------------------------------------------------------ Fusszeile */

.stm-fuss {
	position: relative;
	overflow: hidden;
	color: #fff;
	background: var(--wp--preset--color--dunkelblau);
}
/* Grosse, durchscheinende Dreiecke rechts */
.stm-fuss::before,
.stm-fuss::after {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	pointer-events: none;
}
.stm-fuss::before {
	right: 0;
	width: 520px;
	background: rgba(255, 255, 255, .10);
	clip-path: polygon(100% 0, 100% 100%, 0 100%);
}
.stm-fuss::after {
	right: 90px;
	width: 300px;
	background: rgba(30, 164, 227, .28);
	clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.stm-fuss__spalten {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	max-width: 1108px;
	margin: 0 auto !important;
	padding: 52px 20px 58px;
	gap: 0 !important;
	flex-wrap: nowrap !important;
}
.stm-fuss__spalten > .wp-block-column {
	flex: 0 1 auto !important;
	padding: 0 40px;
	border-left: 1px solid rgba(255, 255, 255, .7);
}
.stm-fuss__spalten > .wp-block-column:first-child { padding-left: 0; border-left: 0; }
.stm-fuss__spalten > .wp-block-column:last-child { border-right: 1px solid rgba(255, 255, 255, .7); }
.stm-fuss p { margin: 0; font-size: 17px; line-height: 1.55; }
.stm-fuss strong { letter-spacing: .04em; }
.stm-fuss a { color: #fff; text-decoration: none; }
.stm-fuss a:hover { text-decoration: underline; }

/* ------------------------------------------------------------ Tablet und Handy */

@media (max-width: 1000px) {
	.stm-kopf__inhalt {
		position: relative;
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: space-between;
		padding: 18px 20px;
	}
	.stm-kopf .stm-logo img { width: 240px; }

	.stm-menu { margin: 0; }
	.stm-menu__knopf {
		display: inline-flex;
		align-items: center;
		gap: 10px;
		padding: 10px 14px;
		font: inherit;
		font-size: 16px;
		font-weight: 700;
		color: var(--wp--preset--color--dunkelblau);
		background: var(--wp--preset--color--hintergrund);
		border: 0;
		border-radius: 6px;
		cursor: pointer;
	}
	.stm-menu__knopf span,
	.stm-menu__knopf span::before,
	.stm-menu__knopf span::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		border-radius: 1px;
		transition: transform .2s, background .2s;
	}
	.stm-menu__knopf span { position: relative; }
	.stm-menu__knopf span::before,
	.stm-menu__knopf span::after { content: ""; position: absolute; left: 0; }
	.stm-menu__knopf span::before { top: -6px; }
	.stm-menu__knopf span::after { top: 6px; }
	.stm-menu.is-offen .stm-menu__knopf span { background: transparent; }
	.stm-menu.is-offen .stm-menu__knopf span::before { transform: translateY(6px) rotate(45deg); }
	.stm-menu.is-offen .stm-menu__knopf span::after { transform: translateY(-6px) rotate(-45deg); }

	.stm-menu__liste {
		display: none;
		position: absolute;
		top: 100%;
		right: 0;
		left: 0;
		margin: 1px 0 0 !important;
		padding: 6px 0 14px !important;
		background: #fff;
		box-shadow: 0 14px 24px rgba(11, 74, 130, .16);
		max-height: calc(100vh - 120px);
		overflow-y: auto;
	}
	.stm-menu.is-offen .stm-menu__liste { display: block; }
	.stm-menu__liste li { position: relative; display: block; }
	.stm-menu__liste > li { border-bottom: 1px solid #edf1f5; }
	.stm-menu__liste > li::after { display: none; }
	.stm-menu__liste > li > a { padding: 13px 64px 13px 20px; font-size: 18px; white-space: normal; }
	.stm-menu__liste > li > a::before,
	.stm-menu__liste > li > a::after { display: none; }
	.stm-menu__liste > li.is-aktiv > a { font-weight: 700; box-shadow: inset 4px 0 0 var(--wp--preset--color--blau); }

	.stm-menu__auf {
		display: block;
		position: absolute;
		top: 4px;
		right: 12px;
		width: 42px;
		height: 42px;
		padding: 0;
		background: none;
		border: 0;
		cursor: pointer;
	}
	.stm-menu__auf::before,
	.stm-menu__auf::after {
		content: "";
		position: absolute;
		top: 50%;
		left: 50%;
		width: 14px;
		height: 2px;
		margin: -1px 0 0 -7px;
		background: var(--wp--preset--color--blau);
		transition: transform .2s;
	}
	.stm-menu__auf::after { transform: rotate(90deg); }
	li.open > .stm-menu__auf::after { transform: rotate(0); }
	.stm-menu__unter .stm-menu__auf { top: 0; }

	.stm-menu__unter,
	.stm-menu__unter .stm-menu__unter {
		display: none;
		position: static;
		min-width: 0;
		padding: 0 0 8px !important;
		border: 0;
		border-radius: 0;
		box-shadow: none;
		opacity: 1;
		visibility: visible;
		transform: none;
	}
	li.open > .stm-menu__unter { display: block; }
	.stm-menu__unter a { padding: 8px 64px 8px 36px; font-size: 16px; }
	.stm-menu__unter .stm-menu__unter a { padding-left: 52px; }

	.stm-banner { margin-top: 0 !important; }
	.stm-inhalt { padding: 32px 20px 56px; }

	.stm-fuss__spalten { flex-wrap: wrap !important; padding: 40px 20px 44px; }
	.stm-fuss__spalten > .wp-block-column { flex: 1 1 100% !important; padding: 0 0 18px; border: 0 !important; }
	.stm-fuss__spalten > .wp-block-column + .wp-block-column { padding-top: 18px; border-top: 1px solid rgba(255, 255, 255, .35) !important; }
	.stm-fuss__spalten > .wp-block-column:last-child { padding-bottom: 0; }
	.stm-fuss::before { width: 300px; }
	.stm-fuss::after { width: 170px; right: 40px; }
}

@media (max-width: 781px) {
	.st-profil { flex-wrap: wrap !important; gap: 16px !important; }
	.st-profil > .wp-block-column { flex-basis: 100% !important; }
	.st-profil > .wp-block-column:last-child { order: -1; }
	.st-profil .wp-block-image img { max-width: 220px; }
	.st-referenz { flex-wrap: nowrap !important; gap: 24px !important; }
	.st-referenz > .wp-block-column:first-child { flex: 0 0 200px !important; }
	.st-referenz .wp-block-image img { max-height: 90px; }
}

@media (max-width: 600px) {
	.st-referenz { flex-wrap: wrap !important; gap: 14px !important; padding: 22px 0; }
	.st-referenz > .wp-block-column:first-child { flex: 0 0 100% !important; }
	.st-referenz .wp-block-image img { max-height: 80px; }
}

@media (max-width: 600px) {
	body { font-size: 18px; }
	.stm-kopf .stm-logo img { width: 190px; }
	.stm-menu__knopf { padding: 9px 12px; font-size: 15px; }
	.stm-inhalt { padding: 26px 16px 48px; }
	.stm-kopf__inhalt { padding: 14px 16px; }
	.stm-titelzeile { margin-bottom: 22px !important; }
	.stm-titelzeile h1 { font-size: 28px; }
	.wp-block-post-content > .wp-block-heading { margin-top: 24px; }
	.st-einzug { margin-left: 14px !important; }
	.stm-fuss__spalten { padding: 34px 16px 38px; }
	.stm-fuss p { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	* { transition: none !important; scroll-behavior: auto !important; }
}
