/* ========================================
   SIDEBAR COMPONENT — Trust + Action
   Pairs visually with main-content .rv-card
   ======================================== */

:where(.rv-sidebar) {
    /* Decorative rating star color — no global gold token exists. */
    --rv-sidebar-star: #f59e0b;
    --rv-sidebar-check-size: 20px;
}

/* ── Container ────────────────────────────── */

.rv-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--rv-space-5);
    position: sticky;
    top: var(--rv-space-5);
    align-self: flex-start;
}

/* Override global .rv-card hover-lift inside the sidebar:
   sidebar cards are informational, not interactive, and the lift
   conflicts with position: sticky. */
.rv-sidebar .rv-card.rv-sidebar-card:hover {
    transform: none;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05),
        0 1px 2px rgba(0, 0, 0, 0.03);
    border-color: var(--rv-color-border);
}

.rv-sidebar-card {
    gap: var(--rv-space-5);
}

/* Action card: barely-perceptible gradient to signal primary focus
   without breaking visual consistency with main-content cards. */
.rv-sidebar-card--action {
    background:
        linear-gradient(
            180deg,
            var(--rv-color-surface) 0%,
            var(--rv-color-bg) 100%
        );
}

/* ── Trust block ──────────────────────────── */

.rv-sidebar-trust {
    display: flex;
    flex-direction: column;
    gap: var(--rv-space-2);
}

/* Rating row: big score + (stars on top of label) side-by-side */
.rv-sidebar-trust__rating {
    display: flex;
    align-items: center;
    gap: var(--rv-space-3);
}

.rv-sidebar-trust__score {
    font-size: var(--rv-font-size-3xl);
    font-weight: 700;
    line-height: 1;
    color: var(--rv-color-text);
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.rv-sidebar-trust__stars {
    display: flex;
    gap: 2px;
    align-items: center;
    line-height: 1;
}

.rv-sidebar-trust__stars .rv-star {
    display: inline-flex;
    flex-shrink: 0;
}

.rv-star {
    transition: transform 0.2s var(--rv-ease-out);
}

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

.rv-star--empty {
    color: var(--rv-md-outline);
}

/* Inline count line with embedded Google attribution */
.rv-sidebar-trust__count {
    margin: 0;
    font-size: var(--rv-text-xs);
    color: var(--rv-color-muted);
    font-weight: 500;
    line-height: var(--rv-line-normal);
}

.rv-sidebar-trust__source-link {
    display: inline-flex;
    align-items: center;
    gap: var(--rv-space-1);
    color: var(--rv-color-text);
    text-decoration: none;
    font-weight: 600;
    vertical-align: baseline;
    padding: 2px 6px;
    margin: 0 -2px;
    border-radius: var(--rv-radius-sm);
    transition: background-color 0.15s var(--rv-ease-out);
}

a.rv-sidebar-trust__source-link:hover,
a.rv-sidebar-trust__source-link:focus-visible {
    background: var(--rv-color-bg);
    outline: none;
}

.rv-sidebar-trust__source-logo {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.rv-sidebar-trust__source-label {
    letter-spacing: -0.005em;
}

/* ── Divider ──────────────────────────────── */

.rv-sidebar-divider {
    width: 100%;
    height: 1px;
    border: 0;
    background: var(--rv-color-border);
    margin: 0;
}

/* ── Action block (label + CTAs) ──────────── */

.rv-sidebar-action {
    display: flex;
    flex-direction: column;
    gap: var(--rv-space-3);
}

.rv-sidebar-action__label {
    margin: 0;
}

.rv-sidebar-action__cta {
    display: flex;
    flex-direction: column;
    gap: var(--rv-space-2);
}

/* CTA buttons — full-width, large touch target, icon + label.
   Visual identity inherited from .rv-btn / .rv-btn--primary / --outlined. */
.rv-sidebar-btn {
    min-height: 48px;
    gap: var(--rv-space-2);
    font-size: var(--rv-text-sm);
    letter-spacing: -0.005em;
}

.rv-sidebar-btn__icon {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.rv-sidebar-btn__label {
    font-weight: 600;
}

/* ── Benefits list ────────────────────────── */

.rv-sidebar-benefits {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--rv-space-3);
}

.rv-sidebar-benefit {
    display: flex;
    align-items: flex-start;
    gap: var(--rv-space-3);
}

.rv-sidebar-benefit__check {
    flex-shrink: 0;
    color: var(--rv-color-success);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Optical alignment with text baseline */
    margin-top: 1px;
}

.rv-sidebar-benefit__text {
    font-size: var(--rv-text-base);
    color: var(--rv-color-text);
    line-height: var(--rv-line-normal);
    font-weight: 500;
}

/* ── Responsive ───────────────────────────── */

@media (max-width: 900px) {
    .rv-sidebar {
        margin-top: var(--rv-space-6);
        gap: var(--rv-space-4);
    }
}

/* ── Accessibility ────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    .rv-star {
        transition: none;
    }
}

/* ── Print ────────────────────────────────── */

@media print {
    .rv-sidebar {
        break-inside: avoid;
    }
}
