/*
 * Realtor Reviews Carousel
 *
 * To adjust colors, override these variables in
 * Appearance > Customize > Additional CSS, for example:
 *   .rrc { --rrc-bg: #101218; --rrc-accent: #b69145; }
 */
.rrc {
    --rrc-bg: #101218;          /* section background */
    --rrc-accent: #b69145;      /* gold accent (stars) */
    --rrc-text: #ffffff;        /* review text, client name, arrows */
    --rrc-muted: #b4b9c4;       /* detail line, source and date */
    --rrc-star: var(--rrc-accent); /* filled stars */
    --rrc-star-empty: #4a4f5c;  /* empty stars */
    --rrc-dot: #5a6070;         /* inactive dots */
    --rrc-line: rgba(255, 255, 255, 0.16);
    --rrc-body-font: 'Mulish', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --rrc-title-font: 'Noto Serif Display', Georgia, 'Times New Roman', serif;
    --rrc-cols: 1;              /* reviews visible at once (set by the columns attribute) */
    --rrc-gap: 40px;            /* space between reviews */

    box-sizing: border-box;
    margin: 0;
    padding: 0;
    background: var(--rrc-bg);
    color: var(--rrc-text);
    font-family: var(--rrc-body-font);
}

.rrc *,
.rrc *::before,
.rrc *::after {
    box-sizing: border-box;
}

/* ---------- Optional heading + summary (off by default) ---------- */
.rrc-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 0 auto 32px;
    text-align: center;
}

.rrc .rrc-title {
    margin: 0;
    color: var(--rrc-text);
    font-family: var(--rrc-title-font);
}

.rrc-summary {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: var(--rrc-muted);
}

.rrc-summary strong {
    color: var(--rrc-text);
}

/* ---------- Layout: arrows beside the review on desktop, below on phones ---------- */
.rrc-stage {
    display: grid;
    grid-template-columns: 52px minmax(0, 800px) 52px;
    grid-template-areas:
        "prev view next"
        ".    dots .";
    justify-content: center;
    align-items: center;
    column-gap: 40px;
    row-gap: 28px;
}

.rrc-prev     { grid-area: prev; }
.rrc-next     { grid-area: next; }
.rrc-viewport { grid-area: view; min-width: 0; }
.rrc-dots     { grid-area: dots; }

@media (max-width: 640px) {
    .rrc {
        padding: 0 24px 40px;
    }
    .rrc-stage {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        grid-template-areas:
            "view view view"
            "prev dots next";
        column-gap: 8px;
        row-gap: 24px;
    }
}

/* ---------- Track ---------- */
.rrc .rrc-track {
    display: flex;
    gap: var(--rrc-gap);
    margin: 0;
    padding: 0;
    list-style: none;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
}

.rrc-track::-webkit-scrollbar {
    display: none;
}

.rrc-track:focus-visible {
    outline: 2px solid var(--rrc-text);
    outline-offset: 6px;
}

.rrc .rrc-slide {
    flex: 0 0 calc((100% - (var(--rrc-cols) - 1) * var(--rrc-gap)) / var(--rrc-cols));
    scroll-snap-align: start;
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
}

.rrc .rrc-slide::before,
.rrc .rrc-slide::marker {
    content: none;
}

/* ---------- Review ---------- */
.rrc .rrc-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 16px 40px 8px;
    background: transparent;
    border: 0;
    text-align: center;
}

@media (max-width: 640px) {
    .rrc .rrc-card {
        gap: 14px;
        padding: 8px 4px;
    }
}

.rrc .rrc-review-title {
    margin: 0;
    color: var(--rrc-text);
    font-family: var(--rrc-title-font);
    font-weight: 500;
    font-size: 32px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-align: center;
    text-transform: none;
}

.rrc .rrc-quote {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    quotes: none;
    font-style: normal;
    color: var(--rrc-text);
}

.rrc .rrc-quote::before,
.rrc .rrc-quote::after {
    content: none;
}

.rrc .rrc-text {
    max-width: 64ch;
    color: var(--rrc-text);
    font-family: var(--rrc-body-font);
    font-size: 18px;
    line-height: 1.65;
    text-align: center;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5;
    overflow: hidden;
}

.rrc .rrc-text p {
    margin: 0 0 0.8em;
    color: inherit;
    font: inherit;
}

.rrc .rrc-text p:last-child {
    margin-bottom: 0;
}

.rrc-card.is-expanded .rrc-text {
    -webkit-line-clamp: unset;
    display: block;
}

@media (max-width: 640px) {
    .rrc .rrc-review-title {
        font-size: 24px;
    }
    .rrc .rrc-text {
        font-size: 16px;
        line-height: 1.6;
        -webkit-line-clamp: 7;
    }
}

