/*
 * SP Startseite – Block „Highlights (Klingen-Akkordeon)“, Stil „Sammelkarte“.
 * Referenz: docs/prototyp-highlights.html, Layout A, Stil Sammelkarte (#a-desk-4-karte, #a-tab-4-karte, #a-mob-4-karte).
 * Tokens und Bausteine (Textbox, Kiste, Glas-Pille, Badge) kommen aus spst-basis.css.
 * Desktop > 1000px: Akkordeon 480px hoch. Tablet 700–1000px: 420px. Handy < 700px: Wisch-Slider.
 */

.spst-hl {
	--spst-hl-hoehe: 480px;
	--spst-hl-dauer: .7s;
	--spst-hl-kurve: cubic-bezier(.2, .8, .2, 1);
}

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

.spst-hl__kopf { margin: 0 0 26px; }
.spst-hl__kicker {
	display: block;
	font-size: 13px;
	letter-spacing: .26em;
}
.spst-hl .spst-hl__titel {
	margin: 2px 0 0;
	font-size: 44px;
}

/* ---------- Akkordeon ---------- */

.spst-hl__liste {
	display: flex;
	gap: 10px;
	height: var(--spst-hl-hoehe);
	margin: 0;
	padding: 0;
	list-style: none;
}
.spst-hl__panel {
	position: relative;
	flex: 1 1 0;
	min-width: 0;
	margin: 0;
	transition: flex-grow var(--spst-hl-dauer) var(--spst-hl-kurve);
}
.spst-hl__panel.is-offen { flex-grow: 4.4; }

.spst-hl .spst-hl__link {
	position: absolute;
	inset: 0;
	display: block;
	overflow: hidden;
	color: #fff;
	text-decoration: none;
	background: #0a1628;
	border: var(--spst-rand-dezent);
	border-radius: var(--spst-radius-rahmen);
	transition: border-color .4s, box-shadow .4s;
}
/* Offen: großer Rahmen mit Schein */
.spst-hl__panel.is-offen .spst-hl__link {
	border: 7px solid var(--spst-rahmen);
	box-shadow: var(--spst-schein);
}

/* Bild: geschlossen gedimmt und entsättigt, offen in voller Farbe, Hover-Zoom nur offen */
.spst-hl__bild,
.spst-hl__verlauf {
	position: absolute;
	inset: 0;
}
.spst-hl__img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	filter: saturate(.35) brightness(.5);
	transition: filter .6s, transform .8s ease;
}
.spst-hl__panel:hover .spst-hl__img { filter: saturate(.6) brightness(.62); }
.spst-hl__panel.is-offen .spst-hl__img { filter: none; }
.spst-hl__panel.is-offen:hover .spst-hl__img { transform: scale(1.04); }

/* Nur ein leichter Verlauf von unten, kein blaues Overlay */
.spst-hl__verlauf {
	z-index: 1;
	pointer-events: none;
	background: linear-gradient(0deg, rgba(16, 17, 41, .55), rgba(16, 17, 41, 0) 45%);
}

.spst-hl__badge {
	position: absolute;
	top: 16px;
	left: 18px;
	z-index: 3;
}

/* Senkrechter Titel im geschlossenen Panel (von unten nach oben) */
.spst-hl .spst-hl__senkrecht {
	position: absolute;
	left: 50%;
	bottom: 26px;
	z-index: 2;
	font-size: 40px;
	white-space: nowrap;
	color: #fff;
	writing-mode: vertical-rl;
	transform: translateX(-50%) rotate(180deg);
	transition: opacity .3s;
}
.spst-hl__panel.is-offen .spst-hl__senkrecht { opacity: 0; }

/* Inhalt: Textbox links bündig am Panelrand, Kennzahl-Kiste rechts bündig */
.spst-hl__inhalt {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 22px;
	z-index: 2;
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .25s, transform .25s;
	pointer-events: none;
}
.spst-hl__panel.is-offen .spst-hl__inhalt {
	opacity: 1;
	transform: none;
	transition: opacity .5s .35s, transform .6s .35s var(--spst-hl-kurve);
	pointer-events: auto;
}
/* Geschlossene Panels: Inhalt nur unsichtbar (opacity), nicht visibility/display. Er bleibt so der
   Name des Links für Screenreader, der senkrechte Titel ist aria-hidden. Das Panel schneidet ihn ab. */

