/*
 * ReviewPulse widgets. Everything is scoped to .rpw so themes can't break it and it
 * can't break themes. Styles are sets of --rpw-* values (render/Catalog.php).
 * Fonts are inherited from the site.
 */

.rpw {
	--rpw-card-bg: #F4F4F4;
	--rpw-card-border: transparent;
	--rpw-border-w: 0px;
	--rpw-radius: 12px;
	--rpw-shadow: none;
	--rpw-text: #1F1F1F;
	--rpw-muted: #6B6B6B;
	--rpw-star: #F6BB06;
	--rpw-star-empty: rgba(128, 128, 128, .28);
	--rpw-accent: #1A73E8;
	--rpw-summary-bg: transparent;
	--rpw-card-w: 340px;
	--rpw-gap: 20px;

	position: relative;
	margin: 1.5em 0;
	color: var(--rpw-text);
	font-size: 16px;
	line-height: 1.55;
	text-align: left;
}

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

.rpw :where(p, h2, h3, figure, blockquote) {
	margin: 0;
}

.rpw a {
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.rpw img {
	max-width: none;
	border: 0;
	margin: 0;
	padding: 0;
	box-shadow: none;
}

.rpw button {
	margin: 0;
	font: inherit;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
}

.rpw [hidden] {
	display: none !important;
}

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

/* Stars: grey row with a coloured row on top, cut to the rating. Edge to edge, as on
   Google: the star shape itself leaves a hairline between them. */
.rpw-stars {
	position: relative;
	display: inline-block;
	flex: none;
	width: 5em;
	height: 1em;
	font-size: 18px;
	line-height: 0;
	vertical-align: middle;
}

.rpw-stars__bg,
.rpw-stars__fg {
	position: absolute;
	top: 0;
	left: 0;
	display: flex;
	height: 100%;
	white-space: nowrap;
	overflow: hidden;
}

.rpw-stars__bg {
	fill: var(--rpw-star-empty);
}

.rpw-stars__fg {
	width: var(--rpw-fill, 100%);
	fill: var(--rpw-star);
}

.rpw-stars svg {
	flex: none;
	width: 1em;
	height: 1em;
}

.rpw-g {
	display: block;
	flex: none;
}

/* Google logo as an image: height follows the font size, sits on the text baseline. */
.rpw-wordmark {
	display: inline-block;
	width: auto;
	height: 1em;
	vertical-align: -.25em;
}

/* Card */
.rpw-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 10px;
	height: 100%;
	min-width: 0;
	padding: 24px;
	background: var(--rpw-card-bg);
	border: var(--rpw-border-w) solid var(--rpw-card-border);
	border-radius: var(--rpw-radius);
	box-shadow: var(--rpw-shadow);
	transition: transform .2s ease, box-shadow .2s ease;
}

/* Lift on hover with a mouse only (a tap on a phone would leave it stuck). The shadow is
   kept small so it fits inside the slider row instead of being cut off at its edges. */
@media (hover: hover) {
	.rpw--hover .rpw-card:hover {
		transform: translateY(-2px);
		box-shadow: 0 6px 12px -4px rgba(0, 0, 0, .16);
	}
}

.rpw-card__head {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}

.rpw-avatar {
	flex: none;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	object-fit: cover;
}

.rpw-avatar--letter {
	display: grid;
	place-items: center;
	color: #FFFFFF;
	font-weight: 600;
	font-size: 19px;
	background: #7B8794;
}

.rpw-card__who {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-width: 0;
}

.rpw-name {
	overflow: hidden;
	font-weight: 600;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.rpw-name a:hover {
	text-decoration: underline;
}

.rpw-date {
	color: var(--rpw-muted);
	font-size: 13px;
}

.rpw-card__source {
	flex: none;
	align-self: flex-start;
}

.rpw-card__rating {
	display: flex;
	align-items: center;
	gap: 6px;
}

.rpw-verified {
	display: inline-flex;
	width: 18px;
	height: 18px;
}

.rpw-verified svg {
	width: 100%;
	height: 100%;
}

.rpw--quote .rpw-card::before {
	content: "\201C";
	position: absolute;
	top: 6px;
	right: 52px;
	color: var(--rpw-muted);
	font-family: Georgia, serif;
	font-size: 48px;
	line-height: 1;
	opacity: .25;
}

/* Text, clamped to N lines; "Read more" appears only when it's cut (reviewpulse.js). */
.rpw-text {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: var(--rpw-lines, 4);
	overflow-wrap: anywhere;
}

.rpw-text.is-open {
	display: block;
}

/* "Read more" left, small photos right, on one line at the bottom of the card. */
.rpw-card__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	margin-top: auto;
}

.rpw-card__foot:not(:has(> :not([hidden]))) {
	display: none;
}

