/* ==========================================================================
   Gambit Testimonials Block
   Premium social proof section. Dark surface, elevated cards,
   structured trust metrics. Horizontal scroll on mobile.
   ========================================================================== */

.gambit-testimonials {
	background-color: var(--deep-charcoal);
	position: relative;
	overflow: hidden;
}

/* Cap the inner container at --hero-max-width on medication pages so the
   reviews section aligns horizontally with the hero (hero-v2 uses the same
   token). Mirrors blocks/how-it-works/style.css:7-9. The .single-medication
   scope keeps homepage testimonials at their existing full width. */
.single-medication .gambit-testimonials .gambit-container--full {
	max-width: var(--hero-max-width);
}


/* Layered radial glow — warm red center + cool teal rim for depth */
.gambit-testimonials::before {
	content: "";
	position: absolute;
	top: -15%;
	left: 50%;
	transform: translateX(-50%);
	width: 1000px;
	height: 800px;
	background: radial-gradient(
		ellipse at center,
		rgba(196, 61, 47, 0.06) 0%,
		rgba(42, 157, 143, 0.02) 40%,
		transparent 70%
	);
	pointer-events: none;
}

/* ==========================================================================
   Section Header
   ========================================================================== */

.gambit-testimonials__header {
	text-align: center;
	margin-bottom: 20px;
}

.gambit-testimonials__headline {
	font-family: var(--font-heading);
	font-size: clamp(28px, 4vw, 44px);
	font-weight: 700;
	color: var(--warm-white);
	margin: 0 0 16px;
	line-height: 1.15;
	letter-spacing: -0.03em;
}

.gambit-testimonials__subheadline {
	font-family: var(--font-body);
	font-size: clamp(15px, 1.6vw, 17px);
	color: var(--off-white);
	opacity: 0.65;
	text-align: center;
	margin: 0 auto;
	max-width: 500px;
	line-height: 1.65;
}

/* ==========================================================================
   Rating Badge — centered above cards
   ========================================================================== */

.gambit-testimonials__rating-badge {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-bottom: 44px;
	padding: 10px 22px;
	background: rgba(247, 245, 242, 0.05);
	border: 1px solid rgba(247, 245, 242, 0.08);
	border-radius: 100px;
	width: fit-content;
	margin-left: auto;
	margin-right: auto;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.gambit-testimonials__rating-stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
}

.gambit-testimonials__star-svg {
	display: block;
	flex-shrink: 0;
}

.gambit-testimonials__rating-value {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 16px;
	color: var(--warm-white);
	line-height: 1;
}

.gambit-testimonials__rating-label {
	font-family: var(--font-body);
	font-size: 13px;
	color: var(--off-white);
	opacity: 0.5;
	line-height: 1;
}

.gambit-testimonials__google-icon {
	flex-shrink: 0;
}

/* ==========================================================================
   Scroll Wrapper — holds the grid + right-edge fade on mobile
   ========================================================================== */

.gambit-testimonials__scroll-wrap {
	position: relative;
}

/* Right-edge fade to hint at more content (mobile only) */
@media (max-width: 767px) {
	.gambit-testimonials__scroll-wrap::after {
		content: "";
		position: absolute;
		top: 0;
		right: 0;
		bottom: 0;
		width: 48px;
		background: linear-gradient(
			to right,
			transparent 0%,
			rgba(26, 26, 30, 0.95) 100%
		);
		pointer-events: none;
		z-index: 2;
	}
}

/* ==========================================================================
   Card Grid — 3-col on desktop, horizontal scroll on mobile
   ========================================================================== */

.gambit-testimonials__grid {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;

	/* Inset padding so first/last cards align with container */
	padding-left: var(--side-padding);
	padding-right: var(--side-padding);
	scroll-padding-left: var(--side-padding);
	scroll-padding-right: var(--side-padding);
}

.gambit-testimonials__grid::-webkit-scrollbar {
	display: none;
}

/* ==========================================================================
   Individual Card
   ========================================================================== */

/* Card sizing on mobile — show ~75% of active card + generous peek of next */
.gambit-testimonials__card {
	flex: 0 0 78%;
	min-width: 0;
	height: 420px;
	scroll-snap-align: start;
	position: relative;
	border-radius: 20px;
	padding: 1px;
	background: linear-gradient(
		160deg,
		rgba(247, 245, 242, 0.14) 0%,
		rgba(247, 245, 242, 0.03) 40%,
		rgba(247, 245, 242, 0.08) 100%
	);
	transition: transform 0.3s cubic-bezier(0.23, 1, 0.32, 1),
	            box-shadow 0.3s cubic-bezier(0.23, 1, 0.32, 1);
}

