/* =========================================================
   Scrolling Reviews — editorial testimonial style
   ========================================================= */

.sr-root {
	--sr-bg: #f6f1e7;
	--sr-ink: #1a1a1a;
	--sr-muted: #6b6357;
	--sr-card: #ffffff;
	--sr-card-border: rgba(26, 26, 26, 0.08);
	--sr-accent: #b7411a;
	--sr-quote: #d9c9a8;

	/* Trustpilot-style stars */
	--sr-star-filled: #00B77F;
	--sr-star-empty: #dcdce6;
	--sr-star-glyph: #ffffff;
	--sr-star-size: 26px;

	--sr-shadow: 0 1px 2px rgba(26, 26, 26, 0.04), 0 8px 24px rgba(26, 26, 26, 0.06);
	--sr-fade: var(--sr-bg);
	--sr-serif: "Cormorant Garamond", "Playfair Display", Georgia, "Times New Roman", serif;
	--sr-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

	font-family: var(--sr-sans);
	color: var(--sr-ink);
	background: var(--sr-bg);
	padding: 3rem 1.25rem;
	border-radius: 2px;
	max-width: 100%;
	position: relative;
}

.sr-root.sr-theme-dark {
	--sr-bg: #111111;
	--sr-ink: #f2ece1;
	--sr-muted: #9a9287;
	--sr-card: #1a1a1a;
	--sr-card-border: rgba(242, 236, 225, 0.08);
	--sr-accent: #e38a5b;
	--sr-quote: #3d342a;
	--sr-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.4);
	--sr-fade: var(--sr-bg);
}

.sr-title {
	font-family: var(--sr-serif);
	font-weight: 500;
	font-style: italic;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	letter-spacing: -0.01em;
	text-align: center;
	margin: 0 0 2rem 0;
	color: var(--sr-ink);
}

/* --- Viewport ------------------------------------------- */

.sr-viewport {
	position: relative;
	height: var(--sr-height, 560px);
	overflow: hidden;
	max-width: 1200px;
	margin: 0 auto;
}

.sr-fade {
	position: absolute;
	left: 0;
	right: 0;
	height: 120px;
	pointer-events: none;
	z-index: 2;
}

.sr-fade-top {
	top: 0;
	background: linear-gradient(to bottom, var(--sr-fade) 0%, var(--sr-fade) 20%, transparent 100%);
}

.sr-fade-bottom {
	bottom: 0;
	background: linear-gradient(to top, var(--sr-fade) 0%, var(--sr-fade) 20%, transparent 100%);
}

/* --- Columns & tracks ----------------------------------- */

.sr-columns {
	display: grid;
	gap: 1.5rem;
	height: 100%;
}

.sr-columns[data-columns="1"] { grid-template-columns: minmax(0, 640px); justify-content: center; }
.sr-columns[data-columns="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sr-columns[data-columns="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 900px) {
	.sr-columns[data-columns="3"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.sr-columns[data-columns="2"],
	.sr-columns[data-columns="3"] { grid-template-columns: minmax(0, 1fr); }
}

.sr-track {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	will-change: transform;
	animation: sr-scroll var(--sr-duration, 40s) linear infinite;
}

.sr-columns[data-columns="2"] .sr-track:nth-child(2),
.sr-columns[data-columns="3"] .sr-track:nth-child(2) {
	animation-delay: calc(var(--sr-duration, 40s) * -0.33);
}
.sr-columns[data-columns="3"] .sr-track:nth-child(3) {
	animation-delay: calc(var(--sr-duration, 40s) * -0.66);
}

@keyframes sr-scroll {
	from { transform: translateY(0); }
	to   { transform: translateY(-50%); }
}

.sr-viewport:hover .sr-track {
	animation-play-state: paused;
}

@media (prefers-reduced-motion: reduce) {
	.sr-track { animation: none; }
	.sr-viewport { overflow-y: auto; }
}

/* --- Review card ---------------------------------------- */

.sr-card {
	position: relative;
	background: var(--sr-card);
	border: 1px solid var(--sr-card-border);
	border-radius: 4px;
	padding: 1.75rem;
	box-shadow: var(--sr-shadow);
	flex-shrink: 0;
}

/* --- Trustpilot-style star rating ----------------------- */

.sr-rating {
	display: inline-flex;
	gap: 2px;
	margin-bottom: 1rem;
}

.sr-star {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--sr-star-size);
	height: var(--sr-star-size);
	font-size: calc(var(--sr-star-size) * 0.7);
	color: var(--sr-star-glyph);
	line-height: 1;
}

.sr-star-filled {
	background: var(--sr-star-filled);
}

.sr-star-empty {
	background: var(--sr-star-empty);
}

/* --- Heading, quote, attribution ------------------------ */

.sr-heading {
	font-family: var(--sr-sans);
	font-weight: 700;
	font-size: 1.125rem;
	line-height: 1.3;
	color: var(--sr-ink);
	margin: 0 0 0.5rem 0;
	letter-spacing: -0.01em;
}

.sr-quote {
	font-family: var(--sr-serif);
	font-size: 1.0625rem;
	line-height: 1.55;
	font-weight: 400;
	color: var(--sr-ink);
	margin: 0 0 1.25rem 0;
}

.sr-attribution {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	padding-top: 1rem;
	border-top: 1px solid var(--sr-card-border);
}

.sr-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	background: var(--sr-quote);
	flex-shrink: 0;
}

.sr-avatar-fallback {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: var(--sr-quote);
	color: var(--sr-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--sr-serif);
	font-weight: 600;
	font-size: 1.25rem;
	flex-shrink: 0;
}

.sr-author {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.sr-author-name {
	font-weight: 600;
	font-size: 0.9375rem;
	color: var(--sr-ink);
	letter-spacing: -0.005em;
}

/* --- Loading / error states (JSON mode) ----------------- */

.sr-state {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	color: var(--sr-muted);
	font-size: 0.9375rem;
	background: var(--sr-bg);
	z-index: 3;
}

.sr-state.sr-hidden { display: none; }

.sr-spinner {
	width: 14px;
	height: 14px;
	border: 2px solid var(--sr-quote);
	border-top-color: var(--sr-accent);
	border-radius: 50%;
	animation: sr-spin 0.8s linear infinite;
}

@keyframes sr-spin {
	to { transform: rotate(360deg); }
}

.sr-state-error {
	color: var(--sr-accent);
	font-style: italic;
}
