/* ==========================================================================
   Google Reviews — [google_reviews]
   Carrousel 3 colonnes + grille responsive
   ========================================================================== */

/* ---------- Wrapper ---------- */
.th-gr {
	--gr-radius: 25px;
	--gr-card-radius: 20px;
	--gr-gap: 20px;
	--gr-bg: var(--gcid-white, #fbf9f5);
	--gr-card-bg: #fff;
	--gr-text: var(--gcid-body-color, #202020);
	--gr-text-muted: #6b6b6b;
	--gr-border: rgba(0, 0, 0, 0.08);
	--gr-star: #FBBC05;
	--gr-per-view: 3;
	position: relative;
	font-family: "Instrument Sans", sans-serif;
	color: var(--gr-text);
}

.th-gr--dark {
	--gr-bg: var(--gcid-body-color, #202020);
	--gr-card-bg: #2a2a2a;
	--gr-text: var(--gcid-white, #fbf9f5);
	--gr-text-muted: #b0b0b0;
	--gr-border: rgba(255, 255, 255, 0.1);
}

/* ---------- Résumé (note globale) ---------- */
.th-gr__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding: 1.25rem 1.5rem;
	background: var(--gr-card-bg);
	border: 1px solid var(--gr-border);
	border-radius: var(--gr-radius);
	margin-bottom: var(--gr-gap);
}

.th-gr__summary-left {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.th-gr__summary-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.th-gr__summary-brand {
	display: block;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--gr-text-muted);
	margin-bottom: 2px;
}

.th-gr__summary-rating {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.th-gr__summary-score {
	font-size: 1.75rem;
	font-weight: 700;
	line-height: 1;
	color: var(--gr-text);
}

.th-gr__summary-count {
	font-size: 14px;
	color: var(--gr-text-muted);
	white-space: nowrap;
}

.th-gr__summary-link {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1.25rem;
	border: 2px solid var(--gr-text);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	color: var(--gr-text);
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.th-gr__summary-link:hover {
	background: var(--gr-text);
	color: var(--gr-bg);
}

.th-gr__summary-link svg {
	flex-shrink: 0;
}

/* ---------- Étoiles ---------- */
.th-gr__stars-wrap {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	vertical-align: middle;
}

.th-gr__star {
	display: block;
}

.th-gr__stars {
	margin-bottom: 0.6rem;
}

/* ---------- Carrousel (slider) — Viewport / Track / Slides ---------- */
.th-gr__viewport {
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
	position: relative;
}

.th-gr__viewport:active {
	cursor: grabbing;
}

.th-gr__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: stretch;
	will-change: transform;
}

.th-gr--slider .th-gr__card {
	flex: 0 0 auto;
	box-sizing: border-box;
}

/* ---------- Grille (grid) ---------- */
.th-gr--grid .th-gr__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: var(--gr-gap);
}

/* ---------- Carte ---------- */
.th-gr__card {
	background: var(--gr-card-bg);
	border: 1px solid var(--gr-border);
	border-radius: var(--gr-card-radius);
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.th-gr--grid .th-gr__card:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

/* ---------- Header de carte (avatar + nom) ---------- */
.th-gr__card-header {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.75rem;
}

.th-gr__avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.th-gr__avatar--placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--gcid-primary-color, #88c649);
	color: #fff;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
}

.th-gr__card-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.th-gr__author {
	font-size: 15px;
	font-weight: 600;
	color: var(--gr-text);
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

a.th-gr__author:hover {
	text-decoration: underline;
}

.th-gr__time {
	font-size: 13px;
	color: var(--gr-text-muted);
}

/* ---------- Texte de l'avis ---------- */
.th-gr__text {
	flex: 1;
}

.th-gr__text p {
	margin: 0;
	font-size: 15px;
	line-height: 1.6;
	color: var(--gr-text);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.th-gr__card:hover .th-gr__text p {
	-webkit-line-clamp: unset;
}

/* ---------- Attribution ---------- */
.th-gr__attribution {
	text-align: center;
	margin-top: 1rem;
	opacity: 0.5;
}

.th-gr__attribution small {
	font-size: 12px;
	color: var(--gr-text-muted);
}

/* ---------- Navigation (flèches) ---------- */
.th-gr__nav {
	display: flex;
	justify-content: flex-end;
	gap: 0.75rem;
	margin-top: 1.25rem;
}

.th-gr__nav-btn {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	background: none;
	color: var(--gr-text);
	border: 2px solid var(--gr-text);
	cursor: pointer;
	transition: transform 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.th-gr__nav-btn:hover:not(:disabled) {
	transform: translateY(-2px);
}

.th-gr__nav-btn:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.th-gr__nav-btn::before {
	content: '';
	display: block;
	width: 10px;
	height: 10px;
	border: 2px solid currentColor;
	border-radius: 1px;
	border-top: none;
	border-right: none;
}

.th-gr__nav-btn[data-dir="prev"]::before {
	transform: rotate(45deg);
	margin-left: 4px;
}

.th-gr__nav-btn[data-dir="next"]::before {
	transform: rotate(-135deg);
	margin-right: 4px;
}

/* ---------- Erreur (admin) ---------- */
.th-gr-error {
	padding: 1rem 1.5rem;
	background: #fef2f1;
	border: 1px solid #f15848;
	border-radius: 15px;
	color: #c0392b;
	font-size: 14px;
}

.th-gr-error p {
	margin: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
	.th-gr {
		--gr-per-view: 2;
	}
}

@media (max-width: 767px) {
	.th-gr {
		--gr-per-view: 1;
	}

	.th-gr__summary {
		flex-direction: column;
		align-items: flex-start;
		padding: 1rem 1.25rem;
	}

	.th-gr--grid .th-gr__list {
		grid-template-columns: 1fr;
	}

	.th-gr__card {
		padding: 1.25rem;
	}

	.th-gr__summary-score {
		font-size: 1.5rem;
	}

	.th-gr__nav {
		justify-content: center;
	}
}
