/* EHNES Themen-Block – Anreißer (Split/Karten) + Volltext-Lightbox.
   CI: Roboto, Blau/Ink, eckig (border-radius 0). Siehe DESIGN.md.

   Farb-Variablen werden vom Widget auf {{WRAPPER}} gesetzt und hier nur als
   Fallback verwendet — deshalb bewusst KEINE Deklaration auf .thm selbst
   (eine eigene Deklaration würde den geerbten Wert vom Wrapper überstimmen).
   Ausnahme: .thm--invert soll überstimmen (Invertier-Regel DESIGN.md §4).

   Variablen: --thm-eyebrow --thm-title --thm-text --thm-accent
              --thm-accent-hover --thm-card-bg --thm-card-border --thm-card-pad
*/

.thm {
	--thm-ease: cubic-bezier(.4, 0, .2, 1);
	--thm-hex: var(--ws-hex, polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%));
	--thm-hex-ratio: var(--ws-hex-ratio, 0.866);
	font-family: "Roboto", system-ui, sans-serif;
	width: 100%;
	max-width: 1180px;
	margin-left: auto;
	margin-right: auto;
	box-sizing: border-box;
}
.thm *, .thm *::before, .thm *::after { box-sizing: border-box; }

/* ---------------------------------------------------------------
   Textbausteine (in beiden Layouts identisch)
   --------------------------------------------------------------- */
