/*---*\
Homepage Reviews V2
Dark navy panel with BRB Google reviews carousel, side image, quote marks, and house outline.

KEY FEATURES:
- Styles Business Reviews Bundle (.rpi) cards
- Custom orange circle nav wired to plugin slider buttons
- Hardcoded quote marks and house outline decorations
- Side image overlaps navy panel bottom-left
- Cards: 1 (mobile), 2 (768+), 3 (1025-1199 and 1200+)

IMPLEMENTATION NOTES:
- Reviews content from BRB shortcode; do not hardcode review copy
- Panel uses --section-padding for top/bottom inset; section
  utilities omitted so previous section-padding + panel pad equals designed rhythm
- Extra section padding-bottom clears overlapping side image and house outline
\*---*/

.reviews-v2 {
	position: relative;
	overflow: visible;
	/* Extra bottom space so the overlapping side image and house outline clear the panel. */
	padding-bottom: 222px;
}

.reviews-v2__inner {
	position: relative;
	max-width: var(--container-max-width);
	margin: 0 auto;
	padding: 0 22px;
	overflow: visible;
}

.reviews-v2__panel {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 33px;
	padding: var(--section-padding) 25px 45px;
	border-radius: 20px;
	background: var(--dark-blue);
	overflow: visible;
}

.reviews-v2__main {
	display: flex;
	flex-direction: column;
	gap: 33px;
	width: 100%;
	min-width: 0;
}

.reviews-v2__intro {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 20px;
	max-width: 285px;
}

.reviews-v2__heading {
	margin: 0;
	padding-bottom: 0;
	color: var(--text-inverse);
	font-family: var(--font-heading);
	font-size: var(--fs-h3);
	font-weight: var(--font-weight-bold);
	line-height: var(--lh-heading);
}

.reviews-v2__reviews {
	position: relative;
	width: 100%;
	min-width: 0;
	height: 318px;
}

.reviews-v2__quote {
	position: absolute;
	width: 41px;
	height: 31px;
	pointer-events: none;
	z-index: 0;
}

.reviews-v2__quote--top {
	top: -23px;
	left: -11px;
}

.reviews-v2__quote--bottom {
	right: -7px;
	bottom: 30px;
	transform: rotate(180deg);
}

.reviews-v2__slider-wrap {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
	align-items: flex-start;
	width: 100%;
	min-width: 0;
	height: 100%;
}

.reviews-v2__plugin {
	/* content-box pad/margin: room for card box-shadow inside overflow:hidden */
	box-sizing: content-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	padding: 12px;
	margin: -12px;
	overflow: hidden;
}

/*
 * BRB ships CSS variables + !important on .rpi-name / .rpi a.
 * Set tokens on .rpi so plugin rules resolve without fighting
 * every declaration. Documented !important only where BRB already uses it.
 */
.reviews-v2__plugin .rpi {
	--font-family: var(--font-body);
	--name-color: var(--text-heading);
	--name-fs: var(--fs-subheading);
	--name-weight: var(--font-weight-bold);
	--text-fs: var(--fs-body);
	--text-line-height: calc(var(--fs-body) * 1.5);
	/* Five lines before the inline Read More control. */
	--text-lines: 5;
	--card-padding: 20px;
	--card-bg: var(--white);
	--card-bg-color: var(--white);
	--card-radius: 20px;
	--card-shadow: 0 0 11.5px rgba(5, 21, 41, 0.04);
	--card-gap: 32px;
	--slider-card-gap: 32px;
	--body-gap: 20px;
	--star-color: var(--orange);
	--rpi-star-color: var(--orange);
	--rpi-star-size: 20px;
	--star-size: 20px;
	--stars-gap: 3px;
	--time-color: var(--black-01);
	--rev-time-fs: 20px;
	--info-gap: 10px;
	font-family: var(--font-body);
}

.reviews-v2__plugin .rpi,
.reviews-v2__plugin .rpi-cnt,
.reviews-v2__plugin .rpi-content,
.reviews-v2__plugin .rpi-cards {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	visibility: visible !important;
}

/* Kill BRB slider chrome padding/margins that inflate card track height. */
.reviews-v2__plugin .rpi-cnt {
	padding: 0 !important;
}

.reviews-v2__plugin .rpi-cards {
	/*
	 * BRB sets overflow-x: scroll, which clips box-shadows. Pad the scrollport
	 * and pull back with negative margin so card layout size is unchanged.
	 */
	box-sizing: content-box !important;
	padding: 12px !important;
	margin: -12px !important;
}

