/* ============================================================
 * AMEFIT HERO SLIDER — strona główna
 * Pełnoekranowy, 4 slajdy, crossfade + slight scale, auto-play 6s.
 * Wczytywane warunkowo przez wp_enqueue_scripts (is_front_page).
 * ============================================================ */

.af-slider {
	position: relative;
	width: 100vw;
	margin-left: 50%;
	transform: translateX(-50%);
	overflow: hidden;
	contain: layout paint;
}

/* Wysokość — desktop / tablet / mobile */
.af-slider {
	height: min(85vh, 800px);
	min-height: 520px;
}

@media (max-width: 1199px) and (min-width: 768px) {
	.af-slider {
		height: 70vh;
		min-height: 480px;
	}
}

@media (max-width: 767px) {
	.af-slider {
		height: 78vh;
		min-height: 480px;
	}
}

/* === TRACK + SLIDES (crossfade) ============================ */

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

.af-slider__slide {
	position: absolute;
	inset: 0;
	display: block;
	margin: 0;
	padding: 0;
	opacity: 0;
	transform: scale(1.02);
	pointer-events: none;
	transition: opacity 700ms cubic-bezier(0.16, 1, 0.3, 1),
		transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
	will-change: opacity, transform;
	z-index: 1;
}

.af-slider__slide.is-active {
	opacity: 1;
	transform: scale(1);
	pointer-events: auto;
	z-index: 2;
}

/* Bez JS pierwszy slajd jest aktywny i widoczny — pozostałe ukryte
 * przez opacity:0. Po włączeniu JS layer dorzuca .af-slider--enhanced
 * i logikę przełączania. Graceful degradation — bez JS ciągle widać
 * pierwszy slajd. */

.af-slider__media {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
}

/* Specyficzność (0,2,0) podbita prefixem `.af-slider__media` żeby pobić
 * BeTheme'owe `.content_wrapper img { max-width: 100%; height: auto }`
 * (0,1,1) — bez tego img bierze wysokość proporcjonalną do szerokości
 * (intrinsic 2.33:1), co zostawia czarny pas pod grafiką w sliderze 85vh. */
.af-slider .af-slider__image,
.af-slider__media .af-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	aspect-ratio: auto;
	object-fit: cover;
	object-position: right center;
	will-change: transform;
}

@media (max-width: 767px) {
	.af-slider__image {
		object-position: 70% center;
	}
}

/* Per-slajd object-position — slajdy w kolejności z hero-slides.php.
 * Każda grafika ma sylwetkę po prawej; tweakujemy wycentrowanie żeby
 * na mobile postać nie zachodziła na tekst. */
.af-slider__slide:nth-of-type(1) .af-slider__image { object-position: 75% center; }
.af-slider__slide:nth-of-type(2) .af-slider__image { object-position: 80% center; }
.af-slider__slide:nth-of-type(3) .af-slider__image { object-position: 70% center; }
.af-slider__slide:nth-of-type(4) .af-slider__image { object-position: 75% center; }
.af-slider__slide:nth-of-type(5) .af-slider__image { object-position: 75% center; }
.af-slider__slide:nth-of-type(6) .af-slider__image { object-position: 70% center; }

@media (max-width: 767px) {
	.af-slider__slide .af-slider__image {
		object-position: 78% center;
	}
}

/* === OVERLAY GRADIENT (czytelność tekstu) ================== */

.af-slider__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		90deg,
		rgba(0, 0, 0, 0.6) 0%,
		rgba(0, 0, 0, 0.3) 45%,
		transparent 70%
	);
	pointer-events: none;
}

@media (max-width: 767px) {
	.af-slider__overlay {
		background:
			linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.15) 45%, rgba(0, 0, 0, 0.55) 100%),
			linear-gradient(90deg, rgba(0, 0, 0, 0.4) 0%, transparent 60%);
	}
}

/* === CONTENT LAYER ========================================= */

.af-slider__content {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	padding: 0 clamp(1.5rem, 6vw, 6rem);
	z-index: 3;
	pointer-events: none;
}

.af-slider__content-inner {
	max-width: 720px;
	pointer-events: auto;
}

.af-slider__lead {
	color: #ffffff;
	font-size: clamp(2.25rem, 6.5vw, 5.5rem);
	font-weight: 800;
	line-height: 1.05;
	letter-spacing: -0.02em;
	margin: 0 0 1.25rem;
	text-shadow:
		0 2px 12px rgba(0, 0, 0, 0.55),
		0 1px 2px rgba(0, 0, 0, 0.6);
}