.thm__eyebrow {
	display: block;
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: var(--thm-eyebrow, #0B55A0);
}
.thm__title {
	margin: 0 0 14px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: var(--thm-title, #1C2530);
}
.thm__teaser {
	margin: 0;
	font-size: 18px;
	font-weight: 300;
	line-height: 1.65;
	color: var(--thm-text, #5B6770);
}

/* Stichpunkte mit Hexagon-Marker (Marken-Motiv, sparsam eingesetzt) */
.thm__list {
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}
.thm__list li {
	position: relative;
	padding-left: 24px;
	font-size: 17px;
	font-weight: 300;
	line-height: 1.55;
	color: var(--thm-text, #5B6770);
}
.thm__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 11px;
	height: auto;
	aspect-ratio: var(--thm-hex-ratio, 0.866);
	background: var(--thm-accent, #0B55A0);
	clip-path: var(--thm-hex);
}

/* ---------------------------------------------------------------
   Bild / Platzhalter
   --------------------------------------------------------------- */
.thm__media { position: relative; min-width: 0; }
.thm__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
}

/* ---------------------------------------------------------------
   Auslöser „Mehr erfahren"
   --------------------------------------------------------------- */
.thm__more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 22px;
	padding: 2px 0;
	border: 0;
	background: none;
	font-family: inherit;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .02em;
	color: var(--thm-accent, #0B55A0);
	text-decoration: none;
	cursor: pointer;
	transition: color .18s var(--thm-ease);
}
.thm__more:hover,
.thm__more:focus-visible { color: var(--thm-accent-hover, #08427B); }
.thm__arrow {
	display: inline-block;
	transition: transform .18s var(--thm-ease);
}
.thm__more:hover .thm__arrow,
.thm__more:focus-visible .thm__arrow { transform: translateX(3px); }
/* Sichtbarer Fokus bleibt erhalten (nie unterdrücken). */
.thm__more:focus-visible {
	outline: 2px solid var(--thm-accent, #0B55A0);
	outline-offset: 3px;
}

/* ---------------------------------------------------------------
   Layout „split" – Zickzack
   --------------------------------------------------------------- */
.thm__blocks { display: grid; gap: 72px; }
.thm__block {
	display: grid;
	grid-template-columns: 1.05fr 0.95fr;
	gap: 48px;
	align-items: center;
}
/* Bild links: Reihenfolge im Grid drehen, DOM-Reihenfolge bleibt Text → Bild.
   Die Spaltenbreiten müssen dabei mitwandern, sonst landet das Bild in der
   breiten Textspalte und die Bilder springen von Block zu Block in der Größe. */
.thm__block--media-left { grid-template-columns: 0.95fr 1.05fr; }
.thm__block--media-left > .thm__media { order: -1; }
.thm__block > .thm__body { min-width: 0; }
.thm__block .thm__title { font-size: clamp(1.5rem, 1.1rem + 1.1vw, 2.05rem); }
.thm__block > .thm__media img { aspect-ratio: 4 / 3; }

/* Ohne Bildbereich: der Text bekommt die ganze Spalte, wird aber nicht
   endlos breit — lange Zeilen sind schlechter lesbar als eine ruhige Spalte. */
.thm--nomedia .thm__block,
.thm--nomedia .thm__block--media-left { grid-template-columns: minmax(0, 1fr); }
.thm--nomedia .thm__blocks { gap: 48px; }
.thm--nomedia .thm__block > .thm__body { max-width: 78ch; }

/* ---------------------------------------------------------------
   Layout „cards" – Raster
   --------------------------------------------------------------- */
.thm__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px;
}
.thm__card {
	display: flex;
	flex-direction: column;
	padding: var(--thm-card-pad, 28px);
	background: var(--thm-card-bg, #FFFFFF);
	border: 1px solid var(--thm-card-border, #E5E9ED);
	border-radius: 0;
	transition: border-color .18s var(--thm-ease), transform .18s var(--thm-ease);
}
.thm__card:hover {
	border-color: var(--thm-accent, #0B55A0);
	transform: translateY(-2px);
}
/* Bild randlos oben in der Karte */
.thm__card > .thm__media {
	margin:
		calc(var(--thm-card-pad, 28px) * -1)
		calc(var(--thm-card-pad, 28px) * -1)
		22px;
}
/* Flacher als im Zickzack (16:9 statt 4:3): in einer Karte steht das Bild über
   dem Text, ein hohes Format schiebt Titel und Anreißer sonst unter die Falz. */
.thm__card > .thm__media img,
.thm__card > .thm__media .ehp-ph { aspect-ratio: 16 / 9; }
.thm__card > .thm__body { flex: 1 1 auto; min-width: 0; }
.thm__card .thm__title { margin-bottom: 10px; font-size: 1.28rem; }
.thm__card .thm__teaser { font-size: 17px; }
.thm__card .thm__list { margin-top: 16px; }
.thm__card .thm__list li { font-size: 16px; }
/* Auslöser sitzt bündig am Kartenfuß, egal wie lang der Text ist. */
.thm__card .thm__more { margin-top: auto; padding-top: 22px; align-self: flex-start; }

/* ---------------------------------------------------------------
   Invertierung (blauer/dunkler Abschnitt) – überstimmt bewusst
   --------------------------------------------------------------- */
.thm--invert {
	--thm-eyebrow: #FFFFFF;
	--thm-title: #FFFFFF;
	--thm-text: rgba(255, 255, 255, .88);
	--thm-accent: #FFFFFF;
	--thm-accent-hover: rgba(255, 255, 255, .72);
	--thm-card-bg: transparent;
	--thm-card-border: rgba(255, 255, 255, .28);
}
.thm--invert .thm__card:hover { border-color: rgba(255, 255, 255, .72); }

/* ---------------------------------------------------------------
   Lightbox
   Die Box wird vom Script an <body> gehängt (sonst bricht position:fixed
   in transformierten Elementor-Containern). Deshalb hier vollständig
   eigenständig gestylt — ohne die --thm-Variablen der Seite.
   --------------------------------------------------------------- */
.thm-box {
	--thmb-ease: cubic-bezier(.4, 0, .2, 1);
	position: fixed;
	inset: 0;
	z-index: 10000; /* über dem Sticky-Header (z-index 100) */
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
	font-family: "Roboto", system-ui, sans-serif;
	box-sizing: border-box;
}
.thm-box *, .thm-box *::before, .thm-box *::after { box-sizing: border-box; }
.thm-box.is-open { display: flex; }

.thm-box__backdrop {
	position: absolute;
	inset: 0;
	background: var(--ws-glass-bg, rgba(248, 250, 252, 0.40));
	-webkit-backdrop-filter: var(--ws-glass-blur, blur(24px) saturate(180%));
	        backdrop-filter: var(--ws-glass-blur, blur(24px) saturate(180%));
	animation: thm-fade .35s var(--thmb-ease);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
	.thm-box__backdrop { background: var(--ws-glass-solid, rgba(244, 247, 250, 0.80)); }
}

.thm-box__panel {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: var(--thmb-w, 820px);
	max-height: 85vh;
	background: #FFFFFF;
	border-radius: 0;
	box-shadow: 0 30px 80px rgba(8, 31, 56, .32);
	animation: thm-rise .35s var(--thmb-ease);
}

.thm-box__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 40px;
	height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #FFFFFF;
	color: #5B6770;
	font-family: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: color .18s var(--thmb-ease), background .18s var(--thmb-ease);
}
.thm-box__close:hover { color: #0B55A0; }
.thm-box__close:focus-visible {
	outline: 2px solid #0B55A0;
	outline-offset: 2px;
}

.thm-box__media { flex: none; overflow: hidden; }
.thm-box__media img {
	display: block;
	width: 100%;
	height: 190px;
	object-fit: cover;
}

.thm-box__head {
	flex: none;
	padding: 34px 44px 0;
}
.thm-box__eyebrow {
	display: block;
	margin: 0 0 10px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #0B55A0;
}
.thm-box__title {
	margin: 0;
	font-size: clamp(1.4rem, 1.1rem + .9vw, 1.9rem);
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -.01em;
	color: #1C2530;
}

.thm-box__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	padding: 22px 44px 34px;
	overscroll-behavior: contain;
}
.thm-box__content:focus-visible {
	outline: 2px solid #0B55A0;
	outline-offset: -2px;
}
/* Ohne Kopf (kein Eyebrow, kein Titel) folgt der Text direkt auf den
   Schließen-Knopf — dann oben Platz lassen, damit er nichts überdeckt. */
.thm-box__close + .thm-box__content { padding-top: 56px; }
.thm-box__content > *:first-child { margin-top: 0; }
.thm-box__content > *:last-child { margin-bottom: 0; }

.thm-box__content p {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 300;
	line-height: 1.65;
	color: #5B6770;
}
.thm-box__content p.thm-box__intro,
.thm-box__content p.thm-box__lead {
	font-size: 19px;
	font-weight: 400;
	line-height: 1.55;
	color: #1C2530;
}
.thm-box__h {
	margin: 28px 0 10px;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.3;
	letter-spacing: .01em;
	color: #1C2530;
}
.thm-box__list {
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 10px;
}
.thm-box__list li {
	position: relative;
	padding-left: 24px;
	font-size: 17px;
	font-weight: 300;
	line-height: 1.55;
	color: #5B6770;
}
.thm-box__list li::before {
	content: "";
	position: absolute;
	left: 0;
	top: .5em;
	width: 11px;
	height: auto;
	aspect-ratio: var(--ws-hex-ratio, 0.866);
	background: #0B55A0;
	clip-path: var(--ws-hex, polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%));
}
.thm-box__content p.thm-box__note {
	margin: 26px 0 0;
	padding-top: 16px;
	border-top: 1px solid #E5E9ED;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: #5B6770;
}

@keyframes thm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes thm-rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------------------------------------------------------------
   Responsiv
   --------------------------------------------------------------- */
@media (max-width: 1023px) {
	.thm__blocks { gap: 48px; }
	.thm__block,
	.thm__block--media-left { grid-template-columns: 1fr; gap: 28px; }
	/* einspaltig steht das Bild immer oben */
	.thm__block > .thm__media,
	.thm__block--media-left > .thm__media { order: -1; }
	/* Sicherheitsnetz für das Karten-Raster: greift nur, wenn die von Elementor
	   erzeugte Spalten-CSS fehlt (deren Selektoren sind spezifischer). */
	.thm__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
	.thm__teaser { font-size: 17px; }
	.thm__grid { grid-template-columns: minmax(0, 1fr); }
	.thm-box { padding: 12px; }
	.thm-box__panel { max-height: 92vh; }
	.thm-box__media img { height: 150px; }
	.thm-box__head { padding: 28px 22px 0; }
	.thm-box__content { padding: 18px 22px 28px; }
	.thm-box__content p { font-size: 17px; }
	.thm-box__content p.thm-box__intro,
	.thm-box__content p.thm-box__lead { font-size: 18px; }
}

@media (prefers-reduced-motion: reduce) {
	.thm-box__backdrop,
	.thm-box__panel { animation: none; }
	.thm__card,
	.thm__more,
	.thm__arrow,
	.thm-box__close { transition: none; }
	.thm__more:hover .thm__arrow,
	.thm__more:focus-visible .thm__arrow { transform: none; }
	.thm__card:hover { transform: none; }
}
