/**
 * Front-end styles for the Google Reviews Widget.
 *
 * Light-themed review cards, carousel navigation, initial avatars,
 * green verified checkmarks, and the "Free Google Reviews Widget"
 * footer label.
 */

.grw-widget {
	--grw-accent: #1a73e8;
	--grw-card-bg: #ffffff;
	--grw-text: #202124;
	--grw-muted: #5f6368;
	--grw-border: #e8eaed;
	--grw-star: #fbbc04;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var( --grw-text );
	max-width: 100%;
	margin: 0 auto;
}

/* Defensive box model so card padding never overflows its width. */
.grw-widget,
.grw-widget * {
	box-sizing: border-box;
}

/* --------------------------------------------------------------------- *
 * Viewport + track
 * --------------------------------------------------------------------- */

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

.grw-track {
	display: flex;
	gap: 16px;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x mandatory;
	padding: 6px 2px 12px;
	flex: 1 1 auto;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

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

/* Grid layout wraps instead of scrolling. */
.grw-layout-grid .grw-track {
	display: grid;
	grid-template-columns: repeat( var( --grw-columns, 3 ), minmax( 0, 1fr ) );
	overflow: visible;
}

/* Collapse to fewer columns on smaller screens. */
@media screen and ( max-width: 900px ) {
	.grw-layout-grid .grw-track {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

@media screen and ( max-width: 560px ) {
	.grw-layout-grid .grw-track {
		grid-template-columns: 1fr;
	}
}

/*
 * On phones the fixed 300px carousel card is wider than the space left
 * between the arrows, so it clips. Let each card fill the track (one card
 * per view) and shrink the arrows slightly to give the card more room.
 */
@media screen and ( max-width: 600px ) {
	.grw-layout-carousel .grw-track {
		gap: 12px;
	}

	.grw-layout-carousel .grw-card {
		flex-basis: 100%;
		max-width: 100%;
	}

	.grw-widget .grw-nav {
		width: 36px !important;
		height: 36px !important;
		min-width: 36px !important;
		max-width: 36px !important;
	}
}

.grw-layout-grid .grw-nav {
	display: none;
}

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

.grw-card {
	background: var( --grw-card-bg );
	border: 1px solid var( --grw-border );
	border-radius: 12px;
	padding: 18px 18px 16px;
	box-shadow: 0 1px 2px rgba( 60, 64, 67, 0.1 );
	flex: 0 0 300px;
	max-width: 300px;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
}

.grw-layout-grid .grw-card {
	flex: 1 1 auto;
	max-width: none;
}

.grw-card-head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.grw-avatar {
	width: 44px;
	height: 44px;
	border-radius: 50%;
	flex: 0 0 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	color: #fff;
	font-weight: 700;
	font-size: 18px;
}

.grw-avatar-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

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

.grw-author {
	display: flex;
	align-items: center;
	gap: 6px;
}

.grw-author-name {
	font-weight: 600;
	font-size: 15px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.grw-verified {
	display: inline-flex;
	flex: 0 0 auto;
}

.grw-age {
	color: var( --grw-muted );
	font-size: 12px;
	margin-top: 2px;
}

.grw-google-mark {
	flex: 0 0 auto;
}

.grw-stars {
	display: flex;
	gap: 2px;
	margin: 12px 0 8px;
}

.grw-star-on {
	fill: var( --grw-star );
}

.grw-star-off {
	fill: #dadce0;
}

.grw-text {
	font-size: 14px;
	line-height: 1.5;
	color: #3c4043;
	white-space: pre-line;
	word-wrap: break-word;
	overflow-wrap: anywhere;
}

.grw-text.grw-truncated {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.grw-readmore {
	align-self: flex-start;
	margin-top: 8px;
	background: none;
	border: 0;
	color: var( --grw-accent );
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
}

/* --------------------------------------------------------------------- *
 * Navigation arrows
 * --------------------------------------------------------------------- */

/*
 * Nav buttons are hardened against theme "button {}" resets: themes often
 * set width/padding/border-radius/background on all buttons with enough
 * specificity to squash these into empty pills, so the box model and icon
 * sizing are locked with !important.
 */
.grw-widget .grw-nav {
	flex: 0 0 auto;
	box-sizing: border-box !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 40px !important;
	max-width: 40px !important;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 50% !important;
	border: 1px solid var( --grw-border ) !important;
	background: #fff !important;
	color: var( --grw-muted );
	cursor: pointer;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	line-height: 1 !important;
	-webkit-appearance: none;
	appearance: none;
	box-shadow: 0 1px 3px rgba( 60, 64, 67, 0.15 );
	transition: background 0.15s ease, color 0.15s ease;
}

.grw-widget .grw-nav svg {
	display: block;
	width: 22px !important;
	height: 22px !important;
	max-width: none !important;
	fill: currentColor;
}

.grw-widget .grw-nav svg path {
	fill: currentColor;
}

.grw-widget .grw-nav:hover {
	background: var( --grw-accent ) !important;
	color: #fff;
	border-color: var( --grw-accent ) !important;
}

.grw-widget .grw-nav:disabled {
	opacity: 0.4;
	cursor: default;
}

/* --------------------------------------------------------------------- *
 * Footer
 * --------------------------------------------------------------------- */

.grw-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 10px;
	padding: 8px 12px;
	font-size: 12px;
	color: var( --grw-muted );
	background: #f1f3f4;
	border-radius: 8px;
}

.grw-footer-close {
	background: none;
	border: 0;
	color: var( --grw-muted );
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	padding: 0 2px;
}

.grw-footer-close:hover {
	color: var( --grw-text );
}

/* --------------------------------------------------------------------- *
 * Notices / placeholders
 * --------------------------------------------------------------------- */

.grw-notice {
	padding: 14px 16px;
	background: #f1f3f4;
	border: 1px solid var( --grw-border );
	border-radius: 8px;
	color: var( --grw-muted );
	font-size: 14px;
}

/* Editor placeholder for the block. */
.grw-block-placeholder {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 22px;
	border: 1px dashed #c9ced6;
	border-radius: 10px;
	background: #f6f7f9;
}

.grw-block-icon {
	font-size: 28px;
	color: #fbbc04;
}