/* Remove BRB .rpi-slides-bite notch mask between slider arrows and cards */
.reviews-v2__plugin .rpi .rpi-slides-bite {
	-webkit-mask: none;
	mask: none;
}

.reviews-v2__plugin .rpi-header,
.reviews-v2__plugin .rpi-based,
.reviews-v2__plugin .rpi-dots,
.reviews-v2__plugin .rpi-ltgt {
	display: none !important;
}

.reviews-v2__plugin .rpi-card {
	box-sizing: border-box;
	/* Fill the available mobile review viewport. */
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
	height: 266px;
	margin: 0;
}

/* Override BRB .rpi-card-inner { display: block !important; margin: 8px }. */
.reviews-v2__plugin .rpi-content .rpi-card-inner {
	display: flex !important;
	flex-direction: column;
	justify-content: space-between;
	gap: 20px;
	width: 100%;
	height: 266px;
	min-height: 266px;
	max-height: 266px;
	margin: 0 !important;
	padding: 20px;
	border-radius: 20px;
	background: var(--white);
	box-shadow: 0 0 11.5px rgba(5, 21, 41, 0.04);
	border: none;
	overflow: hidden;
	position: relative;
	box-sizing: border-box;
}

/* Hide BRB provider badge on card; Google G is shown beside stars instead. */
.reviews-v2__plugin .rpi-card-inner.rpi-logo {
	padding-inline-start: 20px !important;
}

.reviews-v2__plugin .rpi-card-inner.rpi-logo::before,
.reviews-v2__plugin .rpi-card-inner > .rpi-logos {
	display: none !important;
}

.reviews-v2__plugin .rpi-flex {
	order: 2;
	align-items: flex-start;
	width: 100%;
	margin-top: auto;
	flex-shrink: 0;
}

.reviews-v2__plugin .rpi-body {
	order: 1;
	/* Grid: Google + stars on row 1, review text on row 2 */
	display: grid;
	grid-template-columns: 26px auto;
	grid-template-rows: auto auto;
	column-gap: 3px;
	row-gap: 20px;
	align-items: start;
	align-content: start;
	justify-content: start;
	width: 100%;
	min-height: 0;
	flex: 1 1 auto;
	margin: 0;
}

.reviews-v2__plugin .rpi-body::before {
	content: "";
	grid-column: 1;
	grid-row: 1;
	width: 26px;
	height: 26px;
	margin-top: 2px;
	background: url("/wp-content/themes/fx/assets/img/homepage/reviews/google-g.png") center / contain no-repeat;
}

.reviews-v2__plugin .rpi-text {
	grid-column: 1 / -1;
	grid-row: 2;
	align-self: start;
	color: var(--text-body);
	font-family: var(--font-body);
	font-size: 18px;
	font-weight: var(--font-weight-regular);
	line-height: var(--lh-body);
	height: auto !important;
	max-height: calc(var(--text-lines) * var(--fs-body) * 1.5);
	overflow: hidden;
	scrollbar-width: none;
}

/* BRB adds body-gap as margin-bottom on text; card already has gap between body and flex */
.reviews-v2__plugin .rpi-sh .rpi-text:not(:empty):last-child {
	margin-bottom: 0;
}

.reviews-v2__plugin .rpi-text::-webkit-scrollbar {
	display: none;
	width: 0;
	height: 0;
}

/* Scrollbar only after Read More expands the truncated copy */
.reviews-v2__plugin .rpi-text.is-expanded {
	overflow-x: hidden;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--orange) rgba(5, 21, 41, 0.08);
}

.reviews-v2__plugin .rpi-text.is-expanded::-webkit-scrollbar {
	display: block;
	width: 4px;
	height: auto;
}

.reviews-v2__plugin .rpi-text.is-expanded::-webkit-scrollbar-track {
	background: rgba(5, 21, 41, 0.08);
	border-radius: 4px;
}

.reviews-v2__plugin .rpi-text.is-expanded::-webkit-scrollbar-thumb {
	background: var(--orange);
	border-radius: 10px;
}

.reviews-v2__plugin .rpi-text a,
.reviews-v2__plugin .rpi-more,
.reviews-v2__plugin .rpi-text .rpi-clickable,
.reviews-v2__plugin .rpi-readmore {
	color: var(--orange) !important;
	font-weight: var(--font-weight-bold);
	text-decoration: none;
	text-transform: capitalize;
	cursor: pointer;
}

