/* =========================================================================
 * Pasani Hero Slider – Frontend
 * ========================================================================= */

.phs {
	/* Full-bleed: randlos ueber die volle Fensterbreite, egal wie breit der
	   Eltern-Container ist. Funktioniert in boxed- wie in full-width-Layouts. */
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
	background-color: var(--phs-active-bg, #eef1ee);
	transition: background-color 0.6s ease;
	outline: none;
}

/* Flush zum (sticky) Menue: den Deko-Abstand von .main-wrapper (Basis
   padding-top:180px, gilt auf allen Breiten) entfernen, sobald ein Hero-Slider
   auf der Seite ist. Der Header .pmm-navbar ist sticky, braucht also keine
   Freihaltung. Opt-out per [hero_slider flush="none"]. Body-Klasse kommt aus
   phs_body_class() im Plugin. */
body.has-phs-flush-top .main-wrapper {
	padding-top: 0;
}

/* Der sticky Navbar wirft einen Schatten (0 4px 20px), der weich auf den
   Slider-Anfang faellt und wie ein kleiner Abstand wirkt. Auf Flush-Seiten
   entfernen, damit der Slider wirklich nahtlos ans Menue anschliesst. */
body.has-phs-flush-top .pmm-navbar {
	box-shadow: none;
}

/* Der [home_video]-Hero setzt in seinem Inline-Style mobil margin-top:-60px (Deko
   aus der Zeit, als er das erste Element war). Steht ein Hero-Slider darueber,
   zieht sich home_video 60px in die Slider-Bedienleiste -> Overlap. Auf Seiten
   mit Slider neutralisieren. Hoehere Spezifitaet (0-2-0) schlaegt die Theme-Regel. */
@media (max-width: 767px) {
	body.has-phs-slider .home-video-banner {
		margin-top: 0;
	}
}

/* --- Viewport & Slides (Crossfade) -------------------------------------- */
.phs__viewport {
	/* Grid-Stacking: alle Slides liegen im selben Cell (grid-area 1/1). Der
	   Viewport ist dadurch immer so hoch wie der HOECHSTE Slide - kein JS-Hoehen-
	   management, keine Hoehen-Animation und damit kein Ueberlappen der
	   Bedienleiste / naechsten Sektion beim Slide-Wechsel. */
	display: grid;
	min-height: clamp(400px, 44vw, 600px);
}

.phs__slide {
	grid-area: 1 / 1;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--phs-bg);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.6s ease, visibility 0s linear 0.6s;
}

.phs__slide.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.6s ease;
	z-index: 2;
}

.phs__inner {
	display: flex;
	align-items: center;
	gap: clamp(24px, 4vw, 72px);
	width: 100%;
	max-width: 1440px;
	min-height: clamp(400px, 44vw, 600px);
	padding: clamp(36px, 5vw, 72px) clamp(20px, 5vw, 72px);
	box-sizing: border-box;
}

.phs__slide--left .phs__inner {
	flex-direction: row-reverse;
}

.phs__content {
	flex: 1 1 48%;
	max-width: 620px;
	/* min-width:0 erlaubt dem Flex-Item, unter seine Inhaltsbreite zu schrumpfen
	   (sonst kann eine lange Headline die Spalte aufblaehen -> Overflow). */
	min-width: 0;
	/* Inhalt durchgaengig linksbuendig - sonst zentriert die Theme-Regel
	   h2{text-align:center} nur die Headline und der Slide wirkt uneinheitlich. */
	text-align: left;
}

.phs__media {
	flex: 1 1 52%;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 0;
}

.phs__img {
	display: block;
	max-width: 100%;
	width: auto;
	height: auto;
	max-height: clamp(300px, 40vw, 560px);
	object-fit: contain;
}

/* --- Textfarben je nach Schema ------------------------------------------ */
.phs__slide[data-scheme="dark"] {
	color: #1a1a1a;
}
.phs__slide[data-scheme="light"] {
	color: #ffffff;
}