.af-slider__subtitle {
	color: #ffffff;
	font-size: clamp(1rem, 1.6vw, 1.35rem);
	font-weight: 500;
	line-height: 1.5;
	max-width: 520px;
	margin: 0 0 2rem;
	text-shadow:
		0 1px 8px rgba(0, 0, 0, 0.55),
		0 1px 2px rgba(0, 0, 0, 0.6);
}

/* Nowe slajdy (cardio + strength2) — jaśniejsze tła, mocniejszy
 * gradient + cień tekstu dla pełnej czytelności. */
.af-slider__slide:nth-of-type(2) .af-slider__overlay,
.af-slider__slide:nth-of-type(4) .af-slider__overlay {
	background: linear-gradient(
		90deg,
		rgba(0, 0, 0, 0.78) 0%,
		rgba(0, 0, 0, 0.5) 45%,
		rgba(0, 0, 0, 0.15) 75%,
		transparent 100%
	);
}

@media (max-width: 767px) {
	.af-slider__slide:nth-of-type(2) .af-slider__overlay,
	.af-slider__slide:nth-of-type(4) .af-slider__overlay {
		background:
			linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 45%, rgba(0, 0, 0, 0.65) 100%),
			linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, transparent 60%);
	}
}

.af-slider__cta-row {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	align-items: center;
}

@media (max-width: 599px) {
	.af-slider__cta-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.75rem;
	}
}

/* === CTA — primary i secondary ============================= */

/* Specyficzność podbita prefixem `.amefit-modernized` żeby pobić rule
 * `.amefit-modernized a { color: var(--af-color-accent) }` z fazy 1
 * (custom.css), które inaczej zalewa nasz tekst CTA na magenta. */

.amefit-modernized .af-slider__cta {
	display: inline-flex;
	align-items: center;
	gap: 0.6rem;
	padding: 1rem 2rem;
	border: 2px solid transparent;
	border-radius: var(--af-radius-sm, 8px);
	font-family: inherit;
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1),
		box-shadow 220ms cubic-bezier(0.16, 1, 0.3, 1),
		background-color 220ms cubic-bezier(0.65, 0, 0.35, 1),
		color 220ms cubic-bezier(0.65, 0, 0.35, 1),
		border-color 220ms cubic-bezier(0.65, 0, 0.35, 1);
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.amefit-modernized .af-slider__cta--primary,
.amefit-modernized a.af-slider__cta--primary {
	background: var(--af-color-accent, #cf0261);
	color: #ffffff;
}

.amefit-modernized .af-slider__cta--primary:hover,
.amefit-modernized .af-slider__cta--primary:focus-visible,
.amefit-modernized a.af-slider__cta--primary:hover,
.amefit-modernized a.af-slider__cta--primary:focus-visible {
	background: var(--af-color-accent-hover, #b00254);
	color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 14px 28px -10px rgba(207, 2, 97, 0.55);
	outline: none;
}

.amefit-modernized .af-slider__cta--secondary,
.amefit-modernized a.af-slider__cta--secondary {
	background: transparent;
	color: #ffffff;
	border-color: rgba(255, 255, 255, 0.6);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
}

.amefit-modernized .af-slider__cta--secondary:hover,
.amefit-modernized .af-slider__cta--secondary:focus-visible,
.amefit-modernized a.af-slider__cta--secondary:hover,
.amefit-modernized a.af-slider__cta--secondary:focus-visible {
	background: #ffffff;
	color: var(--af-color-text, #161922);
	border-color: #ffffff;
	transform: translateY(-2px);
	box-shadow: 0 14px 28px -10px rgba(0, 0, 0, 0.4);
	outline: none;
}

.amefit-modernized .af-slider__cta:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 4px;
}

.amefit-modernized .af-slider__cta-arrow {
	display: inline-block;
	transition: transform 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.amefit-modernized .af-slider__cta:hover .af-slider__cta-arrow,
.amefit-modernized .af-slider__cta:focus-visible .af-slider__cta-arrow {
	transform: translateX(4px);
}

/* === NAV ARROWS (prev/next) ================================ */

.amefit-modernized .af-slider__nav,
.af-slider__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 52px;
	height: 52px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.32);
	color: #ffffff;
	cursor: pointer;
	z-index: 5;
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	transition: background-color 220ms cubic-bezier(0.65, 0, 0.35, 1),
		transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* SVG strzałki — explicit stroke #fff (currentColor mogło być nadpisane
 * przez fazę 1 / BeTheme inline). Również wymuszamy stroke na polyline
 * elementach żeby pobić ewentualne wewnętrzne reguły BeTheme. */
.amefit-modernized .af-slider__nav svg,
.af-slider__nav svg {
	color: #ffffff;
	stroke: #ffffff;
	fill: none;
	width: 24px;
	height: 24px;
	pointer-events: none;
}

.amefit-modernized .af-slider__nav svg polyline,
.amefit-modernized .af-slider__nav svg path,
.af-slider__nav svg polyline,
.af-slider__nav svg path {
	stroke: #ffffff;
	fill: none;
}

.af-slider__nav--prev { left: clamp(0.75rem, 2vw, 2rem); }
.af-slider__nav--next { right: clamp(0.75rem, 2vw, 2rem); }

.af-slider__nav:hover,
.af-slider__nav:focus-visible {
	background: rgba(0, 0, 0, 0.55);
	transform: translateY(-50%) scale(1.08);
	outline: none;
}

.af-slider__nav:focus-visible {
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6);
}

