/**
 * Featured Review — Figma section 04 (node 1092:19052)
 * 1920x830, padding 120 240, transparent background (page white).
 * Left column = review, right column = 705x590 image.
 *
 * Shares its Figma frame name with section 06 but is a different layout.
 */

.featured-review__inner {
	display: grid;
	/* 1440 - 60 gap - 705 image = 675 review column, as a ratio so neither
	 * side collapses between 991 and 1440. */
	grid-template-columns: minmax(0, 675fr) minmax(0, 705fr);
	gap: var(--space-60);
}

/* No `align-items: center` on the grid above: both columns stretch to the row
 * height, and the review column centres its own content in that height instead.
 * Same optical result when the copy is short, but the photo column now fills
 * the row rather than being centred at its natural height. */
.featured-review__content {
	max-width: 585px;
	align-content: center;
}

/* --- opening quote mark ------------------------------------------- */
.featured-review__quote-mark {
	display: block;
	margin-bottom: var(--space-30);
	color: var(--primary-green);
}

.featured-review__quote-mark svg {
	width: 56px;
	height: auto;
}

.featured-review__quote {
	margin: 0 0 var(--space-25);
}

/* --- author ------------------------------------------------------- */
.featured-review__author {
	padding-top: var(--space-25);
	border-top: 1px solid var(--mid-green);
}

.featured-review__author-text {
	display: block;
}

/* --- rating panel -------------------------------------------------- */
.featured-review__rating {
	display: flex;
	align-items: center;
	gap: var(--space-30);
	/* 50 at the developer's instruction, replacing the 30 it was built with. */
	margin-top: 50px;

	/* Figma insets the content 40 on all four sides: the 503x105 Content frame
	 * sits at (40,40) inside the 583x185 panel. 32/40 at the developer's
	 * instruction. */
	padding: 32px 40px;
	background-color: var(--pale-green);
}

.featured-review__rating-logo {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	/* 80 at the developer's instruction, up from the 60 this was built with —
	 * the design's Google mark is an 80x80 vector. One custom property drives
	 * the disc and the glyph inside it, so the half-size ratio cannot drift as
	 * the two step down below desktop. */
	--rating-logo: 80px;
	width: var(--rating-logo);
	height: var(--rating-logo);
	border-radius: 50%;
	background-color: var(--white);
}

.featured-review__rating-logo svg,
.featured-review__rating-img {
	width: calc(var(--rating-logo) / 2);
	height: calc(var(--rating-logo) / 2);
	object-fit: contain;
}

.featured-review__rating-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding-left: var(--space-30);
	border-left: 1px solid var(--mid-green);
}

/* 39, not the 36 of --lh-30: the panel's two lines have their ink tops 39
 * apart in Figma (577.6 and 616.6). Local to this panel. */
.featured-review__rating-text {
	color: var(--primary-black);
	font-family: var(--font-heading);
	font-size: var(--fs-30);
	font-weight: 400;
	line-height: 39px;
}

.featured-review__rating-text strong,
.featured-review__rating-text b {
	font-weight: 700;
}

/* --- live rating feed -----------------------------------------------------
 * The two lines Figma draws — "4.9 out of 5.0 on Google" over a green
 * "544+ reviews" — arrive as one string from the plugin's rating layout, so
 * the count run is promoted to its own line here. Everything else folds the
 * plugin's block markup back into the two-line stack.
 *
 * See css/blocks/testimonials-slider.css for the same skin at 24px; the
 * `--stars: 0` trick there is explained in full.
 * ------------------------------------------------------------------------ */
.featured-review__rating-text .wp-gr {
	display: inline;
	margin: 0;
	padding: 0;
	font-family: var(--font-heading) !important;
	font-size: var(--fs-30) !important;
	line-height: inherit !important;
}

/* `.wp-gr .wp-google-list.grw-rating .grw-header-inner` is the plugin's own
 * selector for the 16px inset, and its stylesheet loads after the theme's —
 * so !important is not enough, the selector has to out-specify it. That 16px
 * was indenting the first line against the second. */
