/**
 * Power to Move — "Testemunhos" section (Figma "Homepage - 1440 V2" and
 * "Projeto - Detalhe"), printed by [ptm_testemunhos].
 *
 * The slider layout is done in assets/js/testimonials.js, which reads these
 * custom properties from .ptm-testimonials__slider:
 * - --ptm-testimonials-overlap: desktop, how much the active card covers the
 *   previous one.
 * - --ptm-testimonials-peek / --ptm-testimonials-peek-step: tablet and mobile,
 *   how far the next two cards come over the active one's right edge.
 *
 * Card colours repeat dark → green → grey (palette 2, 1, 6).
 *
 * Breakpoints match Blocksy: tablet ≤ 999.98px, mobile ≤ 689.98px.
 */

.ptm-testimonials {
	overflow: hidden;
	overflow: clip;
	color: var(--theme-palette-color-2);
}

/* Product page: "Equipamentos mais procurados" above already has bottom padding. */
.ptm-popular + .ptm-testimonials {
	padding-top: 0;
}

.ptm-testimonials__inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"title nav"
		"slider slider";
	align-items: start;
	gap: 56px 48px;
}

.ptm-testimonials .ptm-testimonials__title {
	grid-area: title;
	margin: 0;
	color: var(--theme-palette-color-4);
}

.ptm-testimonials__nav {
	--ptm-round-button-size: 74px;
	grid-area: nav;
	display: flex;
	gap: 12px;
}

.ptm-testimonials__slider {
	--ptm-testimonials-overlap: 140px;
	grid-area: slider;
	width: min(518px, 100%);
	margin: 0;
	overflow: visible;
}

/* Swiper's a11y live region (not in swiper.min.css). */
.ptm-testimonials .swiper-notification {
	position: absolute;
	top: 0;
	left: 0;
	z-index: -1000;
	opacity: 0;
	pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Card                                                                 */
/* ------------------------------------------------------------------ */

.ptm-testimonials .ptm-testimonial {
	--ptm-testimonial-bg: var(--theme-palette-color-2);
	--ptm-testimonial-color: var(--theme-palette-color-8);
	--ptm-testimonial-mark: var(--theme-palette-color-1);
	display: flex;
	/* Equal heights: stretch to the tallest card. */
	height: auto;
	min-height: 443px;
	border-radius: 50px;
	background-color: var(--ptm-testimonial-bg);
	color: var(--ptm-testimonial-color);
}

.ptm-testimonials .ptm-testimonial--green {
	--ptm-testimonial-bg: var(--theme-palette-color-1);
	--ptm-testimonial-color: var(--theme-palette-color-2);
	--ptm-testimonial-mark: var(--theme-palette-color-2);
}

.ptm-testimonials .ptm-testimonial--grey {
	--ptm-testimonial-bg: var(--theme-palette-color-6);
	--ptm-testimonial-color: var(--theme-palette-color-2);
	--ptm-testimonial-mark: var(--theme-palette-color-2);
}

.ptm-testimonial:not(.swiper-slide-active) {
	cursor: pointer;
}

/*
 * A card stacked under the active one fades into its own background
 * (--ptm-stacked: 0 → 1, set by the script; follows the slide transition).
 */
.ptm-testimonial::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(
		90deg,
		color-mix(in srgb, var(--ptm-testimonial-bg) 10%, transparent),
		color-mix(in srgb, var(--ptm-testimonial-bg) 90%, transparent) 73%
	);
	opacity: var(--ptm-stacked, 0);
	pointer-events: none;
	transition-property: opacity;
	transition-duration: inherit;
}

.ptm-testimonials .ptm-testimonial__figure {
	display: flex;
	flex-direction: column;
	gap: 24px;
	width: 100%;
	margin: 0;
	padding: 46px 42px 76px 62px;
}

.ptm-testimonials .ptm-testimonial__title {
	max-width: 320px;
	margin: 0;
	font-size: 32px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0;
	color: inherit;
}

/* The quote mark opens the first line of the title. */
.ptm-testimonial__mark {
	float: left;
	width: 27px;
	height: 23px;
	margin: 0.25em 13px 0 0;
	color: var(--ptm-testimonial-mark);
}

.ptm-testimonials .ptm-testimonial__text {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font-size: var(--ptm-quote-size);
	font-style: normal;
	line-height: var(--ptm-quote-line-height);
	color: inherit;
}

.ptm-testimonials .ptm-testimonial__text p {
	margin: 0;
	font: inherit;
}

.ptm-testimonials .ptm-testimonial__author {
	display: flex;
	align-items: center;
	gap: 16px;
	margin: auto 0 0;
	font-size: 18px;
	line-height: 1;
	text-align: start;
	color: inherit;
}

.ptm-testimonial__avatar {
	flex-shrink: 0;
	width: 51px;
	height: 51px;
	border-radius: 50%;
	object-fit: cover;
}

.ptm-testimonial__person {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 999.98px) {
	.ptm-testimonials {
		padding-block: 64px;
	}

	.ptm-testimonials__inner {
		row-gap: 40px;
	}

	.ptm-testimonials__nav {
		--ptm-round-button-size: 64px;
	}

	.ptm-testimonials__slider {
		--ptm-testimonials-peek: 43px;
		--ptm-testimonials-peek-step: 30px;
		width: 100%;
	}

	.ptm-testimonials .ptm-testimonial {
		min-height: 0;
		border-radius: 36px;
	}

	/* Keep the text clear of the next cards peeking over the right edge. */
	.ptm-testimonials .ptm-testimonial__figure {
		gap: 20px;
		padding: 40px calc(40px + var(--ptm-testimonials-peek)) 40px 40px;
	}

	.ptm-testimonials .ptm-testimonial__title {
		max-width: none;
		font-size: 28px;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile                                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 689.98px) {
	.ptm-testimonials {
		padding-block: 40px;
	}

	.ptm-testimonials__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"title"
			"slider"
			"nav";
		row-gap: 24px;
	}

	.ptm-testimonials__nav {
		justify-self: center;
	}

	.ptm-testimonials .ptm-testimonial {
		border-radius: 24px;
	}

	.ptm-testimonials .ptm-testimonial__figure {
		padding: 24px calc(20px + var(--ptm-testimonials-peek)) 24px 20px;
	}

	.ptm-testimonials .ptm-testimonial__title {
		font-size: 24px;
	}

	/* The quote mark gets its own row above the title. */
	.ptm-testimonial__mark {
		display: block;
		float: none;
		margin: 15px 0 83px;
	}

	.ptm-testimonials .ptm-testimonial__author {
		line-height: 1.2;
	}

	.ptm-testimonial__avatar {
		width: 56px;
		height: 56px;
	}

	.ptm-testimonial__person {
		gap: 4px;
	}

	.ptm-testimonial__role {
		font-size: 16px;
	}
}
