/* ==========================================================================
   Star Rating — a mark out of five, to read in a table row or to set on a form
   Gold for the stars given, faint for the rest. Blank is a line of text rather
   than five empty stars, because "nobody has formed a view" and "somebody has
   formed a poor one" must not look alike (see shared/_star_rating).
   ========================================================================== */
.star-rating {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.star-rating__star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-border-strong);
  transition: color var(--transition-base);
}

.star-rating__star--filled {
  color: #f2b134;
}

.star-rating__icon {
  width: 15px;
  height: 15px;
}

.star-rating__empty {
  color: var(--color-text-muted);
  font-size: var(--font-size-medium);
  white-space: nowrap;
}

/* --- The form control ---------------------------------------------------- */
.star-rating--input {
  gap: var(--space-1);
}

.star-rating__star--button {
  padding: 2px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.star-rating__star--button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.star-rating--input .star-rating__icon {
  width: 22px;
  height: 22px;
}

/* Sits to the right of the row and says what is set — and that clicking the star
   a rating sits on is the way back to no rating at all, which a row of stars
   gives no hint of on its own. */
.star-rating__label {
  margin-left: var(--space-2);
  color: var(--color-text-muted);
  font-size: var(--font-size-small);
}