/* Tablet: slightly narrower cards, show more of next */
@media (min-width: 500px) and (max-width: 767px) {
	.gambit-testimonials__card {
		flex: 0 0 65%;
	}
}

/* Desktop: horizontal scroll showing ~3 cards */
@media (min-width: 768px) {
	.gambit-testimonials__grid {
		gap: 20px;
	}

	.gambit-testimonials__card {
		flex: 0 0 calc(33.333% - 14px);
		height: 450px;
	}
}

/* Expanded card breaks out of fixed height (applies at all viewport widths).
   min-height keeps the card locked to the sibling size when the expanded
   content happens to be shorter — cards can only grow, never shrink. */
.gambit-testimonials__card.is-card-expanded {
	height: auto;
	min-height: 420px;
}

@media (min-width: 768px) {
	.gambit-testimonials__card.is-card-expanded {
		min-height: 450px;
	}
}

@media (min-width: 1200px) {
	.gambit-testimonials__grid {
		gap: 24px;
	}
}

@media (hover: hover) and (pointer: fine) {
	.gambit-testimonials__card:hover {
		transform: translateY(-4px);
		box-shadow:
			0 16px 48px rgba(26, 26, 30, 0.4),
			0 4px 16px rgba(196, 61, 47, 0.06);
	}
}

.gambit-testimonials__card-inner {
	background: linear-gradient(
		168deg,
		rgba(247, 245, 242, 0.07) 0%,
		rgba(32, 32, 36, 0.98) 100%
	);
	border-radius: 19px;
	padding: 28px 24px;
	display: flex;
	flex-direction: column;
	height: 100%;
	/* Liquid glass inner refraction */
	box-shadow: inset 0 1px 0 rgba(247, 245, 242, 0.08);
}

@media (min-width: 768px) {
	.gambit-testimonials__card-inner {
		padding: 36px 32px;
	}
}

/* ==========================================================================
   Stars (in-card)
   ========================================================================== */

.gambit-testimonials__stars {
	display: inline-flex;
	align-items: center;
	gap: 2px;
	margin-bottom: 20px;
}

/* ==========================================================================
   Quote
   ========================================================================== */

.gambit-testimonials__quote {
	font-family: var(--font-body);
	font-size: 16px;
	line-height: 1.55;
	color: var(--off-white);
	opacity: 0.92;
	margin: 0;
	padding: 0;
	border: none;
	position: relative;
}

.gambit-testimonials__quote-text {
	display: -webkit-box;
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gambit-testimonials__quote-text.is-expanded {
	display: block;
	-webkit-line-clamp: unset;
}


/* Read more / Show less toggle */
.gambit-testimonials__read-more {
	background: none;
	border: none;
	padding: 12px 0 16px;
	margin: 0;
	font-family: var(--font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--clinical-teal);
	cursor: pointer;
	opacity: 0.85;
	transition: opacity 0.2s ease-out;
	min-height: 37px;
}

/* Invisible but still takes up space for consistent card layout */
.gambit-testimonials__read-more--hidden {
	visibility: hidden;
	pointer-events: none;
}

@media (hover: hover) and (pointer: fine) {
	.gambit-testimonials__read-more:hover {
		opacity: 1;
	}
}

.gambit-testimonials__read-more:focus-visible {
	outline: 2px solid var(--clinical-teal);
	outline-offset: 2px;
	border-radius: 2px;
}

.gambit-testimonials__read-more:active {
	transform: scale(0.97);
}

@media (min-width: 768px) {
	.gambit-testimonials__quote {
		font-size: 17px;
	}
}

@media (min-width: 1200px) {
	.gambit-testimonials__quote {
		font-size: 18px;
	}
}

.gambit-testimonials__quote-mark {
	font-family: var(--font-heading);
	font-size: 52px;
	font-weight: 700;
	line-height: 0.6;
	color: var(--signal-red);
	opacity: 0.35;
	display: block;
	margin-bottom: 14px;
	user-select: none;
}

/* ==========================================================================
   Author
   ========================================================================== */

.gambit-testimonials__author {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 20px;
	border-top: 1px solid rgba(247, 245, 242, 0.08);
	margin-top: auto;
}

/* Avatar — circular photo or initials fallback */
.gambit-testimonials__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
	border: 2px solid rgba(247, 245, 242, 0.12);
}

