/**
 * Reviews Page — Interactive Masonry Grid
 * SW-242: Redesigned with proper brand colors, animations, and interactivity
 */

/* ─────────────────────────────────────────────
   CSS VARIABLES
───────────────────────────────────────────── */
:root {
    --rv-navy: #1F2D69;
    --rv-blue: #2E5EB1;
    --rv-light-blue: #3B7ADE;
    --rv-deep-navy: #142F57;
    --rv-gold: #FFB800;
    --rv-gold-light: #FFD44D;
    --rv-bg: #F4F6FA;
    --rv-white: #FFFFFF;
    --rv-text: #374151;
    --rv-text-light: #6b7280;
    --rv-border: #E5E7EB;
    --rv-shadow: 0 2px 12px rgba(31, 45, 105, 0.07);
    --rv-shadow-hover: 0 12px 32px rgba(31, 45, 105, 0.15);
    --rv-radius: 16px;
    --rv-radius-sm: 10px;
    --rv-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─────────────────────────────────────────────
   PAGE WRAPPER
───────────────────────────────────────────── */
.rv-page {
    background: var(--rv-bg);
    min-height: 100vh;
    font-family: "Plus Jakarta Sans", Inter, system-ui, -apple-system, Helvetica, Arial, sans-serif;
    overflow-x: hidden;
}

/* ─────────────────────────────────────────────
   HERO BANNER — extends about-banner to match site
───────────────────────────────────────────── */
.about-banner.rv-banner {
    background: var(--rv-blue);
    padding: 160px 0 90px;
    position: relative;
    overflow: hidden;
}

.about-banner.rv-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.about-banner.rv-banner::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.04) 0%, transparent 70%);
    pointer-events: none;
}

.rv-hero-sub {
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    font-size: clamp(15px, 2vw, 18px);
    max-width: 600px;
    margin: 16px auto 0;
    line-height: 1.6;
}

/* ─────────────────────────────────────────────
   STATS SECTION
───────────────────────────────────────────── */
.rv-stats {
    position: relative;
    z-index: 2;
    margin-top: -40px;
    padding: 0 24px 32px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rv-stats.rv-visible {
    opacity: 1;
    transform: translateY(0);
}

.rv-stats-grid {
    max-width: 900px;
    margin: 0 auto;
    background: var(--rv-white);
    border-radius: var(--rv-radius);
    box-shadow: 0 4px 24px rgba(31, 45, 105, 0.1);
    padding: 32px 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
}

.rv-stat-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.rv-stat-value {
    font-size: 42px;
    font-weight: 800;
    color: var(--rv-navy);
    line-height: 1;
    letter-spacing: -0.02em;
}

/* Fractional stars from --rating (set from srm_rating_claim(), WIN-3602),
   same technique as the home trust block: a grey row with a gold row clipped on top. */
.rv-stat-stars {
    position: relative;
    display: inline-block;
    font-size: 22px;
    line-height: 1;
}

.rv-stat-stars::before,
.rv-stat-stars::after {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f005\f005\f005\f005\f005";
    letter-spacing: 3px;
}

.rv-stat-stars::before {
    color: rgba(31, 45, 105, 0.18);
}

.rv-stat-stars::after {
    color: var(--rv-gold);
    position: absolute;
    left: 0;
    top: 0;
    /* Minus one letter-spacing: the row's width includes the gap after the 5th star. */
    width: calc(var(--rating) * 20% - 3px);
    overflow: hidden;
    white-space: nowrap;
}

.rv-stat-label {
    font-size: 12px;
    color: var(--rv-text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
}

/* "Based on 200+ customer reviews" under the rating (WIN-3602) */
.rv-stat-note {
    font-size: 12px;
    color: var(--rv-text-light);
}

.rv-stat-divider {
    width: 1px;
    height: 56px;
    background: var(--rv-border);
}

/* ─────────────────────────────────────────────
   FILTER CONTROLS
───────────────────────────────────────────── */
.rv-controls {
    padding: 0 24px;
    margin-top: 8px;
}

.rv-controls-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 20px 0;
}

.rv-filters {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.rv-filter-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--rv-text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.rv-pill {
    padding: 8px 24px;
    border-radius: 99px;
    border: 2px solid var(--rv-border);
    background: var(--rv-white);
    color: var(--rv-text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--rv-transition);
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.rv-pill:hover {
    border-color: var(--rv-blue);
    color: var(--rv-blue);
    background: rgba(46, 94, 177, 0.04);
}

.rv-pill.active {
    background: var(--rv-blue);
    border-color: var(--rv-blue);
    color: var(--rv-white);
    box-shadow: 0 4px 12px rgba(46, 94, 177, 0.3);
}

.rv-showing {
    font-size: 14px;
    color: var(--rv-text-light);
}

.rv-showing strong {
    color: var(--rv-navy);
}

/* ─────────────────────────────────────────────
   MASONRY GRID
───────────────────────────────────────────── */
.rv-grid-section {
    padding: 0 24px 60px;
}

.rv-grid-section > .container {
    max-width: 1200px;
    margin: 0 auto;
}

.rv-masonry {
    columns: 3;
    column-gap: 22px;
}

/* ─────────────────────────────────────────────
   REVIEW CARDS — BASE
───────────────────────────────────────────── */
.rv-card {
    break-inside: avoid;
    -webkit-column-break-inside: avoid;
    page-break-inside: avoid;
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    background: var(--rv-white);
    border-radius: var(--rv-radius);
    padding: 28px;
    margin-bottom: 22px;
    box-shadow: var(--rv-shadow);
    transition: box-shadow var(--rv-transition), transform var(--rv-transition);
    position: relative;
    border: 1px solid transparent;
}

.rv-card:hover {
    box-shadow: var(--rv-shadow-hover);
    transform: translateY(-3px);
}

/* ── Card entrance animation ── */
.rv-card-enter {
    opacity: 0;
    transform: translateY(28px);
}

.rv-card-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ── Stars ── */
.rv-card-stars {
    font-size: 18px;
    color: var(--rv-gold);
    letter-spacing: 2px;
    margin-bottom: 16px;
    line-height: 1;
}

/* ── Card body text ── */
.rv-card-body {
    font-size: 14px;
    line-height: 1.7;
    color: var(--rv-text);
    margin-bottom: 18px;
}

.rv-card-body p {
    margin: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* ── Author row ── */
.rv-card-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid var(--rv-border);
}

.rv-author-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--rv-blue), var(--rv-navy));
    color: var(--rv-white);
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    letter-spacing: 0.5px;
}

