/**
 * mod_googlereviews - front-end styles
 * Namespaced under .grv so it cannot leak into the template.
 */

.grv {
	--grv-accent: #1a73e8;
	--grv-star: #fbbc04;
	--grv-bg: transparent;
	--grv-card-bg: #ffffff;
	--grv-card-border: #e3e5e8;
	--grv-text: #1f2328;
	--grv-muted: #70757a;
	--grv-shadow: 0 1px 2px rgba(60, 64, 67, .1), 0 2px 8px rgba(60, 64, 67, .07);
	--grv-radius: 12px;
	--grv-gap: 16px;
	--grv-per-desktop: 3;
	--grv-per-tablet: 2;
	--grv-per-mobile: 1;
	--grv-per: var(--grv-per-desktop);
	--grv-clamp: 5;

	position: relative;
	box-sizing: border-box;
	color: var(--grv-text);
	background: var(--grv-bg);
	font-size: 15px;
	line-height: 1.55;
}

.grv *,
.grv *::before,
.grv *::after {
	box-sizing: inherit;
}

.grv--dark {
	--grv-card-bg: #1f2226;
	--grv-card-border: #34383d;
	--grv-text: #e8eaed;
	--grv-muted: #9aa0a6;
	--grv-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
	--grv-accent: #8ab4f8;
}

@media (prefers-color-scheme: dark) {
	.grv--auto {
		--grv-card-bg: #1f2226;
		--grv-card-border: #34383d;
		--grv-text: #e8eaed;
		--grv-muted: #9aa0a6;
		--grv-shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 2px 10px rgba(0, 0, 0, .3);
		--grv-accent: #8ab4f8;
	}
}

/* ------------------------------------------------------------------ Stars */

.grv-stars {
	position: relative;
	display: inline-block;
	line-height: 0;
	vertical-align: middle;
}

.grv-stars__row {
	display: flex;
	gap: 2px;
}

.grv-stars__row svg {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
	display: block;
}

.grv-stars__row--base svg {
	fill: #dadce0;
}

.grv--dark .grv-stars__row--base svg {
	fill: #45494e;
}

@media (prefers-color-scheme: dark) {
	.grv--auto .grv-stars__row--base svg { fill: #45494e; }
}

.grv-stars__row--fill svg {
	fill: var(--grv-star);
}

.grv-stars__clip {
	position: absolute;
	top: 0;
	left: 0;
	height: 100%;
	overflow: hidden;
	pointer-events: none;
}

.grv-stars__clip .grv-stars__row {
	width: -webkit-max-content;
	width: max-content;
}

.grv-stars--lg .grv-stars__row svg {
	width: 20px;
	height: 20px;
}

/* ---------------------------------------------------------------- Summary */

.grv-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	padding: 16px 20px;
	margin-bottom: 18px;
	background: var(--grv-card-bg);
	border: 1px solid var(--grv-card-border);
	border-radius: var(--grv-radius);
	box-shadow: var(--grv-shadow);
}

.grv-summary__brand {
	display: flex;
	align-items: center;
	gap: 8px;
	font-weight: 600;
}

.grv-summary__brandtext {
	font-size: 16px;
	letter-spacing: -.01em;
}

.grv-g {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
	display: block;
}