.rpw-more {
	padding: 0;
	color: var(--rpw-muted);
	font-size: 13px;
	font-weight: 600;
	background: none;
	border: 0;
	cursor: pointer;
}

/* Some themes outline every clicked button; keep the outline for keyboard users only. */
.rpw-more:focus:not(:focus-visible) {
	outline: none;
}

.rpw-more:hover {
	color: var(--rpw-text);
	background: none;
}

.rpw-photos {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

/* Sliders: tiny photos, so one review with photos doesn't make every card taller (D93). */
.rpw-slide .rpw-photo {
	width: 36px;
	height: 36px;
	border-radius: 6px;
}

.rpw-more[hidden] + .rpw-photos {
	margin-left: 0;
}

.rpw-photo {
	position: relative;
	display: block;
	width: 48px;
	height: 48px;
	overflow: hidden;
	border-radius: 8px;
}

.rpw-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rpw-photo__more {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #FFFFFF;
	font-weight: 600;
	background: rgba(0, 0, 0, .5);
}

.rpw-reply {
	padding: 10px 12px;
	font-size: 13px;
	background: rgba(128, 128, 128, .08);
	border-radius: 8px;
}

.rpw-reply p {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	color: var(--rpw-muted);
}

/* Summary */
.rpw-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	color: var(--rpw-text);
}

.rpw-summary__word {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .02em;
}

.rpw-summary__count {
	color: var(--rpw-muted);
	font-size: 14px;
}

.rpw-summary__count strong {
	color: var(--rpw-text);
}

.rpw-summary__brand {
	font-size: 22px;
}

.rpw-summary--top {
	justify-content: center;
	margin-bottom: 18px;
}

.rpw-summary--top .rpw-summary__word {
	font-size: 20px;
}

.rpw-summary--top .rpw-stars {
	font-size: 26px;
}

.rpw-summary--top .rpw-summary__brand {
	font-size: 30px;
}

/* Dark styles: light text needs its own dark bar, whatever the page colour. */
.rpw--dark .rpw-summary--top {
	padding: 12px 16px;
	background: var(--rpw-summary-bg);
	border-radius: var(--rpw-radius);
}

.rpw-summary--side {
	flex: 0 0 240px;
	flex-direction: column;
	justify-content: center;
	gap: 6px; /* Compact stack: EXCELLENT, stars, "Based on…", logo. */
	padding: 16px;
	text-align: center;
	background: var(--rpw-summary-bg);
	border-radius: var(--rpw-radius);
}

.rpw-summary--side .rpw-summary__word {
	font-size: 26px;
	line-height: 1.1;
}

.rpw-summary--side .rpw-summary__count {
	line-height: 1.3;
}

.rpw-summary--side .rpw-stars {
	font-size: 38px;
}

.rpw-summary--side .rpw-summary__brand {
	font-size: 44px;
	line-height: 0;
}

.rpw-summary--side .rpw-wordmark {
	vertical-align: top;
}

/* Slider IV business panel */
.rpw-company {
	display: flex;
	flex: 0 0 240px;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 16px;
	text-align: center;
	background: var(--rpw-summary-bg);
	border-radius: var(--rpw-radius);
}

.rpw-company__photo {
	width: 80px;
	height: 80px;
	border-radius: 50%;
	object-fit: cover;
}

.rpw-company__name {
	font-size: 19px;
}

.rpw-company__rating {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 20px;
}

.rpw-company__rating .rpw-stars {
	font-size: 24px;
}

.rpw-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 6px;
	padding: 8px 14px;
	color: #1F1F1F;
	font-size: 14px;
	font-weight: 600;
	background: #FFFFFF;
	border: 1px solid #DADCE0;
	border-radius: 999px;
}

.rpw-button:hover {
	background: #F8F9FA;
}

/* Arrangements */
.rpw-body--side {
	display: flex;
	gap: var(--rpw-gap);
	align-items: stretch;
}

.rpw-body--side > .rpw-slider {
	flex: 1 1 auto;
	min-width: 0;
}

.rpw--list .rpw-items {
	display: flex;
	flex-direction: column;
	gap: var(--rpw-gap);
}

.rpw--grid .rpw-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(var(--rpw-card-w), 100%), 1fr));
	gap: var(--rpw-gap);
}

/* Masonry: same columns as the grid, but each card keeps its own height. reviewpulse.js
   packs the cards up under each other (newest still left to right); without it,
   rows simply don't line up their heights. */
.rpw--masonry .rpw-items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(var(--rpw-card-w), 100%), 1fr));
	gap: var(--rpw-gap);
	align-items: start;
}

.rpw--masonry .rpw-card {
	height: auto;
}

.rpw--masonry .rpw-items.is-packed {
	grid-auto-rows: 1px;
	row-gap: 0;
}

