/**
 * Review Widget — frontend (Green Wall Google + LinkedIn)
 */

.rw-widget {
	--rw-lime: #b8e000;
	--rw-lime-deep: #9bc200;
	--rw-accent: #3d7a00;
	--rw-primary: #1a73e8;
	--rw-bg: #ffffff;
	--rw-text: #202124;
	--rw-muted: #5f6368;
	--rw-border: rgba(32, 33, 36, 0.1);
	--rw-radius: 20px;
	--rw-card-radius: 16px;
	--rw-shadow: 0 2px 10px rgba(32, 33, 36, 0.06);
	--rw-star: #fbbc04;
	--rw-per-view: 4;
	box-sizing: border-box;
	background: var(--rw-bg);
	color: var(--rw-text);
	border-radius: var(--rw-radius);
	padding: 1.1rem 1.15rem 1.25rem;
	font-family: "DM Sans", "Segoe UI", Helvetica, Arial, sans-serif;
	line-height: 1.45;
	overflow: hidden;
	position: relative;
}

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

/* —— Google / Green Wall shell —— */
.rw-widget--google {
	--rw-bg: var(--rw-lime);
	--rw-primary: var(--rw-accent);
	background: var(--rw-bg);
	border: none;
	padding: 1.15rem 1.2rem 1.35rem;
}

.rw-widget__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
	flex-wrap: wrap;
}

.rw-widget--google .rw-widget__header {
	background: #fff;
	border-radius: 999px;
	padding: 0.7rem 1.25rem;
	margin-bottom: 1.15rem;
	box-shadow: var(--rw-shadow);
	justify-content: flex-start;
}

.rw-widget__brand {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	min-width: 0;
}

.rw-widget__summary-block {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	flex-wrap: wrap;
	min-width: 0;
}

.rw-widget__avg {
	margin: 0;
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var(--rw-text);
	line-height: 1;
}

.rw-widget__count {
	font-size: 0.8rem;
	color: var(--rw-muted);
	width: 100%;
	margin: 0;
}

.rw-widget--google .rw-widget__count {
	display: none;
}

.rw-widget__google-mark {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin-left: 0.15rem;
	color: var(--rw-muted);
	font-size: 0.95rem;
	font-weight: 500;
}

.rw-widget__google-mark svg {
	display: block;
	width: 18px;
	height: 18px;
	flex-shrink: 0;
}

.rw-widget__logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.25rem;
	height: 2.25rem;
	border-radius: 50%;
	background: #fff;
	border: 1px solid var(--rw-border);
	color: var(--rw-primary);
	font-weight: 700;
	font-size: 1.1rem;
	flex-shrink: 0;
}

.rw-widget__logo--li {
	background: #0a66c2;
	border-color: #0a66c2;
	color: #fff;
	font-size: 0.85rem;
	letter-spacing: -0.02em;
}

.rw-widget__title {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 600;
}

.rw-widget__summary {
	margin: 0.15rem 0 0;
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-wrap: wrap;
	color: var(--rw-muted);
	font-size: 0.9rem;
}

.rw-widget__cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.55rem 1.15rem;
	border-radius: 999px;
	background: var(--rw-primary);
	color: #fff !important;
	text-decoration: none !important;
	font-size: 0.875rem;
	font-weight: 600;
	white-space: nowrap;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.rw-widget--google .rw-widget__cta {
	background: #111;
	color: #fff !important;
	padding: 0.65rem 1.25rem;
	font-size: 0.82rem;
}

