/**
 * Bpers Review Count and Rating front end styles.
 *
 * Everything is driven by custom properties so a theme can restyle the badge
 * without overriding rules. Set them on .rvnum-badge, or globally on :root.
 */

.rvnum-badge,
.rvnum-stars {
	--rvnum-star-size: 1.05em;
	--rvnum-star-color: #f5a623;
	--rvnum-star-empty: currentColor;
	--rvnum-star-empty-opacity: 0.25;
	--rvnum-gap: 0.45em;
}

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

.rvnum-stars {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	font-size: var(--rvnum-star-size);
	line-height: 1;
}

.rvnum-stars__layer {
	display: flex;
	flex-wrap: nowrap;
	line-height: 1;
}

.rvnum-stars__layer--full {
	position: absolute;
	top: 0;
	left: 0;
	overflow: hidden;
	width: 0;
	color: var(--rvnum-star-color);
}

.rvnum-stars__layer--empty {
	color: var(--rvnum-star-empty);
	opacity: var(--rvnum-star-empty-opacity);
}

.rvnum-star {
	display: block;
	flex: 0 0 auto;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* Badge ------------------------------------------------------------------ */

.rvnum-badge {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rvnum-gap);
	line-height: 1.4;
}

.rvnum-badge__body {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--rvnum-gap);
}

.rvnum-badge__label {
	font-weight: 600;
}

.rvnum-badge__rating {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.rvnum-badge__count {
	opacity: 0.85;
}

.rvnum-badge__attribution,
.rvnum-attribution {
	font-size: 0.78em;
	opacity: 0.7;
	white-space: nowrap;
}

/* Links ------------------------------------------------------------------ */

.rvnum-link {
	color: inherit;
	text-decoration: inherit;
}

.rvnum-link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: no-preference) {

	.rvnum-link {
		transition: opacity 0.15s ease;
	}

	.rvnum-link:hover {
		opacity: 0.8;
	}
}
