﻿#reviewsCarousel {
    --rvHCenter: 420px; /* collapsed height for center cards */
    --rvHSide: 300px; /* collapsed height for side cards */
    --rvAvatarSide: 92px;
    --rvAvatarCenter: 120px;
    --rvPadX: 1.25rem;
    --rvPadTop: 4.25rem; /* room for avatar bubble */
    padding-top: calc(var(--rvAvatarCenter) / 2 + 12px);
}

    /* ---------- Structure ---------- */
    #reviewsCarousel .carousel-inner {
        overflow: visible;
    }

.rv-track {
    display: flex;
    gap: 24px;
    padding: .25rem 0 2rem;
    justify-content: center;
    align-items: stretch;
}

.rv-wrap {
    flex: 0 0 auto;
    width: clamp(260px, 30vw, 360px);
}

.rv-card {
    position: relative;
    border-radius: 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    box-shadow: 0 .25rem 1rem rgba(0,0,0,.06);
    transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease, opacity .28s ease, height .2s ease;
    overflow: visible; /* so avatar glow isn’t cut */
    display: flex;
    flex-direction: column;
    padding: var(--rvPadTop) var(--rvPadX) 1.25rem;
}

.rv-card-side {
    transform: scale(.94);
    opacity: .95;
    height: var(--rvHSide);
}

.rv-card-center {
    transform: scale(1.12);
    border-width: 2px;
    border-color: #fbbf24;
    z-index: 2;
    height: var(--rvHCenter);
    box-shadow: 0 .9rem 2.2rem rgba(0,0,0,.14);
}

.rv-card.expanded {
    height: auto;
}

/* Accent bar like reference */
.rv-card-center::after {
    content: "";
    position: absolute;
    right: 22px;
    top: 36px;
    width: 4px;
    height: 48px;
    border-radius: 2px;
    background: linear-gradient(180deg,#f59e0b 0%, #fbbf24 100%);
}

/* ---------- Avatar bubble ---------- */
.rv-avatar-cluster {
    position: absolute;
    left: 50%;
    top: 0;
    transform: translate(-50%,-50%);
    width: var(--rvAvatarSide);
    height: var(--rvAvatarSide);
    border-radius: 50%;
    background: #fff;
    border: 4px solid #fff;
    box-shadow: 0 .5rem 1.25rem rgba(0,0,0,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rv-card-center .rv-avatar-cluster {
    width: var(--rvAvatarCenter);
    height: var(--rvAvatarCenter);
}

/* Avatar media ALWAYS centered (img / emoji / initials / svg) */
.rv-avatar-media {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .rv-avatar-media img,
    .rv-avatar-media svg {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        border-radius: 50%;
    }

    .rv-avatar-media .rv-emoji,
    .rv-avatar-media .rv-initials {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
        line-height: 1;
        font-weight: 700;
        font-size: 46px; /* tweak if needed */
    }

/* ---------- Head ---------- */
.rv-head {
    text-align: center;
    margin: .25rem 0;
}

.rv-name {
    font-weight: 800;
    font-size: 1.35rem;
}

.rv-title {
    color: #6b7280;
    font-size: .95rem;
    line-height: 1.35;
}

    .rv-title a {
        text-decoration: underline;
    }

.rv-stars {
    color: #f59e0b;
}

/* ---------- Body (fills height, button stays at bottom) ---------- */
.rv-body {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    min-height: 0;
    height: 100%;
    margin-top: .5rem;
}

.rv-quote {
    position: relative;
    color: #111827;
    flex: 1 1 auto;
}

.rv-card-side .rv-quote {
    color: #374151;
}

/* Collapsed line clamps tuned to visually fill fixed heights */
.rv-card-center:not(.expanded) .rv-quote-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 10; /* center looks full */
}

.rv-card-side:not(.expanded) .rv-quote-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    -webkit-line-clamp: 7; /* sides slightly less */
}

/* Soft fade at bottom in collapsed state (smaller so it reads as filled) */
.rv-card:not(.expanded) .rv-quote::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, #fff 85%);
    pointer-events: none;
}

/* Expanded shows all, removes fade */
.rv-card.expanded .rv-quote-text {
    display: block;
    -webkit-line-clamp: unset;
}

.rv-card.expanded .rv-quote::after {
    display: none;
}

/* Read more / less */
.rv-readmore {
    align-self: center;
    font-size: .95rem;
    color: #0ea5e9;
    cursor: pointer;
    border: 0;
    background: transparent;
}

    .rv-readmore:hover {
        text-decoration: underline;
    }

/* Controls & indicators */
#reviewsCarousel .carousel-control-prev,
#reviewsCarousel .carousel-control-next {
    width: 3.25rem;
    opacity: 1;
}

#reviewsCarousel .carousel-control-prev-icon,
#reviewsCarousel .carousel-control-next-icon {
    filter: invert(1) drop-shadow(0 0 2px rgba(0,0,0,.35));
    background-color: rgba(0,0,0,.45);
    border-radius: 50%;
    width: 3.25rem;
    height: 3.25rem;
    background-size: 50% 50%;
}

#reviewsCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#reviewsCarousel .carousel-control-next:hover .carousel-control-next-icon {
    background-color: rgba(0,0,0,.65);
}

#reviewsCarousel .carousel-indicators [data-bs-target] {
    background: #94a3b8;
    width: .6rem;
    height: .6rem;
}

#reviewsCarousel .carousel-indicators .active {
    background: #0ea5e9;
}

/* Floating play button */
.rv-play-fab {
    position: absolute; /* relative to .rv-card (which is position:relative) */
    left: 50%;
    transform: translateX(-50%); /* horizontal center only */
    z-index: 3;
    width: 48px;
    height: 48px;
    border-radius: 999px;
    background: #ff0000;
    border: 1px solid #e5e7eb;
    display: grid;
    place-items: center;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 .4rem 1rem rgba(0,0,0,.28);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}

    .rv-play-fab:hover {
        background: #cc0000;
        box-shadow: 0 .6rem 1.4rem rgba(0,0,0,.38);
        transform: translateX(-50%) scale(1.05);
    }

    .rv-play-fab i {
        font-size: 30px;
        line-height: 1;
    }

.rv-card-side .rv-play-fab {
    top: calc(var(--rvAvatarSide) / 2 - 28px);
}

.rv-card-center .rv-play-fab {
    top: calc(var(--rvAvatarCenter) / 2 - 28px);
}

@media (max-width: 600px) {
    .rv-play-fab {
        width: 38px; /* smaller button */
        height: 38px;
    }

        .rv-play-fab i {
            font-size: 22px; /* smaller icon */
        }

    /* adjust overlap slightly for mobile */
    .rv-card-side .rv-play-fab {
        top: calc(var(--rvAvatarSide) / 2 - 28px);
    }

    .rv-card-center .rv-play-fab {
        top: calc(var(--rvAvatarCenter) / 2 - 28px);
    }
}
