/*-- -------------------------- -->
<---          Reviews           -->
<--- -------------------------- -*/

/* Mobile - 360px */
@media only screen and (min-width: 0rem) {
    #testimonials {
        background-color: rgba(0, 0, 0, 0.01);
        padding: var(--sectionPadding);
        position: relative;
        z-index: 1;
    }
    #testimonials .cs-container {
        width: 100%;
        max-width: 50rem;
        margin: auto;
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: clamp(1.5rem, 3vw, 2rem);
    }
    #testimonials .cs-content {
        text-align: center;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    #testimonials .cs-title {
        max-width: 20ch;
        margin: 0;
    }
    
    /* Carousel Wrapper */
    #testimonials .cs-carousel-wrapper {
        width: 100%;
        display: flex;
        align-items: center;
        gap: 1rem;
        position: relative;
    }
    
    /* Carousel Track - contains the testimonials */
    #testimonials .cs-carousel-track {
        flex: 1;
        position: relative;
        /* Fixed height to prevent layout shifts - accommodates longest quote on mobile */
        height: 18rem;
        overflow: hidden;
    }
    
    /* Card group - holds all items, positioned absolutely */
    #testimonials .cs-card-group {
        padding: 0;
        margin: 0;
        list-style: none;
        position: relative;
        width: 100%;
        height: 100%;
    }
    
    /* Individual testimonial item - stacked on top of each other */
    #testimonials .cs-item {
        width: 100%;
        padding: 1rem;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.5s ease, visibility 0.5s ease;
    }
    
    #testimonials .cs-item.cs-active {
        opacity: 1;
        visibility: visible;
    }
    
    #testimonials .cs-flex-group {
        margin-bottom: 0.75rem;
    }
    
    #testimonials .cs-name {
        font-size: clamp(1.25rem, 2.5vw, 1.5rem);
        line-height: 1.4em;
        font-weight: 700;
        color: var(--primary);
        display: block;
    }
    
    #testimonials .cs-review {
        font-size: clamp(1rem, 2vw, 1.25rem);
        line-height: 1.7em;
        font-style: italic;
        margin: 0;
        color: var(--bodyTextColor);
    }
    
    /* Carousel Arrows */
    #testimonials .cs-carousel-arrow {
        flex-shrink: 0;
        width: 2.75rem;
        height: 2.75rem;
        background: var(--primary);
        border: none;
        border-radius: 50%;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        color: #fff;
        transition: background-color 0.3s, transform 0.3s;
        z-index: 2;
    }
    #testimonials .cs-carousel-arrow:hover {
        background: #000;
        transform: scale(1.1);
    }
    #testimonials .cs-carousel-arrow svg {
        width: 1.25rem;
        height: 1.25rem;
    }
    
    /* Carousel Dots */
    #testimonials .cs-carousel-dots {
        display: flex;
        justify-content: center;
        gap: 0.75rem;
        flex-wrap: wrap;
    }
    #testimonials .cs-carousel-dot {
        /* Touch target: 44x44px minimum for accessibility */
        width: 2.75rem;
        height: 2.75rem;
        background: transparent;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        transition: transform 0.3s;
        padding: 0;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    /* Visual dot inside the touch target */
    #testimonials .cs-carousel-dot::after {
        content: '';
        width: 0.625rem;
        height: 0.625rem;
        background: #ccc;
        border-radius: 50%;
        transition: background-color 0.3s, transform 0.3s;
    }
    #testimonials .cs-carousel-dot:hover::after {
        background: var(--primary);
    }
    #testimonials .cs-carousel-dot.cs-active::after {
        background: var(--primary);
        transform: scale(1.4);
    }
}

/* Tablet - 600px */
@media only screen and (min-width: 37.5rem) {
    #testimonials .cs-carousel-track {
        height: 12rem;
    }
}

/* Desktop - 1024px */
@media only screen and (min-width: 64rem) {
    #testimonials .cs-carousel-track {
        height: 9rem;
    }
    
    #testimonials .cs-carousel-arrow {
        width: 3rem;
        height: 3rem;
    }
    
    #testimonials .cs-carousel-arrow svg {
        width: 1.5rem;
        height: 1.5rem;
    }
}

/* Dark Mode */
@media only screen and (min-width: 0rem) {
    body.dark-mode #testimonials .cs-topper,
    body.dark-mode #testimonials .cs-name {
        color: var(--primaryLight);
    }
    body.dark-mode #testimonials .cs-title,
    body.dark-mode #testimonials .cs-review {
        color: var(--bodyTextColorWhite);
    }
    body.dark-mode #testimonials .cs-review {
        opacity: 0.9;
    }
    body.dark-mode #testimonials {
        background-color: rgba(0, 0, 0, 0.2);
    }
    body.dark-mode #testimonials .cs-carousel-arrow {
        background: var(--primaryLight);
        color: #000;
    }
    body.dark-mode #testimonials .cs-carousel-arrow:hover {
        background: var(--bodyTextColorWhite);
    }
    body.dark-mode #testimonials .cs-carousel-dot::after {
        background: rgba(255, 255, 255, 0.3);
    }
    body.dark-mode #testimonials .cs-carousel-dot:hover::after,
    body.dark-mode #testimonials .cs-carousel-dot.cs-active::after {
        background: var(--primaryLight);
    }
}
