/*  
 *  Pure CSS star rating that works without reversing order
 *  of inputs
 *  -------------------------------------------------------
 *  NOTE: For the styling to work, there needs to be a radio
 *        input selected by default. There also needs to be a
 *        radio input before the first star, regardless of
 *        whether you offer a 'no rating' or 0 stars option
 *  
 *  This codepen uses FontAwesome icons
 */

#half-stars-example {
  /* use display:inline-flex to prevent whitespace issues. alternatively, you can put all the children of .rating-group on a single line */
  /* make hover effect work properly in IE */
  /* hide radio inputs */
  /* set icon padding and size */
  /* add padding and positioning to half star labels */
  /* set default star color */
  /* set color of none icon when unchecked */
  /* if none icon is checked, make it red */
  /* if any input is checked, make its following siblings grey */
  /* make all stars orange on rating group hover */
  /* make hovered input's following siblings grey on hover */
  /* make none icon grey on rating group hover */
  /* make none icon red on hover */

  /* transform: scale(0.65); */
  transform: translateX(-9.5px);
}
#half-stars-example .rating-group {
  display: inline-flex;
}
#half-stars-example .rating__icon {
  pointer-events: none;
}
#half-stars-example .rating__input {
  position: absolute !important;
  left: -9999px !important;
}
#half-stars-example .rating__label {
  cursor: pointer;
  /* if you change the left/right padding, update the margin-right property of .rating__label--half as well. */
  padding: 0 0.1em;
  font-size: 0.9rem;
}
#half-stars-example .rating__label--half {
  padding-right: 0;
  margin-right: -1.2em;
  z-index: 2;
}
#half-stars-example .rating__icon--star {
  color: gold;
}
#half-stars-example .rating__icon--none {
  color: #eee;
}

#half-stars-example
  .rating__input:checked
  ~ .rating__label
  .rating__icon--star {
  color: #ddd;
}
#half-stars-example .rating-group:hover .rating__label .rating__icon--star,
#half-stars-example
  .rating-group:hover
  .rating__label--half
  .rating__icon--star {
  color: gold;
}
#half-stars-example .rating__input:hover ~ .rating__label .rating__icon--star,
#half-stars-example
  .rating__input:hover
  ~ .rating__label--half
  .rating__icon--star {
  color: #ddd;
}
#half-stars-example
  .rating-group:hover
  .rating__input--none:not(:hover)
  + .rating__label
  .rating__icon--none {
  color: #eee;
}
#half-stars-example
  .rating__input--none:hover
  + .rating__label
  .rating__icon--none {
  color: red;
}
