/* Hungry Stomach Recipes: star ratings. The theme can recolor the stars with --hsr-star and --hsr-ink. */

.hsr-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Stars that show a rating */
.hsr-stars {
	position: relative;
	display: inline-block;
	width: 5.5em;
	height: 1.1em;
	vertical-align: -0.18em;
	flex: none;
}

.hsr-stars__fill,
.hsr-stars::after {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") repeat-x 0 0 / 1.1em 1.1em;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.6l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E") repeat-x 0 0 / 1.1em 1.1em;
}

.hsr-stars__fill { background: var(--hsr-star, #ffd23f); }

.hsr-stars::after {
	content: "";
	right: 0;
	background: var(--hsr-ink, #161616);
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.6l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.6' stroke-linejoin='round'%3E%3Cpath d='M12 2.6l2.9 6.1 6.6.8-4.9 4.6 1.3 6.6L12 17.4l-5.9 3.3 1.3-6.6-4.9-4.6 6.6-.8z'/%3E%3C/svg%3E");
}

.hsr-comment-rating { margin: 4px 0 2px; font-size: 18px; line-height: 1; }

/* The star picker in the comment form */
.hsr-rate { margin: 0; padding: 0; border: 0; min-width: 0; }
.hsr-rate__legend { padding: 0; font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.hsr-rate__optional { font-weight: 400; color: #555; }
.hsr-rate__row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.hsr-rate__stars { display: inline-flex; flex-direction: row-reverse; gap: 2px; }

.hsr-rate__input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.hsr-rate__star {
	display: inline-flex;
	padding: 3px;
	cursor: pointer;
	margin: 0 !important;
}

.hsr-rate__star svg {
	display: block;
	fill: #fff;
	stroke: var(--hsr-ink, #161616);
	stroke-width: 1.6;
	stroke-linejoin: round;
	transition: fill 0.1s;
}

.hsr-rate__input:checked ~ .hsr-rate__star svg { fill: var(--hsr-star, #ffd23f); }

@media (hover: hover) {
	.hsr-rate__stars:hover .hsr-rate__star svg { fill: #fff; }
	.hsr-rate__stars .hsr-rate__star:hover svg,
	.hsr-rate__stars .hsr-rate__star:hover ~ .hsr-rate__star svg { fill: var(--hsr-star, #ffd23f); }
}

.hsr-rate__input:focus-visible + .hsr-rate__star { outline: 2px solid var(--hsr-ink, #161616); outline-offset: 1px; }

.hsr-rate__clear {
	background: none;
	border: 0;
	padding: 4px 0;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	cursor: pointer;
	color: inherit;
}

.hsr-rate__hint { margin: 4px 0 0; font-size: 14px; color: #555; }

@media print {
	.hsr-rate { display: none; }
}
