.md3-gr {
	--md3-gr-bg: #fff;
	--md3-gr-fg: #1a1a1a;
	--md3-gr-muted: #6b6b6b;
	--md3-gr-accent: #1a73e8;
	--md3-gr-star: #f5b301;
	--md3-gr-radius: 12px;
	--md3-gr-gap: 20px;
	--md3-gr-font: inherit;
	--md3-gr-columns: 2;

	font-family: var(--md3-gr-font);
	color: var(--md3-gr-fg);
}

.md3-gr__skeleton { min-height: 220px; }

/*
 * Flexbox, not CSS Grid: the grid's columns are `1fr` tracks, so they
 * always consume the full row width and `justify-content` on a grid
 * container has nothing to distribute — a lone item in a partial last
 * row would sit flush left with a visible gap next to it. Flex items
 * that wrap keep their own basis, so an incomplete last row is exactly
 * as wide as its items and `justify-content: center` centres it.
 */
.md3-gr__grid {
	display: flex;
	flex-wrap: wrap;
	gap: var(--md3-gr-gap);
	justify-content: center;
}

.md3-gr__grid > .md3-gr__card {
	box-sizing: border-box;
	flex: 0 1 calc((100% - (var(--md3-gr-columns) - 1) * var(--md3-gr-gap)) / var(--md3-gr-columns));
	min-width: 0;
}

.md3-gr__card {
	background: var(--md3-gr-bg);
	border: 1px solid rgba(0, 0, 0, .08);
	border-radius: var(--md3-gr-radius);
	padding: 20px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.md3-gr__stars { color: var(--md3-gr-star); letter-spacing: 2px; }
.md3-gr__text { margin: 0; line-height: 1.6; }
.md3-gr__more {
	align-self: flex-start;
	background: none;
	border: 0;
	padding: 0;
	color: var(--md3-gr-accent);
	cursor: pointer;
	text-decoration: underline;
}
.md3-gr__by { display: flex; align-items: center; gap: 12px; margin-top: auto; }
.md3-gr__avatar { flex-shrink: 0; border-radius: 50%; width: 44px; height: 44px; object-fit: cover; }
/* Stands in for a missing or failed photo; the tint follows the accent colour. */
.md3-gr__avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .06);
	background: color-mix(in srgb, var(--md3-gr-accent) 14%, transparent);
	color: var(--md3-gr-fg);
	font-weight: 700;
	font-size: 1.125em;
	line-height: 1;
	user-select: none;
}
.md3-gr__name { font-weight: 600; }
.md3-gr__when { color: var(--md3-gr-muted); font-size: .875em; }

/* Summary header: brand and rating on the left, "Review us on Google" on the right; stacks when narrow. */
.md3-gr__summary { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px; margin-bottom: var(--md3-gr-gap); padding: 20px 24px; background: var(--md3-gr-bg); border-radius: var(--md3-gr-radius); }
.md3-gr__summary-main { display: grid; gap: 6px; }
.md3-gr__brand { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; }
.md3-gr__mark { flex-shrink: 0; }
.md3-gr__rating { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; }
.md3-gr__score { font-size: 1.5em; font-weight: 700; line-height: 1; }
.md3-gr__count { color: var(--md3-gr-muted); }
/* Visually hidden, still read by screen readers. */
.md3-gr__sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.md3-gr__cta { justify-content: center; align-items: flex-start; gap: 14px; }
.md3-gr__btn {
	display: inline-block;
	padding: 12px 18px;
	border-radius: calc(var(--md3-gr-radius) / 2);
	text-decoration: none;
	min-height: 44px;
	line-height: 1.5;
}
.md3-gr__btn--primary { background: var(--md3-gr-accent); color: #fff; }
.md3-gr__btn--ghost { border: 1px solid var(--md3-gr-accent); color: var(--md3-gr-accent); }

.md3-gr__carousel { position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; }
.md3-gr__arrow { background: none; border: 1px solid rgba(0,0,0,.15); border-radius: 50%; width: 44px; height: 44px; cursor: pointer; }
.md3-gr__dots { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
/*
 * The dot itself is a real button sized to the 44x44 minimum tap target;
 * the visible small circle is drawn as a centred ::after so the hit area
 * grows without the dot looking oversized. Sizing the button box itself
 * (rather than overflowing a pseudo-element past a smaller box) keeps the
 * flex `gap` measuring between the true 44px boxes, so enlarged dots still
 * can't overlap each other or spill into the track/arrows row above.
 */
.md3-gr__dot {
	position: relative;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}
.md3-gr__dot::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1px solid var(--md3-gr-accent);
	transform: translate(-50%, -50%);
}
.md3-gr__dot[aria-current="true"]::after { background: var(--md3-gr-accent); }

.md3-gr :focus-visible { outline: 2px solid var(--md3-gr-accent); outline-offset: 2px; }

@media (max-width: 782px) {
	.md3-gr__grid > .md3-gr__card { flex-basis: 100%; }
}

/* Editor preview only: the block renders its cards server-side there, because
   front-end scripts do not run in the editor canvas. */
.md3-gr--empty{padding:24px;border:1px dashed rgba(0,0,0,.2);border-radius:var(--md3-gr-radius);color:var(--md3-gr-muted)}
.md3-gr--empty p{margin:0}
.md3-gr__note{margin:12px 0 0;font-size:.875em;color:var(--md3-gr-muted)}
/* Native disclosure: opens in the editor with no script, and hides its own
   ellipsis and label on open so the review reads as one paragraph. */
.md3-gr__disclosure{display:inline}
.md3-gr__disclosure>summary{display:inline;cursor:pointer;color:var(--md3-gr-accent);text-decoration:underline;list-style:none}
.md3-gr__disclosure>summary::-webkit-details-marker{display:none}
.md3-gr__disclosure>summary::marker{content:""}
.md3-gr__disclosure[open]>summary{display:none}
.md3-gr__disclosure>summary:focus-visible{outline:2px solid var(--md3-gr-accent);outline-offset:2px}
.md3-gr__cta-score{color:var(--md3-gr-muted)}