.rpw--masonry .rpw-items.is-packed .rpw-card {
	margin-bottom: var(--rpw-gap);
}

.rpw .rpw-card[hidden] {
	display: none;
}

.rpw-load {
	margin: calc(var(--rpw-gap) + 4px) 0 0;
	text-align: center;
}

/* "Load more": the widget's own colours in every state, so a theme's button hover can't hide the text. */
.rpw .rpw-load__more,
.rpw .rpw-load__more:hover,
.rpw .rpw-load__more:focus,
.rpw .rpw-load__more:active {
	justify-content: center;
	min-width: 190px;
	padding: 10px 22px;
	color: var(--rpw-text);
	font-size: 14px;
	text-decoration: none;
	background: var(--rpw-card-bg);
	border: 1px solid rgba(128, 128, 128, .35);
	box-shadow: none;
}

.rpw .rpw-load__more:hover {
	border-color: var(--rpw-text);
}

.rpw .rpw-load__more:focus:not(:focus-visible) {
	outline: none;
}

.rpw .rpw-load__more[aria-busy="true"] {
	cursor: progress;
	opacity: .85;
}

.rpw-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: rpw-spin .7s linear infinite;
}

@keyframes rpw-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.rpw-spinner {
		animation-duration: 2.4s;
	}
}

/* Slider: native scrolling with snap; works without JS as a swipeable row. */
.rpw-slider {
	position: relative;
}

/* Room at the sides for the arrows, so they never cover a card. */
.rpw-slider.has-arrows {
	padding: 0 30px;
}

.rpw-track {
	display: flex;
	gap: var(--rpw-gap);
	padding: 4px 8px 14px;
	overflow-x: auto;
	scroll-padding-inline: 8px;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

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

/* min-width 0: a long reviewer name is cut with "…" instead of widening its card. */
.rpw-slide {
	flex: 0 0 min(var(--rpw-card-w), 85%);
	min-width: 0;
	scroll-snap-align: start;
}

/* Set by reviewpulse.js: as many whole cards as fit, sharing the width. */
.rpw-track[style*="--rpw-per-view"] .rpw-slide {
	flex-basis: calc((100% - (var(--rpw-per-view) - 1) * var(--rpw-gap)) / var(--rpw-per-view));
}

.rpw-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	padding: 0;
	color: #3C4043;
	background: #FFFFFF;
	border: 1px solid #DADCE0;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
	transform: translateY(-50%);
	cursor: pointer;
}

.rpw-arrow:hover {
	color: #000000;
	background: #F8F9FA;
}

.rpw-arrow--prev {
	left: -4px;
}

.rpw-arrow--next {
	right: -4px;
}

.rpw-arrow[disabled] {
	opacity: .35;
	cursor: default;
}

.rpw-dots {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 6px;
}

.rpw-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	background: var(--rpw-star-empty);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}

.rpw-dot[aria-current="true"] {
	width: 20px;
	background: var(--rpw-muted);
	border-radius: 4px;
}

.rpw-footer {
	margin-top: 20px;
	text-align: center;
	font-size: 14px;
}

.rpw-footer a {
	color: var(--rpw-accent);
}

.rpw-footer a:hover {
	text-decoration: underline;
}

/* Badges */
.rpw--badge,
.rpw--button {
	margin: .5em 0;
}

.rpw .rpw-badge {
	display: inline-flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px;
	color: var(--rpw-text);
	background: var(--rpw-card-bg);
	border: var(--rpw-border-w) solid var(--rpw-card-border);
	border-radius: var(--rpw-radius);
	box-shadow: var(--rpw-shadow);
}

.rpw-badge__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.rpw-badge__title {
	font-weight: 700;
}

.rpw-badge__line {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Badge stars a touch larger than in cards, like the rating summaries. */
.rpw-badge__line .rpw-stars {
	font-size: 20px;
}

.rpw-badge__small {
	display: flex;
	align-items: center;
	gap: 6px;
	color: var(--rpw-muted);
	font-size: 13px;
}

.rpw-badge__photo {
	width: 48px;
	height: 48px;
	border-radius: 10px;
	object-fit: cover;
}

.rpw-badge__medal svg {
	display: block;
	width: 52px;
	height: 52px;
}

.rpw .rpw-badge--seal {
	padding: 0;
	background: none;
	border: 0;
	box-shadow: none;
}

.rpw-seal {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	width: 132px;
	height: 132px;
	color: var(--rpw-text);
	text-align: center;
	background: var(--rpw-card-bg);
	border: 3px double var(--rpw-star);
	border-radius: 50%;
	box-shadow: var(--rpw-shadow);
}

.rpw-seal__top {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .12em;
}

.rpw-seal__rating {
	font-size: 30px;
	font-weight: 800;
	line-height: 1;
}

.rpw-seal .rpw-stars {
	font-size: 16px;
}

.rpw-seal__year {
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--rpw-muted);
	font-size: 12px;
}

