/**
 * Testimonials — theme title + badge embed + Elfsight slider.
 *
 * Width: same outer box as the header (--container-outer-max).
 */

.testimonials {
	--tm-pad-block-start: clamp(3rem, 4vw, 4.25rem); /* ~100px */
	--tm-pad-block-end: clamp(2.5rem, 5vw, 3.75rem); /* ~60px */
	--tm-stack-gap: clamp(1.75rem, 3.5vw, 2.75rem); /* ~44px */
	--tm-headline-size: var(--type-h2-size); /* ~38px */
	--tm-ease: cubic-bezier(0.22, 1, 0.36, 1);

	padding-block: var(--tm-pad-block-start) var(--tm-pad-block-end);
	color: var(--color-navy);
	background-color: var(--color-white);
	overflow: visible;
}

.testimonials__inner {
	display: flex;
	flex-direction: column;
	gap: var(--tm-stack-gap);
	width: 100%;
	max-width: var(--container-outer-max);
	margin-inline: auto;
	padding-inline: var(--container-pad-inline);
	min-width: 0;
	box-sizing: border-box;
	overflow: visible;
}

.testimonials__header {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1.5rem;
	width: 100%;
	min-width: 0;
}

.testimonials__headline {
	margin: 0;
	max-width: 40rem;
	min-width: 0;
	font-family: var(--font-family-display);
	font-size: var(--tm-headline-size);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--color-navy);
	overflow-wrap: break-word;
}

.testimonials__badge {
	flex-shrink: 0;
	min-width: 0;
	max-width: 100%;
}

.testimonials__badge iframe,
.testimonials__badge [class*='elfsight'] {
	display: block;
	max-width: 100%;
}

.testimonials__embed {
	position: relative;
	z-index: 1;
	width: 100%;
	min-width: 0;
	/* Elfsight next arrow sits on the trailing edge — do not clip it. */
	overflow: visible;
	/* Leave room so trailing nav control is not flush against the gutter edge. */
	padding-inline-end: 0.75rem;
	box-sizing: border-box;
}

.testimonials__embed > * {
	max-width: none;
}

.testimonials__embed iframe {
	display: block;
	max-width: 100%;
}

@media (min-width: 48rem) {
	.testimonials__header {
		flex-direction: row;
		align-items: center;
		gap: 2rem;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.testimonials__header {
		opacity: 0;
		transform: translateY(-2.25rem);
		transition:
			opacity 0.8s var(--tm-ease),
			transform 0.8s var(--tm-ease);
		will-change: opacity, transform;
	}

	/*
	 * Embed: opacity only. A non-none transform on this box makes browsers
	 * clip overflowing Elfsight nav arrows even when overflow is visible.
	 */
	.testimonials__embed {
		opacity: 0;
		transition: opacity 0.8s var(--tm-ease);
		will-change: opacity;
	}

	.testimonials.is-inview .testimonials__header {
		opacity: 1;
		transform: none;
		will-change: auto;
	}

	.testimonials.is-inview .testimonials__embed {
		opacity: 1;
		will-change: auto;
	}
}
