/*
 * Frontend styles for rls/testimonials.
 * Mirrors the antigravity theme look using CSS variables with safe fallbacks
 * so the carousel still renders sensibly outside that theme.
 */

:root {
    --accent-color: #F5C026;
    --primary-dark: #0D0A3D;
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --space-md: clamp(0.75rem, 0.6rem + 0.75vw, 1.25rem);
    --text-main: #334155;
    --text-light: #64748B;
}

#testimonials {
    background-color: var(--primary-dark, #112d4e);
    color: #fff;
    max-width: 100%;
    padding-left: 0;
    padding-right: 0;
    position: relative;
}

#testimonials > header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 0 var(--space-md, 1.5rem);
}

#testimonials h2 {
    color: var(--accent-color);
    font-size: 2.5rem;
    position: relative;
    padding-bottom: 1rem;
}

#testimonials h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 60px;
    background-color: var(--accent-color, #e5a200);
}

.carousel-container {
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2rem;
}

.carousel-container::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 2rem;
    padding: 0 5vw;
}

.testimonial-slide {
    background: #fff;
    color: var(--text-main, #222);
    border-radius: 8px;
    padding: 2.5rem;
    flex: 0 0 400px;
    max-width: 80vw;
    scroll-snap-align: center;
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0, 0, 0, 0.1));
    margin: 0;
    display: flex;
    flex-direction: column;
}

.testimonial-slide blockquote {
    margin: 0 0 1.5rem 0;
    font-size: 1.125rem;
    font-style: italic;
    line-height: 1.6;
    flex-grow: 1;
}

.testimonial-slide .rating {
    color: var(--accent-color, #e5a200);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.testimonial-slide figcaption {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    padding-top: 1rem;
}

.testimonial-slide figcaption strong {
    color: var(--primary-dark, #112d4e);
    font-size: 1.125rem;
}

.testimonial-slide figcaption .title-company {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    font-style: italic;
}

.testimonial-slide figcaption .source {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    font-weight: 600;
}

.testimonial-slide figcaption .source a {
    color: inherit;
}

.testimonial-slide figcaption time {
    font-size: 0.875rem;
    color: var(--text-light, #666);
    margin-top: 0.25rem;
}

.see-more-reviews {
    text-align: center;
    margin: 2rem 0 0 0;
    padding: 0 var(--space-md, 1.5rem);
}

.see-more-reviews a {
    color: var(--accent-color, #e5a200);
    font-weight: 600;
    font-size: 1rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/*
 * Defensive override: some themes (notably the RRA theme) ship a broad
 * `.carousel-container a { position: absolute; bottom: 0; ... }` rule that
 * was written for an older slider markup. With the new <figure>-based
 * markup that rule would pin in-slide source links to the bottom of the
 * scroll container. Two-class specificity (0,2,1) beats the theme's
 * (0,1,1) regardless of stylesheet load order.
 */
.carousel-container .testimonial-slide a {
    position: static;
    bottom: auto;
    left: auto;
    right: auto;
    margin-bottom: 0;
    text-align: inherit;
}

/*
 * Prev/Next arrow buttons. The theme's carousel.js wraps the scroll
 * container in <div class="carousel-wrapper"> and appends two
 * <button class="carousel-nav"> siblings. We position them as absolute
 * overlays centered on the carousel's vertical midpoint.
 */
.carousel-wrapper {
    position: relative;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: var(--primary-dark, #112d4e);
    font-size: 1.75rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.carousel-nav:hover,
.carousel-nav:focus-visible {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
    transform: translateY(-50%) scale(1.1);
    outline: none;
}

.carousel-nav-prev {
    left: 0.75rem;
}

.carousel-nav-next {
    right: 0.75rem;
}

@media (max-width: 600px) {
    .carousel-nav {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.5rem;
    }
}

/*
 * Widget rendering: shares the horizontal-scroll carousel markup with the
 * block. Mirrors the antigravity look — slides scroll side-to-side rather
 * than stacking top-to-bottom — while toning down typography and padding
 * for sidebar-width containers.
 */
.testimonial_widget {
    background-color: var(--primary-dark, #112d4e);
    color: #fff;
    padding: 1.5rem 0;
    border-radius: 8px;
}

.testimonial_widget > .widget-title,
.testimonial_widget > h2,
.testimonial_widget > h3 {
    color: #fff;
    text-align: center;
    margin: 0 1rem 1.25rem;
    padding-bottom: 0.75rem;
    position: relative;
}

.testimonial_widget > .widget-title::after,
.testimonial_widget > h2::after,
.testimonial_widget > h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 3px;
    width: 48px;
    background-color: var(--accent-color, #e5a200);
}

.testimonial_widget .carousel-track {
    padding: 0 1rem;
    gap: 1rem;
}

.testimonial_widget .testimonial-slide {
    flex: 0 0 85%;
    max-width: 85%;
    padding: 1.5rem;
    scroll-snap-align: start;
}

.testimonial_widget .testimonial-slide blockquote {
    font-size: 1rem;
    margin-bottom: 1rem;
}
