/*
 * FF Thiede Seitenkopf – gestaltet Blocksys Seitenkopf Typ 2 (.hero-section[data-type=type-2]).
 * Markup von Blocksy: .hero-section > figure > .ct-media-container > img  und  > header.entry-header > h1.page-title …
 * Vom Plugin ergänzt: .ffsk-kicker (vor dem Titel), .ffsk-meta, .ffsk-jump, .ffsk-date (nach dem Titel).
 * Entwurf: addons/startseite-entwurf/header-unterseiten.html
 */

.hero-section.ffsk[data-type="type-2"] {
	--ffsk-navy: #132036;
	--ffsk-ink: #102136;
	--ffsk-red: #ec1c24;
	--ffsk-red-2: #c41c22;
	--ffsk-soft: #c3ccd6;
	--ffsk-paper: #f6f4f0;
	--ffsk-display: Poppins, var(--theme-font-family, system-ui), sans-serif;
	--ffsk-cut: 40px;          /* Höhe der schrägen Unterkante */
	--ffsk-media: min(52%, calc(50% + 60px)); /* Breite des Bildes rechts */
	--ffsk-slant: 24%;         /* Schräge der linken Bildkante (Anteil der Bildbreite) */

	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--ffsk-navy);
	color: var(--ffsk-soft);
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--ffsk-cut)), 0 100%);
	/* Blocksy-Variablen des Kopfs */
	--min-height: 0px;
	--container-padding: 44px 0 calc(var(--ffsk-cut) + 40px);
	--alignment: left;
	--vertical-alignment: center;
	--theme-heading-color: #fff;
	--theme-text-color: var(--ffsk-soft);
}

/* Punkteraster oben links */
.hero-section.ffsk[data-type="type-2"]::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
	background-image: radial-gradient(rgba(255, 255, 255, .1) 1.2px, transparent 1.7px);
	background-size: 24px 24px;
	-webkit-mask-image: radial-gradient(60% 80% at 8% 25%, #000, transparent 70%);
	mask-image: radial-gradient(60% 80% at 8% 25%, #000, transparent 70%);
}

/* Skyline steht auf der Schräge: skewY um den Winkel der Unterkante, Gebäude bleiben senkrecht.
   --ffsk-x0 = linker Rand als Anteil der Breite; dort liegt die Kante um cut · x0 höher als ganz links. */
.hero-section.ffsk[data-type="type-2"]::after {
	--ffsk-x0: 0;
	content: "";
	position: absolute;
	z-index: 0;
	pointer-events: none;
	left: calc(var(--ffsk-x0) * 100%);
	bottom: calc(var(--ffsk-cut) * var(--ffsk-x0) - 1px);
	width: 52%;
	aspect-ratio: 1298 / 350;
	background: url("thiede-skyline.svg") left bottom / 100% auto no-repeat;
	opacity: .07;
	transform-origin: 0 100%;
	transform: skewY(calc(-1 * atan2(var(--ffsk-cut), 100vw)));
}

/* ---------------------------------------------------------------- Bild rechts mit schräger Kante */
.hero-section.ffsk[data-type="type-2"] > figure {
	inset: 0 0 0 auto;
	width: var(--ffsk-media);
	overflow: visible;
	background: #0b1626;
	clip-path: polygon(var(--ffsk-slant) 0, 100% 0, 100% 100%, 0 100%);
}
.hero-section.ffsk[data-type="type-2"] > figure .ct-media-container img {
	width: 100%;
	object-fit: cover;
	object-position: var(--ffsk-focus, 50% 50%); /* Bildausschnitt je Seite (Kasten im Editor) */
	transform-origin: var(--ffsk-focus, 50% 50%);
	animation: ffsk-kb 14s ease-out both;
}
@keyframes ffsk-kb { from { transform: scale(1.08); } to { transform: scale(1); } }
.hero-section.ffsk[data-type="type-2"] > figure > .ct-media-container::after {
	background:
		/* oben dunkel, damit die (transparente) Kopfleiste lesbar bleibt */
		linear-gradient(180deg, rgba(11, 22, 38, .88) 0, rgba(11, 22, 38, .6) calc(var(--header-height, 80px) * .9), rgba(11, 22, 38, 0) calc(var(--header-height, 80px) + 70px)),
		linear-gradient(90deg, rgba(19, 32, 54, .55) 0, rgba(19, 32, 54, 0) 40%) !important;
	opacity: 1 !important;
}
/* roter Streifen entlang der Schräge */
.hero-section.ffsk[data-type="type-2"] > figure::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background: var(--ffsk-red);
	clip-path: polygon(var(--ffsk-slant) 0, calc(var(--ffsk-slant) + 6px) 0, 6px 100%, 0 100%);
}

