/* Homepage community rating. This file is independently versioned because
   /css assets are cached immutable for one year. */

.community-rating {
  width: min(680px, 96vw);
  min-height: 44px;
  margin: -7px auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 12px;
  color: var(--muted, #9a9aa3);
  font-family: "Chakra Petch", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}

.community-rating::before,
.community-rating::after {
  content: "";
  width: clamp(18px, 4vw, 54px);
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 43, 61, .72));
}

.community-rating::after {
  transform: scaleX(-1);
}

.community-rating__label {
  color: var(--white, #f4f4f5);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 13px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: .14em;
}

.community-rating__stars {
  position: relative;
  display: inline-block;
  letter-spacing: .04em;
  line-height: 1;
}

.community-rating__stars-base {
  color: rgba(255, 255, 255, .2);
}

.community-rating__stars-fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--rating-fill, 0%);
  overflow: hidden;
  color: #ffb800;
  text-shadow: 0 0 12px rgba(255, 184, 0, .28);
  white-space: nowrap;
}

.community-rating__summary {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}

.community-rating__value {
  min-width: 24px;
  color: var(--white, #f4f4f5);
  font-family: "Barlow Condensed", sans-serif;
  font-size: 18px;
  font-style: italic;
  font-weight: 800;
  letter-spacing: 0;
}

.community-rating__scale {
  color: #ffb800;
  letter-spacing: 0;
}

.community-rating__cta {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--white, #f4f4f5);
  text-decoration: none;
  transition: color .16s ease, text-shadow .16s ease;
}

.community-rating__cta:hover {
  color: var(--red-hot, #ff2b3d);
  text-shadow: 0 0 14px rgba(255, 43, 61, .35);
}

.community-rating__cta span {
  color: var(--red-hot, #ff2b3d);
  font-size: 18px;
  line-height: 1;
}

.community-rating[data-state="loading"] .community-rating__summary {
  opacity: .55;
}

.community-rating:not([data-state="ready"]) .community-rating__stars {
  display: none;
}

.community-rating[data-state="unavailable"] .community-rating__summary {
  display: none;
}

@media (max-width: 768px) {
  .community-rating {
    width: 100%;
    min-height: 52px;
    margin: -8px auto 10px;
    gap: 7px;
    padding: 0 4px;
    font-size: 8px;
    letter-spacing: .07em;
  }

  .community-rating::before,
  .community-rating::after {
    display: none;
  }

  .community-rating__label {
    font-size: 11px;
    letter-spacing: .08em;
  }

  .community-rating__stars {
    display: none;
  }

  .community-rating__value {
    min-width: 20px;
    font-size: 16px;
  }

  .community-rating__cta {
    padding-inline: 2px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .community-rating[data-state="ready"] .community-rating__value {
    animation: community-score-lock .32s cubic-bezier(.22, .9, .32, 1);
  }
}

@keyframes community-score-lock {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (forced-colors: active) {
  .community-rating {
    border-block: 1px solid CanvasText;
  }

  .community-rating__cta {
    text-decoration: underline;
  }
}
