/* Customer review cards.
   Loaded from comments-section.php after every page stylesheet, so this file owns the card UI
   on the home page and on all brand pages. Classes use the rv- prefix, so older comment rules
   in home.css / reference-theme.css / home-compact.css no longer fight with it. */
.comments-section{
    --rv-ink:#17304f;
    --rv-text:#2b3f55;
    --rv-muted:#566a7f;
    --rv-line:#e3e9f1;
    --rv-soft:#f3f7fb;
    --rv-on:#e08a00;
    --rv-off:#d6dee9;
    --rv-ok:#146c43;
    --rv-ok-bg:#e8f5ee;
    --rv-accent:#126b83;
}

/* ---------- list: 3 columns desktop, 2 tablet, 1 phone ---------- */
#comments #commentsList.rv-list{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:20px!important;
    align-items:stretch;
    padding:0!important;
    border:0!important;
    background:transparent!important;
    overflow:visible!important;
    box-shadow:none!important;
}
#comments #commentsList.rv-list>:not(.rv-card){grid-column:1/-1}
/* home-compact.css spans every non-.comment-item child across the grid; cards must stay in their column. */
#comments #commentsList.rv-list>.rv-card{grid-column:auto}
@media(max-width:1000px){
    #comments #commentsList.rv-list{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:16px!important}
}
@media(max-width:640px){
    #comments #commentsList.rv-list{grid-template-columns:minmax(0,1fr)!important;gap:14px!important}
}

/* ---------- card ---------- */
#comments .rv-card{
    display:flex;
    flex-direction:column;
    gap:12px;
    min-width:0;
    margin:0;
    padding:18px;
    background:#fff;
    border:1px solid var(--rv-line);
    border-radius:16px;
    box-shadow:0 1px 2px rgba(23,48,79,.04),0 8px 22px rgba(23,48,79,.06);
    color:var(--rv-text);
    text-align:right;
}
#comments .rv-card[hidden]{display:none!important}

/* header: avatar, name + city, stars */
.rv-head{display:flex;align-items:center;gap:12px;min-width:0}
.rv-avatar{
    flex:0 0 42px;
    width:42px;height:42px;
    display:grid;place-items:center;
    border-radius:50%;
    background:var(--rv-soft);
    border:1px solid var(--rv-line);
    color:var(--rv-ink);
    font-size:17px;font-weight:800;line-height:1;
}
.rv-who{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:3px}
.rv-name{
    display:block;
    overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
    color:var(--rv-ink);
    font-size:15px;font-weight:800;line-height:1.5;
}
.rv-meta{display:flex;flex-wrap:wrap;align-items:center;gap:6px;color:var(--rv-muted);font-size:12.5px;line-height:1.6}
.rv-tag{
    padding:0 9px;
    border-radius:999px;
    background:var(--rv-soft);
    border:1px solid var(--rv-line);
    color:var(--rv-ink);
    font-size:12px;line-height:1.8;
}
.rv-rating{flex:0 0 auto;display:inline-flex;font-size:15px;line-height:1;letter-spacing:1px;white-space:nowrap}
.rv-on{color:var(--rv-on)}
.rv-off{color:var(--rv-off)}

/* review text */
.rv-text{
    margin:0;
    color:var(--rv-text);
    font-size:14.5px;line-height:2;
    overflow-wrap:anywhere;
}
/* Long reviews are clamped only when the script is running, so no-script readers still get the full text. */
.rv-js .rv-card:not(.is-open) .rv-text{
    display:-webkit-box;
    -webkit-box-orient:vertical;
    -webkit-line-clamp:5;
    line-clamp:5;
    overflow:hidden;
}
.rv-toggle{
    align-self:flex-start;
    min-height:40px;
    margin:-8px 0 -4px;
    padding:6px 0;
    background:none;border:0;
    color:var(--rv-accent);
    font:inherit;font-size:13.5px;font-weight:700;
    text-decoration:underline;text-underline-offset:4px;
    cursor:pointer;
}
.rv-toggle[hidden]{display:none!important}

/* manager reply */
.rv-reply{
    margin:0;
    padding:12px 14px;
    border-radius:12px;
    background:var(--rv-soft);
    border:1px solid var(--rv-line);
}
.rv-reply-label{
    display:flex;align-items:center;gap:6px;
    margin-bottom:4px;
    color:var(--rv-ink);
    font-size:12.5px;font-weight:800;
}
.rv-reply-label::before{
    content:"";
    width:13px;height:13px;
    background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 3 1.5 7.5 6.5 12V9c3.6 0 5.7.9 8 4-.5-4.4-3-7.4-8-8z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.5 3 1.5 7.5 6.5 12V9c3.6 0 5.7.9 8 4-.5-4.4-3-7.4-8-8z'/%3E%3C/svg%3E") center/contain no-repeat;
    transform:scaleX(-1);
}
.rv-reply p{margin:0;color:var(--rv-text);font-size:13.5px;line-height:1.95;overflow-wrap:anywhere}

/* footer: date + verified, always pinned to the bottom of the card */
.rv-foot{
    display:flex;align-items:center;justify-content:space-between;gap:10px;
    margin-top:auto;
    padding-top:12px;
    border-top:1px solid var(--rv-line);
    font-size:12px;line-height:1.6;
}
.rv-date{color:var(--rv-muted)}
.rv-verified{
    display:inline-flex;align-items:center;gap:5px;
    padding:2px 10px 2px 9px;
    border-radius:999px;
    background:var(--rv-ok-bg);
    color:var(--rv-ok);
    font-weight:700;
}
.rv-verified::before{
    content:"";
    width:12px;height:12px;
    background:currentColor;
    -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.2 11.6 2.6 8l1.2-1.2 2.4 2.4 6-6L13.4 4.4z'/%3E%3C/svg%3E") center/contain no-repeat;
    mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M6.2 11.6 2.6 8l1.2-1.2 2.4 2.4 6-6L13.4 4.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- phone ---------- */
@media(max-width:640px){
    #comments .rv-card{padding:16px;gap:11px;border-radius:16px}
    .rv-text{font-size:15px}
    .rv-reply{padding:11px 13px}
}
@media(max-width:360px){
    .rv-head{flex-wrap:wrap;row-gap:8px}
    .rv-who{flex-basis:calc(100% - 56px)}
    .rv-rating{margin-inline-start:54px}
}

/* ---------- compact rating summary above the cards (phone) ---------- */
@media(max-width:680px){
    #comments .comments-heading .comments-summary{
        display:grid;
        grid-template-columns:auto 1fr;
        align-items:center;
        column-gap:14px;
        row-gap:2px;
        padding:12px 14px!important;
        border-radius:14px;
        background:rgba(255,255,255,.08)!important;
        text-align:right;
    }
    #comments .comments-heading .comments-summary-score{grid-row:1/3;font-size:34px!important;line-height:1;text-align:center}
    #comments .comments-heading .comments-stars{margin:0!important;text-align:right;font-size:17px;letter-spacing:2px}
    #comments .comments-heading .comments-summary-label{margin:0;text-align:right}
    #comments .comments-heading .comments-summary-note{grid-column:1/-1;margin-top:8px!important;text-align:right}
}

/* ---------- focus + motion ---------- */
#comments .rv-card:focus{outline:3px solid #086b83;outline-offset:3px}
#comments .rv-toggle:focus-visible{outline:3px solid #086b83;outline-offset:3px;border-radius:4px}