.rv-author-info {
    flex: 1;
    min-width: 0;
}

.rv-author-info strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: var(--rv-navy);
    line-height: 1.3;
}

.rv-author-info span {
    font-size: 12px;
    color: var(--rv-text-light);
}

/* ─────────────────────────────────────────────
   FEATURED CARD — explicitly marked by marketing
───────────────────────────────────────────── */
.rv-card--featured {
    border-color: var(--rv-gold-light);
    border-width: 2px;
    background: linear-gradient(180deg, #FFFDF5 0%, var(--rv-white) 60px);
}

.rv-card--featured:hover {
    border-color: var(--rv-gold);
    box-shadow: 0 12px 36px rgba(255, 184, 0, 0.15), var(--rv-shadow-hover);
}

/* ─────────────────────────────────────────────
   HAS-IMAGES CARD — regular card with photos
───────────────────────────────────────────── */
.rv-card--has-images {
    border-color: var(--rv-border);
}

.rv-card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, var(--rv-gold-light), var(--rv-gold));
    color: var(--rv-navy);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 4px 14px;
    border-radius: 99px;
    margin-bottom: 14px;
}

/* Image gallery inside featured cards */
.rv-card-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
}

.rv-card-images a {
    display: block;
    border-radius: var(--rv-radius-sm);
    overflow: hidden;
    aspect-ratio: 1;
    transition: transform var(--rv-transition), box-shadow var(--rv-transition);
}

.rv-card-images a:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.rv-card-images img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Single large image layout */
.rv-card-images--single {
    grid-template-columns: 1fr;
}

.rv-card-images--single a {
    aspect-ratio: 16 / 10;
    border-radius: var(--rv-radius-sm);
}