/* Keep "... read more" as one unit so it never orphans mid-phrase */
.reviews-v2__plugin .rpi-text .rpi-more-wrap {
	display: inline;
	white-space: nowrap;
}

.reviews-v2__plugin .rpi-text .rpi-s,
.reviews-v2__plugin .rpi-text .rpi-readmore {
	display: inline;
}

.reviews-v2__plugin .rpi-stars {
	grid-column: 2;
	grid-row: 1;
	align-self: start;
	margin-top: 4px;
	--star-size: 20px;
	--rpi-star-size: 20px;
	--star-color: var(--orange);
	--rpi-star-color: var(--orange);
}

.reviews-v2__plugin .rpi-info {
	display: flex;
	flex-direction: column;
	gap: var(--info-gap);
	align-items: flex-start;
	width: 100%;
	overflow: visible;
}

/* Beat BRB .rpi a { color: inherit !important } and .rpi-name color !important. */
.reviews-v2__plugin a.rpi-name,
.reviews-v2__plugin .rpi-name {
	color: var(--text-heading) !important;
	font-family: var(--font-heading);
	font-size: var(--fs-subheading);
	font-weight: var(--font-weight-bold);
	line-height: var(--lh-heading);
	text-align: left;
	text-decoration: none;
	white-space: normal;
	overflow: visible;
	text-overflow: unset;
}

.reviews-v2__plugin a.rpi-name:hover,
.reviews-v2__plugin a.rpi-name:focus-visible {
	color: var(--orange) !important;
	text-decoration: none;
}

.reviews-v2__plugin .rpi-time {
	color: var(--black-01);
	font-family: var(--font-heading);
	font-size: 20px;
	font-weight: var(--font-weight-regular);
	line-height: 1.2;
	height: auto;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: visible;
}

/* Mobile only: drop shadow pad so a single full-width card does not overflow. */
@media (max-width: 767px) {
	.reviews-v2__plugin {
		box-sizing: border-box;
		padding: 0;
		margin: 0;
	}

	.reviews-v2__plugin .rpi-cards {
		box-sizing: border-box !important;
		padding: 0 !important;
		margin: 0 !important;
	}
}

.reviews-v2__nav {
	position: absolute;
	left: 0;
	top: 278px;
	display: flex;
	align-items: center;
	gap: 10px;
}

.reviews-v2__nav-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--orange);
	border-radius: 44px;
	background: transparent;
	cursor: pointer;
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.reviews-v2__nav-btn:hover,
.reviews-v2__nav-btn:focus-visible {
	background: rgba(242, 103, 39, 0.12);
	outline: none;
}

.reviews-v2__nav-btn:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: 2px;
}

.reviews-v2__nav-btn img {
	width: 21px;
	height: 21px;
	display: block;
}

.reviews-v2__nav-btn--prev img {
	transform: scaleX(-1);
}

.reviews-v2__media {
	position: absolute;
	left: 25px;
	bottom: -160px;
	width: 100%;
	max-width: 281px;
	height: 183px;
	margin-top: 0;
	border-radius: 20px;
	overflow: hidden;
	flex-shrink: 0;
	z-index: 2;
}

.reviews-v2__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.reviews-v2__media-overlay {
	position: absolute;
	inset: 0;
	background: rgba(5, 21, 41, 0.2);
	pointer-events: none;
	border-radius: 20px;
}

.reviews-v2__house {
	position: absolute;
	/* Offset by the 22px inner gutter so the house art hangs past the panel. */
	right: -49px;
	bottom: -234px;
	width: 329px;
	max-width: none;
	height: auto;
	pointer-events: none;
	z-index: 0;
}

