/* ==========================================================================
   AF Slider – styling
   Werte abgeleitet aus dem originalen Slider-Revolution-Export (Egli 2026):
   - Montserrat
   - Titel 86px / 900 / line-height 90px
   - Slogan 20px / 500 / uppercase / letter-spacing 5px
   - Body 24px / line-height 30px
   - BG #e6002f, fullscreen
   ========================================================================== */

.af-slider {
	--af-slider-bg: #e6002f;
	--af-slider-bg-image: url(/wp-content/plugins/af-slider/assets/images/egli_background.svg);
	--af-slider-transition: 800ms;
	--af-slider-fg: #ffffff;
	--af-slider-accent: #fff; /* kursiver Slogan */
	--af-slider-link: #000;

	position: relative;
	width: 100%;
	height: 100vh;
	min-height: 560px;
	overflow: hidden;
	background: var(--af-slider-bg);
	/*font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;*/
	color: var(--af-slider-fg);
	isolation: isolate;
}

.af-slider__viewport {
	position: relative;
	width: 100%;
	height: 100%;
}

/* --- Slide ----------------------------------------------------------------- */
.af-slide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--af-slide-bg, var(--af-slider-bg));
	background-image: var(--af-slider-bg-image);
	background-size: cover;
	background-position: top;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
}

.af-slide.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

/* Background graphic (e.g. faint logo) */
.af-slide__bg {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	background-position: center center;
	background-size: clamp(400px, 60vw, 1100px);
	opacity: 0.12;
	z-index: 0;
	pointer-events: none;
}

.af-slide__content {
	position: relative;
	z-index: 2;
	width: min(1480px, 92vw);
	height: 100%;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 1fr 1fr;
	align-items: center;
	gap: 2rem;
}

/* --- Text block ------------------------------------------------------------ */
.af-slide__text {
	align-self: center;
	max-width: 620px;
}

.af-slide__slogan {

	margin: 0 0 1.25rem;
	font-size: 20px;
	font-weight: 400!important;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--af-slider-accent);
}

.af-slide__title {
	margin: 0 0 1.5rem;
	font-family: 'QuatroSlab', "Times New Roman", Times, serif !important;
	font-size: clamp(40px, 6vw, 86px);
	font-weight: 900;
	line-height: 0.95;
	letter-spacing: 0;
	color: var(--af-slider-fg);
	white-space: nowrap;
	text-transform: unset !important;
	text-shadow: 0 1px 3px #0009, 0 8px 24px #00000059;
}

.af-slide__body {
	margin: 0 0 1.25rem;
	font-size: clamp(16px, 1.6vw, 24px);
	line-height: 1.3;
	color: var(--af-slider-link);
	max-width: 36ch;
}

.af-slide__body p {
	font-size: clamp(16px, 1.6vw, 24px);
	margin: 0;
}

.af-slide__bullets-list {
	font-family: 'FrutigerLTStd-Roman', Tahoma, Verdana, sans-serif !important;
	list-style: none;
	margin: 0 0 1.75rem;
	padding: 0;
	font-size: clamp(15px, 1.4vw, 20px);
	line-height: 1.6;
	color: var(--af-slider-link);
}

.af-slide__bullets-list li::before {
	content: "";
	color: black;
	font-weight: 700;
	width: 5px;
	height: 5px;
	display: inline-block;
	background: black;
	margin: 0 10px 4px 0;
	border-radius: 99px;
}

/* --- Buttons --------------------------------------------------------------- */
.af-slide__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.af-slide__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	padding: 0 24px;
	background: #000;
	color: #fff!important;
	font-size: 20px;
	font-weight: 500;
	text-decoration: none;
	border: none;
	transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease;
}

.af-slide__button:hover {
	background: #fff;
	color: #000!important;
}

.af-slide__button:active { transform: translateY(1px); }

/* --- Foreground / cut-out image ------------------------------------------- */
.af-slide__media {
	position: relative;
	height: 100%;
	display: flex;
	align-items: flex-end;
	justify-content: flex-end;
}

.af-slide__media img {
	max-height: 92%;
	width: auto;
	object-fit: contain;
	object-position: bottom right;
	filter: drop-shadow(0 12px 30px rgba(0, 0, 0, 0.18));
}

/* --- Nav arrows ------------------------------------------------------------ */
.af-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.25);
	color: #fff;
	border: none;
	cursor: pointer;
	transition: background-color 0.2s ease;
}
.af-slider__nav.af-slider__nav--next { background: rgba(255, 255, 255, 0.25); }

