/**
 * Shared by the Rating and Review Box blocks: square star meter and the
 * visually hidden text that carries the score for screen readers.
 */

.twr-stars {
	--twr-size: 16px;
	--twr-gap: 2px;
	position: relative;
	display: inline-block;
	flex: none;
	line-height: 0;
}

.twr-stars.is-size-s {
	--twr-size: 13px;
}

.twr-stars.is-size-l {
	--twr-size: 22px;
	--twr-gap: 3px;
}

.twr-stars__track,
.twr-stars__fill {
	display: flex;
	gap: var(--twr-gap);
}

.twr-stars__fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--twr-score);
	overflow: hidden;
}

.twr-stars i {
	position: relative;
	flex: none;
	width: var(--twr-size);
	height: var(--twr-size);
	border-radius: 2px;
	background: var(--wp--preset--color--line, #d9dedc);
}

.twr-stars__fill i {
	background: var(--wp--preset--color--accent, #93e547);
}

.twr-stars i::before {
	content: "";
	position: absolute;
	inset: 15%;
	background: #000;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.9 7.1.6-5.4 4.7 1.6 7.3L12 17.8 5.8 21.5l1.6-7.3L2 9.5l7.1-.6z'/%3E%3C/svg%3E") center / contain no-repeat;
}

.twr-stars__track i::before {
	background: var(--wp--preset--color--muted, #5c6360);
}

:where(.wp-block-titanworks-ev-reviews-rating, .twr-box) .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}
