/* ── Recipe Star Rating – Frontend Styles ── */
:root {
    --rsr-color:   #f5c842;
    --rsr-size:    2.2rem;
    --rsr-gray:    #c8c8c8;
    --rsr-text:    #444;
    --rsr-radius:  12px;
}

/* ── Widget wrapper ─────────────────────────────────────────── */
.rsr-widget {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 28px 24px 20px;
    margin: 36px 0 20px;
    background: #f9f7f3;
    border-radius: var(--rsr-radius);
    text-align: center;
    font-family: inherit;
}

.rsr-widget--small  { --rsr-size: 1.4rem; }
.rsr-widget--normal { --rsr-size: 2.2rem; }
.rsr-widget--large  { --rsr-size: 3.2rem; }

/* ── Heading ────────────────────────────────────────────────── */
.rsr-heading {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #222;
}

/* ── Stars row ──────────────────────────────────────────────── */
.rsr-stars-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    justify-content: center;
}

.rsr-stars {
    display: flex;
    gap: 4px;
}

/* ── Individual star button ─────────────────────────────────── */
.rsr-star {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--rsr-size);
    line-height: 1;
    color: var(--rsr-gray);
    cursor: pointer;
    transition: color 0.15s ease, transform 0.12s ease;
    -webkit-appearance: none;
}

.rsr-star:hover,
.rsr-star.rsr-star--hover {
    color: var(--rsr-color);
    transform: scale(1.2);
}

.rsr-star--filled {
    color: var(--rsr-color);
}

.rsr-star:disabled {
    cursor: default;
}

.rsr-star:focus-visible {
    outline: 2px solid var(--rsr-color);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ── Average text ───────────────────────────────────────────── */
.rsr-avg-beside {
    font-size: 1rem;
    color: var(--rsr-text);
    white-space: nowrap;
}

.rsr-avg-below {
    font-size: 0.95rem;
    color: var(--rsr-text);
    margin-top: 2px;
}

.rsr-count {
    color: #888;
    font-size: 0.875em;
}

.rsr-no-votes {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
}

/* ── Feedback / thank-you ───────────────────────────────────── */
.rsr-feedback {
    min-height: 1.4em;
    font-size: 0.9rem;
}

.rsr-thankyou {
    color: #3a7d44;
    font-weight: 600;
}

.rsr-error {
    color: #c0392b;
}

/* ── Archive / homepage badge ───────────────────────────────── */
.rsr-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.85em;
    vertical-align: middle;
    background: #fff8e1;
    border: 1px solid #f5c842;
    border-radius: 20px;
    padding: 1px 8px;
    margin-left: 6px;
    white-space: nowrap;
}

.rsr-badge__icon {
    color: var(--rsr-color);
    font-size: 1em;
}

.rsr-badge__avg {
    font-weight: 700;
    color: #333;
}

.rsr-badge__count {
    color: #888;
    font-size: 0.9em;
}

/* ── Mobile: disable hover effects on touch devices ─────────────────────────
   On touchscreens :hover sticks after tap. We use @media (hover: none) to
   disable CSS hover completely – JS handles the filled state instead.      */
@media (hover: none) {
    .rsr-star:hover {
        color: var(--rsr-gray);
        transform: none;
    }
    .rsr-star.rsr-star--hover {
        color: var(--rsr-color);
        transform: none;
    }
    .rsr-star--filled {
        color: var(--rsr-color);
    }
}
