/*
 * P3 Struktur – Hero / Header-Varianten.
 * Alle Werte aus den Theme-Variablen (Design-Tokens), jeweils mit Ersatzwert.
 * Lokale Steuer-Variablen beginnen mit --_.
 */

.p3s-hero {
	--_max: var(--container-max, 1240px);
	--_gutter: clamp(20px, 4vw, 48px);
	--_space: var(--section-space, clamp(56px, 8vw, 112px));
	--_radius: var(--radius-lg, var(--base-radius, 16px));
	--_ease: var(--motion-ease, cubic-bezier(.2, .8, .2, 1));
	--_bg: var(--color-bg-1, #fff);
	--_fg: var(--body-color, #1d2330);
	--_head: var(--color-heading, var(--_fg));
	--_muted: color-mix(in srgb, var(--_fg) 72%, transparent);
	--_line: color-mix(in srgb, var(--_fg) 14%, transparent);
	--_mark: var(--color-secondary, var(--color-primary, #2f43c9));
	--_eyebrow: var(--color-accent, var(--color-primary, #2f43c9));
	--_shape: var(--color-secondary, var(--color-primary, #2f43c9));
	position: relative;
	isolation: isolate;
	background: var(--_bg);
	color: var(--_fg);
	overflow: hidden;
}
.p3s-hero *, .p3s-hero *::before, .p3s-hero *::after { box-sizing: border-box; }

/* ---------- Flächen ---------- */
.p3s-hero--s-light     { --_bg: var(--color-bg-1, #fff); }
.p3s-hero--s-surface   { --_bg: var(--color-surface-1, #f5f6f8); }
.p3s-hero--s-surface-2 { --_bg: var(--color-surface-2, color-mix(in srgb, var(--color-primary, #2f43c9) 7%, var(--color-bg-1, #fff))); }
.p3s-hero--s-primary   { --_bg: var(--color-primary, #2f43c9); --_fg: var(--color-primary-contrast, #fff); }
.p3s-hero--s-secondary { --_bg: var(--color-secondary, #2f43c9); --_fg: var(--color-secondary-contrast, #fff); --_mark: var(--color-accent, rgba(255,255,255,.3)); }
.p3s-hero--s-accent    { --_bg: var(--color-accent, #2f43c9); --_fg: var(--color-accent-contrast, #fff); --_eyebrow: var(--_fg); }
.p3s-hero--s-dark      { --_bg: var(--color-dark, #141a2e); --_fg: var(--color-dark-contrast, #fff); }
.p3s-hero--on-dark     { --_head: var(--_fg); --_muted: color-mix(in srgb, var(--_fg) 82%, transparent); --_line: color-mix(in srgb, var(--_fg) 25%, transparent); }
.p3s-hero--s-primary, .p3s-hero--s-dark { --_eyebrow: var(--color-secondary, var(--_fg)); }
.p3s-hero--shape-accent  { --_shape: var(--color-accent, var(--color-primary, #2f43c9)); }
.p3s-hero--shape-primary { --_shape: var(--color-primary, #2f43c9); }

/* ---------- Grundbausteine ---------- */
.p3s-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: calc(var(--_max) + 2 * var(--_gutter));
	margin: 0 auto;
	padding: var(--_space) var(--_gutter);
}
.p3s-hero__text { max-width: 44rem; }
.p3s-hero--align-center .p3s-hero__text { margin-inline: auto; text-align: center; }
.p3s-hero--align-center .p3s-hero__actions { justify-content: center; }

.p3s-hero__eyebrow {
	display: inline-flex; align-items: center; gap: .75em;
	margin: 0 0 var(--base-clearance-sm, 16px);
	font-size: var(--base-font-sm, .875rem); font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: var(--_eyebrow);
}
.p3s-hero__eyebrow::before { content: ""; width: 2.2em; height: 2px; background: currentColor; }
.p3s-hero--align-center .p3s-hero__eyebrow::before { display: none; }

.p3s-hero .p3s-hero__title {
	margin: 0 0 var(--base-clearance-md, 24px);
	font-family: var(--font-heading, inherit);
	line-height: 1.04 !important;
	letter-spacing: -.02em;
	color: var(--_head);
	text-wrap: balance;
}
.p3s-hero--t-xxl .p3s-hero__title { font-size: clamp(2.6rem, 1rem + 6vw, 6rem) !important; }
.p3s-hero--t-xl  .p3s-hero__title { font-size: clamp(2.2rem, 1rem + 4vw, 4.4rem) !important; }
.p3s-hero--t-l   .p3s-hero__title { font-size: var(--base-heading-h1, 2.6rem) !important; }
.p3s-hero--t-m   .p3s-hero__title { font-size: var(--base-heading-h2, 2rem) !important; }
.p3s-hero__mark {
	padding: 0 .04em;
	margin: 0 -.04em;
	background: linear-gradient(transparent 62%, color-mix(in srgb, var(--_mark) 55%, transparent) 62% 92%, transparent 92%);
	-webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.p3s-hero--on-dark .p3s-hero__mark { background: linear-gradient(transparent 66%, color-mix(in srgb, var(--_fg) 26%, transparent) 66% 90%, transparent 90%); }
.p3s-hero--s-secondary .p3s-hero__mark { color: inherit; text-decoration: underline; text-decoration-thickness: .08em; text-underline-offset: .12em; }

.p3s-hero__lead {
	max-width: 38em;
	margin: 0;
	font-size: var(--base-font-lg, 1.2rem);
	line-height: 1.55;
	color: var(--_muted);
	text-wrap: pretty;
}
.p3s-hero--align-center .p3s-hero__lead { margin-inline: auto; }
.p3s-hero__actions { display: flex; flex-wrap: wrap; gap: var(--base-clearance-sm, 14px); margin-top: var(--base-clearance-lg, 36px); }
.p3s-hero__btn { margin: 0 !important; }

/* Buttons auf dunklen Flächen und Bildern */
.p3s-hero--on-dark .p3s-hero__btn.button-filled > a {
	background: var(--_fg) !important; border-color: var(--_fg) !important; color: var(--_bg-ink, var(--color-primary, #1d2330)) !important;
}
.p3s-hero--on-dark .p3s-hero__btn.button-outline > a { background: transparent !important; border-color: currentColor !important; color: var(--_fg) !important; }
.p3s-hero--on-dark .p3s-hero__btn.button-outline > a:hover { background: color-mix(in srgb, var(--_fg) 14%, transparent) !important; }

/* Brotkrumen */
.p3s-hero__crumbs {
	display: flex; flex-wrap: wrap; align-items: center; gap: .5em;
	margin: 0 0 var(--base-clearance-md, 24px);
	font-size: var(--base-font-sm, .875rem);
	color: var(--_muted);
}
.p3s-hero--align-center .p3s-hero__crumbs { justify-content: center; }
.p3s-hero__crumbs a { color: inherit; text-decoration: none; border-bottom: 1px solid var(--_line); }
.p3s-hero__crumbs a:hover { color: var(--_head); border-color: currentColor; }
.p3s-hero__crumbs span[aria-current], .p3s-hero__crumbs .breadcrumb_last { color: var(--_head); }
.p3s-hero__sep { opacity: .5; }

/* Bilder */
.p3s-hero__img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--_focus, center); }

/* ==========================================================
   BÜhne (cover) + Bildband (band)
   ========================================================== */
.p3s-hero--cover, .p3s-hero--band {
	--_bg: var(--color-dark, #141a2e);
	--_fg: #fff;
	--_bg-ink: var(--color-dark, #141a2e);
	display: flex; align-items: flex-end;
}
.p3s-hero--cover.p3s-hero--align-center, .p3s-hero--band.p3s-hero--align-center { align-items: center; }
.p3s-hero--h-full   { min-height: 100svh; }
.p3s-hero--h-large  { min-height: 82svh; }
.p3s-hero--h-medium { min-height: 62svh; }
.p3s-hero--h-small  { min-height: clamp(320px, 42svh, 460px); }
.p3s-hero--band.p3s-hero--h-full, .p3s-hero--band.p3s-hero--h-large { min-height: clamp(380px, 56svh, 620px); }
.p3s-hero--band.p3s-hero--h-medium { min-height: clamp(320px, 44svh, 520px); }
.p3s-hero--band.p3s-hero--h-small  { min-height: clamp(260px, 32svh, 380px); }

.p3s-hero__media { position: absolute; inset: 0; z-index: 0; }
.p3s-hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--_focus, center); }
.p3s-hero--cover .p3s-hero__media::after, .p3s-hero--band .p3s-hero__media::after {
	content: ""; position: absolute; inset: 0;
	background:
		linear-gradient(to top, color-mix(in srgb, var(--color-dark, #0d1222) calc(var(--_overlay, .45) * 100%), transparent) 0%, transparent 70%),
		linear-gradient(100deg, color-mix(in srgb, var(--color-dark, #0d1222) calc(var(--_overlay, .45) * 110%), transparent) 0%, transparent 72%);
}
.p3s-hero--align-center .p3s-hero__media::after {
	background: color-mix(in srgb, var(--color-dark, #0d1222) calc(var(--_overlay, .45) * 100%), transparent);
}
.p3s-hero--no-image.p3s-hero--cover, .p3s-hero--no-image.p3s-hero--band {
	background:
		radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--color-secondary, var(--color-primary, #2f43c9)) 55%, transparent), transparent 60%),
		var(--color-primary, #2f43c9);
}
.p3s-hero--cover .p3s-hero__inner { padding-bottom: clamp(48px, 9vh, 120px); }
.p3s-hero--band .p3s-hero__inner { padding-block: clamp(36px, 6vw, 72px); }
.p3s-hero--cover .p3s-hero__lead, .p3s-hero--band .p3s-hero__lead { color: rgba(255, 255, 255, .88); }
.p3s-hero--cover .p3s-hero__eyebrow, .p3s-hero--band .p3s-hero__eyebrow { color: #fff; }
.p3s-hero--cover .p3s-hero__eyebrow::before, .p3s-hero--band .p3s-hero__eyebrow::before { background: currentColor; opacity: .7; }
.p3s-hero--cover .p3s-hero__crumbs, .p3s-hero--band .p3s-hero__crumbs { color: rgba(255, 255, 255, .8); }
.p3s-hero--under-nav .p3s-hero__inner { padding-top: calc(var(--p3s-nav-h, 96px) + clamp(32px, 6vw, 72px)); }

/* Scroll-Hinweis */
.p3s-hero__scroll {
	position: absolute; z-index: 3; left: 50%; bottom: 22px; width: 26px; height: 42px; margin-left: -13px;
	border: 2px solid rgba(255, 255, 255, .7); border-radius: 999px;
}
.p3s-hero__scroll::after {
	content: ""; position: absolute; left: 50%; top: 8px; width: 4px; height: 8px; margin-left: -2px;
	border-radius: 2px; background: #fff; animation: p3s-scroll 1.8s var(--_ease) infinite;
}
@keyframes p3s-scroll { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* ==========================================================
   Geteilt (split) + Bogen (arch)
   ========================================================== */
.p3s-hero--split .p3s-hero__inner, .p3s-hero--arch .p3s-hero__inner {
	display: grid; grid-template-columns: 1fr; gap: clamp(36px, 5vw, 80px); align-items: center;
}
@media (min-width: 992px) {
	.p3s-hero--split .p3s-hero__inner { grid-template-columns: 1.08fr .92fr; }
	.p3s-hero--arch .p3s-hero__inner { grid-template-columns: 1.2fr .8fr; }
}
.p3s-hero--split .p3s-hero__media, .p3s-hero--arch .p3s-hero__media { position: relative; }
.p3s-hero__frame { position: relative; z-index: 1; overflow: hidden; }
.p3s-hero--split .p3s-hero__frame { aspect-ratio: 4 / 5; border-radius: var(--_radius); box-shadow: var(--shadow-lg, 0 30px 60px -30px rgba(0,0,0,.35)); }
.p3s-hero--split .p3s-hero__media::before {
	content: ""; position: absolute; z-index: 0; inset: 0; transform: translate(22px, 22px);
	border: 2px solid var(--_shape); border-radius: var(--_radius);
}
.p3s-hero--split .p3s-hero__media::after {
	content: ""; position: absolute; z-index: 2; left: -18px; top: 12%; width: 36px; height: 36%;
	background: var(--_shape); border-radius: 999px;
}
.p3s-hero--arch .p3s-hero__frame { aspect-ratio: 4 / 5; border-radius: 999px 999px var(--_radius) var(--_radius); box-shadow: var(--shadow-lg, 0 30px 60px -30px rgba(0,0,0,.35)); }
.p3s-hero--arch .p3s-hero__media::before {
	content: ""; position: absolute; z-index: 0; right: -12%; top: -6%; width: 58%; aspect-ratio: 1; border-radius: 50%; background: var(--_shape);
}
.p3s-hero--arch .p3s-hero__media::after {
	content: ""; position: absolute; z-index: 2; left: -8%; bottom: 10%; width: 22%; aspect-ratio: 1; border-radius: 50%;
	border: 2px solid var(--_shape); background: var(--_bg);
}
.p3s-hero--shape-none .p3s-hero__media::before, .p3s-hero--shape-none .p3s-hero__media::after { display: none; }
@media (max-width: 991px) {
	.p3s-hero--split .p3s-hero__media, .p3s-hero--arch .p3s-hero__media { max-width: 520px; width: 88%; margin-inline: auto; }
}

/* ==========================================================
   Typografisch (editorial)
   ========================================================== */
.p3s-hero--editorial .p3s-hero__inner { padding-bottom: clamp(36px, 5vw, 64px); }
.p3s-hero--editorial .p3s-hero__text { max-width: none; }
.p3s-hero--editorial .p3s-hero__title { max-width: 14ch; }
.p3s-hero--editorial.p3s-hero--align-center .p3s-hero__title { margin-inline: auto; }
@media (min-width: 992px) {
	.p3s-hero--editorial.p3s-hero--align-left .p3s-hero__text { display: grid; grid-template-columns: 1fr minmax(0, 26rem); column-gap: clamp(32px, 6vw, 96px); align-items: end; }
	.p3s-hero--editorial.p3s-hero--align-left .p3s-hero__text > * { grid-column: 1 / -1; }
	.p3s-hero--editorial.p3s-hero--align-left .p3s-hero__lead { grid-column: 2; grid-row: span 1; margin-top: -.5em; }
	.p3s-hero--editorial.p3s-hero--align-left .p3s-hero__actions { grid-column: 2; }
	.p3s-hero--editorial.p3s-hero--align-left .p3s-hero__title { grid-column: 1; max-width: 12ch; margin-bottom: 0; }
}
.p3s-hero--editorial .p3s-hero__media {
	position: relative; z-index: 1;
	width: calc(100% - 2 * var(--_gutter)); max-width: calc(var(--_max) + 160px); margin: 0 auto;
	aspect-ratio: 21 / 8; overflow: hidden; border-radius: var(--_radius) var(--_radius) 0 0;
}
@media (max-width: 767px) { .p3s-hero--editorial .p3s-hero__media { aspect-ratio: 4 / 3; } }

/* ==========================================================
   Titelleiste (bar)
   ========================================================== */
.p3s-hero--bar .p3s-hero__inner { padding-block: clamp(36px, 6vw, 80px) clamp(32px, 5vw, 64px); }
.p3s-hero--bar .p3s-hero__title { margin-bottom: 0; }
.p3s-hero--bar .p3s-hero__title::after {
	content: ""; display: block; width: 64px; height: 4px; margin-top: .45em;
	background: var(--color-secondary, var(--color-primary, #2f43c9)); border-radius: 2px;
}
.p3s-hero--bar.p3s-hero--align-center .p3s-hero__title::after { margin-inline: auto; }
.p3s-hero--bar .p3s-hero__lead { margin-top: var(--base-clearance-md, 24px); }
.p3s-hero--bar::after {
	content: ""; position: absolute; z-index: 0; right: -6vw; bottom: -40%; width: 38vw; max-width: 520px; aspect-ratio: 1; border-radius: 50%;
	border: 2px solid var(--_line); pointer-events: none;
}

/* ==========================================================
   Animationen
   ========================================================== */
@media (prefers-reduced-motion: no-preference) {
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero__text > * { animation: p3s-rise .9s var(--_ease) both; }
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero__text > :nth-child(2) { animation-delay: .08s; }
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero__text > :nth-child(3) { animation-delay: .16s; }
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero__text > :nth-child(4) { animation-delay: .24s; }
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero__text > :nth-child(5) { animation-delay: .32s; }
	.p3s-hero:not(.p3s-hero--anim-none) .p3s-hero--split .p3s-hero__media,
	.p3s-hero--split:not(.p3s-hero--anim-none) .p3s-hero__media,
	.p3s-hero--arch:not(.p3s-hero--anim-none) .p3s-hero__media { animation: p3s-fade 1.1s .15s var(--_ease) both; }
	.p3s-hero--anim-zoom .p3s-hero__img { animation: p3s-zoom 9s var(--_ease) both; }
	.p3s-hero--anim-reveal .p3s-hero__frame, .p3s-hero--anim-reveal.p3s-hero--editorial .p3s-hero__media,
	.p3s-hero--anim-reveal.p3s-hero--cover .p3s-hero__media, .p3s-hero--anim-reveal.p3s-hero--band .p3s-hero__media { animation: p3s-reveal 1.2s .1s var(--_ease) both; }
}
@keyframes p3s-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes p3s-fade { from { opacity: 0; transform: translateY(24px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes p3s-zoom { from { transform: scale(1.1); } to { transform: scale(1); } }
@keyframes p3s-reveal { from { clip-path: inset(0 0 100% 0); } to { clip-path: inset(0 0 0 0); } }

/* Theme: Abstand oberhalb des Inhalts entfernen, wenn ein Header da ist */
.has-p3s-hero #p3s-after-hero { height: 0; }