/* Buttons */
/* ".rpw .rpw-pill": the pill is a link, and ".rpw a" (no theme link styles) would remove its shadow. */
.rpw .rpw-pill {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 10px 18px;
	color: var(--rpw-text);
	background: var(--rpw-card-bg);
	border: var(--rpw-border-w) solid var(--rpw-card-border);
	border-radius: 999px;
	box-shadow: var(--rpw-shadow);
}

.rpw-pill strong {
	letter-spacing: .03em;
}

.rpw-pill > span:not(.rpw-stars) {
	color: var(--rpw-muted);
	font-size: 14px;
}

.rpw-pill .rpw-stars {
	font-size: 18px;
}

.rpw-pill--review {
	font-weight: 600;
}

.rpw-pill.rpw-pill--review > span {
	color: var(--rpw-text);
	font-size: 15px;
}

/* Reviewer photos button (D87): overlapping faces, a star, "4.9 Google | 312 reviews". */
.rpw .rpw-pill--faces {
	gap: 12px;
	padding: 12px 22px 12px 14px;
	font-size: 17px;
	border-radius: max(var(--rpw-radius), 14px);
}

.rpw-faces,
.rpw-pill .rpw-faces__info {
	display: flex;
	align-items: center;
	color: var(--rpw-text);
	font-size: inherit;
}

.rpw-pill .rpw-faces__info {
	gap: 10px;
}

.rpw .rpw-face {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin-left: -9px;
	color: #FFFFFF;
	font-size: 15px;
	font-weight: 600;
	background: var(--rpw-accent);
	border: 2px solid var(--rpw-card-bg);
	border-radius: 50%;
	object-fit: cover;
}

.rpw .rpw-face:first-child {
	margin-left: 0;
}

.rpw-faces__star {
	flex: none;
	width: 22px;
	height: 22px;
	fill: var(--rpw-star);
}

.rpw-pill--faces strong {
	color: var(--rpw-text);
	font-weight: 700;
	letter-spacing: 0;
	white-space: nowrap;
}

.rpw-faces__sep {
	align-self: stretch;
	width: 1px;
	margin: 4px 0;
	background: var(--rpw-muted);
	opacity: .6;
}

@media (max-width: 420px) {
	.rpw-pill--faces {
		flex-wrap: wrap;
		justify-content: center;
		font-size: 15px;
	}

	.rpw .rpw-face {
		width: 32px;
		height: 32px;
	}
}

.rpw--hover .rpw-badge,
.rpw--hover .rpw-pill {
	transition: transform .2s ease;
}

.rpw--hover .rpw-badge:hover,
.rpw--hover .rpw-pill:hover {
	transform: translateY(-2px);
}

/* Read-more popup */
.rpw-dialog {
	width: min(560px, calc(100vw - 32px));
	max-height: calc(100vh - 64px);
	padding: 0;
	overflow: auto;
	background: transparent;
	border: 0;
}

.rpw-dialog::backdrop {
	background: rgba(0, 0, 0, .55);
}

.rpw-dialog .rpw-card {
	height: auto;
}

.rpw-dialog .rpw-text {
	display: block;
}

/* The close button sits where the Google "G" is, so the "G" moves left in the popup. */
.rpw-dialog .rpw-card__head {
	padding-right: 40px;
}

/* Themes style every button (big, dark, padded); the popup's close button keeps its own small look. */
.rpw-dialog .rpw-dialog__close,
.rpw-dialog .rpw-dialog__close:hover,
.rpw-dialog .rpw-dialog__close:focus {
	display: grid;
	place-items: center;
	min-width: 0;
	min-height: 0;
	margin: 0;
	color: var(--rpw-muted, #6B6B6B);
	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
}

.rpw-dialog .rpw-dialog__close:hover {
	color: var(--rpw-text, #1F1F1F);
	background: rgba(128, 128, 128, .15);
}

.rpw-dialog__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 1;
	width: 32px;
	height: 32px;
	padding: 0;
	color: var(--rpw-text);
	font-size: 22px;
	line-height: 1;
	background: transparent;
	border: 0;
	cursor: pointer;
}

/* Phones */
@media (max-width: 700px) {
	.rpw-body--side {
		flex-direction: column;
	}

	.rpw-summary--side,
	.rpw-company {
		flex-basis: auto;
	}

}

@media (prefers-reduced-motion: reduce) {
	.rpw-track {
		scroll-behavior: auto;
	}

	.rpw-card,
	.rpw-badge,
	.rpw-pill {
		transition: none;
	}
}
