/**
 * Spree & Havel — Design-System-Layer
 * ------------------------------------------------------------------
 * Einzige Quelle für Farben, Typo-Skala, Radien, Motion und die
 * wiederkehrenden Bausteine der SH-Module (Blog, Beratungsstellen-Grid,
 * Karriere-Landing).
 *
 * REGEL: Kein Modul definiert eigene Farb-, Radius- oder Motion-Variablen.
 * Alles kommt aus :root. Siehe DESIGN.md → "Die Zwei-Rampen-Regel".
 */

:root {
	/* ---------- Marke: eine Buntfarbe ---------- */
	--sh-navy: #16395d;        /* Leitfarbe — 11,81:1 auf Weiß */
	--sh-navy-deep: #0a4882;   /* Hover-Ziel: heller/gesättigter als Navy */
	--sh-navy-abyss: #0a2540;  /* dunkles Ende der Verläufe + Schattenfarbe */

	/* ---------- Textrampe (alle Werte gegen Weiß gemessen) ---------- */
	--sh-ink: #1f2d3d;         /* 13,99:1 — strong, Listen, Eingabetext */
	--sh-body: #3a4654;        /*  9,62:1 — Fließtext */
	--sh-muted: #566273;       /*  6,19:1 — Meta, Labels, Platzhalter, Leerzustand */

	/* Text auf Navy-Flächen */
	--sh-on-navy: #ffffff;
	--sh-on-navy-soft: rgba(255, 255, 255, .9);
	--sh-on-navy-quiet: rgba(255, 255, 255, .85);

	/* ---------- Flächen ---------- */
	--sh-surface: #f6f8fa;     /* getönte Sektionsfläche */
	--sh-surface-sunken: #e8edf2; /* Kartenplatzhalter, Map-Hintergrund */
	--sh-line: #e2e7ec;        /* die einzige Trennlinie */

	/* ---------- Funktional (nicht Marke) ---------- */
	--sh-map-pin: #d62828;     /* rote Marker: Lesbarkeit auf fremdem Kartenmaterial */

	/* ---------- Radien ---------- */
	--sh-r-btn: 4px;
	--sh-r-img: 6px;
	--sh-r-card: 10px;
	--sh-r-tile: 12px;
	--sh-r-card-strong: 14px;
	--sh-r-pill: 50px;

	/* ---------- Typografie ---------- */
	--sh-font-body: 'Open Sans', Helvetica, Arial, sans-serif;
	--sh-font-head: 'Montserrat', Helvetica, Arial, sans-serif;

	--sh-fs-display: clamp(2.1rem, 5.2vw, 3.6rem);
	--sh-fs-h2: clamp(1.6rem, 3.4vw, 2.4rem);
	--sh-fs-h3: 1.2rem;
	--sh-fs-body: 1.06rem;
	--sh-fs-kicker: .8rem;
	--sh-fs-stat: clamp(2.6rem, 6vw, 3.8rem);

	--sh-lh-display: 1.08;
	--sh-lh-heading: 1.2;
	--sh-lh-body: 1.75;
	--sh-ls-display: -.015em;
	--sh-ls-kicker: .16em;

	/* ---------- Layout ---------- */
	--sh-container: min(90%, 1080px);
	--sh-container-wide: min(92%, 1200px);
	--sh-measure: 760px;          /* Lesebreite Fließtext */
	--sh-section: clamp(3.5rem, 7vw, 5.5rem);
	--sh-section-tight: clamp(2.4rem, 5vw, 3.6rem);
	--sh-gap: 1.4rem;

	/* ---------- Motion: ein Easing, drei Dauern ---------- */
	--sh-ease: cubic-bezier(.22, 1, .36, 1);  /* ease-out-quart, kein Bounce */
	--sh-dur-fast: .2s;   /* Zustandswechsel */
	--sh-dur: .3s;        /* Karte, Lift */
	--sh-dur-slow: .6s;   /* Einzug */

	/* ---------- Elevation: nur als Antwort auf Hover/Fokus ---------- */
	--sh-lift: 0 16px 34px -16px rgba(22, 57, 93, .35);
	--sh-lift-strong: 0 26px 46px -22px rgba(10, 37, 64, .6);
	--sh-lift-badge: 0 4px 12px -4px rgba(10, 37, 64, .4);
	--sh-focus-ring: 0 0 0 4px rgba(22, 57, 93, .14);

	/* ---------- Verläufe: ein Winkel für Heroes (168°), einer für Medien (150°) ---------- */
	--sh-hero-overlay: linear-gradient(168deg, rgba(22, 57, 93, .78) 0%, rgba(10, 37, 64, .92) 100%);
	--sh-hero-overlay-soft: linear-gradient(168deg, rgba(22, 57, 93, .55) 0%, rgba(10, 37, 64, .92) 100%);
	--sh-media-overlay: linear-gradient(150deg, rgba(22, 57, 93, .5) 0%, rgba(10, 37, 64, .82) 100%);
	--sh-navy-gradient: linear-gradient(150deg, var(--sh-navy) 0%, var(--sh-navy-abyss) 100%);
}

