/* ===========================================================
   RewardRace — Testimonial (rrTest)
   Paginated carousel of customer testimonial cards.
   Section background + tokens mirror "How It Works" (rrHow):
   white in light, deep ink in dark. Brand purple accent +
   soft lavender avatar tint.
   =========================================================== */

.rrTest {
	/* ---- Tokens (light) ---- */
	--rrtest-bg:          #FFFFFF;
	--rrtest-section-bg:  #FFFFFF;
	--rrtest-heading:     var(--rr-heading);
	--rrtest-text:        var(--rr-text);
	--rrtest-muted:       var(--rr-muted);
	--rrtest-subtle:      var(--rr-subtle);
	--rrtest-accent:      var(--rr-brand);
	--rrtest-accent-soft: var(--rr-brand-soft);
	--rrtest-accent-tint: var(--rr-brand-tint);

	--rrtest-card-bg:     #FFFFFF;
	--rrtest-card-border: var(--rr-border);
	--rrtest-card-shadow: 0 1px 2px rgba(11, 10, 20, .04), 0 6px 18px rgba(11, 10, 20, .04);
	--rrtest-card-shadow-hover: 0 4px 14px rgba(87, 63, 211, .12), 0 12px 32px rgba(11, 10, 20, .08);

	--rrtest-star-on:     var(--rr-star);          /* warm yellow #F5B100 */
	--rrtest-star-off:    rgba(11, 10, 20, .14);

	--rrtest-avatar-bg:   var(--rr-brand-soft);
	--rrtest-avatar-fg:   var(--rr-brand);

	--rrtest-dot:         rgba(11, 10, 20, .18);
	--rrtest-dot-active:  var(--rr-brand);

	/* Responsive cards-per-slide (set by render via inline style). */
	--rrtest-cols-d: 3;
	--rrtest-cols-t: 2;
	--rrtest-cols-m: 1;

	position: relative;
	font-family: var(--rr-font-sans);
	color: var(--rrtest-text);
	background-color: var(--rrtest-section-bg);
	box-sizing: border-box;
	border-top: 0 !important;
	overflow: hidden;
}
.rrTest *, .rrTest *::before, .rrTest *::after { box-sizing: border-box; }

/* Force Plus Jakarta Sans and block italics, matching the
   site-wide rule applied to every other widget namespace. */
.rrTest, .rrTest * {
	font-family: var(--rr-font-sans) !important;
	font-style: normal !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Dark-mode theming — mirrors How It Works (rrHow) dark tokens. */
.rrTest--dark,
html[data-theme="dark"] .rrTest--auto {
	--rrtest-bg:         #0A0912;
	--rrtest-section-bg: #0A0912;
	--rrtest-card-bg:    #14122A;
	--rrtest-card-border: rgba(255, 255, 255, .08);
	--rrtest-card-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .35);
	--rrtest-card-shadow-hover: 0 6px 22px rgba(139, 115, 255, .22), 0 18px 38px rgba(0, 0, 0, .45);
	--rrtest-accent:      #8B73FF;
	--rrtest-accent-soft: rgba(139, 115, 255, .14);
	--rrtest-accent-tint: rgba(139, 115, 255, .18);
	--rrtest-avatar-bg:   rgba(139, 115, 255, .18);
	--rrtest-avatar-fg:   #C5B6FF;
	--rrtest-star-off:    rgba(255, 255, 255, .16);
	--rrtest-dot:         rgba(255, 255, 255, .22);
	--rrtest-dot-active:  #8B73FF;
}

/* ===========================================================
   Layout
   =========================================================== */
.rrTest__wrap {
	max-width: var(--rr-container);
	margin: 0 auto;
	padding: clamp(3rem, 6vw, 5.5rem) clamp(1.25rem, 3vw, 2.5rem);
	position: relative;
	z-index: 1;
}

/* ===========================================================
   Heading block
   =========================================================== */
.rrTest__head {
	margin: 0 auto var(--rr-space-12);
	max-width: var(--rr-head-max-width);
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.rrTest .rrTest__eyebrow {
	display: inline-flex;
	align-items: center;
	font-size: var(--rr-fs-2xs);
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--rrtest-subtle);
	margin-bottom: var(--rr-space-4);
}

.rrTest .rrTest__title {
	font-size: var(--rr-fs-h2);
	font-weight: 800;
	letter-spacing: -.022em;
	line-height: var(--rr-lh-snug);
	margin: 0;
	color: var(--rrtest-heading);
	text-wrap: balance;
}
.rrTest__titleLead,
.rrTest__titleTail { color: inherit; }

.rrTest .rrTest__titleAccent {
	color: var(--rrtest-accent) !important;
	font-weight: 800;
	font-style: normal !important;
}

/* ===========================================================
   Carousel viewport + track
   The viewport clips horizontally; the track is a flex row
   that translates by whole "pages" on dot click.
   =========================================================== */
.rrTest__viewport {
	position: relative;
	overflow: hidden;
	margin: 0 auto;
	max-width: 1140px;
	/* Padding lets card hover shadow breathe without being clipped. */
	padding: 6px 0 14px;
}

