/*  
 *  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
 */
#full-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 */
  /* 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 */
}

#full-stars-example .rating-group {
  display: inline-flex;
}

#full-stars-example .rating__icon {
  pointer-events: none;
}

#full-stars-example .rating__input {
  position: absolute !important;
  left: -9999px !important;
}

#full-stars-example .rating__label {
  cursor: pointer;
  padding: 0 0.1em;
  font-size: 2rem;
}

#full-stars-example .rating__icon--star {
  color: orange;
}

#full-stars-example .rating__icon--none {
  color: #eee;
}

#full-stars-example .rating__input--none:checked+.rating__label .rating__icon--none {
  color: red;
}

#full-stars-example .rating__input:checked~.rating__label .rating__icon--star {
  color: #ddd;
}

#full-stars-example .rating-group:hover .rating__label .rating__icon--star {
  color: orange;
}

#full-stars-example .rating__input:hover~.rating__label .rating__icon--star {
  color: #ddd;
}

#full-stars-example .rating-group:hover .rating__input--none:not(:hover)+.rating__label .rating__icon--none {
  color: #eee;
}

#full-stars-example .rating__input--none:hover+.rating__label .rating__icon--none {
  color: red;
}

#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 */
}

#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: 2rem;
}

#half-stars-example .rating__label--half {
  padding-right: 0;
  margin-right: -0.6em;
  z-index: 2;
}

#half-stars-example .rating__icon--star {
  color: orange;
}

#half-stars-example .rating__icon--none {
  color: #eee;
}

#half-stars-example .rating__input--none:checked+.rating__label .rating__icon--none {
  color: red;
}

#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: orange;
}

#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;
}

#full-stars-example-two {
  /* 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 */
  /* hide 'none' input from screenreaders */
  /* set icon padding and size */
  /* set default star color */
  /* 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 */
}

#full-stars-example-two .rating-group {
  display: inline-flex;
}

#full-stars-example-two .rating__icon {
  pointer-events: none;
}

#full-stars-example-two .rating__input {
  position: absolute !important;
  left: -9999px !important;
}

#full-stars-example-two .rating__input--none {
  display: none;
}

#full-stars-example-two .rating__label {
  cursor: pointer;
  padding: 0 0.1em;
  font-size: 2rem;
}

#full-stars-example-two .rating__icon--star {
  color: orange;
}

#full-stars-example-two .rating__input:checked~.rating__label .rating__icon--star {
  color: #ddd;
}

#full-stars-example-two .rating__input:hover~.rating__label .rating__icon--star {
  color: #ddd;
}















.rating {
  margin: auto;
  --bg: #e3e4e8;
  --fg: #17181c;
  --primary: #255ff4;
  --yellow: #f4a825;
  --yellow-t: rgba(244, 168, 37, 0);
  --bezier: cubic-bezier(0.42, 0, 0.58, 1);
  --trans-dur: 0.3s;
}

.rating__display {
  font-size: 1em;
  font-weight: 500;
  min-height: 1.25em;
  position: absolute;
  top: 100%;
  /* width: 100%; */
  text-align: center;
}

.rating__stars {
  display: flex;
  padding-bottom: 0.375em;
  position: relative;
}

.rating__star {
  display: block;
  overflow: visible;
  pointer-events: none;
  width: 2em;
  height: 2em;
}

.rating__star-ring,
.rating__star-fill,
.rating__star-line,
.rating__star-stroke {
  animation-duration: 1s;
  animation-timing-function: ease-in-out;
  animation-fill-mode: forwards;
}

.rating__star-ring,
.rating__star-fill,
.rating__star-line {
  stroke: var(--yellow);
}

.rating__star-fill {
  fill: var(--yellow);
  transform: scale(0);
  transition: fill var(--trans-dur) var(--bezier), transform var(--trans-dur) var(--bezier);
}

.rating__star-stroke {
  stroke: #c7cad1;
  transition: stroke var(--trans-dur);
}

.rating__label {
  cursor: pointer;
  padding: 0.125em;
}

.rating__label--delay1 .rating__star-ring,
.rating__label--delay1 .rating__star-fill,
.rating__label--delay1 .rating__star-line,
.rating__label--delay1 .rating__star-stroke {
  animation-delay: 0.05s;
}

.rating__label--delay2 .rating__star-ring,
.rating__label--delay2 .rating__star-fill,
.rating__label--delay2 .rating__star-line,
.rating__label--delay2 .rating__star-stroke {
  animation-delay: 0.1s;
}

.rating__label--delay3 .rating__star-ring,
.rating__label--delay3 .rating__star-fill,
.rating__label--delay3 .rating__star-line,
.rating__label--delay3 .rating__star-stroke {
  animation-delay: 0.15s;
}

.rating__label--delay4 .rating__star-ring,
.rating__label--delay4 .rating__star-fill,
.rating__label--delay4 .rating__star-line,
.rating__label--delay4 .rating__star-stroke {
  animation-delay: 0.2s;
}

.rating__input {
  -webkit-appearance: none;
  appearance: none;
  padding: 0px 0px 0px 0px !important;
  width: 0px !important;
}

