/**
 * Paripoorn Testimonials widget.
 */

.pp-tm {
	position: relative;
}

.pp-tm__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: 32px;
}

.pp-tm__title {
	font-family: var(--pp-font-heading, "Libre Caslon Text", serif);
	font-weight: 400;
	font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
	line-height: 1.2;
	color: var(--pp-heading, #222222);
	margin: 0 0 8px;
}

.pp-tm__subtitle {
	font-family: var(--pp-font-body, "Manrope", sans-serif);
	font-size: 15px;
	color: #6B6B6B;
	margin: 0;
}

.pp-tm__arrows {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	margin-top: 6px;
}

.pp-tm .pp-tm__arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background-color: transparent;
	border: 1px solid #D9CBB0;
	padding: 0;
	color: #222222;
	transition: color 250ms ease, background-color 250ms ease, border-color 250ms ease;
}

.pp-tm .pp-tm__arrow:hover {
	background-color: var(--pp-primary, #F20D16);
	border-color: var(--pp-primary, #F20D16);
	color: #fff;
}

/*
 * A real sliding track. .pp-tm__viewport clips anything outside the
 * visible window; .pp-tm__grid holds every card in a single flex row
 * and is moved with a CSS transform. Card width and the transform
 * distance are both set directly by testimonials.js as pixel values
 * measured from the live DOM (viewport.clientWidth, gap, visible
 * count) — not a CSS percentage/calc() guess — so the track's total
 * width and each step's distance are always exact, and a slide can
 * never end up sitting half on/half off the visible edge.
 */
.pp-tm__viewport {
	overflow: hidden;
	width: 100%;
}

.pp-tm__grid {
	display: flex;
	gap: 24px;
	will-change: transform;
	transition: transform 500ms cubic-bezier(.4, 0, .2, 1);
}

/*
 * Slide width is normally written as an exact px value by
 * testimonials.js (see above). This flex-basis is the fallback for
 * before/without that measurement — most importantly on first paint and
 * inside the Elementor editor, where the canvas iframe can report
 * clientWidth: 0 at render time. Without it a slide has no width at all
 * and the card renders at its natural size, overflowing the viewport on
 * a phone. --pp-tm-slides is written by the widget's Cards Per Row
 * control so the fallback matches the configured count.
 */
.pp-tm__slide {
	flex-shrink: 0;
	min-width: 0;
	flex-basis: calc(
		(100% - (24px * (var(--pp-tm-slides, 4) - 1))) / var(--pp-tm-slides, 4)
	);
}

/* Nothing inside a card may force it wider than its track — long words in
   a quote or a role line would otherwise push the whole row sideways. */
.pp-tm__slide,
.pp-tm__card {
	box-sizing: border-box;
	max-width: 100%;
}

.pp-tm__quote,
.pp-tm__name,
.pp-tm__role {
	overflow-wrap: break-word;
	min-width: 0;
}

@media (max-width: 599px) {
	.pp-tm__header {
		flex-direction: column;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pp-tm__grid {
		transition: none;
	}
}

.pp-tm__card {
	background: #FFFFFF;
	border-radius: 16px;
	padding: 24px;
	height: 100%;
	display: flex;
	flex-direction: column;
}

.pp-tm__stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-bottom: 14px;
}

.pp-tm__star svg {
	fill: #D89B32;
}

.pp-tm__star--empty svg {
	fill: #E5DCC8;
}

.pp-tm__quote {
	font-family: var(--pp-font-body, "Manrope", sans-serif);
	font-size: 14px;
	line-height: 1.6;
	color: #4A4A4A;
	margin: 0 0 20px;
	flex: 1;
}

.pp-tm__author {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: auto;
}

.pp-tm__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.pp-tm__name {
	font-family: var(--pp-font-body, "Manrope", sans-serif);
	font-size: 13px;
	font-weight: 700;
	color: var(--pp-heading, #222222);
	line-height: 1.3;
}

.pp-tm__role {
	font-family: var(--pp-font-body, "Manrope", sans-serif);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	color: #9A9A9A;
	line-height: 1.3;
}

/*
 * Breakpoint fallbacks for the slide width.
 *
 * The JS re-measures on resize and overrides these with exact pixels, but
 * these keep the layout correct on first paint at every screen size —
 * which is when the overflow was visible on mobile.
 */
@media (max-width: 1023px) {
	.pp-tm__slide {
		flex-basis: calc(
			(100% - (24px * (var(--pp-tm-slides-tablet, 2) - 1))) / var(--pp-tm-slides-tablet, 2)
		);
	}
}

@media (max-width: 599px) {
	.pp-tm__grid {
		gap: 16px;
	}

	.pp-tm__slide {
		flex-basis: calc(
			(100% - (16px * (var(--pp-tm-slides-mobile, 1) - 1))) / var(--pp-tm-slides-mobile, 1)
		);
	}
}