.rw-widget__cta:hover,
.rw-widget__cta:focus {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.rw-widget--google .rw-widget__cta:hover,
.rw-widget--google .rw-widget__cta:focus {
	background: #222;
}

.rw-stars {
	display: inline-flex;
	gap: 1px;
	letter-spacing: 0;
	line-height: 1;
}

.rw-star {
	font-size: 1rem;
}

.rw-widget--google .rw-widget__header .rw-star {
	font-size: 1.15rem;
}

.rw-star--on {
	color: var(--rw-star);
}

.rw-star--off {
	color: #dadce0;
}

.rw-widget__viewport {
	overflow: hidden;
	width: 100%;
}

.rw-layout-carousel .rw-widget__track {
	display: flex;
	align-items: stretch; /* equal card heights in each row */
	gap: 1rem;
	transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.rw-layout-carousel .rw-card {
	flex: 0 0 calc((100% - (var(--rw-per-view) - 1) * 1rem) / var(--rw-per-view));
	max-width: calc((100% - (var(--rw-per-view) - 1) * 1rem) / var(--rw-per-view));
	min-width: 0;
	align-self: stretch;
	height: auto;
}

.rw-layout-list .rw-widget__track {
	display: flex;
	flex-direction: column;
	gap: 0.85rem;
}

.rw-card {
	background: #fff;
	border: 1px solid var(--rw-border);
	border-radius: var(--rw-card-radius);
	padding: 1.1rem 1.15rem 1rem;
	box-shadow: var(--rw-shadow);
	animation: rw-fade-in 0.45s ease both;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
}

.rw-widget--google .rw-card {
	border: none;
	min-height: 0;
}

.rw-layout-carousel .rw-card__text {
	/* Reserve 4 lines so short/empty reviews match taller ones */
	min-height: calc(1.45em * 4);
	flex: 1 1 auto;
}

.rw-layout-carousel .rw-card__more {
	margin-top: auto;
}

.rw-widget--google .rw-card.is-expanded {
	z-index: 2;
	box-shadow: 0 8px 24px rgba(32, 33, 36, 0.14);
}

.rw-card__person {
	display: flex;
	gap: 0.7rem;
	align-items: flex-start;
}

.rw-card__avatar {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
	background: #e8eaed;
}

.rw-card__avatar--initials {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.9rem;
	color: #fff;
	background: var(--rw-accent);
}

.rw-card__identity {
	min-width: 0;
	flex: 1;
}

.rw-card__name-row {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	min-width: 0;
}

.rw-card__name {
	margin: 0;
	font-weight: 600;
	font-size: 0.95rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rw-card__name a {
	color: inherit;
	text-decoration: none;
}

.rw-card__name a:hover {
	text-decoration: underline;
}

.rw-card__verified {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 1rem;
	height: 1rem;
	color: var(--rw-accent);
	font-size: 0;
	line-height: 0;
}

.rw-card__verified svg {
	width: 100%;
	height: 100%;
	display: block;
}

.rw-visually-hidden {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	margin: -1px !important;
	overflow: hidden !important;
	clip: rect(0, 0, 0, 0) !important;
	white-space: nowrap !important;
	border: 0 !important;
}

.rw-card__meta,
.rw-card__location,
.rw-card__date {
	margin: 0.1rem 0 0;
	font-size: 0.78rem;
	color: var(--rw-muted);
}

.rw-card__text {
	margin: 0;
	font-size: 0.9rem;
	color: var(--rw-text);
	display: -webkit-box;
	-webkit-line-clamp: 4;
	line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	word-break: break-word;
}

.rw-card__text.is-expanded {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: unset;
	/* Keep long reviews inside the card instead of blowing up the row */
	max-height: 12.5rem;
	overflow-y: auto;
	padding-right: 0.15rem;
	overscroll-behavior: contain;
}

.rw-card__more {
	appearance: none;
	border: 0;
	background: none;
	padding: 0;
	margin: 0;
	align-self: flex-start;
	color: var(--rw-accent);
	font: inherit;
	font-size: 0.88rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
}

.rw-card__more:hover,
.rw-card__more:focus {
	text-decoration: underline;
}

.rw-card__more[hidden] {
	display: none !important;
}

.rw-widget__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1rem;
	margin-top: 1.1rem;
	min-height: 2.75rem;
}

.rw-widget__dots {
	display: none !important;
}

.rw-nav {
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	border: none;
	background: #fff;
	color: var(--rw-text);
	cursor: pointer;
	font-size: 1.35rem;
	line-height: 1;
	box-shadow: var(--rw-shadow);
	flex-shrink: 0;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.rw-nav:hover:not(:disabled),
.rw-nav:focus:not(:disabled) {
	background: #111;
	color: #fff;
	transform: scale(1.05);
}

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

.rw-widget__empty {
	margin: 0.5rem 0 1rem;
	padding: 1rem 1.1rem;
	background: rgba(255, 255, 255, 0.85);
	border-radius: var(--rw-card-radius);
	color: var(--rw-muted);
	font-size: 0.95rem;
}

.rw-widget__footer {
	margin-top: 0.85rem;
	padding-top: 0.65rem;
	border-top: 1px solid var(--rw-border);
	font-size: 0.75rem;
	color: var(--rw-muted);
}

.rw-widget--google .rw-widget__footer {
	display: none;
}

.rw-widget--linkedin {
	--rw-primary: #0a66c2;
	border: 1px solid var(--rw-border);
}

@keyframes rw-fade-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Tablet: 2 cards */
@media (max-width: 900px) {
	.rw-widget--google {
		--rw-per-view: 2;
	}

	.rw-widget--google .rw-widget__header {
		border-radius: 18px;
		padding: 0.65rem 0.75rem;
	}
}

/* Mobile: 1 card */
@media (max-width: 600px) {
	.rw-widget {
		--rw-per-view: 1;
		padding: 0.75rem;
	}

	.rw-widget--google {
		--rw-per-view: 1;
		padding: 0.7rem 0.55rem 0.85rem;
	}

	.rw-widget--google .rw-widget__header {
		border-radius: 16px;
		padding: 0.55rem 0.75rem;
		margin-bottom: 0.75rem;
	}

	.rw-widget__summary-block {
		gap: 0.35rem;
		justify-content: center;
		width: 100%;
	}

	.rw-widget__avg {
		font-size: 1.15rem;
	}

	.rw-widget--google .rw-widget__header .rw-star {
		font-size: 1rem;
	}

	.rw-layout-carousel .rw-widget__track {
		gap: 0.65rem;
	}

	.rw-widget--google .rw-card {
		padding: 0.95rem 0.95rem 0.85rem;
	}

	.rw-card__text.is-expanded {
		max-height: 10rem;
	}

	.rw-widget__nav {
		gap: 0.85rem;
		margin-top: 0.75rem;
	}

	.rw-nav {
		width: 2.85rem;
		height: 2.85rem;
		font-size: 1.45rem;
	}

}

@media (prefers-reduced-motion: reduce) {
	.rw-layout-carousel .rw-widget__track,
	.rw-card,
	.rw-widget__cta,
	.rw-nav {
		transition: none !important;
		animation: none !important;
	}
}