/* ==================================================================
   Divi-Wrapper-Reset
   Neutralisiert Section/Row/Column-Padding, damit ein Modul randlos
   laufen kann. Vorher zweimal wortgleich in zwei Modulen.
   ================================================================== */
.et_pb_section:has(.sh-divi-reset) {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
.et_pb_row:has(.sh-divi-reset) {
	padding: 0 !important;
	margin-top: 0 !important;
	margin-bottom: 0 !important;
	width: 100% !important;
	max-width: 100% !important;
}
.et_pb_column:has(.sh-divi-reset) {
	padding: 0 !important;
	margin: 0 !important;
	width: 100% !important;
}
.et_pb_text:has(.sh-divi-reset),
.et_pb_text:has(.sh-divi-reset) .et_pb_text_inner {
	margin: 0 !important;
	padding: 0 !important;
}

/* ==================================================================
   Basis: Wurzelklasse jedes SH-Moduls
   ================================================================== */
.sh-scope {
	font-family: var(--sh-font-body);
	color: var(--sh-body);
}
.sh-scope *,
.sh-scope *::before,
.sh-scope *::after {
	box-sizing: border-box;
}

/* Sichtbarer Fokus auf allen interaktiven SH-Elementen (WCAG 2.1 AA). */
.sh-scope a:focus-visible,
.sh-scope button:focus-visible,
.sh-scope input:focus-visible,
.sh-scope select:focus-visible,
.sh-scope [tabindex]:focus-visible {
	outline: 3px solid var(--sh-navy);
	outline-offset: 3px;
	/* Kein border-radius hier: der Outline folgt dem Radius des Elements.
	   Ein eigener Wert würde Pill-Felder beim Fokussieren eckig machen. */
}

/* ---------- Container ---------- */
.sh-container { width: var(--sh-container); margin-inline: auto; }
.sh-container--wide { width: var(--sh-container-wide); }
.sh-container--measure { width: min(90%, var(--sh-measure)); }

/* ---------- Sektionsrhythmus ---------- */
.sh-section { padding-block: var(--sh-section); }
.sh-section--tight { padding-block: var(--sh-section-tight); }
.sh-section--surface { background: var(--sh-surface); }

/* ==================================================================
   Typografie-Bausteine
   ================================================================== */

/* Kicker: gehört auf Hero und CTA — NICHT über jede Sektion. */
.sh-kicker {
	display: inline-block;
	font-family: var(--sh-font-head);
	font-weight: 700;
	font-size: var(--sh-fs-kicker);
	letter-spacing: var(--sh-ls-kicker);
	text-transform: uppercase;
	color: var(--sh-navy);
	margin: 0 0 1rem;
}
.sh-kicker--on-navy { color: var(--sh-on-navy-quiet); }

.sh-display {
	font-family: var(--sh-font-body);
	font-weight: 800;
	font-size: var(--sh-fs-display);
	line-height: var(--sh-lh-display);
	letter-spacing: var(--sh-ls-display);
	text-wrap: balance;
	margin: 0;
}

.sh-h2 {
	font-family: var(--sh-font-head);
	font-weight: 800;
	font-size: var(--sh-fs-h2);
	line-height: var(--sh-lh-heading);
	color: var(--sh-navy);
	text-wrap: balance;
	margin: 0 0 1rem;
}

.sh-h3 {
	font-family: var(--sh-font-body);
	font-weight: 700;
	font-size: var(--sh-fs-h3);
	line-height: 1.35;
	color: var(--sh-navy);
	margin: 0 0 .5rem;
}

.sh-prose p,
.sh-prose li {
	font-size: var(--sh-fs-body);
	line-height: var(--sh-lh-body);
	color: var(--sh-body);
}
.sh-prose p { margin: 0 0 1.3rem; text-wrap: pretty; }
.sh-prose strong { color: var(--sh-ink); }
.sh-prose a {
	color: var(--sh-navy);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color var(--sh-dur-fast) ease;
}
.sh-prose a:hover { color: var(--sh-navy-deep); }
.sh-prose img { max-width: 100%; height: auto; border-radius: var(--sh-r-img); }

/* ==================================================================
   Button
   Löst .shl-btn und .sh-fusion-button-white zusammen (waren identisch).
   ================================================================== */
.sh-btn {
	display: inline-flex;
	align-items: center;
	gap: .6rem;
	font-family: var(--sh-font-body);
	font-weight: 700;
	font-size: .95rem;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: 1rem 2rem;
	border: 0;
	border-radius: var(--sh-r-btn);
	text-decoration: none;
	cursor: pointer;
	background: var(--sh-navy);
	color: var(--sh-on-navy);
	transition: transform var(--sh-dur-fast) var(--sh-ease),
	            box-shadow var(--sh-dur-fast) ease,
	            background-color var(--sh-dur-fast) ease;
}
.sh-btn svg { width: 1em; height: 1em; }

/* Heller Button auf dunklem Hero */
.sh-btn--light { background: #fff; color: var(--sh-navy); }

@media (hover: hover) {
	.sh-btn:hover { transform: translateY(-2px); box-shadow: var(--sh-lift); }
	.sh-btn--light:hover { box-shadow: 0 12px 26px -10px rgba(0, 0, 0, .5); }
}
@media (hover: none) {
	.sh-btn:active { transform: translateY(-1px); box-shadow: var(--sh-lift); }
}

/* ==================================================================
   Karte
   ================================================================== */
.sh-card {
	position: relative;
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--sh-line);
	border-radius: var(--sh-r-card);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform var(--sh-dur) var(--sh-ease),
	            box-shadow var(--sh-dur) ease,
	            border-color var(--sh-dur) ease;
}
.sh-card[hidden] { display: none !important; }  /* schlägt display:flex — sonst greift der Filter nicht */

/* Kräftigere Variante für das Verzeichnis (anklickbare Kachel) */
.sh-card--listing { border-width: 2px; border-radius: var(--sh-r-card-strong); }

/* Der Lift ist eine Antwort auf den Zeiger — es gibt ihn nur, wo es einen gibt. */
@media (hover: hover) {
	.sh-card:hover { transform: translateY(-4px); box-shadow: var(--sh-lift); }
	.sh-card--listing:hover {
		transform: translateY(-6px);
		box-shadow: var(--sh-lift-strong);
		border-color: var(--sh-navy);
	}
}

/* Auf Touch gäbe es sonst überhaupt keine Rückmeldung: dieselbe Geste,
   ausgelöst beim Antippen statt beim Überfahren. */
@media (hover: none) {
	.sh-card:active { transform: translateY(-2px); box-shadow: var(--sh-lift); }
	.sh-card--listing:active { border-color: var(--sh-navy); box-shadow: var(--sh-lift-strong); }
}

.sh-card__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--sh-navy-gradient);
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	justify-content: center;
}
.sh-card__media.has-img::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--sh-media-overlay);
}
.sh-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .5s var(--sh-ease);
}
.sh-card:hover .sh-card__media img { transform: scale(1.05); }