/* ─────────────────────────────────────────────
   PULL QUOTE CARD
───────────────────────────────────────────── */
.rv-card--quote {
    background: linear-gradient(135deg, #F0F4FF 0%, #E8EDFA 100%);
    border-color: rgba(46, 94, 177, 0.15);
    padding: 32px 28px 28px;
}

.rv-card--quote .rv-card-quote-mark {
    font-size: 64px;
    line-height: 0.6;
    font-family: Georgia, 'Times New Roman', serif;
    color: var(--rv-blue);
    opacity: 0.25;
    margin-bottom: 8px;
    user-select: none;
}

.rv-card--quote .rv-card-body {
    font-size: 16px;
    font-style: italic;
    line-height: 1.75;
    color: var(--rv-deep-navy);
    font-weight: 500;
}

.rv-card--quote .rv-card-author {
    border-top-color: rgba(46, 94, 177, 0.15);
}

/* ─────────────────────────────────────────────
   VIDEO TESTIMONIAL CARD
   Consistent with regular card styling.
   Video at top, then featured badge + stars +
   content + author below.
───────────────────────────────────────────── */
.rv-card.rv-card--video {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.rv-card--video .rv-card-video {
    width: 100%;
}

.rv-card--video .rv-card-video iframe {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    display: block;
    background: #000;
}

.rv-card--video .rv-card-video video {
    width: 100%;
    /* preload="none": keep the 16:9 box before metadata loads (WIN-3655). */
    aspect-ratio: 16 / 9;
    object-fit: contain;
    border: 0;
    display: block;
    background: #000;
}

.rv-card--video .rv-card-content {
    padding: 24px 28px 28px;
}

/* Featured + Video combo — gold border still applies */
.rv-card--video.rv-card--featured {
    border-color: var(--rv-gold-light);
    border-width: 2px;
}

/* ─────────────────────────────────────────────
   VIDEO INSIDE CARD BODY (fallback)
   Handles videos added via WordPress content
   editor rather than the Video URL meta field.
───────────────────────────────────────────── */
.rv-card-body video,
.rv-card-body iframe[src*="youtube"],
.rv-card-body iframe[src*="vimeo"] {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: var(--rv-radius-sm);
    margin: 12px 0;
    display: block;
}

/* ─────────────────────────────────────────────
   CTA CARD (inline within grid)
───────────────────────────────────────────── */
.rv-card--cta {
    background: linear-gradient(135deg, var(--rv-navy) 0%, var(--rv-blue) 100%);
    border: none;
    color: var(--rv-white);
    text-align: center;
    padding: 36px 24px;
}

.rv-card--cta:hover {
    box-shadow: 0 12px 36px rgba(31, 45, 105, 0.25);
}

.rv-card--cta h3 {
    color: var(--rv-white);
    font-size: 20px;
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.3;
}

.rv-card--cta p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
}

.rv-cta-link {
    display: inline-block;
    background: var(--rv-gold-light);
    color: var(--rv-navy);
    font-weight: 800;
    font-size: 14px;
    padding: 12px 28px;
    border-radius: 99px;
    text-decoration: none;
    transition: transform var(--rv-transition), box-shadow var(--rv-transition);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.rv-cta-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: var(--rv-navy);
}

/* ─────────────────────────────────────────────
   LOAD MORE BUTTON
───────────────────────────────────────────── */
.rv-load-more-wrap {
    text-align: center;
    padding: 20px 0 0;
}

.rv-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 40px;
    border-radius: 99px;
    border: 2px solid var(--rv-blue);
    background: transparent;
    color: var(--rv-blue);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
    transition: all var(--rv-transition);
    min-width: 200px;
    min-height: 50px;
}

.rv-load-more-btn:hover {
    background: var(--rv-blue);
    color: var(--rv-white);
    box-shadow: 0 6px 20px rgba(46, 94, 177, 0.3);
    transform: translateY(-2px);
}

.rv-btn-spinner {
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--rv-border);
    border-top-color: var(--rv-blue);
    border-radius: 50%;
    animation: rv-spin 0.7s linear infinite;
    display: inline-block;
}

/* ─────────────────────────────────────────────
   LOADING STATE
───────────────────────────────────────────── */
.rv-loading {
    column-span: all;
    -webkit-column-span: all;
    text-align: center;
    padding: 60px 20px;
    color: var(--rv-text-light);
}

.rv-loading p {
    margin: 16px 0 0;
    font-size: 15px;
    color: var(--rv-text-light);
}

.rv-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--rv-border);
    border-top-color: var(--rv-blue);
    border-radius: 50%;
    margin: 0 auto;
    animation: rv-spin 0.7s linear infinite;
}

@keyframes rv-spin {
    to { transform: rotate(360deg); }
}

/* ─────────────────────────────────────────────
   EMPTY STATE
───────────────────────────────────────────── */
.rv-empty {
    text-align: center;
    padding: 60px 20px;
}

.rv-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.rv-empty h3 {
    color: var(--rv-navy);
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
}

.rv-empty p {
    color: var(--rv-text-light);
    font-size: 15px;
    margin: 0;
}

