.block-hero {
	position: relative;
	width: 100%;
	min-height: 110vh;
	min-height: 110dvh;
	display: flex;
	align-items: stretch;
	overflow: clip;
	--hero-mask-fade: 0;
	/*
	 * Alpha mask na całej sekcji łącząca dwa fade'y:
	 *  - stały bottom fade ostatnich ~10% (zastępuje dawny
	 *    `.block-hero__layers::after` z kolorowym gradientem):
	 *    sekcja w spoczynku jest pełna do 90%, a od 90% do 100%
	 *    spada do alpha 0.08 (delikatne zlanie z tłem strony).
	 *  - dynamiczny exit fade sterowany `--hero-mask-fade` przy
	 *    scrollu: pasmo wygaszania rośnie w górę sekcji wraz z
	 *    fade'em — górny stop transition wjedzie z 82% do ~46%,
	 *    dolny z 90% do ~66%, dzięki czemu maska realnie zwiększa
	 *    swój zasięg, a nie tylko intensywność.
	 *
	 * Wzór gwarantuje monotoniczność stops dla każdego mask-fade
	 * w [0..1] (każdy kolejny stop ≤ poprzedni).
	 */
	-webkit-mask-image: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 1) 0%,
		rgba(255, 255, 255, 1) calc(72% - var(--hero-mask-fade, 0) * 47%),
		rgba(255, 255, 255, calc(1 - (var(--hero-mask-fade, 0) * 1.35))) calc(82% - var(--hero-mask-fade, 0) * 52%),
		rgba(255, 255, 255, calc(1 - (var(--hero-mask-fade, 0) * 1.35))) calc(90% - var(--hero-mask-fade, 0) * 35%),
		rgba(255, 255, 255, calc((1 - (var(--hero-mask-fade, 0) * 1.35)) * 0.08)) 100%
	);
	mask-image: linear-gradient(
		to bottom,
		rgba(255, 255, 255, 1) 0%,
		rgba(255, 255, 255, 1) calc(72% - var(--hero-mask-fade, 0) * 47%),
		rgba(255, 255, 255, calc(1 - (var(--hero-mask-fade, 0) * 1.35))) calc(82% - var(--hero-mask-fade, 0) * 52%),
		rgba(255, 255, 255, calc(1 - (var(--hero-mask-fade, 0) * 1.35))) calc(90% - var(--hero-mask-fade, 0) * 35%),
		rgba(255, 255, 255, calc((1 - (var(--hero-mask-fade, 0) * 1.35)) * 0.08)) 100%
	);
	-webkit-mask-size: 100% 100%;
	mask-size: 100% 100%;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-mode: alpha;
	mask-mode: alpha;
}

.weblance-js .block-hero--pending .block-hero__content {
	opacity: 0;
}

.weblance-js .block-hero--pending .block-hero__layers {
	transform: translateX(-50%) translateY(100vh);
}

/* Full-viewport-width layers, outside padded content; anchored to block bottom. */
.block-hero__layers {
	position: absolute;
	left: 50%;
	bottom: 0;
	transform: translateX(-50%);
	width: 100vw;
	max-width: none;
	pointer-events: none;
	z-index: 0;
	--layers-fade: 10;
}

/* Bottom fade warstw przeniesiony na alpha-mask całej sekcji (.block-hero). */

.block-hero__layer {
	width: 100%;
	filter: brightness(0.90);
}

/* First layer in DOM (always warstwa 1 when present) stays in flow for height. */
.block-hero__layer:first-child {
	position: relative;
}

.block-hero__layer:not(:first-child) {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
}

/* Stos: 1 na wierzchu, 3 pod spodem (tył). */
.block-hero__layer--1 {
	z-index: 3;
}

.block-hero__layer--2 {
	z-index: 2;
}

.block-hero__layer--3 {
	z-index: 1;
}

.block-hero__layer img {
	width: 100%;
	height: auto;
	display: block;
}

