/* Vazir Star Ratings */

@font-face {
    font-family: "Vazirmatn";
    src: url("../fonts/Vazirmatn-VF.woff2") format("woff2");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

.vsr,
.vsr * {
    box-sizing: border-box;
}

.vsr {
    --vsr-size: 24px;
    --vsr-gap: 4px;
    --vsr-active: #f5a623;
    --vsr-empty: #d4d4d8;
    --vsr-hover: #f59e0b;

    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: .75rem;
    row-gap: .25rem;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    margin: .5rem 0;
}

.vsr.vsr-align-start  { justify-content: flex-start; }
.vsr.vsr-align-center { justify-content: center; }
.vsr.vsr-align-end    { justify-content: flex-end; }

/* Stars */

.vsr .vsr-stars {
    position: relative;
    display: inline-block;
    line-height: 0;
}

.vsr .vsr-base {
    display: flex;
}

.vsr .vsr-fill {
    display: flex;
    position: absolute;
    top: 0;
    inset-inline-start: 0;
    overflow: hidden;
    pointer-events: none;
    transition: opacity .15s;
}

.vsr .vsr-star {
    display: block;
    flex: 0 0 auto;
    margin: 0 !important;
    margin-inline-end: var(--vsr-gap) !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    line-height: 0;
    min-width: 0;
    min-height: 0;
    cursor: pointer;
    transition: color .15s, transform .15s;
}

.vsr .vsr-star svg {
    display: block;
    width: var(--vsr-size);
    height: var(--vsr-size);
    fill: currentColor;
    stroke: none;
}

.vsr .vsr-base .vsr-star { color: var(--vsr-empty) !important; }
.vsr .vsr-fill .vsr-star { color: var(--vsr-active) !important; }

.vsr.is-readonly .vsr-star,
.vsr.is-readonly .vsr-star:hover {
    cursor: default;
}

/* Hover preview: all stars up to the hovered one light up. */

.vsr:not(.is-readonly) .vsr-stars:hover .vsr-fill { opacity: 0; }
.vsr:not(.is-readonly) .vsr-stars:hover .vsr-base .vsr-star { color: var(--vsr-hover) !important; }
.vsr:not(.is-readonly) .vsr-stars:hover .vsr-base .vsr-star:hover ~ .vsr-star { color: var(--vsr-empty) !important; }
.vsr:not(.is-readonly) .vsr-base .vsr-star:hover { transform: scale(1.12); }

.vsr .vsr-star:focus-visible {
    outline: 2px solid var(--vsr-hover);
    outline-offset: 2px;
    border-radius: 4px !important;
}

.vsr.is-busy { opacity: .7; pointer-events: none; }

/* Text */

.vsr .vsr-legend {
    font-size: max(13px, calc(var(--vsr-size) / 1.6));
    color: inherit;
}

.vsr .vsr-muted { opacity: .65; }

.vsr .vsr-msg {
    flex: 0 0 100%;
    font-size: 13px;
    min-height: 0;
}

.vsr .vsr-msg:empty { display: none; }
.vsr .vsr-msg.is-ok    { color: #15803d; }
.vsr .vsr-msg.is-error { color: #b91c1c; }

/* Comments: a little smaller & tighter */
.vsr.vsr-type-comment { margin: .35rem 0; }