.featured-review__rating-text .wp-gr .wp-google-list,
.featured-review__rating-text .wp-gr .grw-header,
.featured-review__rating-text .wp-gr .wp-google-list.grw-rating .grw-header-inner,
.featured-review__rating-text .wp-gr .grw-header-inner > .rpi-flx {
	display: inline !important;
	flex: 0 0 auto !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;

	/* These wrappers are left at `line-height: normal`, and normal for 30px Anek
	 * Devanagari is 51px — every one of them contributes its strut to the line
	 * box, so the two lines sat 51 apart instead of the designed 39. */
	line-height: inherit !important;
}

.featured-review__rating-text .wp-gr .wp-google-list.grw-rating .grw-header-inner {
	cursor: default !important;
	pointer-events: none !important;
}

.featured-review__rating-text .rpi-stars {
	--stars: 0;
	--star-gap: 0px;
	--rpi-star-size: 30px;
	--rating-scale: 1;
	--head-grade-weight: 700;
	--rpi-rating-color: var(--primary-black);

	display: inline !important;
	height: auto !important;
	padding: 0 !important;
	vertical-align: baseline !important;
	font-family: var(--font-heading) !important;
	line-height: inherit !important;
}

.featured-review__rating-text .rpi-stars::before,
.featured-review__rating-text .rpi-stars::after {
	content: none !important;
}

.featured-review__rating-text .wp-google-based {
	display: inline !important;
	margin: 0 0 0 0.25em !important;
	padding: 0 !important;
	color: var(--primary-black) !important;
	font-family: var(--font-heading) !important;
	font-size: var(--fs-30) !important;
	font-weight: 400 !important;
	line-height: inherit !important;
}

/* Figma puts the count on the second line, green: line one at y577.6, the
 * count at y616.6 — a 39px pitch, which 30/1.3 already gives.
 *
 * The break is a newline in ::before rather than `display: block`. A block
 * inside an inline splits that inline in two and the empty tail keeps a line
 * box of its own, which pushed the pitch to 51. */
.featured-review__rating-text .grw-count::before {
	content: "\A";
	white-space: pre;
}

.featured-review__rating-text .grw-count {
	margin: 0 !important;
	line-height: inherit !important;
	color: var(--primary-green) !important;
	font-size: var(--fs-30) !important;
	font-weight: 700 !important;
}

.featured-review__rating-text .wp-google-powered,
.featured-review__rating-text .grw-popup,
.featured-review__rating-text > .wp-gr > svg {
	display: none !important;
}

/* --- image --------------------------------------------------------- */
.featured-review__figure {
	margin: 0;
}

/**
 * Figma renders this image at 705x590. Using aspect-ratio rather than a fixed
 * height means the frame scales with its column and still holds its proportions
 * if the editor swaps in an image of different dimensions.
 */
.featured-review__image {
	width: 100%;
	height: auto;
	aspect-ratio: 705 / 590;
	object-fit: cover;
}

@media (max-width: 1199px) {

	.featured-review__inner {
		grid-template-columns: 1fr 1fr;
		gap: var(--space-40);
	}

	/* 1199, not 991: iPad landscape is 1024 and would otherwise keep the full
	 * 80px disc, which is heavy once the panel is sharing a narrower column. */
	.featured-review__rating-logo {
		--rating-logo: 64px;
	}
}

@media (max-width: 991px) {

	.featured-review__inner {
		grid-template-columns: 1fr;
	}

	.featured-review__content {
		max-width: none;
	}

}

@media (max-width: 567px) {

	.featured-review__rating {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--space-16);
		/* 25 all round at the developer's instruction, in place of the 32/40 the
		 * panel carries above — the 40 sides are a lot of inset on a phone. */
		padding: 25px;
	}

	.featured-review__rating-body {
		padding-left: 0;
		border-left: 0;
	}

	/* Mobile — the rating stacks here, so the disc sits alone above the text. */
	.featured-review__rating-logo {
		--rating-logo: 56px;
	}
}
