/**
 * Allium Housing - published review cards.
 * Sits inside an Elementor section; inherits page width from its container.
 */

.af-reviews.af-reviews {
	--af-green: #2b8563;
	--af-green-dark: #182615;
	--af-green-soft: #42574f;
	--af-accent: #fac102;
	--af-cream: #f5f2ed;
	--af-sage: #e7ebde;
	--af-sage-dark: #e2e2d4;
	--af-text: #272727;
	--af-muted: #6b6f68;

	color: var(--af-text);
	font-family: "proxima-nova", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	line-height: 1.55;
}

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

.af-reviews .af-reviews__heading {
	margin: 0 0 0.75rem;
	font-family: "Libre Baskerville", Georgia, serif;
	font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
	line-height: 1.2;
	color: var(--af-green-dark);
}

/* Full-width rows: one review per line, filling whatever container it sits
   in. The quote must not stretch here or the footer drifts to the bottom. */
.af-reviews.af-reviews--list .af-review__quote {
	flex: 0 1 auto;
}

/* Summary ---------------------------------------------------------- */

/* Every line-height below is stated explicitly. The block is dropped into
   whatever Elementor container the page provides, and an inherited
   line-height of 2+ opens large gaps that no amount of specificity fixes,
   because an undeclared property is simply inherited. */

.af-reviews .af-reviews__summary {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.15rem 0.6rem;
	margin: 0 0 1rem;
	padding: 0.6rem 0.85rem;
	border-radius: 6px;
	background: var(--af-sage);
	line-height: 1.4;
}

.af-reviews .af-reviews__score {
	font-family: "Libre Baskerville", Georgia, serif;
	font-size: 1.5rem;
	line-height: 1;
	font-weight: 700;
	color: var(--af-green-dark);
}

/* A row, not a column: the stars and the count read as one line beside the
   score, rather than stacking and stretching the banner. */
.af-reviews .af-reviews__summary-body {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.15rem 0.5rem;
	line-height: 1.4;
}

.af-reviews .af-reviews__count {
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--af-green-soft);
}

/* Layout ----------------------------------------------------------- */

/* align-items: start keeps each card at its natural height. With the default
   stretch, expanding one card's detail would stretch every card in that row,
   stranding their footers at the bottom of a tall empty box. */
.af-reviews .af-reviews__items {
	display: grid;
	align-items: start;
	gap: 0.85rem;
}

.af-reviews.af-reviews--cols-2 .af-reviews__items {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.af-reviews.af-reviews--cols-3 .af-reviews__items {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.af-reviews.af-reviews--cols-4 .af-reviews__items {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.af-reviews.af-reviews--list .af-reviews__items {
	grid-template-columns: minmax(0, 1fr);
}

@media (max-width: 900px) {
	.af-reviews.af-reviews--cols-3 .af-reviews__items,
	.af-reviews.af-reviews--cols-4 .af-reviews__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.af-reviews .af-reviews__items {
		grid-template-columns: minmax(0, 1fr) !important;
	}
}

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

.af-reviews .af-review {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--af-sage-dark);
	border-radius: 6px;
	background: #fff;
	line-height: 1.5;
}

.af-reviews .af-review__rating {
	line-height: 1;
}

.af-reviews .af-review__quote {
	margin: 0;
	padding: 0;
	border: 0;
	flex: 1 1 auto;
	quotes: "\201C" "\201D";
}

.af-reviews .af-review__quote p {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: var(--af-text);
}

.af-reviews .af-review__quote p::before {
	content: open-quote;
	margin-right: 0.05em;
	color: var(--af-green);
}

.af-reviews .af-review__quote p::after {
	content: close-quote;
	margin-left: 0.05em;
	color: var(--af-green);
}

/* Attribution reads as one line - "Advocate · With Allium Housing for over 12
   months" - rather than stacked, which left an awkward gap between the two. */
.af-reviews .af-review__meta {
	display: flex;
	align-items: baseline;
	flex-wrap: wrap;
	gap: 0.1rem 0.45rem;
	margin-top: 0.1rem;
	padding-top: 0.5rem;
	border-top: 1px solid var(--af-sage);
	line-height: 1.4;
}

.af-reviews .af-review__name {
	font-size: 0.875rem;
	font-style: normal;
	font-weight: 600;
	line-height: 1.4;
	color: var(--af-green-dark);
}

.af-reviews .af-review__duration {
	font-size: 0.75rem;
	line-height: 1.4;
	color: var(--af-muted);
}

.af-reviews .af-review__name + .af-review__duration::before {
	content: "·";
	margin-right: 0.45rem;
	color: var(--af-sage-dark);
}

.af-reviews .af-reviews__empty {
	color: var(--af-muted);
	font-size: 0.9375rem;
}

/* Expanded detail -------------------------------------------------- */

/* Selectors carry the .af-reviews prefix so they outrank Elementor's
   .elementor-kit-N rules. See the README before removing it. */

.af-reviews .af-review__more {
	margin-top: 0.15rem;
}

.af-reviews .af-review__toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	padding: 0;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--af-green);
	cursor: pointer;
	list-style: none;
	transition: color 0.15s ease;
}