/* ---------------------------------------------------------------- Text links */
.hero-section.ffsk[data-type="type-2"] > .entry-header {
	width: var(--theme-container-width, calc(100% - 48px));
	max-width: var(--theme-normal-container-max-width, 1290px);
	margin-inline: auto;
	align-items: flex-start;
	text-align: left;
}
.hero-section.ffsk[data-type="type-2"] > .entry-header > * {
	max-width: min(640px, 52%);
	margin-inline: 0;
}
.hero-section.ffsk.ffsk--noimg[data-type="type-2"] > .entry-header > * { max-width: 780px; }

/* Blocksys eigene Metadaten und Brotkrumen ersetzt der Kopf */
.hero-section.ffsk[data-type="type-2"] .entry-meta,
.hero-section.ffsk[data-type="type-2"] .ct-breadcrumbs,
.hero-section.ffsk[data-type="type-2"] .ct-title-label { display: none; }

.hero-section.ffsk[data-type="type-2"] .ffsk-kicker {
	order: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin: 0;
	font: 600 12px/1 var(--ffsk-display);
	letter-spacing: .16em;
	text-transform: uppercase;
	color: #ff8a8f;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-kicker::before {
	content: "";
	width: 22px;
	height: 3px;
	border-radius: 2px;
	background: var(--ffsk-red);
}
.hero-section.ffsk[data-type="type-2"] .ffsk-code {
	font: 700 12px/1 ui-monospace, "SF Mono", Menlo, monospace;
	letter-spacing: 0;
	padding: 6px 8px;
	border-radius: 6px;
	background: rgba(236, 28, 36, .18);
	color: #ff8a8f;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-code--th { background: rgba(91, 143, 214, .2); color: #9cc0f0; }

.hero-section.ffsk[data-type="type-2"] .page-title {
	order: 2;
	margin: 12px 0 0;
	color: #fff;
	font-family: var(--ffsk-display);
	font-size: clamp(30px, 3.2vw, 46px);
	font-weight: 800;
	line-height: 1.08;
	letter-spacing: -.035em;
	text-wrap: balance;
	overflow-wrap: break-word;
}
.hero-section.ffsk[data-type="type-2"] .page-description {
	order: 3;
	margin: 12px 0 0;
	max-width: min(560px, 52%);
	font-size: 16.5px;
	line-height: 1.55;
	color: var(--ffsk-soft);
}
.hero-section.ffsk[data-type="type-2"] .page-description p { margin: 0; }
/* Eigener Untertitel (Kasten „Seitenkopf“) ersetzt Blocksys Beschreibung/Auszug */
.hero-section.ffsk.ffsk--sub[data-type="type-2"] .page-description:not(.ffsk-sub) { display: none; }

/* Infofelder (Kapseln) */
.hero-section.ffsk[data-type="type-2"] .ffsk-meta {
	order: 4;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 16px 0 0;
	padding: 0;
	list-style: none;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-meta li {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin: 0;
	padding: 7px 11px;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .1);
	background: rgba(255, 255, 255, .08);
	color: #fff;
	font-size: 13.5px;
	font-weight: 500;
	line-height: 1;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-meta svg { flex: none; width: 13px; height: 13px; color: #ff8a8f; }

/* Sprungmarken */
.hero-section.ffsk[data-type="type-2"] .ffsk-jump {
	order: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-top: 18px;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-jump a {
	padding: 8px 12px;
	border-radius: 999px;
	box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, .22);
	color: var(--ffsk-soft);
	font: 600 12.5px/1 var(--ffsk-display);
	text-decoration: none;
	transition: background .15s, color .15s, box-shadow .15s;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-jump a:hover,
.hero-section.ffsk[data-type="type-2"] .ffsk-jump a:focus-visible { background: #fff; color: var(--ffsk-ink); box-shadow: none; }

/* Datumskarte (Veranstaltungen) */
.hero-section.ffsk[data-type="type-2"] .ffsk-date {
	position: absolute;
	right: clamp(0px, 3vw, 60px);
	bottom: calc(var(--ffsk-cut) + 22px);
	z-index: 3;
	max-width: none;
	min-width: 96px;
	padding: 10px 16px;
	border-radius: 14px;
	background: #fff;
	box-shadow: 0 24px 40px -20px rgba(0, 0, 0, .6);
	text-align: center;
}
.hero-section.ffsk[data-type="type-2"] .ffsk-date small { display: block; font: 600 11px/1 var(--ffsk-display); letter-spacing: .16em; text-transform: uppercase; color: var(--ffsk-red-2); }
.hero-section.ffsk[data-type="type-2"] .ffsk-date b { display: block; margin: 4px 0 2px; font: 800 40px/1 var(--ffsk-display); letter-spacing: -.05em; color: var(--ffsk-ink); }
.hero-section.ffsk[data-type="type-2"] .ffsk-date span { font: 600 12px/1.3 var(--ffsk-display); color: var(--ffsk-ink); }
.hero-section.ffsk[data-type="type-2"] .ffsk-date i { display: block; margin-top: 6px; padding: 4px 6px; border-radius: 6px; background: var(--ffsk-paper); color: #3f4d5c; font: 500 11px/1.3 ui-monospace, "SF Mono", Menlo, monospace; font-style: normal; }

/* Ohne Bild: Skyline größer und weiter rechts */
.hero-section.ffsk.ffsk--noimg[data-type="type-2"]::after { --ffsk-x0: .42; width: 60%; opacity: .09; }

/* ---------------------------------------------------------------- Hauptmenü: roter Strich unter dem aktuellen Bereich */
.ct-header [data-id="menu"] > ul > li.ffsk-current > .ct-menu-link { position: relative; }
.ct-header [data-id="menu"] > ul > li.ffsk-current > .ct-menu-link::after {
	content: "";
	position: absolute;
	left: 50%;
	bottom: calc(50% - 1.1em);
	width: 22px;
	height: 3px;
	margin-left: -11px;
	border-radius: 2px;
	background: #ec1c24;
}

/* ---------------------------------------------------------------- Tablet und Handy: Bild oben, Text darunter */
@media (max-width: 999.98px) {
	.hero-section.ffsk[data-type="type-2"] {
		--ffsk-cut: 26px;
		--container-padding: 14px 0 calc(var(--ffsk-cut) + 26px);
		display: flex;
		flex-direction: column;
		padding-top: 0; /* Bild liegt oben unter der (transparenten) Leiste */
	}
	.hero-section.ffsk.ffsk--noimg[data-type="type-2"] { padding-top: calc(var(--has-transparent-header, 0) * var(--header-height, 0px)); }
	.hero-section.ffsk[data-type="type-2"] > figure {
		position: relative;
		inset: auto;
		width: auto;
		/* Bild reicht unter die (transparente) Kopfleiste, darunter bleibt genug Motiv sichtbar */
		height: calc(var(--has-transparent-header, 0) * var(--header-height, 0px) + clamp(130px, 36vw, 220px));
		clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - 22px));
	}
	.hero-section.ffsk[data-type="type-2"] > figure::after { display: none; }
	.hero-section.ffsk[data-type="type-2"] > figure > .ct-media-container::after {
		background:
			linear-gradient(180deg, rgba(11, 22, 38, .92) 0, rgba(11, 22, 38, .7) calc(var(--header-height, 70px) * .9), rgba(11, 22, 38, 0) calc(var(--header-height, 70px) + 50px)),
			linear-gradient(0deg, rgba(19, 32, 54, .4) 0, rgba(19, 32, 54, 0) 40%) !important;
	}
	.hero-section.ffsk[data-type="type-2"] > .entry-header > *,
	.hero-section.ffsk[data-type="type-2"] .page-description { max-width: none; }
	.hero-section.ffsk.ffsk--noimg[data-type="type-2"] { --container-padding: 40px 0 calc(var(--ffsk-cut) + 26px); }
	.hero-section.ffsk[data-type="type-2"]::after,
	.hero-section.ffsk.ffsk--noimg[data-type="type-2"]::after { --ffsk-x0: 0; width: 100%; opacity: .08; }
	.hero-section.ffsk[data-type="type-2"] .page-title {
		min-width: 0;
		margin-top: 10px;
		font-size: clamp(26px, 7.6vw, 34px);
		overflow-wrap: anywhere; /* lange Wörter (z. B. Fahrzeugnamen) brechen statt überzustehen */
		hyphens: auto;
	}
	.hero-section.ffsk[data-type="type-2"] .page-description { margin-top: 8px; font-size: 15px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-meta { gap: 5px; margin-top: 12px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-meta li { gap: 6px; padding: 6px 9px; font-size: 12.5px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-meta svg { width: 12px; height: 12px; }
	.hero-section.ffsk.ffsk--date[data-type="type-2"] .ffsk-kicker { padding-right: 84px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-date {
		top: -52px;
		bottom: auto;
		right: 0;
		min-width: 70px;
		padding: 8px 12px 7px;
		border-radius: 12px;
	}
	.hero-section.ffsk[data-type="type-2"] .ffsk-date small { font-size: 9.5px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-date b { margin: 3px 0 0; font-size: 28px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-date span { font-size: 11px; }
	.hero-section.ffsk[data-type="type-2"] .ffsk-date i { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	.hero-section.ffsk[data-type="type-2"] > figure .ct-media-container img { animation: none; }
}
