/* ============================================================
   RB Google Reviews — CSS custom-property driven, colors set
   via wp_add_inline_style from the Settings screen.
   ============================================================ */
.rb-grw-section {
    --rb-grw-card-bg:     #ffffff;
    --rb-grw-text:        #4a4a4a;
    --rb-grw-name:        #1b1c24;
    --rb-grw-star-on:     #f6c250;
    --rb-grw-star-off:    #d8d8da;
    --rb-grw-button-bg:   #f6c250;
    --rb-grw-button-text: #1b1c24;
    /* Dark "classic Google reviews widget" theme — used by the slider +
       side-badge combo layout specifically (see .rb-grw-slider-row below),
       matching the site's existing dark/gold sections elsewhere. */
    --rb-grw-dark-bg:      #14151c;
    --rb-grw-dark-card-bg: #1d1e26;
    --rb-grw-dark-card-border: rgba(255,255,255,0.07);
    --rb-grw-author-blue:  #6fa8ff;
    --rb-grw-dark-text:    #d3d3d8;
    --rb-grw-dark-date:    #8d8d96;
    font-family: inherit;
    width: 100%;
    box-sizing: border-box;
}

.rb-grw-section *, .rb-grw-section *::before, .rb-grw-section *::after {
    box-sizing: border-box;
}

.rb-grw-star { color: var(--rb-grw-star-off); font-size: 16px; line-height: 1; }
.rb-grw-star.filled { color: var(--rb-grw-star-on); }

/* ── Summary row (above grid/list/slider) ── */
.rb-grw-summary {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}
.rb-grw-summary-stars { display: flex; gap: 2px; }
.rb-grw-summary-stars .rb-grw-star { font-size: 20px; }
.rb-grw-summary-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--rb-grw-name);
}

.rb-grw-button {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 6px;
    background: var(--rb-grw-button-bg);
    color: var(--rb-grw-button-text);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: transform .2s, box-shadow .2s;
}
.rb-grw-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    color: var(--rb-grw-button-text);
}
.rb-grw-button--small { padding: 7px 16px; font-size: 12px; margin-left: auto; }

/* ── Review card ── */
.rb-grw-grid, .rb-grw-list {
    display: grid;
    gap: 20px;
}
.rb-grw-grid { grid-template-columns: repeat(var(--rb-grw-cols, 3), 1fr); }
.rb-grw-list { grid-template-columns: 1fr; }

.rb-grw-card {
    background: var(--rb-grw-card-bg);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
}

.rb-grw-card-head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rb-grw-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.rb-grw-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rb-grw-star-on);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
}

.rb-grw-card-headtext {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.rb-grw-card-author {
    font-weight: 700;
    font-size: 14px;
    color: var(--rb-grw-name);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rb-grw-card-stars { display: block; }
.rb-grw-card-stars .rb-grw-star { font-size: 14px; }

.rb-grw-google-icon {
    position: absolute;
    top: 14px;
    right: 14px;
    flex-shrink: 0;
    opacity: .9;
}

.rb-grw-card-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: var(--rb-grw-text);
    max-height: 7.75em;
    overflow-y: auto;
    padding-right: 8px;
    scrollbar-width: thin;
}
.rb-grw-card-text::-webkit-scrollbar { width: 5px; }
.rb-grw-card-text::-webkit-scrollbar-track { background: transparent; }
.rb-grw-card-text::-webkit-scrollbar-thumb { background: rgba(120,120,130,.35); border-radius: 3px; }
.rb-grw-card-text.rb-grw-expanded {
    max-height: none;
    overflow: visible;
}

.rb-grw-card-readmore {
    align-self: flex-start;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    font-weight: 700;
    color: var(--rb-grw-name);
    text-decoration: underline;
    cursor: pointer;
}

.rb-grw-card-date {
    font-size: 12.5px;
    color: var(--rb-grw-text);
    opacity: .7;
}

/* ── Slider layout ── */
.rb-grw-wrap {
    position: relative;
}
.rb-grw-viewport {
    overflow: hidden;
}
.rb-grw-slider {
    display: flex;
    gap: 20px;
    transition: transform .4s ease;
}
.rb-grw-slider .rb-grw-card {
    flex: 0 0 calc((100% - 40px) / 3);
    min-width: 260px;
}
.rb-grw-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f4f4f5;
    color: #2b2c33;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.35);
    transition: background .2s, transform .2s;
}
.rb-grw-arrow:hover { transform: translateY(-50%) scale(1.08); background: #ffffff; }
.rb-grw-arrow--prev { left: -14px; }
.rb-grw-arrow--next { right: -14px; }
.rb-grw-arrow[hidden] { display: none; }

/* ── Slider + side badge combo (badge to the left of the slider,
   classic "Google Reviews widget" look — self-contained dark card,
   matches the site's other dark/gold sections). ── */
.rb-grw-slider-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 28px;
    max-width: 100%;
    background: var(--rb-grw-dark-bg);
    border-radius: 14px;
    padding: 28px 34px;
}
.rb-grw-slider-row .rb-grw-wrap {
    flex: 1 1 320px;
    min-width: 0;
}
.rb-grw-slider-row .rb-grw-card {
    background: var(--rb-grw-dark-card-bg);
    border: 1px solid var(--rb-grw-dark-card-border);
    box-shadow: none;
}
.rb-grw-slider-row .rb-grw-card-author { color: var(--rb-grw-author-blue); }
.rb-grw-slider-row .rb-grw-card-date { color: var(--rb-grw-dark-date); opacity: 1; }
.rb-grw-slider-row .rb-grw-card-text { color: var(--rb-grw-dark-text); }
.rb-grw-slider-row .rb-grw-card-text::-webkit-scrollbar-thumb { background: rgba(255,255,255,.18); }