.sh-card__body {
	padding: 1.3rem 1.4rem 1.5rem;
	display: flex;
	flex-direction: column;
	gap: .6rem;
	flex: 1;
}
.sh-card__meta { font-size: .78rem; font-weight: 600; color: var(--sh-muted); }
.sh-card__title {
	font-family: var(--sh-font-body);
	font-weight: 700;
	font-size: 1.04rem;
	line-height: 1.35;
	color: var(--sh-navy);
	margin: 0;
	transition: color var(--sh-dur-fast) ease;
}
.sh-card:hover .sh-card__title { color: var(--sh-navy-deep); }

/* Badge auf dem Kartenbild */
.sh-card__badge {
	position: absolute;
	z-index: 1;
	left: 14px;
	bottom: 14px;
	background: #fff;
	color: var(--sh-navy);
	font-size: .68rem;
	font-weight: 800;
	letter-spacing: .06em;
	text-transform: uppercase;
	padding: .32rem .7rem;
	border-radius: var(--sh-r-pill);
	box-shadow: var(--sh-lift-badge);
}

/* Pfeil-Affordanz oben rechts */
.sh-card__go {
	position: absolute;
	z-index: 1;
	top: 12px;
	right: 12px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .16);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	backdrop-filter: blur(2px);
	transform: translateX(6px);
	opacity: 0;
	transition: opacity var(--sh-dur) ease,
	            transform var(--sh-dur) var(--sh-ease),
	            background-color var(--sh-dur) ease;
}
.sh-card__go svg { width: 18px; height: 18px; }
.sh-card:hover .sh-card__go { opacity: 1; transform: none; background: #fff; color: var(--sh-navy); }

/* Platzhalter, wenn kein Bild existiert — nie ein leeres Rechteck */
.sh-card__placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: rgba(255, 255, 255, .75);
	font-family: var(--sh-font-head);
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	font-size: .72rem;
}