.block-hero .block__container.block-container-hero {
	position: relative;
	z-index: 6;
	width: 100%;
	max-width: none;
	margin-left: 0;
	margin-right: 0;
	padding: var(--verti-padding-big) var(--calc-padding);
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.block-hero__inner {
	width: 100%;
	flex: 1;
	min-height: 0;
	display: flex;
	align-items: start;
	padding-top: 20vh;
	justify-content: center;
}

.block-hero__content {
	width: 100%;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 0;
}

/* ── Breadcrumbs (global hero) ── */
.block-hero__breadcrumbs {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 2px;
	row-gap: 1px;
	color: #fff;
	opacity: 0.5;
	font-size: calc(var(--font-size-small) * 1.2);
	font-weight: 400;
	letter-spacing: 0.02em;
	margin-bottom: -16px;
}

.block-hero__breadcrumbs-link {
	color: rgba(255, 255, 255, 0.5);
	text-decoration: none;
	transition: opacity 0.2s ease;
}

.block-hero__breadcrumbs-link:hover {
	opacity: 0.7;
}

.block-hero__breadcrumbs-sep {
	color: rgba(255, 255, 255, 0.5);
}

.block-hero__breadcrumbs-current {
	color: rgba(255, 255, 255, 0.5);
}

.block-hero__kicker {
	margin: 0 0 5px;
	color: var(--color);
	font-size: var(--font-size-h1);
	font-weight: 400;
	line-height: 1.18;
	letter-spacing: -0.015em;
	width: 100%;
	text-align: center;
}

.block-hero__kicker.block-hero__kicker--image {
	height: 100px;
}

.block-hero__kicker.block-hero__kicker--image img {
	height: 100%;
	width: auto;
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.block-hero__title {
	margin: 0 0 5px;
	color: #fff;
	font-size: calc(1.3 * var(--font-size-h1));
	font-weight: 600;
}

.block-hero__title p {
	margin: 0;
}

.block-hero__title--marquee {
	--hero-marquee-copy-gap: 10vw;
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	overflow: hidden;
	font-size: calc(1.56 * var(--font-size-h1));
	font-weight: 600;
	line-height: 1.1;
	white-space: nowrap;
	text-align: left;
	padding-bottom: 0.08em;
}

.block-hero__title-marquee-track {
	display: flex;
	width: max-content;
	min-width: 100%;
	will-change: transform;
	gap: var(--hero-marquee-copy-gap);
	/*
	 * Stan przed startem animacji: pierwszy znak schowany dokładnie za
	 * prawą krawędzią viewportu. Używamy `100vw` zamiast `%`, bo `%`
	 * referuje do szerokości tracka (max-content = kilka ekranów),
	 * przez co animacja przebiegałaby ogromny dystans i wygladała jakby
	 * zmieniał się margin zamiast wjeżdżać tekst.
	 */
	transform: translateX(100vw);
}

.block-hero__title--marquee.is-marquee-running .block-hero__title-marquee-track {
	/*
	 * Po dodaniu klasy: najpierw entry z prawej krawędzi viewportu do 0
	 * (pierwszy znak wjeżdża z out-of-screen), potem główna pętla marquee.
	 */
	animation:
		heroTitleMarqueeEnter 0.9s cubic-bezier(0.22, 0.61, 0.36, 1) 0s 1 normal both,
		heroTitleMarquee 18s linear 0.9s infinite;
	transform: none;
}

@keyframes heroTitleMarqueeEnter {
	from {
		transform: translateX(100vw);
	}
	to {
		transform: translateX(0);
	}
}

.block-hero__title-marquee-item {
	display: inline-flex;
	align-items: baseline;
	flex: 0 0 auto;
	padding-right: var(--hero-marquee-copy-gap);
}

.block-hero__title-marquee-item::after {
	content: "\00a0\00a0\00a0";
}

@keyframes heroTitleMarquee {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(calc(-50% - (var(--hero-marquee-copy-gap) / 2)));
	}
}

.block-hero__title strong {
	position: relative;
	display: inline-block;
	font-weight: 700;
	margin-left: 0.25em;
}

.block-hero__title strong.is-hero-strong-gap-right {
	margin-right: 0.25em;
}

.block-hero__title strong::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0%;
	height: 0.5em;
	background-image: url("/wp-content/themes/weblance/assets/images/hero-strong-underline.svg");
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-position: center;
	pointer-events: none;
	z-index: -1;
}

