/**
 * corelaw — Format „Kompakt“ (LinkedIn-Karussells, inc/kompakt.php).
 *
 * Geladen auf Kompakt-Beiträgen und auf „Aktuelles“. Die Folien sind 4:5
 * (1080 × 1350). Ihr Grau steht als --ks-folie hier, damit die Fläche vor dem
 * Laden des Bildes nicht weiß aufblitzt.
 */

:root {
	--ks-folie: #bcbebd;
}

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

.kompakt-head {
	padding: clamp(150px, 15vw, 200px) 0 clamp(40px, 5vw, 64px);
}

.kompakt-head h1 {
	max-width: 40ch;
	font-size: clamp(24px, 3vw, 38px);
	line-height: 1.35;
}

.kompakt-head .ph-lead {
	margin-top: 22px;
	font-size: 14px;
	letter-spacing: .08em;
	color: var(--grey-2);
}

/* Autorenzeile: Porträt, Name, Rolle — führt zum Profil auf /anwaelte/ */
.kompakt-autor {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	margin-top: 30px;
}

.kompakt-autor img {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	object-fit: cover;
	object-position: center 18%;
	background: var(--paper-2);
}

.kompakt-autor > span {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ka-name {
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: .16em;
	text-transform: uppercase;
	color: var(--ink);
	transition: color .3s var(--ease);
}

.ka-rolle {
	font-size: 13px;
	line-height: 1.5;
	color: var(--grey-2);
}

.kompakt-autor:hover .ka-name {
	color: var(--navy);
}

.kompakt-head .kompakt-autor + .breadcrumb {
	margin-top: 30px;
}

/* ------------------------------------------------------- Beitrag */

.section.kompakt-beitrag {
	padding-top: clamp(40px, 6vw, 84px);
}

.kompakt-raster {
	display: grid;
	grid-template-columns: minmax(0, 560px) minmax(0, 1fr);
	gap: clamp(40px, 6vw, 100px);
	align-items: start;
}

.kompakt-viewer {
	position: sticky;
	top: 110px;
}

.kompakt-text {
	padding-top: 6px;
}

.kompakt-artikel {
	max-width: 62ch;
	margin: 24px 0 0;
}

.kompakt-linkedin {
	margin-top: 6px;
}

@media (max-width: 900px) {
	.kompakt-raster {
		grid-template-columns: minmax(0, 1fr);
	}

	.kompakt-viewer {
		position: static;
		width: 100%;
		max-width: 560px;
		margin: 0 auto;
	}
}

/* ------------------------------------------------------- Viewer */

.karussell {
	margin: 0;
}

.ks-buehne {
	position: relative;
}

.ks-spur {
	display: flex;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
	background: var(--ks-folie);
	box-shadow: 0 30px 60px -30px rgba(10, 10, 10, .35);
}

.ks-spur::-webkit-scrollbar {
	display: none;
}

.ks-spur:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 4px;
}

.ks-folie {
	flex: 0 0 100%;
	aspect-ratio: 4 / 5;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	container-type: inline-size;
}

.ks-bild {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: var(--ks-folie);
}

/* Pfeile — erst sichtbar, wenn das Skript läuft (hidden wird dann entfernt) */
.ks-pfeil {
	position: absolute;
	top: 50%;
	z-index: 2;
	width: 46px;
	height: 46px;
	margin-top: -23px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .94);
	color: var(--ink);
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(10, 10, 10, .18);
	transition: background .3s var(--ease), color .3s var(--ease), opacity .3s var(--ease);
}

.ks-pfeil:hover {
	background: var(--navy);
	color: #fff;
}

.ks-pfeil:focus-visible {
	outline: 2px solid var(--navy);
	outline-offset: 3px;
}

.ks-pfeil:disabled {
	opacity: 0;
	pointer-events: none;
}

.ks-zurueck { left: 14px; }
.ks-weiter  { right: 14px; }

/* Neben dem Viewer ist Platz: Pfeile halb außerhalb, damit sie keinen Folientext verdecken */
@media (min-width: 901px) {
	.ks-zurueck { left: -23px; }
	.ks-weiter  { right: -23px; }
}

/* Touch-Geräte wischen — dort stehen die Pfeile nur im Weg */
@media (hover: none) and (pointer: coarse) {
	.ks-pfeil { display: none; }
}

@media (max-width: 620px) {
	.ks-pfeil {
		width: 38px;
		height: 38px;
		margin-top: -19px;
		font-size: 15px;
	}

	.ks-zurueck { left: 8px; }
	.ks-weiter  { right: 8px; }
}

