/* smoke-reports.css — star ratings and smoke-report lists.
 */

/* ---------------------------------------------------------------------------
   Smoke-report star ratings
   ---------------------------------------------------------------------------
   The input is a radio group (see the smoke-report modal templates): the real
   radios are visually hidden but stay focusable, and each label carries the
   star glyph. web/static/js/star-rating.js toggles .is-on to fill stars up to
   the selected — or hovered — value.
   --------------------------------------------------------------------------- */
.star-rating {
    display: inline-flex;
    flex-direction: row;
    gap: 0.15rem;
    line-height: 1;
}

/* Hidden but focusable: clip rather than display:none, so arrow-key
   navigation and screen-reader announcement keep working. */
.star-rating input[type="radio"] {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.star-rating label {
    cursor: pointer;
    margin: 0;
    padding: 0 0.05rem;
    color: var(--color-star-empty);
    transition: color 0.08s ease-in-out;
}

.star-rating label.is-on {
    color: var(--color-star);
}

/* While the pointer is over the group, lit stars use the weaker preview shade
   so an unsaved hover never reads as a committed score. */
.star-rating:hover label.is-on {
    color: var(--color-star-preview);
}

/* Focus ring on the label standing in for the focused radio. */
.star-rating input[type="radio"]:focus-visible + label {
    outline: 2px solid var(--color-input-focus-border);
    outline-offset: 2px;
    border-radius: 2px;
}

.star-clear {
    color: var(--color-muted);
    line-height: 1;
}

.star-clear:hover,
.star-clear:focus-visible {
    color: var(--color-danger-text);
}

/* One criterion per line in the modal, name left and stars right. */
.smoke-score-row {
    gap: 0.75rem;
}

/* ---------------------------------------------------------------------------
   Smoke-report card, plant page sidebar
   ---------------------------------------------------------------------------
   The criteria used to be concatenated inline, which wrapped mid-criterion in
   the narrow sidebar — a name on one line and its stars on the next. One grid
   row per criterion keeps each name glued to its own stars.
   --------------------------------------------------------------------------- */
.smoke-score-line {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.smoke-score-name {
    color: var(--color-muted);
    min-width: 0;
    overflow-wrap: anywhere;
}

/* Never split a star run across lines. */
.smoke-score-stars {
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--color-star);
}

.smoke-report-entry .smoke-report-rating {
    white-space: nowrap;
    color: var(--color-star);
}
