/* =========================================================
   SG STORY RATINGS
   Lightweight frontend rating display
   ========================================================= */

.sg-story-rating {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.75rem 0;
    line-height: 1;
}


/* =========================================================
   STARS
   ========================================================= */

.sg-rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 0.08rem;
    white-space: nowrap;
}


/* =========================================================
   CLICKABLE STARS
   ========================================================= */

.sg-rating-star {
    appearance: none;
    -webkit-appearance: none;

    border: 0;
    background: transparent;

    padding: 0;
    margin: 0;

    font: inherit;
    font-size: 1.15rem;
    line-height: 1;

    cursor: pointer;

    color: #b8b8b8;

    transition:
        color 0.15s ease,
        transform 0.15s ease;
}


/* Selected stars */

.sg-rating-star.is-selected {
    color: #f2b01e;
}


/* Hover */

.sg-rating-star:hover {
    transform: scale(1.08);
}

/* Keyboard focus */

.sg-rating-star:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
    border-radius: 3px;
}


/* =========================================================
   AVERAGE
   ========================================================= */

.sg-rating-average {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1;
}


/* =========================================================
   COUNT
   ========================================================= */

.sg-rating-count {
    font-size: 0.85rem;
    opacity: 0.7;
    line-height: 1;
}


/* =========================================================
   STATUS / ACCESSIBILITY
   ========================================================= */

.sg-rating-status {
    font-size: 0.8rem;
    opacity: 0.7;
    line-height: 1;
}


/* =========================================================
   SAVING STATE
   ========================================================= */

.sg-story-rating.is-saving {
    opacity: 0.65;
}

.sg-story-rating.is-saving .sg-rating-star {
    cursor: wait;
}


/* =========================================================
   NO RATINGS
   ========================================================= */

.sg-story-rating .sg-rating-text {
    font-size: 0.85rem;
    opacity: 0.7;
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .sg-rating-star {
        transition: none;
    }

}