/* ─────────────────────────────────────────────
   ERROR / UNAVAILABLE STATE (WIN-1667)
───────────────────────────────────────────── */
.rv-error,
.rv-unavailable {
    text-align: center;
    padding: 40px;
    color: var(--rv-text-light);
    font-size: 15px;
}

/* ─────────────────────────────────────────────
   BOTTOM CTA SECTION
───────────────────────────────────────────── */
.rv-bottom-cta {
    padding: 0 24px 80px;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.rv-bottom-cta.rv-visible {
    opacity: 1;
    transform: translateY(0);
}

.rv-cta-inner {
    max-width: 720px;
    margin: 0 auto;
    background: var(--rv-white);
    border-radius: 24px;
    padding: 56px 40px;
    text-align: center;
    box-shadow: 0 4px 24px rgba(31, 45, 105, 0.08);
    position: relative;
    overflow: hidden;
}

.rv-cta-inner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--rv-blue), var(--rv-gold), var(--rv-blue));
}

.rv-cta-badge {
    display: inline-block;
    background: rgba(46, 94, 177, 0.08);
    color: var(--rv-blue);
    font-size: 13px;
    font-weight: 700;
    padding: 6px 18px;
    border-radius: 99px;
    margin-bottom: 20px;
}

.rv-cta-inner h2 {
    font-size: clamp(24px, 3vw, 36px);
    font-weight: 800;
    color: var(--rv-navy);
    margin: 0 0 14px;
    line-height: 1.25;
}

.rv-cta-inner p {
    color: var(--rv-text-light);
    font-size: 16px;
    margin: 0 0 32px;
    line-height: 1.6;
}

.rv-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--rv-blue), var(--rv-navy));
    color: var(--rv-white);
    font-weight: 800;
    font-size: 16px;
    padding: 16px 40px;
    border-radius: 99px;
    text-decoration: none;
    transition: transform var(--rv-transition), box-shadow var(--rv-transition);
    box-shadow: 0 6px 24px rgba(46, 94, 177, 0.35);
}

.rv-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(46, 94, 177, 0.45);
    color: var(--rv-white);
}

.rv-cta-btn span {
    transition: transform 0.2s ease;
}

.rv-cta-btn:hover span {
    transform: translateX(4px);
}

/* ─────────────────────────────────────────────
   RESPONSIVE — TABLET (max 960px)
───────────────────────────────────────────── */
@media (max-width: 960px) {
    .rv-masonry {
        columns: 2;
        column-gap: 18px;
    }

    .about-banner.rv-banner {
        padding: 140px 0 70px;
    }

    .rv-stats-grid {
        padding: 24px;
        gap: 24px;
    }

    .rv-stat-divider {
        display: none;
    }

    .rv-stat-value {
        font-size: 34px;
    }

    .rv-cta-inner {
        padding: 40px 28px;
    }
}

/* ─────────────────────────────────────────────
   RESPONSIVE — MOBILE (max 640px)
───────────────────────────────────────────── */
@media (max-width: 640px) {
    .rv-masonry {
        columns: 1;
    }

    .about-banner.rv-banner {
        padding: 120px 16px 60px;
    }

    .rv-hero-sub {
        font-size: 15px;
        padding: 0 8px;
    }

    .rv-stats {
        margin-top: -24px;
        padding: 0 16px 24px;
    }

    .rv-stats-grid {
        padding: 20px 16px;
        gap: 20px;
        flex-direction: column;
        align-items: stretch;
    }

    .rv-stat-card {
        align-items: center;
    }

    .rv-stat-value {
        font-size: 28px;
    }

    .rv-controls {
        padding: 0 16px;
    }

    .rv-controls-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .rv-filters {
        gap: 8px;
    }

    .rv-pill {
        padding: 7px 18px;
        font-size: 13px;
    }

    .rv-grid-section {
        padding: 0 16px 40px;
    }

    .rv-card {
        padding: 22px;
        margin-bottom: 16px;
    }

    .rv-card--featured {
        padding: 22px;
    }

    .rv-card-images {
        grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    }

    .rv-card--video .rv-card-content {
        padding: 20px 22px 22px;
    }

    .rv-bottom-cta {
        padding: 0 16px 60px;
    }

    .rv-cta-inner {
        padding: 36px 20px;
        border-radius: 20px;
    }

    .rv-cta-btn {
        padding: 14px 32px;
        font-size: 15px;
        width: 100%;
        justify-content: center;
    }

    .rv-load-more-btn {
        width: 100%;
    }
}
