/**
 * Wappbiz Heading — eyebrow pill + title (with optional highlight) + subtitle.
 * A reusable section heading, generic version of the eyebrow/title pattern
 * used across the other Wappbiz widgets.
 */

.wappbiz-heading {
	display: flex;
	flex-direction: column;
}

/* Alignment */

.wappbiz-heading--align-left {
	align-items: flex-start;
	text-align: left;
}

.wappbiz-heading--align-center {
	align-items: center;
	text-align: center;
	margin-left: auto;
	margin-right: auto;
}

.wappbiz-heading--align-right {
	align-items: flex-end;
	text-align: right;
	margin-left: auto;
}

/* Eyebrow pill */

.wappbiz-heading__eyebrow {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 18px;
	border-radius: 999px;
	background: #ffffff;
	border: 1px solid #c9ecd9;
	color: #25b06a;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	margin-bottom: 20px;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

a.wappbiz-heading__eyebrow {
	cursor: pointer;
}

.wappbiz-heading__eyebrow i,
.wappbiz-heading__eyebrow svg {
	width: 14px;
	height: 14px;
	font-size: 14px;
	flex-shrink: 0;
}

/* Title */

.wappbiz-heading__title {
	margin: 0 0 18px;
	font-size: clamp(28px, 3.6vw, 48px);
	line-height: 1.15;
	font-weight: 800;
	letter-spacing: -0.01em;
	color: #0e2a44;
}

.wappbiz-heading__title-accent {
	color: #25b06a;
}

/* Subtitle */

.wappbiz-heading__subtitle {
	margin: 0;
	max-width: 80%;
	font-size: clamp(15px, 1.15vw, 19px);
	line-height: 1.55;
	color: #51677a;
}

.wappbiz-heading--align-left .wappbiz-heading__subtitle {
	margin-left: 0;
	margin-right: auto;
}

.wappbiz-heading--align-center .wappbiz-heading__subtitle {
	margin-left: auto;
	margin-right: auto;
}

.wappbiz-heading--align-right .wappbiz-heading__subtitle {
	margin-left: auto;
	margin-right: 0;
}

/* ------------------------------------------------------------------------
 * Responsive
 * --------------------------------------------------------------------- */

@media (max-width: 600px) {
	.wappbiz-heading__title {
		font-size: clamp(24px, 7vw, 32px);
	}

	.wappbiz-heading__subtitle {
		max-width: 100%;
		font-size: 15px;
	}

	.wappbiz-heading__eyebrow {
		font-size: 12px;
		padding: 7px 14px;
	}
}

/* ------------------------------------------------------------------------
 * Title word-reveal animation.
 *
 * Each word is wrapped server-side in .wappbiz-heading__reveal-word with a
 * --wappbiz-reveal-index custom property (its position in the sentence).
 * Words start hidden/offset; wappbiz-heading.js adds
 * .wappbiz-heading__title--in-view via IntersectionObserver the first time
 * the title scrolls into view, and each word's transition-delay is derived
 * from its own index so they stagger in left-to-right instead of all
 * animating at once.
 * --------------------------------------------------------------------- */

.wappbiz-heading__title--reveal .wappbiz-heading__reveal-word {
	display: inline-block;
	opacity: 0;
	transform: translateY(0.6em);
	transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: calc(var(--wappbiz-reveal-index, 0) * var(--wappbiz-reveal-stagger, 70ms));
	will-change: opacity, transform;
}

.wappbiz-heading__title--reveal.wappbiz-heading__title--in-view .wappbiz-heading__reveal-word {
	opacity: 1;
	transform: translateY(0);
}

.wappbiz-heading__title--reveal-slow {
	--wappbiz-reveal-stagger: 110ms;
}

.wappbiz-heading__title--reveal-normal {
	--wappbiz-reveal-stagger: 70ms;
}

.wappbiz-heading__title--reveal-fast {
	--wappbiz-reveal-stagger: 40ms;
}

/*
 * Respect reduced-motion preferences: show the finished state immediately,
 * no animation, rather than forcing motion on users who've disabled it.
 */
@media (prefers-reduced-motion: reduce) {
	.wappbiz-heading__title--reveal .wappbiz-heading__reveal-word {
		opacity: 1;
		transform: none;
		transition: none;
	}
}
