/* Reseñas de Google Filtradas
   Hereda la tipografía y el color de texto del tema.
   Personaliza con variables, p. ej.: .rgf { --rgf-accent: #0a5c4a; } */

.rgf {
	--rgf-star: #f5a623;
	--rgf-star-empty: rgba(127, 127, 127, 0.28);
	--rgf-accent: currentColor;
	--rgf-surface: rgba(127, 127, 127, 0.06);
	--rgf-line: rgba(127, 127, 127, 0.22);
	--rgf-muted: rgba(127, 127, 127, 0.95);
	--rgf-gap: 1.25rem;
	--rgf-cols: 3;

	font-family: inherit;
	color: inherit;
	margin-block: 2rem;
}

.rgf *,
.rgf *::before,
.rgf *::after {
	box-sizing: border-box;
}

/* Cabecera: la nota media es el elemento protagonista */
.rgf-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem 1rem;
	margin-bottom: 1.5rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid var(--rgf-line);
}

.rgf-score {
	font-size: clamp(2.75rem, 6vw, 3.75rem);
	font-weight: 700;
	line-height: 0.9;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.rgf-head-info {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
}

.rgf-head .rgf-stars {
	font-size: 1.25rem;
}

.rgf-total {
	font-size: 0.9rem;
	color: var(--rgf-muted);
}

.rgf-cta {
	margin-left: auto;
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--rgf-accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

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

@media (max-width: 960px) {
	.rgf--c3 .rgf-grid,
	.rgf--c4 .rgf-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.rgf-grid {
		grid-template-columns: 1fr;
	}
	.rgf-cta {
		margin-left: 0;
		flex-basis: 100%;
	}
}

.rgf-card {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	padding: 1.25rem 1.25rem 1.4rem;
	background: var(--rgf-surface);
	border-radius: 10px;
}

.rgf-author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
}

.rgf-avatar {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}

.rgf-avatar--initial {
	display: grid;
	place-items: center;
	background: var(--rgf-line);
	font-weight: 700;
	text-transform: uppercase;
}

.rgf-author-meta {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.3;
}

.rgf-name {
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

a.rgf-name:hover {
	text-decoration: underline;
}

.rgf-date {
	font-size: 0.85rem;
	color: var(--rgf-muted);
}

/* Estrellas parciales: capa gris + capa de color recortada al porcentaje */
.rgf-stars {
	position: relative;
	display: inline-block;
	font-size: 1rem;
	line-height: 1;
	letter-spacing: 0.08em;
	color: var(--rgf-star-empty);
	white-space: nowrap;
	width: max-content;
	align-self: flex-start; /* evita que el contenedor flex la estire */
}

.rgf-stars::before,
.rgf-stars-fill::before {
	content: "★★★★★";
}

.rgf-stars-fill {
	position: absolute;
	inset: 0 auto 0 0;
	overflow: hidden;
	color: var(--rgf-star);
}

.rgf-text {
	margin: 0;
	line-height: 1.6;
	max-width: 65ch;
}

.rgf-more {
	margin-top: auto;
	font-size: 0.9rem;
	color: var(--rgf-accent);
	text-underline-offset: 0.2em;
}

.rgf-attribution {
	margin: 1rem 0 0;
	font-size: 0.8rem;
	color: var(--rgf-muted);
	text-align: right;
}

.rgf-attribution span {
	font-weight: 600;
}

.rgf a:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
	border-radius: 2px;
}

.rgf-admin-note {
	padding: 0.75rem 1rem;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #50575e;
	font-size: 0.9rem;
}

/* ------------------------------------------------------------------ */
/* Carrusel                                                            */
/* ------------------------------------------------------------------ */

.rgf {
	--rgf-vis: var(--rgf-cols);
}

.rgf-carousel {
	position: relative;
}

.rgf-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--rgf-vis) - 1) * var(--rgf-gap)) / var(--rgf-vis));
	gap: var(--rgf-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding-block: 2px; /* deja ver el contorno de foco */
}

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

.rgf-track:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
	border-radius: 4px;
}

.rgf-track > .rgf-card {
	scroll-snap-align: start;
}

.rgf-nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	transform: translateY(-50%);
	border: 1px solid var(--rgf-line);
	border-radius: 50%;
	background: Canvas;
	color: CanvasText;
	font: inherit;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

.rgf-nav span {
	margin-top: -0.15em;
}

.rgf-nav[hidden] {
	display: none !important;
}

.rgf-prev {
	left: -1.25rem;
}

.rgf-next {
	right: -1.25rem;
}

.rgf-nav:hover {
	border-color: currentColor;
}

.rgf-nav:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (max-width: 960px) {
	.rgf--c3,
	.rgf--c4 {
		--rgf-vis: 2;
	}
	.rgf-prev {
		left: -0.5rem;
	}
	.rgf-next {
		right: -0.5rem;
	}
}

@media (max-width: 600px) {
	/* En móvil se ve una reseña y asoma la siguiente, para invitar a deslizar. */
	.rgf-track {
		grid-auto-columns: 85%;
	}
	/* Flechas debajo, para no tapar el texto. */
	.rgf-carousel:not(.rgf-carousel--static) {
		padding-bottom: 3.25rem;
	}
	.rgf-nav {
		top: auto;
		bottom: 0;
		transform: none;
		width: 2.5rem;
		height: 2.5rem;
	}
	.rgf-prev {
		left: auto;
		right: 3.25rem;
	}
	.rgf-next {
		right: 0;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.rgf-track {
		scroll-behavior: smooth;
	}
}