.rb-grw-side-badge {
    flex: 0 0 190px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}
.rb-grw-side-badge-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
}
.rb-grw-side-badge-name {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--rb-grw-star-on);
    text-decoration: none;
}
.rb-grw-side-badge-name:hover { text-decoration: underline; }
.rb-grw-side-badge-rating {
    display: flex;
    align-items: center;
    gap: 8px;
}
.rb-grw-side-badge-score {
    font-size: 20px;
    font-weight: 800;
    color: var(--rb-grw-star-on);
}
.rb-grw-side-badge-powered {
    font-size: 12px;
    color: var(--rb-grw-dark-date);
}
.rb-grw-side-badge-google {
    font-weight: 700;
    color: #6fa8ff;
}

/* ── Rating badge layout ── */
.rb-grw-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 6px;
    padding: 24px;
    background: var(--rb-grw-card-bg);
    border-radius: 10px;
}
.rb-grw-badge-rating {
    font-size: 40px;
    font-weight: 800;
    color: var(--rb-grw-name);
    line-height: 1;
}
.rb-grw-badge-stars { display: flex; gap: 3px; }
.rb-grw-badge-stars .rb-grw-star { font-size: 22px; }
.rb-grw-badge-count {
    font-size: 13px;
    color: var(--rb-grw-text);
    margin-bottom: 6px;
}
.rb-grw-badge--inline {
    margin-bottom: 24px;
}

/* ── Responsive ── */
@media (max-width: 960px) {
    .rb-grw-grid { grid-template-columns: repeat(min(var(--rb-grw-cols, 3), 2), 1fr); }
    .rb-grw-slider .rb-grw-card { flex-basis: calc((100% - 20px) / 2); }
}

/* Side-badge + slider needs its own, wider breakpoint: below ~900px there
   isn't enough room to keep the badge column AND a legible slider side by
   side, so stack the badge above the slider (full width) instead. */
@media (max-width: 900px) {
    .rb-grw-slider-row { flex-direction: column; align-items: stretch; gap: 16px; padding: 22px; }
    /* .rb-grw-wrap's "flex: 1 1 320px" is a desktop-row-mode minimum
       WIDTH. In this column-direction row, flex-basis controls HEIGHT
       instead — left as-is it force-stretches the wrap to 320px tall,
       stranding the vertically-centered arrows below the actual card. */
    .rb-grw-slider-row .rb-grw-wrap {
        flex: 0 1 auto;
        width: 100%;
    }
    .rb-grw-side-badge {
        flex: 0 0 auto;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        flex-direction: row;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 16px;
    }
    .rb-grw-side-badge-name {
        flex: 1 1 auto;
        min-width: 0;
    }
    .rb-grw-side-badge-rating,
    .rb-grw-side-badge-powered {
        flex: 0 0 auto;
    }
}

@media (max-width: 640px) {
    .rb-grw-grid { grid-template-columns: 1fr; }
    /* 88% (not 100%) so the next card peeks in from the edge — a visual
       cue that this scrolls, which a full-width single card doesn't give. */
    .rb-grw-slider .rb-grw-card { flex-basis: 88%; min-width: 0; }
    .rb-grw-summary { flex-direction: column; align-items: flex-start; }
    .rb-grw-button--small { margin-left: 0; }
    .rb-grw-arrow--prev { left: 6px; }
    .rb-grw-arrow--next { right: 6px; }
    .rb-grw-slider-row { padding: 18px; }
}

@media (max-width: 420px) {
    .rb-grw-card { padding: 16px; }
    .rb-grw-badge { padding: 18px; }
    .rb-grw-badge-rating { font-size: 32px; }
    .rb-grw-side-badge-photo { width: 44px; height: 44px; }
}
