/* ── Review Aggregator Plugin — Styles ───────────────────────────────────── */

/* Summary bars */
.ra-summaries {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 28px;
}

.ra-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 16px;
    font-size: 15px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.ra-summary__logo {
    display: flex;
    align-items: center;
}

.ra-ct-logo {
    width: 22px;
    height: 22px;
    background: #00a651;
    color: #fff;
    border-radius: 50%;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ra-summary__name {
    font-weight: 600;
    color: #111827;
}

.ra-summary__score {
    font-weight: 700;
    font-size: 16px;
    color: #111827;
}

.ra-summary__count {
    color: #6b7280;
    font-size: 13px;
}

/* Star ratings */
.ra-stars {
    display: inline-flex;
    gap: 1px;
}

.ra-star {
    font-size: 16px;
}

.ra-star--full  { color: #f59e0b; }
.ra-star--half  { color: #f59e0b; opacity: .55; }
.ra-star--empty { color: #d1d5db; }

/* ── Grid layout ─────────────────────────────────────────────────────────── */
.ra-layout-grid .ra-reviews {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 18px;
}

/* ── List layout ─────────────────────────────────────────────────────────── */
.ra-layout-list .ra-reviews {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ── Review card ─────────────────────────────────────────────────────────── */
.ra-review {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ra-review__header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ra-review__avatar {
    flex-shrink: 0;
}

.ra-review__avatar img {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
}

.ra-review__avatar-initials {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #e0e7ff;
    color: #3730a3;
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ra-review--checkatrade .ra-review__avatar-initials {
    background: #d1fae5;
    color: #065f46;
}

.ra-review__meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.ra-review__author {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
}

.ra-review__date {
    font-size: 12px;
    color: #9ca3af;
}

/* Source badge */
.ra-review__badge {
    font-size: 11px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.ra-badge--google {
    background: #e8f0fe;
    color: #1a56db;
}

.ra-badge--checkatrade {
    background: #d1fae5;
    color: #065f46;
}

.ra-review__text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    margin: 0;
}

.ra-review__link {
    font-size: 12px;
    color: #00a651;
    text-decoration: none;
}

.ra-review__link:hover {
    text-decoration: underline;
}

.ra-no-reviews {
    color: #6b7280;
    font-style: italic;
}

/* ── Slider layout ───────────────────────────────────────────────────────── */
.ra-layout-slider .ra-slider {
    position: relative;
    overflow: hidden;
}

.ra-slider__track {
    display: flex;
    transition: transform .35s ease;
}

.ra-slider__track .ra-review {
    min-width: 100%;
}

.ra-slider__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,.9);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ra-slider__btn--prev { left: 4px; }
.ra-slider__btn--next { right: 4px; }

.ra-slider__btn:hover {
    background: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

/* ── Dark mode ───────────────────────────────────────────────────────────── */
@media (prefers-color-scheme: dark) {
    .ra-summary,
    .ra-review {
        background: #1f2937;
        border-color: #374151;
    }
    .ra-summary__name,
    .ra-summary__score,
    .ra-review__author { color: #f9fafb; }
    .ra-summary__count,
    .ra-review__date   { color: #9ca3af; }
    .ra-review__text   { color: #d1d5db; }
    .ra-review__avatar-initials {
        background: #3730a3;
        color: #e0e7ff;
    }
    .ra-slider__btn {
        background: rgba(31,41,55,.9);
        border-color: #374151;
        color: #f9fafb;
    }
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .ra-layout-grid .ra-reviews {
        grid-template-columns: 1fr;
    }
    .ra-summary {
        flex-wrap: wrap;
        font-size: 13px;
    }
}
