/* Google Reviews Showcase — front end
   Inherits the theme's fonts; colours are tokens so light/dark and the accent can be swapped. */

.grs {
	--grs-text: #202124;
	--grs-muted: #5f6368;
	--grs-surface: #ffffff;
	--grs-subtle: #f6f8fc;
	--grs-line: #e2e5ea;
	--grs-star: #fbbc04;
	--grs-star-off: #dadce0;
	--grs-gap: 16px;
	--grs-cols: var(--grs-c, 3);
	color: var(--grs-text);
	font: inherit;
	line-height: 1.6;
	box-sizing: border-box;
}
.grs *, .grs *::before, .grs *::after { box-sizing: inherit; }

.grs--dark {
	--grs-text: #e8eaed;
	--grs-muted: #9aa0a6;
	--grs-surface: #202124;
	--grs-subtle: #2a2b2e;
	--grs-line: #3c4043;
	--grs-star-off: #5f6368;
}

@media (max-width: 900px) { .grs { --grs-cols: min(var(--grs-c, 3), 2); } }
@media (max-width: 600px) { .grs { --grs-cols: 1; } }

/* ---------- Stars ---------- */
.grs-stars { position: relative; display: inline-flex; width: max-content; align-self: flex-start; line-height: 0; vertical-align: middle; }
.grs-stars__bg, .grs-stars__fg { display: inline-flex; gap: 1px; }
.grs-stars__bg { color: var(--grs-star-off); }
.grs-stars__fg {
	position: absolute; top: 0; left: 0; bottom: 0;
	width: var(--grs-fill, 100%);
	overflow: hidden; white-space: nowrap;
	color: var(--grs-star);
}
.grs-stars svg { width: 18px; height: 18px; fill: currentColor; flex-shrink: 0; }
.grs-g { width: 18px; height: 18px; flex-shrink: 0; }

/* ---------- Summary ---------- */
.grs-summary {
	display: grid;
	grid-template-columns: 1fr auto;
	grid-template-areas: "name actions" "score actions";
	align-items: center;
	gap: 6px 24px;
	padding: 22px 26px;
	margin: 0 0 20px;
	background: var(--grs-subtle);
	border-radius: 18px;
}
.grs-summary__name {
	grid-area: name;
	display: flex; align-items: center; gap: 8px;
	margin: 0;
	font-weight: 600;
	color: var(--grs-text);
}
.grs-summary__score { grid-area: score; display: flex; align-items: center; gap: 14px; }
.grs-summary__num {
	font-size: clamp(2.4rem, 5vw, 3.25rem);
	font-weight: 700;
	line-height: 1;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}
