/**
 * GirlTech Google Reviews — Frontend Styles
 * ------------------------------------------
 * All colour/spacing values are driven by CSS custom properties set inline
 * on the .ggr-wrap container. Override them in your theme's CSS by targeting
 * the wrap or a specific instance ID (e.g. #ggr-instance-1) — no specificity
 * wars required.
 *
 * Responsive: grid columns adapt down to 1 on mobile regardless of setting.
 * Layouts: .ggr-layout-grid | .ggr-layout-carousel | .ggr-layout-compact
 */

/* ------------------------------------------------------------------ Reset */

.ggr-wrap,
.ggr-wrap * {
	box-sizing: border-box;
}

.ggr-wrap {
	--ggr-card-bg:     #ffffff;
	--ggr-card-border: #e5e5e5;
	--ggr-card-radius: 8px;
	--ggr-text:        #333333;
	--ggr-name:        #111111;
	--ggr-star-filled: #fbbc04;
	--ggr-star-empty:  #dadce0;
	--ggr-accent:      #1a73e8;
	--ggr-columns:     3;
	--ggr-per-view:    1;

	font-family: inherit;
	color: var(--ggr-text);
	line-height: 1.5;
	max-width: 100%;
}

/* ----------------------------------------------------------- Aggregate */

.ggr-aggregate {
	display: flex;
	align-items: center;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid var(--ggr-card-border);
}

.ggr-aggregate-score {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ggr-aggregate-number {
	font-size: 2rem;
	font-weight: 700;
	color: var(--ggr-name);
	line-height: 1;
}

.ggr-aggregate-stars {
	display: inline-flex;
	font-size: 1.25rem;
	letter-spacing: 1px;
}

.ggr-aggregate-meta {
	font-size: 0.875rem;
	color: var(--ggr-text);
	opacity: 0.85;
}

.ggr-aggregate-meta a {
	color: var(--ggr-accent);
	text-decoration: underline;
}

/* ----------------------------------------------------------------- Stars */

.ggr-star {
	font-size: 1.125rem;
	line-height: 1;
}

.ggr-star-filled {
	color: var(--ggr-star-filled);
}

.ggr-star-empty {
	color: var(--ggr-star-empty);
}

.ggr-stars {
	display: inline-flex;
	gap: 1px;
	margin: 8px 0;
}

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

.ggr-card {
	background: var(--ggr-card-bg);
	border: 1px solid var(--ggr-card-border);
	border-radius: var(--ggr-card-radius);
	padding: 20px;
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.08);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.ggr-card:hover {
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08), 0 12px 24px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.ggr-card-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 8px;
}

.ggr-avatar {
	width: 48px;
	height: 48px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: var(--ggr-card-border);
}

.ggr-card-author {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ggr-author-name {
	font-weight: 600;
	color: var(--ggr-name);
	text-decoration: none;
	font-size: 1rem;
	line-height: 1.2;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

a.ggr-author-name:hover {
	text-decoration: underline;
	color: var(--ggr-accent);
}

.ggr-time {
	font-size: 0.8125rem;
	opacity: 0.7;
	margin-top: 2px;
}

.ggr-card-body {
	flex: 1;
}

.ggr-review-text {
	margin: 0 0 8px 0;
	font-size: 0.9375rem;
	white-space: pre-line;
	word-wrap: break-word;
}

.ggr-readmore {
	background: none;
	border: 0;
	padding: 0;
	color: var(--ggr-accent);
	font-size: 0.875rem;
	cursor: pointer;
	font-weight: 500;
	font-family: inherit;
}

.ggr-readmore:hover {
	text-decoration: underline;
}

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

.ggr-layout-grid .ggr-grid {
	display: grid;
	grid-template-columns: repeat(var(--ggr-columns), minmax(0, 1fr));
	gap: 20px;
}

/* Responsive grid: collapse on smaller viewports */
@media (max-width: 960px) {
	.ggr-layout-grid .ggr-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ggr-layout-grid .ggr-grid {
		grid-template-columns: 1fr;
	}
}

/* ------------------------------------------------------ Carousel layout */
/* These styles apply to BOTH .ggr-layout-carousel and .ggr-layout-featured-carousel. */
/* They're un-scoped on purpose — .ggr-carousel only appears inside carousel layouts. */

.ggr-carousel {
	position: relative;
	display: flex;
	align-items: stretch;
	gap: 12px;
}

.ggr-carousel-viewport {
	flex: 1;
	/* Clip only horizontally so card shadows aren't cut off at top/bottom. */
	overflow-x: clip;
	overflow-y: visible;
	border-radius: var(--ggr-card-radius);
	min-width: 0;
	padding: 8px 0;
}

.ggr-carousel-track {
	display: flex;
	transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
	will-change: transform;
}

.ggr-carousel-slide {
	flex: 0 0 calc(100% / var(--ggr-per-view));
	padding: 0 8px;
	min-width: 0;
	box-sizing: border-box;
}

.ggr-carousel-slide:first-child { padding-left: 0; }
.ggr-carousel-slide:last-child  { padding-right: 0; }

.ggr-carousel-arrow {
	flex-shrink: 0;
	width: 40px;
	height: 40px;
	align-self: center;
	background: var(--ggr-card-bg);
	border: 1px solid var(--ggr-card-border);
	border-radius: 50%;
	cursor: pointer;
	font-size: 24px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ggr-text);
	transition: background 0.2s, border-color 0.2s, color 0.2s;
	font-family: inherit;
}

.ggr-carousel-arrow:hover {
	background: var(--ggr-accent);
	border-color: var(--ggr-accent);
	color: #fff;
}

.ggr-carousel-arrow:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.ggr-carousel-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 16px;
}