.af-slider__nav:active {
	transform: translateY(-50%) scale(0.96);
}

@media (max-width: 599px) {
	.af-slider__nav {
		width: 42px;
		height: 42px;
	}
	.af-slider__nav svg { width: 20px; height: 20px; }
}

/* === DOTS (tablist) ======================================== */
/* Rozmiar zmniejszony o ~50% w stosunku do pierwotnego designu —
 * subtelniejszy, mniej dominujący nad kompozycją hero. */

.af-slider__dots {
	position: absolute;
	left: 50%;
	bottom: clamp(0.6rem, 2vh, 1.25rem);
	transform: translateX(-50%);
	display: inline-flex;
	gap: 0.4rem;
	z-index: 5;
	padding: 0.25rem 0.4rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.28);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
}

.amefit-modernized .af-slider__dot,
.af-slider__dot {
	position: relative;
	width: 14px;
	height: 14px;
	min-width: 40px;
	min-height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 0;
}

.af-slider__dot:focus-visible {
	outline: 2px solid #ffffff;
	outline-offset: 2px;
	border-radius: 50%;
}

.af-slider__dot-core {
	width: 4px;
	height: 4px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	transition: background-color 220ms cubic-bezier(0.65, 0, 0.35, 1),
		transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.af-slider__dot.is-active .af-slider__dot-core,
.af-slider__dot:hover .af-slider__dot-core {
	background: #ffffff;
	transform: scale(1.25);
	box-shadow: 0 0 8px rgba(255, 255, 255, 0.55);
}

.af-slider__dot-progress {
	position: absolute;
	inset: 50%;
	width: 14px;
	height: 14px;
	transform: translate(-50%, -50%);
	pointer-events: none;
	opacity: 0;
	transition: opacity 220ms cubic-bezier(0.65, 0, 0.35, 1);
}

.af-slider__dot.is-active .af-slider__dot-progress {
	opacity: 1;
}

/* SVG progress arc — JS aktualizuje stroke-dashoffset (100 → 0) */
.af-slider__dot-progress-arc {
	transition: stroke-dashoffset 100ms linear;
}

/* === REDUCED MOTION ======================================== */

@media (prefers-reduced-motion: reduce) {
	.af-slider__slide {
		transition-duration: 200ms;
		transform: none;
	}
	.af-slider__slide.is-active {
		transform: none;
	}
	.af-slider__cta:hover,
	.af-slider__nav:hover,
	.af-slider__nav:focus-visible {
		transform: translateY(-50%);
	}
	.af-slider__cta:hover .af-slider__cta-arrow,
	.af-slider__cta:focus-visible .af-slider__cta-arrow {
		transform: none;
	}
	.af-slider__dot.is-active .af-slider__dot-progress {
		opacity: 0;
	}
}

/* === HIDE BeTheme Subheader when slider on home ============ */

.amefit-modernized.home #Subheader {
	display: none;
}

/* Pusta sekcja the_content z BeTheme — generowana zawsze, nawet gdy
 * post_content jest puste (Muffin Builder render). Na froncie nie ma
 * sensu — schowaj. */
.amefit-modernized.home .section.the_content.no_content {
	display: none;
}


/* Override fazy 2 — hero z fazy 2 nie nakłada się na slider.
 * Slider sam ma overlay i typografię. */
.amefit-modernized.home #Content > .section:first-of-type::before {
	display: none;
}
.amefit-modernized.home #Content > .section:first-of-type {
	min-height: auto;
}
