﻿/* rating demo styles — plain CSS section. The library ships zero CSS. */

.rating {
    display: inline-flex;
    gap: 0.15rem;
    border-radius: 0.375rem;
    cursor: pointer;
}

.rating:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 3px; }
.rating[data-readonly], .rating[data-disabled] { cursor: default; }
.rating[data-disabled] { opacity: 0.5; }

.star {
    position: relative;
    display: inline-block;
    width: 1.6rem;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--color-border-control);
}

/* data-state="full|half|empty" follows the value - or the hovered one, with data-highlighted */
.star[data-state="full"] { color: light-dark(#b45309, #fbbf24); }
.star[data-highlighted] { color: light-dark(#d97706, #fcd34d); }

/* A half star: the filled glyph clipped to its first half */
.star[data-state="half"]::after {
    content: "★";
    position: absolute;
    inset: 0;
    width: 50%;
    overflow: hidden;
    color: light-dark(#b45309, #fbbf24);
}

.rating[dir="rtl"] .star[data-state="half"]::after { inset-inline-start: auto; inset-inline-end: 0; direction: rtl; }