/* Leiste: Zähler · Fortschritt · Großansicht */
.ks-leiste {
	display: flex;
	align-items: center;
	gap: 18px;
	margin-top: 18px;
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 11px;
	letter-spacing: .2em;
	color: var(--grey-2);
}

.ks-zaehler {
	min-width: 4.2em;
	font-variant-numeric: tabular-nums;
}

.ks-balken {
	position: relative;
	flex: 1;
	height: 1px;
	background: var(--line);
}

.ks-balken span {
	position: absolute;
	left: 0;
	top: -1px;
	height: 3px;
	background: var(--navy);
	transition: width .45s var(--ease);
}

.ks-gross {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: border-color .3s var(--ease), color .3s var(--ease);
}

.ks-gross:hover,
.ks-gross:focus-visible {
	border-color: var(--navy);
	color: var(--navy);
}

.ks-gross[hidden],
.ks-pfeil[hidden] {
	display: none;
}

/* Schlussfolie der Kanzlei */
.ks-ende {
	background: var(--navy);
	color: #fff;
}

.ks-ende-innen {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 9cqi 8.5cqi;
}

.ks-ende-logo {
	width: 30cqi;
	max-width: 170px;
	height: auto;
	filter: brightness(0) invert(1);
	margin-bottom: auto;
}

.ks-ende-h {
	margin: 0 0 4cqi;
	font-family: var(--f-head);
	font-weight: 300;
	font-size: clamp(19px, 6cqi, 32px);
	line-height: 1.32;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #fff;
}

.ks-ende-t {
	margin: 0 0 7cqi;
	font-size: clamp(14px, 3.3cqi, 17px);
	line-height: 1.75;
	color: rgba(255, 255, 255, .86);
}

.ks-ende-cta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 26px;
}

.ks-ende-link {
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 11px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: #fff;
	border-bottom: 1px solid rgba(255, 255, 255, .4);
	padding-bottom: 3px;
	transition: border-color .3s var(--ease);
}

.ks-ende-link:hover {
	border-color: #fff;
}

/* Großansicht: Overlay, Folie so groß, wie das Fenster es zulässt */
html.ks-offen,
html.ks-offen body {
	overflow: hidden;
}

/* Der Viewer sitzt in einer sticky-Spalte, die einen eigenen Stapelkontext
   bildet — ohne das läge die Großansicht unter Kopfzeile und Textspalte. */
html.ks-offen .kompakt-viewer {
	z-index: 100000;
}

.karussell.ist-gross {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: #0b0b0b;
}

.ist-gross .ks-buehne,
.ist-gross .ks-leiste {
	width: min(100%, calc((100svh - 100px) * .8));
}

.ist-gross .ks-spur {
	box-shadow: none;
}

.ist-gross .ks-leiste {
	color: rgba(255, 255, 255, .7);
}

.ist-gross .ks-balken {
	background: rgba(255, 255, 255, .2);
}

.ist-gross .ks-balken span {
	background: #fff;
}

.ist-gross .ks-gross {
	border-color: rgba(255, 255, 255, .35);
	color: #fff;
}

/* --------------------------------------------- Alle Folien zum Nachlesen */

.ks-text {
	margin-top: clamp(36px, 4vw, 52px);
	border-top: 1px solid var(--line);
	border-bottom: 1px solid var(--line);
	max-width: 62ch;
}

.ks-text summary {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 20px;
	padding: 22px 0;
	list-style: none;
	cursor: pointer;
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 12px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--ink);
	transition: color .3s var(--ease);
}

.ks-text summary::-webkit-details-marker {
	display: none;
}

.ks-text summary::after {
	content: "+";
	font-size: 20px;
	font-weight: 300;
	line-height: 1;
	color: var(--navy);
	transition: transform .3s var(--ease);
}

.ks-text[open] summary::after {
	transform: rotate(45deg);
}

.ks-text summary:hover {
	color: var(--navy);
}

.ks-text-liste {
	list-style: none;
	counter-reset: folie;
	padding: 0 0 10px;
}

.ks-text-liste li {
	counter-increment: folie;
	padding: 22px 0;
	border-top: 1px solid var(--line);
	font-size: 15.5px;
	line-height: 1.78;
}

.ks-text-liste li::before {
	content: "Folie " counter(folie);
	display: block;
	margin-bottom: 8px;
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 10.5px;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: var(--navy);
}

.ks-text-h {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: 600;
	line-height: 1.45;
	letter-spacing: .01em;
	text-transform: none;
	color: var(--ink);
}

.ks-text-liste p {
	margin: 0 0 12px;
}