.grs-summary__meta { display: flex; flex-direction: column; gap: 4px; }
.grs-summary .grs-stars svg { width: 22px; height: 22px; }
.grs-summary__count { font-size: 0.9rem; color: var(--grs-muted); }
.grs-summary__actions { grid-area: actions; display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

@media (max-width: 600px) {
	.grs-summary { grid-template-columns: 1fr; grid-template-areas: "name" "score" "actions"; padding: 20px; }
	.grs-summary__actions { justify-content: flex-start; margin-top: 8px; }
}

/* ---------- Buttons ---------- */
.grs .grs-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 40px;
	padding: 8px 18px;
	border: 1px solid var(--grs-line);
	border-radius: 999px;
	background: var(--grs-surface);
	color: var(--grs-text);
	font: inherit; font-size: 0.92rem; font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, border-color .15s ease;
}
.grs .grs-btn:hover { border-color: var(--grs-accent); }
.grs .grs-btn--primary { background: var(--grs-accent); border-color: var(--grs-accent); color: #fff; }
.grs .grs-btn--primary:hover { filter: brightness(1.08); }
.grs button:focus-visible, .grs a:focus-visible, .grs .grs-items:focus-visible {
	outline: 2px solid var(--grs-accent); outline-offset: 2px;
}

/* ---------- Cards ---------- */
.grs-items { margin: 0; padding: 0; }
.grs-card {
	display: flex; flex-direction: column; gap: 10px;
	padding: 20px;
	background: var(--grs-surface);
	border: 1px solid var(--grs-line);
	border-radius: 14px;
	min-width: 0;
}
.grs-card.grs-is-hidden { display: none; }

.grs-card__head { display: flex; align-items: center; gap: 12px; }
.grs-avatar {
	position: relative;
	flex: 0 0 40px; width: 40px; height: 40px;
	border-radius: 50%;
	display: inline-flex; align-items: center; justify-content: center;
	color: #fff; font-weight: 600; font-size: 1rem;
	overflow: hidden;
}
.grs-avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; margin: 0; max-width: none; }
.grs-card__who { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.grs-card__name {
	font-weight: 600; color: var(--grs-text);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
	text-decoration: none;
}
a.grs-card__name:hover { text-decoration: underline; }
.grs-card__date { font-size: 0.82rem; color: var(--grs-muted); }
.grs-card__source { display: inline-flex; }

.grs-card__text {
	position: relative;
	max-height: calc(var(--grs-lines, 5) * 1.6em);
	overflow: hidden;
	font-size: 0.95rem;
}
.grs-card__text p { margin: 0 0 0.7em; }
.grs-card__text p:last-child { margin-bottom: 0; }
.grs-card__text.grs-is-clamped {
	-webkit-mask-image: linear-gradient(#000 60%, transparent);
	mask-image: linear-gradient(#000 60%, transparent);
}
.grs-card.grs-is-open .grs-card__text { max-height: none; -webkit-mask-image: none; mask-image: none; }

.grs .grs-read-more {
	align-self: flex-start;
	padding: 0; margin: -4px 0 0;
	border: 0; background: none;
	color: var(--grs-accent);
	font: inherit; font-size: 0.88rem; font-weight: 600;
	cursor: pointer;
}
.grs .grs-read-more:hover { text-decoration: underline; }

.grs-reply {
	margin-top: auto;
	padding: 12px 14px;
	border-left: 3px solid var(--grs-accent);
	background: var(--grs-subtle);
	border-radius: 0 8px 8px 0;
	font-size: 0.88rem;
}
.grs-reply p { margin: 0 0 0.5em; }
.grs-reply p:last-child { margin-bottom: 0; }
.grs-reply .grs-reply__label { font-weight: 600; margin-bottom: 4px; }

/* ---------- Layouts ---------- */
.grs--grid .grs-items {
	display: grid;
	grid-template-columns: repeat(var(--grs-cols), minmax(0, 1fr));
	gap: var(--grs-gap);
}

.grs--masonry .grs-items { column-count: var(--grs-cols); column-gap: var(--grs-gap); }
.grs--masonry .grs-card { display: inline-flex; width: 100%; margin: 0 0 var(--grs-gap); break-inside: avoid; }
.grs--masonry .grs-card.grs-is-hidden { display: none; }

.grs--list .grs-items { display: flex; flex-direction: column; gap: var(--grs-gap); max-width: 760px; }

.grs-carousel { display: flex; align-items: center; gap: 10px; }
.grs--carousel .grs-items {
	flex: 1; min-width: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--grs-cols) - 1) * var(--grs-gap)) / var(--grs-cols));
	gap: var(--grs-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 2px;
}
.grs--carousel .grs-items::-webkit-scrollbar { display: none; }
.grs--carousel .grs-card { scroll-snap-align: start; }
.grs .grs-nav {
	flex: 0 0 40px; width: 40px; height: 40px;
	display: inline-flex; align-items: center; justify-content: center;
	padding: 0;
	border: 1px solid var(--grs-line); border-radius: 50%;
	background: var(--grs-surface); color: var(--grs-text);
	cursor: pointer;
}
.grs .grs-nav svg { width: 22px; height: 22px; fill: currentColor; }
.grs .grs-nav:disabled { opacity: .35; cursor: default; }
@media (max-width: 600px) {
	.grs .grs-nav { flex-basis: 32px; width: 32px; height: 32px; }
	.grs-carousel { gap: 6px; }
}

.grs-more-wrap { display: flex; justify-content: center; margin-top: 20px; }

.grs-empty { padding: 16px; border: 1px dashed #c3c4c7; border-radius: 8px; color: #50575e; }

@media (prefers-reduced-motion: reduce) {
	.grs .grs-btn { transition: none; }
	.grs--carousel .grs-items { scroll-behavior: auto; }
}