.af-reviews .af-review__toggle::-webkit-details-marker {
	display: none;
}

.af-reviews .af-review__toggle::before {
	content: "";
	width: 0;
	height: 0;
	border-left: 4px solid currentColor;
	border-top: 3.5px solid transparent;
	border-bottom: 3.5px solid transparent;
	transition: transform 0.15s ease;
}

.af-reviews .af-review__more[open] .af-review__toggle::before {
	transform: rotate(90deg);
}

.af-reviews .af-review__toggle:hover {
	color: var(--af-green-dark);
}

.af-reviews .af-review__toggle:focus-visible {
	outline: 2px solid var(--af-green);
	outline-offset: 2px;
	border-radius: 2px;
}

.af-reviews .af-review__detail {
	margin-top: 0.6rem;
	padding-top: 0.6rem;
	border-top: 1px solid var(--af-sage);
}

/* Full-width rows would otherwise strand each rating label and its stars at
   opposite ends of a very wide row. Flowing the blocks into columns keeps
   label and stars close enough to read as a pair. */
.af-reviews.af-reviews--list .af-review__detail {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
	gap: 0.4rem 2rem;
	align-items: start;
}

.af-reviews.af-reviews--list .af-detail__recommend {
	grid-column: 1 / -1;
}

.af-reviews .af-detail__block {
	margin-bottom: 0.7rem;
}

.af-reviews .af-detail__block:last-child {
	margin-bottom: 0;
}

.af-reviews .af-detail__heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0 0 0.3rem;
	font-family: inherit;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.4;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	color: var(--af-green);
}

.af-reviews .af-detail__avg {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0;
	color: var(--af-green-dark);
}

.af-reviews .af-detail__ratings {
	margin: 0;
	padding: 0;
	list-style: none;
}

.af-reviews .af-detail__ratings li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.15rem 0;
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--af-green-soft);
}

.af-reviews .af-detail__label {
	min-width: 0;
}

.af-reviews .af-detail__ratings .af-stars-static {
	flex: 0 0 auto;
	font-size: 0.8125rem;
}

.af-reviews .af-detail__outcomes {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* A small radius rather than a pill: these labels are long enough to wrap
   onto two lines, where a fully rounded end reads as a misshapen blob. */
.af-reviews .af-detail__outcomes li {
	padding: 0.2rem 0.45rem;
	border-radius: 4px;
	background: var(--af-sage);
	font-size: 0.75rem;
	line-height: 1.45;
	color: var(--af-green-dark);
}

.af-reviews .af-detail__answer {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--af-text);
}

.af-reviews .af-detail__recommend {
	margin: 0;
	padding-top: 0.55rem;
	border-top: 1px solid var(--af-sage);
	font-size: 0.8125rem;
	line-height: 1.4;
	color: var(--af-green-soft);
}

.af-reviews .af-detail__recommend strong {
	color: var(--af-green-dark);
}

.af-reviews .af-detail__recommend--no strong {
	color: #b3261e;
}

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

.af-reviews .af-stars-static {
	display: inline-flex;
	gap: 0.02em;
	color: var(--af-sage-dark);
	font-size: 1rem;
	line-height: 1;
	letter-spacing: 0;
}

.af-reviews .af-stars-static .af-star.is-full {
	color: var(--af-accent);
}

/* Half star: a clipped gold star layered over the grey one. */
.af-reviews .af-stars-static .af-star.is-half {
	position: relative;
	color: var(--af-sage-dark);
}

.af-reviews .af-stars-static .af-star.is-half::before {
	content: "\2605";
	position: absolute;
	inset: 0;
	width: 50%;
	overflow: hidden;
	color: var(--af-accent);
}