.rating__input:hover~[data-rating]:not([hidden]) {
  display: none;
}

.rating__input-1:hover~[data-rating="1"][hidden],
.rating__input-2:hover~[data-rating="2"][hidden],
.rating__input-3:hover~[data-rating="3"][hidden],
.rating__input-4:hover~[data-rating="4"][hidden],
.rating__input-5:hover~[data-rating="5"][hidden],
.rating__input:checked:hover~[data-rating]:not([hidden]) {
  display: block;
}

.rating__input-1:hover~.rating__label:first-of-type .rating__star-stroke,
.rating__input-2:hover~.rating__label:nth-of-type(-n + 2) .rating__star-stroke,
.rating__input-3:hover~.rating__label:nth-of-type(-n + 3) .rating__star-stroke,
.rating__input-4:hover~.rating__label:nth-of-type(-n + 4) .rating__star-stroke,
.rating__input-5:hover~.rating__label:nth-of-type(-n + 5) .rating__star-stroke {
  stroke: var(--yellow);
  transform: scale(1);
}

.rating__input-1:checked~.rating__label:first-of-type .rating__star-ring,
.rating__input-2:checked~.rating__label:nth-of-type(-n + 2) .rating__star-ring,
.rating__input-3:checked~.rating__label:nth-of-type(-n + 3) .rating__star-ring,
.rating__input-4:checked~.rating__label:nth-of-type(-n + 4) .rating__star-ring,
.rating__input-5:checked~.rating__label:nth-of-type(-n + 5) .rating__star-ring {
  animation-name: starRing;
}

.rating__input-1:checked~.rating__label:first-of-type .rating__star-stroke,
.rating__input-2:checked~.rating__label:nth-of-type(-n + 2) .rating__star-stroke,
.rating__input-3:checked~.rating__label:nth-of-type(-n + 3) .rating__star-stroke,
.rating__input-4:checked~.rating__label:nth-of-type(-n + 4) .rating__star-stroke,
.rating__input-5:checked~.rating__label:nth-of-type(-n + 5) .rating__star-stroke {
  animation-name: starStroke;
}

.rating__input-1:checked~.rating__label:first-of-type .rating__star-line,
.rating__input-2:checked~.rating__label:nth-of-type(-n + 2) .rating__star-line,
.rating__input-3:checked~.rating__label:nth-of-type(-n + 3) .rating__star-line,
.rating__input-4:checked~.rating__label:nth-of-type(-n + 4) .rating__star-line,
.rating__input-5:checked~.rating__label:nth-of-type(-n + 5) .rating__star-line {
  animation-name: starLine;
}

.rating__input-1:checked~.rating__label:first-of-type .rating__star-fill,
.rating__input-2:checked~.rating__label:nth-of-type(-n + 2) .rating__star-fill,
.rating__input-3:checked~.rating__label:nth-of-type(-n + 3) .rating__star-fill,
.rating__input-4:checked~.rating__label:nth-of-type(-n + 4) .rating__star-fill,
.rating__input-5:checked~.rating__label:nth-of-type(-n + 5) .rating__star-fill {
  animation-name: starFill;
}

.rating__input-1:not(:checked):hover~.rating__label:first-of-type .rating__star-fill,
.rating__input-2:not(:checked):hover~.rating__label:nth-of-type(2) .rating__star-fill,
.rating__input-3:not(:checked):hover~.rating__label:nth-of-type(3) .rating__star-fill,
.rating__input-4:not(:checked):hover~.rating__label:nth-of-type(4) .rating__star-fill,
.rating__input-5:not(:checked):hover~.rating__label:nth-of-type(5) .rating__star-fill {
  fill: var(--yellow-t);
}

.rating__sr {
  clip: rect(1px, 1px, 1px, 1px);
  overflow: hidden;
  position: absolute;
  width: 1px;
  height: 1px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181c;
    --fg: #e3e4e8;
  }

  .rating {
    margin: auto;
  }

  .rating__star-stroke {
    stroke: #454954;
  }
}

@keyframes starRing {

  from,
  20% {
    animation-timing-function: ease-in;
    opacity: 1;
    r: 8px;
    stroke-width: 16px;
    transform: scale(0);
  }

  35% {
    animation-timing-function: ease-out;
    opacity: 0.5;
    r: 8px;
    stroke-width: 16px;
    transform: scale(1);
  }

  50%,
  to {
    opacity: 0;
    r: 16px;
    stroke-width: 0;
    transform: scale(1);
  }
}

@keyframes starFill {

  from,
  40% {
    animation-timing-function: ease-out;
    transform: scale(0);
  }

  60% {
    animation-timing-function: ease-in-out;
    transform: scale(1.2);
  }

  80% {
    transform: scale(0.9);
  }

  to {
    transform: scale(1);
  }
}

@keyframes starStroke {
  from {
    transform: scale(1);
  }

  20%,
  to {
    transform: scale(0);
  }
}

@keyframes starLine {

  from,
  40% {
    animation-timing-function: ease-out;
    stroke-dasharray: 1 23;
    stroke-dashoffset: 1;
  }

  60%,
  to {
    stroke-dasharray: 12 12;
    stroke-dashoffset: -12;
  }
}