.block-hero__title strong > *,
.block-hero__title strong {
	position: relative;
	z-index: 1;
}

.weblance-js .block-hero__title strong::after {
	transform: scaleX(0);
	transform-origin: left center;
	opacity: 0;
	transition: transform 0.75s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.weblance-js .block-hero__title strong.is-underline-visible::after {
	transform: scaleX(1);
	opacity: 1;
}

.weblance-js .block-hero__title strong.is-underline-instant::after {
	transform: scaleX(1);
	opacity: 1;
	transition: none;
}

.block-hero__subtitle {
	margin: 0 0 5px;
	color: #fff;
	font-size: var(--font-size-h2);
	font-weight: 400;
	line-height: 1.2;
}

.block-hero__subtitle p { margin: 0; }

.block-hero__text {
	width: 100%;
	margin: 0;
	font-size: var(--font-size-h3);
	color: rgba(255, 255, 255, 0.92);
	line-height: 1.55;
}

/* Drugi „nagłówek” (tekst główny / opis) — 5px pod pierwszym nagłówkiem; większy odstęp gdy jest blok opisu przed H2 (global hero). */
.block-hero__text + .block-hero__subtitle {
	margin-top: 24px;
}

.block-hero__text + .block-hero__text {
	margin-top: 24px;
}

/* Odstęp do przycisków jak przy poprzednim gap (24px), nie suma z margin-bottom nagłówka. */
.block-hero__kicker:has(+ .block-hero__buttons),
.block-hero__title:has(+ .block-hero__buttons),
.block-hero__subtitle:has(+ .block-hero__buttons) {
	margin-bottom: 0;
}

.block-hero__text p {
	margin: 0 0 12px;
}

.block-hero__text p:last-child {
	margin-bottom: 0;
}

.block-hero__text strong {
	position: relative;
	display: inline-block;
	font-weight: 700;
}

.block-hero__text strong::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 10%;
	height: 0.5em;
	background-image: url("/wp-content/themes/weblance/assets/images/hero-strong-underline.svg");
	background-repeat: no-repeat;
	background-size: 100% 100%;
	background-position: center;
	pointer-events: none;
	z-index: -1;
}

.block-hero__text strong > *,
.block-hero__text strong {
	position: relative;
	z-index: 1;
}

.block-hero__buttons {
	justify-content: center;
	margin-top: 24px;
}

.block-hero__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 12px 24px;
	border-radius: 100px;
	text-decoration: none;
	font-size: var(--font-size-normal);
	font-weight: 500;
}

.block-hero__btn--secondary {
	border: 2px solid #ffffff33;
	background: rgba(255, 255, 255, 0.04);
	box-shadow: 4px 4px 12.9px 0 rgba(0, 0, 0, 0.25);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

@media (max-width: 767px) {
	.block-hero__title--marquee {
		--hero-marquee-copy-gap: 14vw;
		font-size: calc(2 * var(--font-size-h1));
	}

	.block-hero__title-marquee-track {
		animation-duration: 14s;
	}

	.block-hero__kicker.block-hero__kicker--image {
		height: 70px;
	}

	.block-hero__layers {
		width: 200vw;
		left: 50%;
		transform: translateX(-50%);
	}

	.block-hero__buttons {
		width: 100%;
		padding-left: 0;
		padding-right: 0;
	}

	.block-hero__btn {
		width: 100%;
		max-width: 80%;
		margin-left: auto;
		margin-right: auto;
	}
}

/* Globalny HERO (ACF): odstęp breadcrumbs → kicker / H1 (nadpisuje ujemny margin). */
.block-hero--global .block-hero__breadcrumbs {
	margin-bottom: 10px;
}