/* ---------- Kartenraster ---------- */
.sh-grid { display: grid; gap: var(--sh-gap); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.sh-grid--wide { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
/* Verzeichnis: echte Breakpoints statt auto-fit, damit die Spaltenzahl vorhersagbar bleibt */
.sh-grid--directory { grid-template-columns: 1fr; gap: 1.5rem; }
@media (min-width: 560px)  { .sh-grid--directory { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 880px)  { .sh-grid--directory { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1140px) { .sh-grid--directory { grid-template-columns: repeat(4, 1fr); } }

/* ==================================================================
   Hero
   ================================================================== */
.sh-hero {
	position: relative;
	background-color: var(--sh-navy);
	background-size: cover;
	background-position: center;
	display: flex;
	align-items: center;
	min-height: clamp(440px, 72vh, 640px);
}
.sh-hero::before { content: ""; position: absolute; inset: 0; background: var(--sh-hero-overlay); }
.sh-hero--soft::before { background: var(--sh-hero-overlay-soft); }  /* fotogeführt: Bild darf durch */
.sh-hero--article {
	align-items: flex-end;
	min-height: clamp(300px, 48vh, 520px);
	/* dvh folgt der ein- und ausfahrenden Browserleiste auf Mobilgeräten.
	   Die vh-Zeile darüber bleibt als Fallback für ältere Browser stehen. */
	min-height: clamp(300px, 48dvh, 520px);
}

/* Querformat und flache Fenster.
   Ohne diese Regel gemessen: der Artikel-Hero belegt auf einem iPhone quer
   96 % der Viewporthöhe, auf Android quer 92 % — man sieht nichts als den Titel.
   Im Querformat ist die Breite reichlich und die Höhe knapp; eine reine
   vw-Skala sieht das nicht. Deshalb bemisst sich hier alles an der Höhe. */
@media (orientation: landscape) and (max-height: 520px) {
	.sh-hero--article { min-height: 0; }
	.sh-hero--article .sh-hero__inner { padding-block: clamp(1.3rem, 6vh, 2.4rem); }
}
.sh-hero__inner {
	position: relative;
	z-index: 1;
	width: var(--sh-container);
	margin-inline: auto;
	padding-block: clamp(3rem, 8vw, 5rem);
}
.sh-hero__inner > * { color: var(--sh-on-navy); }
.sh-hero__sub {
	color: var(--sh-on-navy-soft);
	font-size: clamp(1.05rem, 1.6vw, 1.25rem);
	line-height: 1.6;
	max-width: 54ch;
	margin: 0 0 2rem;
}

/* ==================================================================
   Marker-Formen
   ================================================================== */
.sh-icon-tile {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 52px;
	height: 52px;
	border-radius: var(--sh-r-tile);
	background: var(--sh-surface);
	color: var(--sh-navy);
	margin-bottom: 1.1rem;
}
.sh-icon-tile svg { width: 26px; height: 26px; }

.sh-step-n {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background: var(--sh-navy);
	color: #fff;
	font-family: var(--sh-font-body);
	font-weight: 800;
	font-size: 1.2rem;
	margin-bottom: 1rem;
}

.sh-chip {
	font-size: .66rem;
	font-weight: 700;
	letter-spacing: .02em;
	color: var(--sh-navy);
	background: var(--sh-surface);
	border: 1px solid var(--sh-line);
	border-radius: var(--sh-r-pill);
	padding: .15rem .5rem;
}

/* ==================================================================
   Formularfelder
   ================================================================== */
.sh-field {
	width: 100%;
	font-family: inherit;
	font-size: 1.02rem;
	color: var(--sh-ink);
	background: #fff;
	border: 2px solid var(--sh-line);
	border-radius: var(--sh-r-card);
	padding: 1rem 1.1rem;
	transition: border-color var(--sh-dur-fast) ease, box-shadow var(--sh-dur-fast) ease;
}
.sh-field--pill { border-radius: var(--sh-r-pill); }
.sh-field--with-icon { padding-left: 3.2rem; }
/* Platzhalter erfüllt 4,5:1 — nicht heller setzen. */
.sh-field::placeholder { color: var(--sh-muted); opacity: 1; }
.sh-field:focus {
	outline: none;
	border-color: var(--sh-navy);
	box-shadow: var(--sh-focus-ring);
}

/* Icon im Feld: Wrapper positioniert, SVG füllt ihn. */
.sh-field-icon {
	position: absolute;
	left: 18px;
	z-index: 1;
	width: 20px;
	height: 20px;
	color: var(--sh-muted);
	pointer-events: none;
	display: block;
}
.sh-field-icon svg { width: 100%; height: 100%; display: block; }

.sh-select {
	font-family: inherit;
	font-size: .95rem;
	font-weight: 600;
	color: var(--sh-ink);
	background: #fff;
	border: 2px solid var(--sh-line);
	border-radius: var(--sh-r-card);
	padding: .75rem 2.4rem .75rem 1rem;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%2316395d' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right .85rem center;
	transition: border-color var(--sh-dur-fast) ease, box-shadow var(--sh-dur-fast) ease;
}
.sh-select:focus { outline: none; border-color: var(--sh-navy); box-shadow: var(--sh-focus-ring); }

.sh-label {
	font-weight: 700;
	font-size: .8rem;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--sh-muted);
}

/* ==================================================================
   Reduced Motion — eine Stelle statt drei
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
	.sh-scope *,
	.sh-scope *::before,
	.sh-scope *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
		scroll-behavior: auto !important;
	}
	.sh-card:hover,
	.sh-card--listing:hover,
	.sh-btn:hover { transform: none; }
}