.rrc .rrc-more {
    margin: 0;
    padding: 10px 0;
    background: none;
    border: 0;
    box-shadow: none;
    color: var(--rrc-text);
    font-family: var(--rrc-body-font);
    font-size: 15px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: normal;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.rrc-more[hidden] {
    display: none !important;
}

/* ---------- Stars ---------- */
.rrc-stars {
    position: relative;
    display: inline-block;
    line-height: 0;
    white-space: nowrap;
}

.rrc-stars svg {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin: 0 1.5px;
}

.rrc-stars-empty svg {
    fill: var(--rrc-star-empty);
}

.rrc-stars-full {
    position: absolute;
    top: 0;
    left: 0;
    overflow: hidden;
}

.rrc-stars-full svg {
    fill: var(--rrc-star);
}

@media (max-width: 640px) {
    .rrc-stars svg {
        width: 18px;
        height: 18px;
    }
}

/* ---------- Client ---------- */
.rrc .rrc-person {
    align-self: stretch;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding-top: 24px;
    border-top: 1px solid var(--rrc-line);
    line-height: 1.4;
    text-align: center;
}

.rrc .rrc-person-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    min-width: 0;
}

.rrc .rrc-avatar {
    width: 48px;
    height: 48px;
    margin-bottom: 8px;
    border-radius: 50%;
    object-fit: cover;
}

.rrc .rrc-avatar-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    color: var(--rrc-text);
    font-weight: 600;
    font-size: 15px;
}

.rrc .rrc-name {
    color: var(--rrc-text);
    font-weight: 600;
    font-size: 16px;
}

.rrc .rrc-detail,
.rrc .rrc-source {
    color: var(--rrc-muted);
    font-size: 14px;
}

.rrc .rrc-source a {
    color: var(--rrc-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.rrc .rrc-source a:hover {
    color: var(--rrc-text);
}

/* ---------- Arrows ---------- */
.rrc .rrc-prev,
.rrc .rrc-next {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    color: var(--rrc-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.rrc .rrc-prev:hover:not(:disabled),
.rrc .rrc-next:hover:not(:disabled) {
    border-color: var(--rrc-text);
    background: transparent;
}

.rrc .rrc-prev:disabled,
.rrc .rrc-next:disabled {
    opacity: 0.35;
    cursor: default;
}

@media (max-width: 640px) {
    .rrc .rrc-prev,
    .rrc .rrc-next {
        width: 44px;
        height: 44px;
    }
}

/* ---------- Dots ---------- */
.rrc-dots {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px;
}

.rrc .rrc-dot {
    appearance: none;
    position: relative;
    width: 24px;
    height: 24px;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    cursor: pointer;
}

@media (max-width: 640px) {
    .rrc .rrc-dot {
        width: 22px;
        height: 44px;
    }
    .rrc-dots {
        gap: 0;
    }
}

.rrc .rrc-dot::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: var(--rrc-dot);
    transition: background-color 0.2s, transform 0.2s;
}

.rrc .rrc-dot[aria-current="true"]::after {
    background: var(--rrc-text);
    transform: scale(1.25);
}

/* ---------- Several reviews at once (columns="2" or "3") ---------- */
.rrc--multi {
    --rrc-gap: 24px;
}

@media (min-width: 1025px) {
    .rrc--cols-2 { --rrc-cols: 2; }
    .rrc--cols-3 { --rrc-cols: 3; }
}

@media (min-width: 641px) and (max-width: 1024px) {
    .rrc--multi { --rrc-cols: 2; }
}

.rrc--multi .rrc-stage {
    grid-template-columns: 52px minmax(0, 1200px) 52px;
    column-gap: 28px;
}

.rrc--multi .rrc-card {
    align-items: flex-start;
    gap: 14px;
    padding: 32px 28px 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--rrc-line);
    border-radius: 16px;
    text-align: left;
}

.rrc--multi .rrc-quote {
    align-items: flex-start;
}

.rrc--multi .rrc-review-title,
.rrc--multi .rrc-text {
    text-align: left;
}

.rrc--multi .rrc-stars svg:first-child {
    margin-left: 0;
}

.rrc--multi .rrc-review-title {
    font-size: 23px;
}

.rrc--multi .rrc-text {
    font-size: 16px;
    line-height: 1.6;
    -webkit-line-clamp: 6;
}

.rrc--multi .rrc-person {
    flex-direction: row;
    align-items: center;
    gap: 14px;
    margin-top: auto;
    padding-top: 20px;
    text-align: left;
}

.rrc--multi .rrc-avatar {
    flex: 0 0 auto;
    margin-bottom: 0;
}

.rrc--multi .rrc-person-info {
    align-items: flex-start;
    gap: 2px;
}

@media (max-width: 640px) {
    .rrc--multi .rrc-stage {
        grid-template-columns: 44px minmax(0, 1fr) 44px;
        column-gap: 8px;
    }
    .rrc--multi .rrc-card {
        padding: 28px 22px 24px;
    }
    .rrc--multi .rrc-review-title {
        font-size: 22px;
    }
    .rrc--multi .rrc-text {
        -webkit-line-clamp: 7;
    }
}

/* ---------- Client photos ----------
 * photo="avatar" (default): small round photo beside the client's name.
 * photo="large":  the photo fills the top of each card.
 * photo="none":   no photos or initials.
 * Reviews without a photo show the client's initials instead.
 */
.rrc--photo-none .rrc-avatar,
.rrc--photo-large .rrc-person .rrc-avatar {
    display: none !important;
}

.rrc .rrc-photo {
    position: relative;
    display: block;
    align-self: stretch;
    margin: 0;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.06);
}

.rrc .rrc-photo img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: cover;
}