.gambit-testimonials__avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, rgba(196, 61, 47, 0.15) 0%, rgba(247, 245, 242, 0.08) 100%);
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 14px;
	color: var(--warm-white);
	letter-spacing: 0.02em;
}

.gambit-testimonials__author-info {
	min-width: 0;
	flex: 1;
}

.gambit-testimonials__name {
	font-family: var(--font-heading);
	font-weight: 600;
	font-size: 15px;
	color: var(--warm-white);
	margin: 0;
	line-height: 1.3;
}

.gambit-testimonials__program {
	font-family: var(--font-body);
	font-size: 13px;
	font-weight: 500;
	color: var(--off-white);
	opacity: 0.45;
	margin: 3px 0 0;
	line-height: 1.3;
}

.gambit-testimonials__verified {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-family: var(--font-body);
	font-size: 12px;
	font-weight: 500;
	color: var(--off-white);
	opacity: 0.45;
	white-space: nowrap;
	flex-shrink: 0;
}

.gambit-testimonials__verified svg {
	opacity: 0.7;
}

/* ==========================================================================
   Navigation — Arrows + Dot Indicators
   ========================================================================== */

.gambit-testimonials__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 36px;
}

.gambit-testimonials__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	border: 1px solid rgba(247, 245, 242, 0.1);
	background: transparent;
	color: var(--warm-white);
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.2s ease-out,
	            border-color 0.2s ease-out,
	            transform 0.15s ease-out;
}

.gambit-testimonials__arrow:active {
	transform: scale(0.95);
}

@media (hover: hover) and (pointer: fine) {
	.gambit-testimonials__arrow:hover {
		background: rgba(247, 245, 242, 0.08);
		border-color: rgba(247, 245, 242, 0.18);
	}
}

.gambit-testimonials__arrow:focus-visible {
	outline: 2px solid var(--clinical-teal);
	outline-offset: 2px;
}

.gambit-testimonials__dots {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.gambit-testimonials__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(247, 245, 242, 0.15);
	transition: background 0.25s cubic-bezier(0.23, 1, 0.32, 1),
	            width 0.25s cubic-bezier(0.23, 1, 0.32, 1),
	            border-radius 0.25s cubic-bezier(0.23, 1, 0.32, 1);
	cursor: pointer;
}

.gambit-testimonials__dot--active {
	background: var(--warm-white);
	width: 24px;
	border-radius: 3px;
}

/* ==========================================================================
   Trust Metrics Bar
   ========================================================================== */

.gambit-testimonials__metrics {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 32px;
	margin-top: 56px;
	margin-bottom: 48px;
	flex-wrap: wrap;
	padding: 56px 0;
	isolation: isolate;
	background:
		radial-gradient(
			60% 100% at 50% 50%,
			rgba(247, 245, 242, 0.04) 0%,
			transparent 70%
		);
}

/* Top/bottom hairlines that fade at the edges. */
.gambit-testimonials__metrics::before,
.gambit-testimonials__metrics::after {
	content: "";
	position: absolute;
	left: 10%;
	right: 10%;
	height: 1px;
	background: linear-gradient(
		to right,
		transparent,
		rgba(247, 245, 242, 0.12) 20%,
		rgba(247, 245, 242, 0.12) 80%,
		transparent
	);
	pointer-events: none;
}

.gambit-testimonials__metrics::before { top: 0; }
.gambit-testimonials__metrics::after  { bottom: 0; }

@media (min-width: 768px) {
	.gambit-testimonials__metrics {
		gap: 72px;
		margin-top: 64px;
		padding: 72px 0;
	}
}

.gambit-testimonials__metric {
	--stagger-index: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
	opacity: 0;
	transform: translateY(16px);
	transition:
		opacity 500ms cubic-bezier(0.22, 1, 0.36, 1),
		transform 500ms cubic-bezier(0.22, 1, 0.36, 1);
	transition-delay: calc(var(--stagger-index) * 120ms);
}

.gambit-testimonials__metrics.is-in-view .gambit-testimonials__metric {
	opacity: 1;
	transform: translateY(0);
}

