/*
 * Google Reviews Widget - grid layout styles.
 * Ported from the "Reviews Section Grid Standalone.html" Claude Design
 * export. Colors use oklch() with hex fallbacks for older browsers (oklch
 * has ~93%+ global support as of mid-2025; the fallback keeps things
 * readable everywhere else).
 */

.grw-section {
	--grw-bg: #fefefc;
	--grw-bg: oklch(0.99 0.003 90);
	--grw-card-bg: #ffffff;
	--grw-pill-bg: #f5f5f3;
	--grw-pill-bg: oklch(0.965 0.004 90);
	--grw-text: #333230;
	--grw-text: oklch(0.2 0.006 90);
	--grw-subtle-text: #79766f;
	--grw-subtle-text: oklch(0.48 0.01 90);
	--grw-border: #e7e6e2;
	--grw-border: oklch(0.92 0.004 90);
	--grw-accent: #3457d5;
	--grw-accent: oklch(0.5 0.16 255);
	--grw-accent-shadow: rgba(58, 160, 120, 0.35);

	background: var(--grw-bg);
	padding: 0;
	transition: background 0.3s ease;
}

.grw-section.grw-theme-dark {
	--grw-bg: #262a30;
	--grw-bg: oklch(0.19 0.008 250);
	--grw-card-bg: #2f333b;
	--grw-card-bg: oklch(0.24 0.01 250);
	--grw-pill-bg: #383c44;
	--grw-pill-bg: oklch(0.27 0.01 250);
	--grw-text: #f4f3f0;
	--grw-text: oklch(0.96 0.003 90);
	--grw-subtle-text: #aeaaa0;
	--grw-subtle-text: oklch(0.68 0.01 90);
	--grw-border: #454951;
	--grw-border: oklch(0.32 0.01 250);
}

.grw-section * {
	box-sizing: border-box;
}

.grw-inner {
	max-width: 1180px;
	margin: 0 auto;
	padding: 96px 32px;
}

/* ---------- Header ---------- */

.grw-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 18px;
	margin-bottom: 56px;
}

.grw-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 6px 14px 6px 8px;
	border-radius: 100px;
	background: var(--grw-pill-bg);
	border: 1px solid var(--grw-border);
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: var(--grw-subtle-text);
	letter-spacing: 0.01em;
}

.grw-heading {
	font-family: Inter, sans-serif;
	font-size: clamp(32px, 4vw, 44px);
	font-weight: 800;
	color: var(--grw-text);
	margin: 0 0 20px;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.grw-subheading {
	font-family: Inter, sans-serif;
	font-size: 17px;
	line-height: 1.6;
	color: var(--grw-subtle-text);
	max-width: 560px;
	margin: 0;
}

.grw-summary {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	justify-content: center;
	margin-top: 8px;
}

.grw-summary-score {
	font-family: Inter, sans-serif;
	font-size: 26px;
	font-weight: 800;
	color: var(--grw-text);
}

.grw-summary-stars {
	display: flex;
	gap: 2px;
	color: #f5a623;
}

.grw-summary-count {
	font-family: Inter, sans-serif;
	font-size: 15px;
	color: var(--grw-subtle-text);
}

.grw-cta {
	margin-top: 6px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 13px 24px;
	border-radius: 10px;
	background: var(--grw-accent);
	color: #ffffff;
	font-family: Inter, sans-serif;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.grw-cta:hover {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -6px var(--grw-accent-shadow);
	color: #ffffff;
}

.grw-empty {
	text-align: center;
	font-family: Inter, sans-serif;
	color: var(--grw-subtle-text);
}

/* ---------- Grid ---------- */

.grw-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
	gap: 24px;
}

.grw-card {
	background: var(--grw-card-bg);
	border: 1px solid var(--grw-border);
	border-radius: 18px;
	padding: 28px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 16px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	height: 100%;
}

.grw-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.14);
}

/*
 * Cards beyond the initial batch start hidden and are revealed by JS when
 * "Show more reviews" is clicked (see google-reviews-widget.js). Using a class
 * rather than removing/re-adding the nodes keeps this simple and avoids any
 * layout jump.
 */
.grw-card-hidden {
	display: none;
}

.grw-card-top {
	display: flex;
	align-items: center;
	gap: 12px;
}