.grv-summary__score {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.grv-summary__rating {
	font-size: 24px;
	font-weight: 700;
	line-height: 1;
}

.grv-summary__count {
	color: var(--grv-muted);
	font-size: 13px;
}

.grv-summary__actions {
	display: flex;
	gap: 8px;
	margin-left: auto;
	flex-wrap: wrap;
}

.grv-btn {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 999px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	line-height: 1.2;
	border: 1px solid transparent;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	white-space: nowrap;
}

.grv-btn--ghost {
	color: var(--grv-accent);
	border-color: var(--grv-card-border);
	background: transparent;
}

.grv-btn--ghost:hover,
.grv-btn--ghost:focus-visible {
	background: rgba(26, 115, 232, .08);
	text-decoration: none;
}

.grv-btn--solid {
	background: var(--grv-accent);
	color: #fff;
}

.grv-btn--solid:hover,
.grv-btn--solid:focus-visible {
	filter: brightness(.93);
	text-decoration: none;
}

/* The dark palette uses a light accent, so the solid button needs dark text. */
.grv--dark .grv-btn--solid,
.grv--dark .grv-btn--solid:hover,
.grv--dark .grv-btn--solid:focus-visible {
	color: #1f2226;
}

@media (prefers-color-scheme: dark) {
	.grv--auto .grv-btn--solid,
	.grv--auto .grv-btn--solid:hover,
	.grv--auto .grv-btn--solid:focus-visible {
		color: #1f2226;
	}
}

.grv--dark .grv-btn--ghost:hover,
.grv--dark .grv-btn--ghost:focus-visible {
	background: rgba(138, 180, 248, .14);
}

/* --------------------------------------------------------------- Carousel */

.grv-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.grv-track {
	display: flex;
	gap: var(--grv-gap);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	flex: 1 1 auto;
	min-width: 0;
	padding: 4px 2px 12px;
	margin: 0;
	scrollbar-width: none;
	-ms-overflow-style: none;
	overscroll-behavior-x: contain;
}

.grv-track::-webkit-scrollbar {
	display: none;
}

.grv-track:focus-visible {
	outline: 2px solid var(--grv-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
	.grv-track {
		scroll-behavior: auto;
	}
}

/* ------------------------------------------------------------------- Card */

.grv-card {
	flex: 0 0 calc((100% - (var(--grv-per) - 1) * var(--grv-gap)) / var(--grv-per));
	max-width: calc((100% - (var(--grv-per) - 1) * var(--grv-gap)) / var(--grv-per));
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 18px;
	background: var(--grv-card-bg);
	border: 1px solid var(--grv-card-border);
	border-radius: var(--grv-radius);
	box-shadow: var(--grv-shadow);
}

.grv-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
}

.grv-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex: 0 0 auto;
	background: #e8eaed;
}

.grv-avatar--initials {
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-weight: 600;
	font-size: 16px;
	letter-spacing: .02em;
}

.grv-card__id {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 1px;
}

.grv-card__author {
	font-weight: 600;
	font-size: 14px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.grv-card__date {
	font-size: 12px;
	color: var(--grv-muted);
}

.grv-card__source {
	margin-left: auto;
	display: flex;
	flex: 0 0 auto;
	opacity: .9;
}

.grv-card__source:hover {
	opacity: 1;
}

.grv-card__body {
	font-size: 14px;
	color: var(--grv-text);
	flex: 1 1 auto;
}

.grv-card__text {
	margin: 0;
	white-space: normal;
	overflow-wrap: anywhere;
}

.grv-card__body.is-clamped .grv-card__text {
	display: -webkit-box;
	-webkit-line-clamp: var(--grv-clamp);
	line-clamp: var(--grv-clamp);
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.grv-more {
	align-self: flex-start;
	background: none;
	border: 0;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	color: var(--grv-accent);
	cursor: pointer;
}

.grv-more:hover {
	text-decoration: underline;
}

/* -------------------------------------------------------- Arrows and dots */

.grv-nav {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	border: 1px solid var(--grv-card-border);
	background: var(--grv-card-bg);
	color: var(--grv-text);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: var(--grv-shadow);
	padding: 0;
	transition: opacity .15s ease, transform .15s ease;
}

.grv-nav svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.grv-nav:hover {
	transform: scale(1.06);
}

.grv-nav[disabled] {
	opacity: .35;
	cursor: default;
	transform: none;
}

.grv-dots {
	display: flex;
	justify-content: center;
	gap: 7px;
	margin-top: 6px;
}

.grv-dots button {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--grv-card-border);
	cursor: pointer;
	transition: width .2s ease, background-color .2s ease;
}

.grv-dots button.is-active {
	width: 22px;
	border-radius: 999px;
	background: var(--grv-accent);
}

.grv-disclaimer {
	margin: 10px 0 0;
	font-size: 11px;
	color: var(--grv-muted);
	text-align: center;
}

.grv-admin-notice {
	padding: 10px 14px;
	border: 1px dashed #d93025;
	border-radius: 8px;
	color: #d93025;
	font-size: 13px;
	background: rgba(217, 48, 37, .05);
}

/* ------------------------------------------------------------ Breakpoints */

@media (max-width: 991px) {
	.grv { --grv-per: var(--grv-per-tablet); }
}

@media (max-width: 599px) {
	.grv {
		--grv-per: var(--grv-per-mobile);
		--grv-gap: 12px;
	}

	.grv-nav {
		display: none;
	}

	.grv-summary__actions {
		margin-left: 0;
		width: 100%;
	}
}