@media (min-width: 768px) {
	.reviews-v2 {
		padding-bottom: 280px;
	}

	.reviews-v2__inner {
		padding: 0 40px;
	}

	.reviews-v2__panel {
		padding-left: 40px;
		padding-right: 40px;
		padding-bottom: 180px;
	}

	.reviews-v2__reviews {
		height: 318px;
	}

	.reviews-v2__quote {
		width: 100px;
		height: 76px;
	}

	.reviews-v2__quote--top {
		top: -50px;
		left: -40px;
	}

	.reviews-v2__quote--bottom {
		right: 0;
		bottom: -40px;
	}

	.reviews-v2__plugin .rpi {
		--text-lines: 6;
		--card-gap: 32px;
		--slider-card-gap: 32px;
	}

	/*
	 * Stay inside the panel content box horizontally (no side negative
	 * margin). Keep vertical pad + pull-back so 318px cards and their
	 * box-shadows are not clipped by overflow:hidden.
	 */
	.reviews-v2__plugin {
		box-sizing: border-box;
		width: 100%;
		max-width: 100%;
		padding: 12px 0;
		margin: -12px 0;
		overflow: hidden;
	}

	.reviews-v2__plugin .rpi-cards {
		box-sizing: border-box !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* Tablet: two cards side-by-side (gap via --slider-card-gap). */
	.reviews-v2__plugin .rpi-card {
		flex: 0 0 calc((100% - 32px) / 2);
		width: calc((100% - 32px) / 2);
		max-width: calc((100% - 32px) / 2);
		height: 318px;
	}

	.reviews-v2__plugin .rpi-content .rpi-card-inner {
		height: 318px;
		min-height: 318px;
		max-height: 318px;
	}

	.reviews-v2__media {
		left: 50%;
		bottom: -100px;
		width: 360px;
		max-width: 360px;
		height: 234px;
		right: 50%;
		transform: translateX(-50%);
	}

	.reviews-v2__house {
		right: -80px;
		bottom: -260px;
		width: 640px;
	}

	.reviews-v2__nav {
		top: calc(100% + 12px);
	}
}

/* Mid desktop: three cards before the 1200px row layout kicks in. */
@media (min-width: 1025px) and (max-width: 1199px) {
	.reviews-v2__plugin .rpi-card {
		flex: 0 0 calc((100% - 64px) / 3);
		width: calc((100% - 64px) / 3);
		max-width: calc((100% - 64px) / 3);
	}
}

@media (min-width: 1200px) {
	.reviews-v2 {
		padding-bottom: 222px;
	}

	.reviews-v2__inner {
		padding: 0 40px;
	}

	.reviews-v2__panel {
		padding: var(--section-padding) 0 165px 84px;
		min-height: 628px;
	}

	.reviews-v2__main {
		flex-direction: row;
		align-items: flex-start;
		gap: 33px;
	}

	.reviews-v2__intro {
		flex: 0 0 285px;
		width: 285px;
		gap: 32px;
	}

	.reviews-v2__reviews {
		flex: 1 1 auto;
		min-width: 0;
		max-width: 863px;
		height: 318px;
		/* Let the 940px card row overflow past the navy panel */
		overflow: visible;
	}

	.reviews-v2__slider-wrap {
		height: 100%;
		gap: 0;
		overflow: visible;
	}

	.reviews-v2__plugin {
		/*
		 * Card row is 940px inside an 863px list so the third card
		 * overlaps the navy panel onto the page background.
		 * Restore content-box pad/margin (tablet zeros it) so box-shadows show.
		 */
		box-sizing: content-box;
		width: 940px;
		max-width: none;
		padding: 12px;
		margin: -12px;
		overflow: hidden;
	}

	.reviews-v2__plugin .rpi-cards {
		box-sizing: content-box !important;
		padding: 12px !important;
		margin: -12px -12px -12px 0 !important;
	}

	.reviews-v2__plugin .rpi-card {
		flex: 0 0 292px;
		width: 292px;
		max-width: 292px;
		height: 318px;
	}

	.reviews-v2__nav {
		/* Sit in the panel bottom padding below the card row. */
		top: 350px;
	}

	.reviews-v2__quote {
		width: 155px;
		height: 118px;
	}

	.reviews-v2__quote--top {
		top: -83px;
		left: -105px;
	}

	.reviews-v2__quote--bottom {
		right: -3px;
		bottom: -177px;
	}

	.reviews-v2__media {
		left: -114.5px;
		right: unset;
		bottom: -88px;
		width: 457px;
		max-width: 457px;
		height: 297px;
		transform: none;
	}

	/*
	 * House is positioned against the 1344px inner wrapper, which includes
	 * 40px gutters around the 1264px panel.
	 */
	.reviews-v2__house {
		right: -108px;
		bottom: -301px;
		width: 964px;
		max-width: none;
	}
}

@media (min-width: 1367px) {
	.reviews-v2__inner {
		max-width: var(--container-max-width);
	}
}