.ks-text-liste strong {
	color: var(--ink);
	font-weight: 600;
}

/* ------------------------------------------- Reihe auf „Aktuelles“ */

.section.kompakt-reihe {
	padding-top: clamp(10px, 3vw, 40px);
}

.kompakt-kopf {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 20px clamp(30px, 5vw, 80px);
	align-items: end;
	margin-bottom: clamp(30px, 3.4vw, 46px);
}

.kompakt-kopf .lead {
	margin: 0;
}

.kompakt-liste {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(22px, 2.6vw, 38px);
}

.kompakt-karte {
	display: block;
}

.kk-bild {
	position: relative;
	aspect-ratio: 4 / 5;
	background: var(--ks-folie);
	/* angedeuteter Folienstapel */
	box-shadow: 7px 7px 0 0 var(--paper-2), 7px 7px 0 1px var(--line);
	margin-right: 8px;
}

.kk-bild {
	transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}

.kk-bild img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Hover: die oberste Folie hebt sich vom Stapel */
.kompakt-karte:hover .kk-bild {
	transform: translate(-3px, -3px);
	box-shadow: 10px 10px 0 0 var(--paper-2), 10px 10px 0 1px var(--line);
}

@media (prefers-reduced-motion: reduce) {
	.kk-bild,
	.ks-balken span {
		transition: none;
	}
}

.kk-folien {
	position: absolute;
	top: 12px;
	right: 12px;
	padding: 5px 10px;
	background: rgba(10, 10, 10, .78);
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 10px;
	letter-spacing: .18em;
	text-transform: uppercase;
	color: #fff;
}

.kk-cat {
	margin-top: 28px;
	font-family: var(--f-head);
	font-weight: 600;
	font-size: 11px;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--navy);
}

.kk-titel {
	margin: 12px 0 10px;
	font-size: 16px;
	line-height: 1.5;
	letter-spacing: .06em;
}

.kk-datum {
	font-size: 12px;
	letter-spacing: .08em;
	color: var(--grey-2);
}

/* Auszug + Link nur in der großen Einzelkarte */
.kk-auszug,
.kk-mehr {
	display: none;
}

/* Erst ein Karussell veröffentlicht: statt einer kleinen Karte in einer
   leeren Viererreihe ein großer Teaser — Folie links, Text rechts. */
.kompakt-liste--einzeln {
	display: block;
}

.kompakt-liste--einzeln .kompakt-karte {
	display: grid;
	grid-template-columns: minmax(0, 380px) minmax(0, 1fr);
	gap: clamp(36px, 6vw, 96px);
	align-items: center;
}

.kompakt-liste--einzeln .kk-cat {
	margin-top: 0;
}

.kompakt-liste--einzeln .kk-titel {
	margin: 18px 0 14px;
	font-size: clamp(20px, 2.2vw, 28px);
	line-height: 1.4;
	max-width: 26ch;
}

.kompakt-liste--einzeln .kk-auszug {
	display: block;
	max-width: 52ch;
	margin: 26px 0 30px;
	font-size: 16px;
	line-height: 1.9;
	color: var(--grey);
}

.kompakt-liste--einzeln .kk-mehr {
	display: inline-flex;
}

.kompakt-liste--einzeln .kompakt-karte:hover .kk-mehr {
	color: var(--navy);
	gap: 18px;
}

.kompakt-liste--einzeln .kompakt-karte:hover .kk-mehr .ln {
	width: 44px;
	background: var(--navy);
}

@media (max-width: 760px) {
	.kompakt-liste--einzeln .kompakt-karte {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.kompakt-liste--einzeln .kk-bild {
		max-width: 340px;
	}

	.kompakt-liste--einzeln .kk-cat {
		margin-top: 28px;
	}

	.kompakt-liste--einzeln .kk-auszug {
		margin: 18px 0 22px;
	}
}

@media (max-width: 1000px) {
	.kompakt-kopf {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Tablet/Handy: waagerecht wischen statt Raster */
	.kompakt-liste:not(.kompakt-liste--einzeln) {
		grid-template-columns: none;
		grid-auto-flow: column;
		grid-auto-columns: 40%;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		padding-bottom: 12px;
		margin-right: calc(var(--pad) * -1);
		padding-right: var(--pad);
	}

	.kompakt-liste::-webkit-scrollbar {
		display: none;
	}

	.kompakt-karte {
		scroll-snap-align: start;
	}
}

@media (max-width: 620px) {
	.kompakt-liste:not(.kompakt-liste--einzeln) {
		grid-auto-columns: 78%;
	}
}