/* --- Inhalt-Typografie --------------------------------------------------- */
.phs__eyebrow {
	display: inline-block;
	background: var(--phs-badge, #f5b700);
	color: var(--phs-badge-color, #1a1a1a);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	padding: 6px 12px;
	border-radius: 4px;
	margin-bottom: 20px;
}

.phs__headline {
	margin: 0 0 18px;
	/* Das Theme setzt bei <=1200px h2{margin-top:45px !important}. Das wuerde den
	   Abstand Badge->Headline mobil auf ~65px aufblaehen -> hier neutralisieren. */
	margin-top: 0 !important;
	text-align: left;
	overflow-wrap: break-word;
	/* Groessen wie der Startseiten-Hero (home-video h1): 46px/56px. Schriftfamilie
	   und -gewicht kommen aus dem Theme (h2 -> TTnorm/300). Mobil 32px (Media Query). */
	font-size: 46px;
	line-height: 56px;
}

.phs__subheadline {
	margin: 0 0 14px;
	font-size: 20px;
	line-height: 28px;
	font-weight: 300;
}

.phs__text {
	/* wie der Fliesstext der Seite (p): 16px/24px. */
	margin: 0 0 28px;
	max-width: 48ch;
	font-size: 16px;
	line-height: 24px;
}

/* Button: Optik kommt komplett aus dem Theme (Klassen .btn .btn-primary im
   Markup) - rotes Pill, uppercase, Hover -> Blau. Hier bewusst KEINE eigenen
   Button-Styles, damit er zu den uebrigen CTAs der Seite passt. Der Abstand nach
   oben ergibt sich aus der margin-bottom des Textes/der Subheadline darueber. */

/* --- Bedienleiste -------------------------------------------------------- */
.phs__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 14px clamp(20px, 5vw, 48px);
	background: #ffffff;
}

.phs__arrow {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid #E30516;
	border-radius: 50%;
	background: transparent;
	color: #E30516;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.phs__arrow:hover {
	border-color: #E30516;
	background: #E30516;
	color: #ffffff;
}
.phs__arrow:focus-visible {
	outline: 3px solid rgba(227, 5, 22, 0.4);
	outline-offset: 2px;
}

.phs__center {
	display: flex;
	align-items: center;
	gap: 16px;
}

.phs__progress {
	display: flex;
	align-items: center;
	gap: 8px;
}

.phs__tick {
	position: relative;
	width: 32px;
	height: 4px;
	padding: 0;
	border: 0;
	border-radius: 4px;
	background: #d7dbe0;
	cursor: pointer;
	overflow: hidden;
	transition: background 0.2s ease;
}
.phs__tick:hover {
	background: #c2c8cf;
}
.phs__tick.is-active {
	background: #c2c8cf;
}
.phs__tick:focus-visible {
	outline: 2px solid rgba(227, 5, 22, 0.5);
	outline-offset: 3px;
}

.phs__tick-fill {
	position: absolute;
	inset: 0;
	width: 0;
	background: #E30516;
	border-radius: 4px;
}
/* Fortschritts-Animation laeuft ueber die Auto-Play-Dauer des aktiven Slides. */
.phs__tick.is-active .phs__tick-fill {
	animation: phs-fill var(--phs-duration, 6000ms) linear forwards;
}
.phs.is-paused .phs__tick.is-active .phs__tick-fill {
	animation-play-state: paused;
}

@keyframes phs-fill {
	from { width: 0; }
	to   { width: 100%; }
}

.phs__toggle {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 1px solid #E30516;
	border-radius: 6px;
	background: #ffffff;
	color: #E30516;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.phs__toggle:hover {
	border-color: #E30516;
	background: #E30516;
	color: #ffffff;
}
.phs__toggle:focus-visible {
	outline: 3px solid rgba(227, 5, 22, 0.4);
	outline-offset: 2px;
}
.phs__ico { fill: currentColor; }
.phs__ico--play { display: none; }
.phs.is-paused .phs__ico--pause { display: none; }
.phs.is-paused .phs__ico--play { display: block; }

/* --- Responsiv ----------------------------------------------------------- */
@media (max-width: 860px) {
	.phs__inner,
	.phs__slide--left .phs__inner {
		flex-direction: column-reverse;
		align-items: flex-start;
		text-align: left;
		gap: 20px;
	}
	.phs__content,
	.phs__media {
		flex: 1 1 auto;
		width: 100%;
		max-width: none;
	}
	.phs__media {
		justify-content: center;
	}
	.phs__img {
		max-height: 46vw;
	}
	.phs__viewport,
	.phs__inner {
		min-height: 0;
	}
	.phs__headline {
		font-size: 38px;
		line-height: 1.15;
	}
}

@media (max-width: 480px) {
	.phs__tick { width: 22px; }
	.phs__arrow { width: 40px; height: 40px; }
	.phs__headline {
		font-size: 32px;
		line-height: 1.22;
	}
	.phs__subheadline {
		font-size: 18px;
		line-height: 25px;
	}
}

/* --- Bewegung reduzieren ------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.phs,
	.phs__viewport,
	.phs__slide {
		transition: none !important;
	}
	.phs__tick.is-active .phs__tick-fill {
		animation: none !important;
		width: 100%;
	}
}