.gambit-testimonials__metric-value {
	font-family: var(--font-mono, 'JetBrains Mono', monospace);
	font-size: clamp(52px, 7.5vw, 88px);
	font-weight: 700;
	color: var(--warm-white);
	line-height: 1;
	letter-spacing: -0.04em;
	display: inline-flex;
	align-items: baseline;
}

.gambit-testimonials__metric-accent {
	color: var(--signal-red);
	font-weight: 700;
	/* Slightly smaller so the accent reads as an accent, not co-equal. */
	font-size: 0.72em;
	line-height: 1;
	margin-left: 0.04em;
}

/* Leading accent (e.g. '#1') sits tight to the number on the right, no left margin. */
.gambit-testimonials__metric-accent:first-child {
	margin-left: 0;
	margin-right: 0.02em;
}

.gambit-testimonials__metric-label {
	font-family: var(--font-body);
	font-size: clamp(13px, 1.2vw, 15px);
	color: var(--off-white);
	opacity: 0.55;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	line-height: 1.3;
	text-align: center;
	max-width: 22ch;
}

.gambit-testimonials__metric-divider {
	width: 1px;
	height: 72px;
	background: linear-gradient(
		to bottom,
		transparent,
		rgba(247, 245, 242, 0.14) 30%,
		rgba(247, 245, 242, 0.14) 70%,
		transparent
	);
	flex-shrink: 0;
	opacity: 0;
	transition: opacity 600ms cubic-bezier(0.22, 1, 0.36, 1) 60ms;
}

.gambit-testimonials__metrics.is-in-view .gambit-testimonials__metric-divider {
	opacity: 1;
}

/* Hide dividers on small mobile when metrics wrap */
@media (max-width: 500px) {
	.gambit-testimonials__metrics {
		gap: 32px 40px;
		padding: 48px 0;
	}

	.gambit-testimonials__metric-divider {
		display: none;
	}

	/* Mobile ordering: lead with 25,000+ (volume), then #1 (quality), then 40+ (heritage).
	   nth-child counts dividers, so metric cards sit at positions 1, 3, 5. */
	.gambit-testimonials__metric:nth-child(1) { order: 2; } /* #1 → visual position 2 */
	.gambit-testimonials__metric:nth-child(3) { order: 1; } /* 25,000+ → visual position 1 */
	.gambit-testimonials__metric:nth-child(5) { order: 3; } /* 40+ → visual position 3 */
}

@media (prefers-reduced-motion: reduce) {
	.gambit-testimonials__metric,
	.gambit-testimonials__metric-divider {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* ==========================================================================
   Mobile-specific header/badge spacing
   ========================================================================== */

@media (max-width: 767px) {
	.gambit-testimonials__header {
		margin-bottom: 16px;
	}

	.gambit-testimonials__rating-badge {
		margin-bottom: 32px;
	}
}

/* ==========================================================================
   CTA
   ========================================================================== */

.gambit-testimonials__cta-wrap {
	text-align: center;
	padding-top: 4px;
}

/* ==========================================================================
   Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.gambit-testimonials__card,
	.gambit-testimonials__arrow,
	.gambit-testimonials__read-more {
		transition: none;
	}

	.gambit-testimonials__dot {
		transition: background 0.1s ease;
	}
}

/* Program page: reset scroll-padding when --side-padding is overridden to 4vw */
@media (min-width: 1200px) {
	.single-program .gambit-testimonials__grid {
		padding-left: 32px;
		padding-right: 32px;
		scroll-padding-left: 32px;
		scroll-padding-right: 32px;
	}
}


/* ==========================================================================
   Visual product page testimonials - dark-red card surface to echo the
   lifestyle-banner "only legally prescribed" treatment elsewhere on these
   pages. Scoped to the .gambit-testimonials--visual-med class auto-applied
   by render.php when a medication post has gambit_med_hero_variant=visual,
   so other testimonials instances keep the default cards.
   Source values mirror blocks/lifestyle-banner/style.css - same #1A1218
   base + signal-red radial tint, applied to the inner card.
   ========================================================================== */
.gambit-testimonials--visual-med .gambit-testimonials__card-inner {
	background:
		radial-gradient(160% 130% at 0% 50%, rgba(196, 61, 47, 0.13), transparent 80%),
		#1A1218;
}

.gambit-testimonials--visual-med .gambit-testimonials__card {
	background: linear-gradient(
		160deg,
		rgba(196, 61, 47, 0.22) 0%,
		rgba(247, 245, 242, 0.04) 40%,
		rgba(196, 61, 47, 0.12) 100%
	);
}