.grw-avatar,
.grw-avatar-photo {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.grw-avatar {
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: Inter, sans-serif;
	font-weight: 700;
	font-size: 17px;
	color: #ffffff;
}

.grw-card-identity {
	flex: 1;
	min-width: 0;
}

.grw-name-row {
	display: flex;
	align-items: center;
	gap: 5px;
}

.grw-name {
	font-family: Inter, sans-serif;
	font-weight: 600;
	font-size: 15px;
	color: var(--grw-text);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.grw-date {
	font-family: Inter, sans-serif;
	font-size: 13px;
	color: var(--grw-subtle-text);
}

.grw-stars {
	display: flex;
	gap: 2px;
	color: var(--grw-accent);
}

/*
 * Photos attached to a review - only ever present on historically-backfilled
 * reviews (see class-grw-seed-data.php / GRW_Database's photo_urls column);
 * Google's live Places API never returns these, so most cards never render
 * this block at all. A simple horizontally-scrollable strip rather than a
 * full lightbox/carousel, matching the "avoid unnecessary complexity" brief -
 * most reviews here only ever carry 1-3 photos.
 */
.grw-card-photos {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: thin;
}

.grw-card-photo {
	width: 96px;
	height: 96px;
	border-radius: 10px;
	object-fit: cover;
	flex-shrink: 0;
	border: 1px solid var(--grw-border);
}

.grw-text {
	font-family: Inter, sans-serif;
	font-size: 14.5px;
	line-height: 1.65;
	color: var(--grw-text);
	margin: 0;
	flex: 1;
	white-space: pre-line;
	/* Animated by JS (max-height, measured via scrollHeight) when Read
	   more/less is toggled - see initReadMoreToggles() in
	   google-reviews-widget.js. overflow:hidden is required for the
	   max-height transition to visually clip during the animation. */
	overflow: hidden;
	transition: max-height 0.35s ease;
}

.grw-text-toggle {
	/* display:inline because this is a <div role="button"> (see the
	   theme-conflict note in google-reviews-widget.js), and a div's default
	   is block-level - inline keeps it flowing at the end of the
	   paragraph's text instead of dropping to its own line. */
	display: inline;
	color: var(--grw-accent);
	font-weight: 600;
	cursor: pointer;
	margin-left: 4px;
	background: none;
	border: none;
	font-family: Inter, sans-serif;
	font-size: 14.5px;
	padding: 0;
}

.grw-reply {
	background: var(--grw-pill-bg);
	border-radius: 12px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.grw-reply-label {
	font-family: Inter, sans-serif;
	font-size: 12.5px;
	font-weight: 700;
	color: var(--grw-text);
}

.grw-reply-text {
	font-family: Inter, sans-serif;
	font-size: 13px;
	line-height: 1.55;
	color: var(--grw-subtle-text);
	white-space: pre-line;
}

.grw-view-link {
	font-family: Inter, sans-serif;
	font-size: 13px;
	font-weight: 600;
	color: var(--grw-subtle-text);
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: auto;
}

.grw-view-link:hover {
	color: var(--grw-accent);
}

/* ---------- Show more reviews ---------- */

.grw-load-more-row {
	display: flex;
	justify-content: center;
	margin-top: 40px;
}

/*
 * This is a <div role="button">, not a native <button> - this site's theme
 * ships a global reset targeting button/[type="button"] that silently
 * strips custom button styling (confirmed by direct inspection while
 * building the carousel version of this section; even a forced inline
 * !important override got fought off). Using a div sidesteps that
 * selector entirely. Keyboard accessibility (Enter/Space) is restored
 * manually in google-reviews-widget.js.
 */
.grw-load-more {
	font-family: Inter, sans-serif;
	font-size: 14px;
	font-weight: 600;
	color: var(--grw-text);
	background: var(--grw-card-bg);
	border: 1px solid var(--grw-border);
	border-radius: 100px;
	padding: 12px 28px;
	cursor: pointer;
	transition: background 0.15s ease;
	user-select: none;
	display: inline-block;
}

.grw-load-more:hover {
	background: var(--grw-pill-bg);
}

.grw-load-more:focus-visible {
	outline: 2px solid var(--grw-accent);
	outline-offset: 2px;
}

.grw-load-more.is-hidden {
	display: none;
}