/**
 * Reviews Carousel for Google.
 *
 * Theme it by overriding the custom properties, e.g.:
 *   body .rcg { --rcg-accent: #c45a2c; --rcg-avatar-bg: #1e4d7b; }
 */

.rcg {
	--rcg-per-view: 3;
	--rcg-gap: 1.5rem;
	--rcg-text: #1a1a1a;
	--rcg-card-text: var(--rcg-text);
	--rcg-muted: #5a6472;
	--rcg-card-bg: #ffffff;
	--rcg-card-bg-hover: #ffffff;
	--rcg-card-border: #e8ecf0;
	--rcg-card-shadow: 0 2px 8px rgba(15, 42, 71, 0.06);
	--rcg-card-shadow-hover: 0 8px 24px rgba(15, 42, 71, 0.1);
	--rcg-card-radius: 14px;
	--rcg-star: #fbbf24;
	--rcg-accent: #1a73e8;
	--rcg-focus: var(--rcg-accent);
	--rcg-avatar-bg: #5a6472;
	--rcg-avatar-border: transparent;
	color: var(--rcg-text);
}

.rcg--dark {
	--rcg-text: #ffffff;
	--rcg-card-text: rgba(255, 255, 255, 0.88);
	--rcg-muted: rgba(184, 200, 216, 0.72);
	--rcg-card-bg: rgba(255, 255, 255, 0.06);
	--rcg-card-bg-hover: rgba(255, 255, 255, 0.1);
	--rcg-card-border: rgba(255, 255, 255, 0.1);
	--rcg-card-shadow: none;
	--rcg-card-shadow-hover: none;
	--rcg-accent: #fbbf24;
}

/* Summary row */

.rcg__summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 0.75rem;
	margin-bottom: 2rem;
	font-size: 0.9375rem;
}

.rcg__google {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: #ffffff;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(15, 42, 71, 0.08);
}

.rcg__google svg {
	width: 20px;
	height: 20px;
}

.rcg__score {
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1;
}

.rcg__stars {
	color: var(--rcg-star);
	font-size: 1.1rem;
	letter-spacing: 0.05em;
	line-height: 1;
}

.rcg a {
	color: inherit;
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
	text-underline-offset: 3px;
}

.rcg a:hover {
	text-decoration-color: currentColor;
}

.rcg a:focus-visible {
	outline: 2px solid var(--rcg-focus);
	outline-offset: 2px;
}

.rcg .rcg__write {
	color: var(--rcg-accent);
	font-weight: 700;
}

/* Track */

.rcg__track {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--rcg-per-view) - 1) * var(--rcg-gap)) / var(--rcg-per-view));
	gap: var(--rcg-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.rcg__track::-webkit-scrollbar {
	display: none;
}

.rcg__track:focus-visible {
	outline: 2px solid var(--rcg-focus);
	outline-offset: 4px;
	border-radius: var(--rcg-card-radius);
}

.rcg__slide {
	display: flex;
	margin: 0;
	scroll-snap-align: start;
}

/* Card */

.rcg-card {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 2rem 1.8rem;
	background: var(--rcg-card-bg);
	border: 1px solid var(--rcg-card-border);
	border-radius: var(--rcg-card-radius);
	box-shadow: var(--rcg-card-shadow);
	transition: background 0.2s ease, box-shadow 0.2s ease;
}

.rcg-card:hover {
	background: var(--rcg-card-bg-hover);
	box-shadow: var(--rcg-card-shadow-hover);
}

.rcg-card__text {
	flex: 1;
	margin: 0;
	color: var(--rcg-card-text);
	font-size: 0.9375rem;
	font-style: italic;
	line-height: 1.72;
}

.rcg .rcg-card__more {
	font-size: 0.85rem;
	font-style: normal;
	white-space: nowrap;
}

.rcg-card__author {
	display: flex;
	align-items: center;
	gap: 0.85rem;
	margin-top: auto;
}

.rcg-card__avatar {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: 42px;
	height: 42px;
	background: var(--rcg-avatar-bg);
	border: 2px solid var(--rcg-avatar-border);
	border-radius: 50%;
	color: #ffffff;
	font-size: 0.72rem;
	font-weight: 800;
	letter-spacing: 0.06em;
	object-fit: cover;
}

.rcg-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.rcg-card__name {
	color: var(--rcg-text);
	font-size: 0.9rem;
	font-weight: 700;
}

.rcg-card__time {
	color: var(--rcg-muted);
	font-size: 0.8rem;
}

/* Controls */

.rcg__controls {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 1.75rem;
}

.rcg.is-static .rcg__controls {
	display: none;
}

.rcg__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
	border-radius: 50%;
	background: transparent;
	color: inherit;
	cursor: pointer;
	transition: background 0.2s ease, border-color 0.2s ease;
}

.rcg__btn:hover,
.rcg__btn:focus-visible {
	background: color-mix(in srgb, currentColor 12%, transparent);
	border-color: currentColor;
}

.rcg__btn:focus-visible {
	outline: 2px solid var(--rcg-focus);
	outline-offset: 2px;
}

.rcg__btn svg {
	width: 18px;
	height: 18px;
}

.rcg__icon-play,
.rcg.is-paused .rcg__icon-pause {
	display: none;
}

.rcg.is-paused .rcg__icon-play {
	display: block;
}

/* Editor-only setup notice */

.rcg-notice {
	padding: 1rem 1.25rem;
	border: 1px dashed #c45a2c;
	border-radius: 8px;
	background: #f4f6f8;
	color: #1a1a1a;
	font-size: 0.9rem;
}

@media (max-width: 860px) {
	.rcg {
		--rcg-per-view: 2;
	}
}

@media (max-width: 520px) {
	.rcg {
		--rcg-per-view: 1.12;
		--rcg-gap: 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rcg-card,
	.rcg__btn {
		transition: none;
	}
}