/* No photo: initials on a soft tile, so every card lines up */
.rrc .rrc-photo--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(120% 90% at 30% 20%, rgba(182, 145, 69, 0.22), transparent 60%),
        rgba(255, 255, 255, 0.05);
}

.rrc .rrc-photo--initials span {
    color: var(--rrc-accent);
    font-family: var(--rrc-title-font);
    font-size: 64px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
}

/* Several reviews at once: photo runs edge to edge across the top of the card */
.rrc--multi.rrc--photo-large .rrc-card {
    padding-top: 0;
    overflow: hidden;
}

.rrc--multi.rrc--photo-large .rrc-photo {
    margin: 0 -28px 10px;
    aspect-ratio: 4 / 3;
}

@media (max-width: 640px) {
    .rrc--multi.rrc--photo-large .rrc-photo {
        margin: 0 -22px 8px;
    }
}

/* One review at a time: a large round photo above the review */
.rrc--cols-1.rrc--photo-large .rrc-photo {
    align-self: center;
    width: 120px;
    height: 120px;
    border-radius: 50%;
}

.rrc--cols-1.rrc--photo-large .rrc-photo--initials span {
    font-size: 40px;
}

/* ---------- Theme-proofing ----------
 * Many themes (Divi included) style every <button> with borders, padding and
 * rounded corners. These rules keep the arrows perfectly round and the dots
 * free of borders no matter what the theme adds.
 */
.rrc .rrc-stage .rrc-prev,
.rrc .rrc-stage .rrc-next {
    width: 52px !important;
    height: 52px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    aspect-ratio: 1 / 1;
    line-height: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 0 !important;
}

.rrc .rrc-stage .rrc-prev:hover:not(:disabled),
.rrc .rrc-stage .rrc-next:hover:not(:disabled) {
    border-color: var(--rrc-text) !important;
}

.rrc .rrc-stage .rrc-prev::after,
.rrc .rrc-stage .rrc-next::after,
.rrc .rrc-stage .rrc-prev::before,
.rrc .rrc-stage .rrc-next::before {
    content: none !important;
    display: none !important;
}

.rrc .rrc-stage .rrc-dots {
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.rrc .rrc-stage .rrc-dot {
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: none !important;
    box-shadow: none !important;
    outline: none;
}

.rrc .rrc-stage .rrc-dot:focus-visible {
    outline: 2px solid var(--rrc-text);
    outline-offset: 2px;
}

@media (max-width: 640px) {
    .rrc .rrc-stage .rrc-prev,
    .rrc .rrc-stage .rrc-next {
        width: 44px !important;
        height: 44px !important;
    }
}

/* Only one review: no arrows or dots needed. */
.rrc.is-single .rrc-prev,
.rrc.is-single .rrc-next,
.rrc.is-single .rrc-dots {
    display: none;
}

/* ---------- Keyboard focus ---------- */
.rrc .rrc-prev:focus-visible,
.rrc .rrc-next:focus-visible,
.rrc .rrc-dot:focus-visible,
.rrc .rrc-more:focus-visible,
.rrc .rrc-source a:focus-visible {
    outline: 2px solid var(--rrc-text);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .rrc .rrc-track {
        scroll-behavior: auto;
    }
    .rrc .rrc-dot::after,
    .rrc .rrc-prev,
    .rrc .rrc-next {
        transition: none;
    }
}

/* ---------- Admin-only notice when there are no reviews ---------- */
.rrc-empty {
    padding: 12px 16px;
    border: 1px dashed #b32d2e;
    color: #b32d2e;
    font-size: 14px;
}