.spst-hl__textbox {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex: 0 1 400px;
	min-width: 0;
	padding: 12px 20px 14px;
	border-radius: 0 var(--spst-radius-kiste) var(--spst-radius-kiste) 0;
}
.spst-hl__kachel-kicker { font-size: 13px; }
.spst-hl .spst-hl__name {
	margin-top: 2px;
	font-size: 34px;
	color: #fff;
}
.spst-hl__text {
	margin-top: 6px;
	font-size: 16px;
	line-height: 1.3;
}
.spst-hl .spst-hl__knopf {
	margin-top: 12px;
	padding: .55em 1.4em;
	font-size: .95rem;
	border-color: rgba(255, 255, 255, .5);
}
.spst-hl__pfeil {
	display: inline-block;
	font-style: normal;
	transition: transform .25s;
}
.spst-hl__link:hover .spst-hl__pfeil { transform: translateX(3px); }
/* Ganzes Panel ist der Link: Hover am Panel hebt die Pille hervor */
.spst-hl__link:hover .spst-hl__knopf,
.spst-hl__link:focus-visible .spst-hl__knopf { background: #1d4fa6; border-color: rgba(255, 255, 255, .7); }

.spst-hl__zahl {
	flex: 0 0 auto;
	gap: 18px;
	margin-bottom: 18px;
	padding: 6px 20px 7px;
}
.spst-hl__zahl .spst-kiste__label { font-size: 20px; }
.spst-hl__zahl .spst-kiste__wert { font-size: 30px; }

/* Fokusring innen, damit der Schein ihn nicht verdeckt */
.spst-hl .spst-hl__link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -3px;
}

.spst-hl__punkte { display: none; }

/* ---------- Tablet ---------- */

/* Container Queries stylen nur Kinder des Containers, nicht .spst-hl selbst: Höhe deshalb an der Liste */
@container spst-block (max-width: 1000px) {
	.spst-hl__liste { height: 420px; }
	.spst-hl .spst-hl__senkrecht { font-size: 32px; }
	.spst-hl__textbox { flex-basis: 360px; }
	.spst-hl .spst-hl__name { font-size: 28px; }
	.spst-hl__text { font-size: 15px; }
	.spst-hl__zahl .spst-kiste__label { font-size: 17px; }
	.spst-hl__zahl .spst-kiste__wert { font-size: 26px; }
}

/* ---------- Handy: Wisch-Slider statt Akkordeon ---------- */

@container spst-block (max-width: 699.98px) {
	.spst-hl .spst-hl__titel { font-size: 34px; }
	.spst-hl__liste {
		display: grid;
		grid-auto-flow: column;
		grid-auto-columns: 84%;
		gap: 12px;
		height: auto;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		overscroll-behavior-x: contain;
	}
	.spst-hl__liste::-webkit-scrollbar { display: none; }
	.spst-hl__panel { scroll-snap-align: start; }
	.spst-hl .spst-hl__link,
	.spst-hl__panel.is-offen .spst-hl__link {
		position: relative;
		inset: auto;
		display: flex;
		flex-direction: column;
		height: 100%;
		border: 5px solid var(--spst-rahmen);
		border-radius: var(--spst-radius-kiste);
		box-shadow: none;
	}
	.spst-hl__bild {
		position: relative;
		inset: auto;
		aspect-ratio: 4 / 3.4;
		overflow: hidden;
	}
	.spst-hl__img,
	.spst-hl__panel:hover .spst-hl__img,
	.spst-hl__panel.is-offen:hover .spst-hl__img {
		filter: none;
		transform: none;
	}
	.spst-hl__verlauf,
	.spst-hl .spst-hl__senkrecht { display: none; }
	.spst-hl__inhalt,
	.spst-hl__panel.is-offen .spst-hl__inhalt {
		position: static;
		flex: 1;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		opacity: 1;
		transform: none;
		pointer-events: auto;
	}
	/* Textbox unter dem Foto: massiv */
	.spst-hl__textbox {
		flex: 1 0 auto;
		padding: 14px 18px 16px;
		background: var(--spst-kiste);
		-webkit-backdrop-filter: none;
		backdrop-filter: none;
		border-radius: 0;
	}
	.spst-hl .spst-hl__name { font-size: 30px; }
	.spst-hl__text { font-size: 16px; }
	.spst-hl__zahl {
		align-self: flex-end;
		margin: 12px 0 14px;
	}
	.spst-hl__punkte {
		display: flex;
		justify-content: center;
		gap: 8px;
		margin-top: 14px;
	}
	.spst-hl__punkt {
		width: 8px;
		height: 8px;
		background: #2a3c5c;
		border-radius: 50%;
		transition: width .3s, background-color .3s;
	}
	.spst-hl__punkt.is-aktiv {
		width: 22px;
		background: var(--spst-kiste);
		border-radius: 4px;
	}
}

/* ---------- Bewegung reduzieren ---------- */

@media (prefers-reduced-motion: reduce) {
	.spst-hl__panel.is-offen:hover .spst-hl__img { transform: none; }
}

/* ---------- Editor ---------- */

.spst-hl-hinweis {
	margin: 0 0 12px;
	padding: 10px 14px;
	font-size: 14px;
	color: #1e1e1e;
	background: #fcf9e8;
	border-left: 4px solid #dba617;
}
