/*
 * Review card + aggregate rating badge.
 * design/DESIGN-SYSTEM.md §4.7 and §4.8, PAGE-STRUCTURE §2.6 / §5.1.
 *
 * The hover border is 0.6 -- the standardised card hover from §8 row 5 (the
 * prototype's 0.5 on this one card is a documented inconsistency).
 *
 * .sp-review-grid caps the track count at 3 so the six-card Recenzie page wraps
 * 3 + 3 instead of the 4 + 2 the raw auto-fit produces (§3.6 / KNOWN-ISSUES).
 */

.sp-review-grid {
	display: grid;
	gap: var(--sp-grid-gap-sm);
	grid-template-columns: repeat(
		auto-fit,
		minmax(max(290px, (100% - 2 * var(--sp-grid-gap-sm)) / 3), 1fr)
	);
}

.sp-review {
	display: flex;
	flex-direction: column;
	gap: var(--sp-4);
	padding: var(--sp-10);
	background: var(--sp-surface);
	border: var(--sp-border);
	border-radius: var(--sp-radius);
	transition: border-color var(--sp-dur-base) var(--sp-ease);
}

.sp-review:hover,
.sp-review:focus-within {
	border-color: var(--sp-line-hover);
}

.sp-review__text {
	margin: 0;
	font-family: var(--sp-font-display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--sp-fs-md);
	line-height: var(--sp-lh-body);
	color: var(--sp-text-78);
	text-wrap: pretty;
}

.sp-review__author {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	margin-top: auto;
	padding-top: var(--sp-3);
	border-top: var(--sp-border);
}

/* A square chip, deliberately not a circle (§4.7). */
.sp-review__avatar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	background: var(--sp-red);
	font-family: var(--sp-font-display);
	font-style: italic;
	font-weight: 900;
	font-size: var(--sp-fs-base);
	text-transform: uppercase;
	color: var(--sp-text);
}

.sp-review__name {
	font-family: var(--sp-font-display);
	font-style: italic;
	font-weight: 700;
	font-size: var(--sp-fs-md);
	line-height: var(--sp-lh-tight);
	text-transform: uppercase;
	color: var(--sp-text);
}

.sp-review__meta {
	font-size: var(--sp-fs-micro);
	color: var(--sp-text-40);
}

/* ------------------------------------------------------------- star row */

.sp-stars {
	color: var(--sp-red);
	font-size: var(--sp-fs-base);
	letter-spacing: 2px;
	line-height: 1;
}

/* -------------------------------------------------- aggregate rating (§4.8) */

.sp-rating {
	display: flex;
	align-items: center;
	gap: var(--sp-3);
	padding: var(--sp-3) var(--sp-7);
	/* 0.14 is the rating-badge alpha (§1.1 Borders); tokens.css does not name it. */
	border: 1px solid rgba(255, 255, 255, 0.14);
}

.sp-rating__score {
	font-family: var(--sp-font-display);
	font-style: italic;
	font-weight: 900;
	font-size: var(--sp-fs-3xl);
	line-height: var(--sp-lh-display);
	color: var(--sp-text);
}

.sp-rating__count {
	font-size: var(--sp-fs-micro);
	color: var(--sp-text-50);
}
