/* Reader ratings on recipe pages (templates/partials/recipe_rating.html) */
.recipe-rating {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.2rem;
  margin: 0.6rem 0 0.9rem;
}

.recipe-rating__summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary, #665e53);
  font-size: 0.95rem;
}

.rating-stars { letter-spacing: 1px; font-size: 1.15rem; line-height: 1; }
.rating-star--full { color: var(--accent-gold, #c9954e); }
.rating-star--empty { color: #cdbba5; }
.rating-star--half {
  background: linear-gradient(90deg, var(--accent-gold, #c9954e) 50%, #cdbba5 50%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.recipe-rating__form fieldset {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
  margin: 0;
  padding: 0;
  border: 0;
}

.recipe-rating__form legend {
  float: left;           /* keeps the legend on the same line as the stars */
  padding: 0;
  margin-right: 0.3rem;
  font-size: 0.92rem;
  color: var(--text-secondary, #665e53);
}

/* Stars in reverse order in the HTML so "this star and the ones before it" light up with plain CSS */
.rating-input {
  display: inline-flex;
  flex-direction: row-reverse;
}

.rating-input__radio {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.rating-input__star {
  cursor: pointer;
  padding: 0 0.12rem;
  font-size: 1.6rem;
  line-height: 1;
  color: #cdbba5;
  transition: color 0.15s, transform 0.15s;
}

.rating-input__star:hover,
.rating-input__star:hover ~ .rating-input__star,
.rating-input__radio:checked ~ .rating-input__star {
  color: var(--accent-gold, #c9954e);
}

.rating-input__star:hover { transform: scale(1.15); }

.rating-input__radio:focus-visible + .rating-input__star {
  outline: 2px solid var(--accent-warm, #ae5c40);
  outline-offset: 2px;
  border-radius: 4px;
}

.recipe-rating__submit {
  padding: 0.3rem 0.9rem;
  font-size: 0.9rem;
  color: #fff;
  background: var(--accent-warm, #ae5c40);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.recipe-rating--js .recipe-rating__submit { display: none; } /* the script sends on click */

.recipe-rating__message {
  width: 100%;
  margin: 0.2rem 0 0;
  font-size: 0.9rem;
  color: var(--highlight, #784527);
}
.recipe-rating__message:empty { display: none; }

.recipe-rating.is-sending .rating-input { opacity: 0.5; pointer-events: none; }

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

@media print {
  .recipe-rating__form { display: none; }
}