.ggr-carousel-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	border: 0;
	background: var(--ggr-card-border);
	cursor: pointer;
	padding: 0;
	transition: background 0.2s, transform 0.2s;
}

.ggr-carousel-dot:hover {
	transform: scale(1.2);
}

.ggr-carousel-dot.is-active {
	background: var(--ggr-accent);
}

@media (max-width: 600px) {
	.ggr-carousel-slide {
		flex-basis: 100%;
	}
	.ggr-carousel-arrow {
		display: none;
	}
}

/* ------------------------------------------------------- Compact layout */

.ggr-layout-compact .ggr-stack {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.ggr-layout-compact .ggr-card {
	padding: 14px 16px;
	flex-direction: row;
	align-items: flex-start;
	gap: 14px;
}

.ggr-layout-compact .ggr-card-header {
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	margin: 0;
	min-width: 110px;
	max-width: 140px;
}

.ggr-layout-compact .ggr-avatar {
	width: 36px;
	height: 36px;
}

.ggr-layout-compact .ggr-stars {
	margin: 4px 0 0 0;
}

.ggr-layout-compact .ggr-star {
	font-size: 0.875rem;
}

.ggr-layout-compact .ggr-review-text {
	font-size: 0.875rem;
}

@media (max-width: 600px) {
	.ggr-layout-compact .ggr-card {
		flex-direction: column;
		gap: 8px;
	}
	.ggr-layout-compact .ggr-card-header {
		flex-direction: row;
		max-width: none;
	}
}

/* --------------------------------------------------------- Attribution */

.ggr-attribution {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid var(--ggr-card-border);
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 0.8125rem;
	color: var(--ggr-text);
	opacity: 0.7;
}

.ggr-attribution-text {
	font-weight: 400;
}

.ggr-google-logo {
	height: 18px;
	width: auto;
	display: inline-block;
	vertical-align: middle;
}

/* --------------------------------------------------------- Empty / error */

.ggr-empty {
	padding: 16px;
	border-radius: var(--ggr-card-radius);
	background: #fff8e1;
	border: 1px solid #ffd54f;
	color: #5d4037;
	font-size: 0.875rem;
}

.ggr-empty-admin::before {
	content: "⚠ Admin only — ";
	font-weight: 600;
}

/* ========================================================== Featured layouts */
/* Trustpilot-style summary card on the left, reviews on the right.            */
/* ==========================================================================  */

.ggr-layout-featured .ggr-featured-split {
	display: grid;
	gap: 24px;
	align-items: center;
	/* Default 1:4 ratio for 3+ visible cards or the static 5-card grid. */
	grid-template-columns: 1fr 4fr;
}

/* 1-2 visible cards → 1:2 ratio (summary takes more relative space). */
.ggr-layout-featured-carousel[data-per-view="1"] .ggr-featured-split,
.ggr-layout-featured-carousel[data-per-view="2"] .ggr-featured-split {
	grid-template-columns: 1fr 2fr;
}

/* Stack on mobile. Specificity matched to the per-view rule so it wins. */
@media (max-width: 768px) {
	.ggr-layout-featured-carousel[data-per-view] .ggr-featured-split,
	.ggr-layout-featured-grid .ggr-featured-split,
	.ggr-layout-featured .ggr-featured-split {
		grid-template-columns: 1fr;
	}
}

/* ----- Summary card */

.ggr-summary-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 24px 16px;
	gap: 12px;
}

.ggr-summary-label {
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	color: var(--ggr-name);
	line-height: 1;
}

.ggr-summary-stars {
	display: inline-flex;
	gap: 2px;
}

.ggr-summary-stars .ggr-star {
	font-size: 1.75rem;
	line-height: 1;
}

.ggr-summary-count {
	font-size: 0.875rem;
	color: var(--ggr-text);
	opacity: 0.85;
}

.ggr-summary-count a {
	color: inherit;
	text-decoration: none;
}

.ggr-summary-count a:hover {
	text-decoration: underline;
	color: var(--ggr-accent);
}

.ggr-summary-count strong {
	font-weight: 700;
}

.ggr-summary-google {
	margin-top: 4px;
}

.ggr-google-logo-lg {
	height: 28px;
	width: auto;
}

.ggr-leave-review {
	display: inline-block;
	margin-top: 8px;
	padding: 8px 16px;
	background: var(--ggr-accent);
	color: #fff;
	text-decoration: none;
	border-radius: var(--ggr-card-radius);
	font-size: 0.875rem;
	font-weight: 500;
	line-height: 1.2;
	transition: opacity 0.2s, transform 0.2s;
}

.ggr-leave-review:hover,
.ggr-leave-review:focus {
	opacity: 0.9;
	transform: translateY(-1px);
	color: #fff;
	text-decoration: none;
}

/* ----- Featured content area (right side) */

.ggr-layout-featured .ggr-featured-content {
	min-width: 0; /* Prevent grid blowout */
}

/* ----- Featured grid (static 5-card layout on right) */
/* 3 columns on desktop = 3 cards top row + 2 bottom row.                    */
/* Cards are roomier than a single row of 5 squashed across.                 */

.ggr-layout-featured-grid .ggr-featured-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

@media (max-width: 1024px) {
	.ggr-layout-featured-grid .ggr-featured-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.ggr-layout-featured-grid .ggr-featured-grid {
		grid-template-columns: 1fr;
	}
}