.af-slider__nav:hover { background: rgba(0, 0, 0, 0.5); }
.af-slider__nav.af-slider__nav--next:hover { background: rgba(230, 0, 47, 0.5); }
.af-slider__nav svg { width: 24px; height: 24px; transition: all 0.2s ease;  }
.af-slider__nav--prev { left: 16px; }
.af-slider__nav--next { right: 16px; }

/* --- Bullets / dots -------------------------------------------------------- */
.af-slider__bullets {
	position: absolute;
	bottom: 28px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	gap: 10px;
}

.af-slider__bullet {
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.7);
	background: transparent;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.af-slider__bullet.is-active {
	background: #fff;
	/*transform: scale(1.15);*/
}

/* --- Autoplay progress bar ------------------------------------------------- */
.af-slider__progress {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 3px;
	background: rgba(0, 0, 0, 0.15);
	z-index: 5;
}

.af-slider__progress-bar {
	display: block;
	height: 100%;
	width: 0;
	background: rgba(255, 255, 255, 0.85);
	transform-origin: left center;
}

/* --- Responsive ------------------------------------------------------------ */
@media (max-width: 1024px) {
	.af-slide__content { width: 94vw; }
	.af-slide__media img { max-height: 80%; }
	.af-slide__title { white-space: unset; }
	.af-slider__nav { display: none; }
}

@media (max-width: 782px) {
	.af-slider { height: auto; min-height: 100vh; padding-top: 75px; }
	.af-slide__content {
		grid-template-columns: 1fr;
		grid-template-rows: auto 1fr;
		align-content: start;
		padding: 5rem 0 0;
		gap: 0.5rem;
		height: 100%;
	}
	/* Text first (top), person image second (bottom) */
	.af-slide__text { order: 1; max-width: none; align-self: start; }
	.af-slide__media {
		order: 2;
		height: auto;
		align-self: end;            /* push image to the bottom of the slide */
		justify-content: flex-end;  /* like Bild 1: person anchored bottom-right */
		margin-top: auto;
	}
	.af-slide__media img {
		max-height: 48vh;           /* larger, like Bild 1 */
		max-width: 90%;
		object-position: bottom right;
	}
	.af-slide__bullets-list,
	.af-slide__body { max-width: none; }
	/* avoid the awkward "Loxone Smart Home / Systeme" break */
	.af-slide__bullets-list li { text-wrap: balance; }
}

/* Respect reduced motion: GSAP also checks this, CSS is a safety net. */
@media (prefers-reduced-motion: reduce) {
	.af-slide { transition: opacity 0.2s linear; }
}

section.af-slide[data-slug="sicherheit"] .af-slide__media img {
	position: relative;
	top: 5%;
}


/* ==========================================================================
   AF Slider – Bullet-Tooltips (Hover)
   Zeigt den Slide-Titel als weisses Label mit Pfeil über dem Punkt.
   Nutzt das vorhandene aria-label des Bullets – kein Markup-Zwang.
   Für eigenes Feld: aria-label durch data-title ersetzen (siehe Hinweis unten).
   ========================================================================== */

.af-slider__bullet {
	position: relative; /* Bezugspunkt für den Tooltip */
}

/* Label-Box */
.af-slider__bullet::after {
	content: attr(data-slogan);
	position: absolute;
	bottom: calc(100% + 12px);      /* über dem Punkt, Platz für den Pfeil */
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background: #fff;
	color: #6b6b6b;                 /* dezentes Grau wie im Screenshot */
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	padding: 6px 9px;
	border-radius: 2px;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 10;
}

/* Pfeil-Dreieck unten an der Box */
.af-slider__bullet::before {
	content: "";
	position: absolute;
	bottom: calc(100% + 4px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	width: 0;
	height: 0;
	border-left: 9px solid transparent;
	border-right: 9px solid transparent;
	border-top: 9px solid #fff;     /* zeigt nach unten */
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.18s ease, transform 0.18s ease;
	z-index: 10;
}

/* Sichtbar nur beim Hover (und Tastatur-Fokus für a11y) */
.af-slider__bullet:hover::after,
.af-slider__bullet:focus-visible::after,
.af-slider__bullet:hover::before,
.af-slider__bullet:focus-visible::before {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* Touch-Geräte: keine Hover-Tooltips (verhindert hängende Labels) */
@media (hover: none) {
	.af-slider__bullet::after,
	.af-slider__bullet::before {
		display: none;
	}
}