.rrTest__track {
	--rrtest-gap: clamp(1rem, 1.8vw, 1.5rem);
	--rrtest-cols: var(--rrtest-cols-d);

	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	gap: var(--rrtest-gap);
	align-items: stretch;
	transform: translate3d(0, 0, 0);
	transition: transform var(--rr-dur-slow, 400ms) var(--rr-ease-out, cubic-bezier(.22, 1, .36, 1));
	will-change: transform;
}

/* Each card fills exactly its share of the viewport width,
   leaving room for the gaps between visible cards. */
.rrTest__item {
	flex: 0 0 calc((100% - (var(--rrtest-gap) * (var(--rrtest-cols) - 1))) / var(--rrtest-cols));
	min-width: 0;
	display: flex;
}

/* ===========================================================
   Testimonial card
   =========================================================== */
.rrTest__card {
	flex: 1;
	min-width: 0;
	background: var(--rrtest-card-bg);
	border: 1px solid var(--rrtest-card-border);
	border-radius: var(--rr-radius-lg);
	padding: clamp(1.25rem, 1.8vw, 1.75rem);
	box-shadow: var(--rrtest-card-shadow);
	display: flex;
	flex-direction: column;
	gap: var(--rr-space-4);
	transition:
		transform var(--rr-dur-base) var(--rr-ease-out),
		box-shadow var(--rr-dur-base) var(--rr-ease-out),
		border-color var(--rr-dur-base) var(--rr-ease-out);
}
.rrTest__card:hover {
	transform: translateY(-3px);
	box-shadow: var(--rrtest-card-shadow-hover);
	border-color: color-mix(in srgb, var(--rrtest-accent) 24%, var(--rrtest-card-border));
}

/* ----- Stars row ----- */
.rrTest__stars {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	line-height: 1;
}
.rrTest__star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
}
.rrTest__star svg { display: block; width: 18px; height: 18px; }
.rrTest__star--on  { color: var(--rrtest-star-on); }
.rrTest__star--off { color: var(--rrtest-star-off); }

/* ----- Quote ----- */
.rrTest .rrTest__quote {
	font-size: var(--rr-fs-sm);
	line-height: var(--rr-lh-relaxed);
	color: var(--rrtest-muted);
	margin: 0;
	font-weight: 400;
	/* keep cards same height even with shorter quotes */
	flex: 1;
}

/* ----- Person row ----- */
.rrTest__person {
	display: flex;
	align-items: center;
	gap: var(--rr-space-3);
	margin-top: auto;
}

.rrTest__avatar {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--rrtest-avatar-bg);
	color: var(--rrtest-avatar-fg);
	flex-shrink: 0;
	overflow: hidden;
}
.rrTest__avatar svg { width: 22px; height: 22px; display: block; }
.rrTest__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.rrTest__personMeta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.rrTest .rrTest__name {
	font-size: .9375rem;
	font-weight: 700;
	color: var(--rrtest-heading);
	line-height: 1.3;
	letter-spacing: -.005em;
}
.rrTest .rrTest__role {
	font-size: .8125rem;
	color: var(--rrtest-muted);
	font-weight: 400;
	line-height: 1.3;
	margin-top: 2px;
}

/* ===========================================================
   Pagination dots
   =========================================================== */
.rrTest__dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: var(--rr-space-6);
	min-height: 12px; /* prevents layout shift when JS injects dots */
}
.rrTest__dot {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	padding: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--rrtest-dot);
	cursor: pointer;
	transition:
		background-color var(--rr-dur-base) var(--rr-ease-out),
		transform var(--rr-dur-base) var(--rr-ease-out),
		width var(--rr-dur-base) var(--rr-ease-out);
}
.rrTest__dot:hover {
	transform: scale(1.15);
}
.rrTest__dot.is-active {
	background-color: var(--rrtest-dot-active);
	width: 22px;
	border-radius: 999px;
}
.rrTest__dot:focus-visible {
	outline: 2px solid var(--rrtest-accent);
	outline-offset: 3px;
}

/* ===========================================================
   Responsive — swap visible columns count
   =========================================================== */

/* Tablet */
@media (max-width: 960px) {
	.rrTest__track { --rrtest-cols: var(--rrtest-cols-t); }
	.rrTest__head  { margin-bottom: var(--rr-space-10); }
}

/* Mobile */
@media (max-width: 720px) {
	.rrTest__wrap {
		padding: clamp(2.5rem, 8vw, 4rem) clamp(1rem, 5vw, 1.5rem);
	}
	.rrTest__head {
		margin-bottom: var(--rr-space-8);
	}
	.rrTest__track { --rrtest-cols: var(--rrtest-cols-m); }
	.rrTest__card  { padding: 1.25rem; }
	.rrTest .rrTest__title {
		font-size: clamp(1.625rem, 5.5vw, 2.25rem);
	}
}

/* ===========================================================
   Reduced motion — no transform animation, no hover lift
   =========================================================== */
@media (prefers-reduced-motion: reduce) {
	.rrTest__track { transition: none; }
	.rrTest__card:hover { transform: none; }
}
