/* ==========================================================================
   Testimonials Carousel - Frontend Styles
   Design: Refined editorial style with clean typography and smooth transitions
   ========================================================================== */

/* --- Google Font import for elegant typography --- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400&family=DM+Sans:wght@300;400;500&display=swap');

/* --- CSS Custom Properties (Design Tokens) --- */
.tc-carousel {
    /* Light theme defaults */
    --tc-bg:           #ffffff;
    --tc-bg-card:      #f8f7f4;
    --tc-text:         #1a1a2e;
    --tc-text-muted:   #6b7280;
    --tc-accent:       #c9702e;
    --tc-accent-light: rgba(201, 112, 46, 0.12);
    --tc-star-filled:  #f59e0b;
    --tc-star-empty:   #e2e0da;
    --tc-border:       rgba(0, 0, 0, 0.08);
    --tc-arrow-bg:     #ffffff;
    --tc-arrow-hover:  #c9702e;
    --tc-arrow-color:  #1a1a2e;
    --tc-dot-inactive: #d1cec8;
    --tc-dot-active:   #c9702e;
    --tc-quote-color:  rgba(201, 112, 46, 0.15);
    --tc-shadow:       0 4px 32px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
    --tc-shadow-arrow: 0 2px 12px rgba(0, 0, 0, 0.12);
    --tc-font-display: 'Playfair Display', Georgia, serif;
    --tc-font-body:    'DM Sans', -apple-system, sans-serif;
    --tc-radius:       16px;
    --tc-radius-sm:    8px;
    --tc-transition:   0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark theme overrides */
.tc-carousel.tc-theme-dark {
    --tc-bg:           #0f0e17;
    --tc-bg-card:      #1c1b2e;
    --tc-text:         #f4f3ef;
    --tc-text-muted:   #9ca3af;
    --tc-accent:       #e8855a;
    --tc-accent-light: rgba(232, 133, 90, 0.15);
    --tc-border:       rgba(255, 255, 255, 0.07);
    --tc-arrow-bg:     #2a2940;
    --tc-arrow-hover:  #e8855a;
    --tc-arrow-color:  #f4f3ef;
    --tc-dot-inactive: #3d3c52;
    --tc-shadow:       0 4px 32px rgba(0, 0, 0, 0.4), 0 1px 4px rgba(0, 0, 0, 0.2);
    --tc-shadow-arrow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* --- Base container --- */
.tc-carousel {
    position: relative;
    width: 100%;
    max-width: 780px;
    margin: 2.5rem auto;
    font-family: var(--tc-font-body);
    background: var(--tc-bg);
    border-radius: var(--tc-radius);
    overflow: hidden; /* Clip slides during transition */
    padding-bottom: 56px; /* Space for arrows and dots */
}

/* --- Carousel track --- */
.tc-track {
    position: relative;
    width: 100%;
    /* Height is determined by the tallest visible slide */
}

/* --- Individual slides --- */
.tc-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 52px 64px 40px;
    background: var(--tc-bg-card);
    border-radius: var(--tc-radius);
    box-sizing: border-box;
    box-shadow: var(--tc-shadow);
    border: 1px solid var(--tc-border);

    /* Hidden by default */
    opacity: 0;
    transform: translateX(40px);
    pointer-events: none;
    transition:
        opacity var(--tc-transition),
        transform var(--tc-transition);
}

/* The first/active slide must be position relative to define track height */
.tc-slide:first-child {
    position: relative;
}

/* Active slide: fully visible */
.tc-slide.tc-slide--active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    position: relative;
}

/* Slide entering from the left (going backwards) */
.tc-slide.tc-slide--enter-left {
    transform: translateX(-40px);
}

/* --- Quote decoration icon --- */
.tc-quote-icon {
    position: absolute;
    top: 24px;
    right: 32px;
    color: var(--tc-quote-color);
    line-height: 0;
    transition: color 0.3s ease;
}

/* --- Star rating --- */
.tc-stars {
    display: flex;
    gap: 3px;
    margin-bottom: 20px;
}

.tc-star {
    font-size: 18px;
    line-height: 1;
    transition: color 0.2s ease;
}

.tc-star--filled {
    color: var(--tc-star-filled);
}

.tc-star--empty {
    color: var(--tc-star-empty);
}

/* --- Testimonial body content --- */
.tc-content {
    font-family: var(--tc-font-display);
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    font-style: italic;
    line-height: 1.75;
    color: var(--tc-text);
    margin-bottom: 32px;
    position: relative;
}

/* Style for bold text inside WYSIWYG content */
.tc-content strong,
.tc-content b {
    font-weight: 600;
    font-style: normal;
    color: var(--tc-accent);
}

/* Style for links inside WYSIWYG content */
.tc-content a {
    color: var(--tc-accent);
    text-decoration: underline;
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
    font-style: normal;
    transition: opacity 0.2s ease;
}

.tc-content a:hover {
    opacity: 0.75;
}

/* Remove default paragraph margin from last element */
.tc-content p:last-child {
    margin-bottom: 0;
}

/* --- Author section --- */
.tc-author {
    display: flex;
    align-items: center;
    gap: 14px;
    padding-top: 24px;
    border-top: 1px solid var(--tc-border);
}

/* Author avatar (image or initials) */
.tc-author-avatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--tc-accent-light);
}

.tc-author-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Initials fallback avatar */
.tc-author-avatar--initials {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--tc-accent-light);
    color: var(--tc-accent);
    font-family: var(--tc-font-display);
    font-size: 22px;
    font-weight: 600;
}

.tc-author-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.tc-author-name {
    font-family: var(--tc-font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--tc-text);
    letter-spacing: 0.01em;
}

.tc-author-role {
    font-family: var(--tc-font-body);
    font-size: 0.82rem;
    color: var(--tc-text-muted);
    font-weight: 300;
    letter-spacing: 0.03em;
}

/* --- Navigation arrows --- */
.tc-arrow {
    position: absolute;
    bottom: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--tc-arrow-bg);
    border: 1px solid var(--tc-border);
    box-shadow: var(--tc-shadow-arrow);
    color: var(--tc-arrow-color);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease,
        box-shadow 0.25s ease;
    padding: 0;
    line-height: 0;
    z-index: 10;
}

.tc-arrow:hover {
    background: var(--tc-arrow-hover);
    color: #ffffff;
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(201, 112, 46, 0.35);
    border-color: transparent;
}

.tc-arrow:active {
    transform: scale(0.95);
}

.tc-arrow--prev {
    left: 24px;
}

.tc-arrow--next {
    right: 24px;
}

/* Disabled state when only one slide exists */
.tc-arrow:disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- Dot indicators --- */
.tc-dots {
    position: absolute;
    bottom: 22px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    z-index: 10;
}

.tc-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--tc-dot-inactive);
    border: none;
    padding: 0;
    cursor: pointer;
    transition:
        background-color 0.3s ease,
        width 0.3s ease,
        border-radius 0.3s ease,
        transform 0.2s ease;
}

/* Active dot becomes a pill/capsule shape */
.tc-dot.tc-dot--active {
    background: var(--tc-dot-active);
    width: 24px;
    border-radius: 4px;
}

.tc-dot:hover:not(.tc-dot--active) {
    background: color-mix(in srgb, var(--tc-dot-active) 50%, var(--tc-dot-inactive));
    transform: scale(1.15);
}

/* --- "No testimonials" fallback message --- */
.tc-no-testimonials {
    text-align: center;
    color: var(--tc-text-muted, #6b7280);
    font-style: italic;
    padding: 2rem 0;
}

/* --- Responsive adjustments --- */
@media (max-width: 640px) {
    .tc-slide {
        padding: 36px 28px 36px;
    }

    .tc-quote-icon {
        right: 20px;
        top: 16px;
    }

    .tc-quote-icon svg {
        width: 32px;
        height: 24px;
    }

    .tc-arrow {
        width: 36px;
        height: 36px;
        bottom: 14px;
    }

    .tc-arrow--prev {
        left: 14px;
    }

    .tc-arrow--next {
        right: 14px;
    }

    .tc-carousel {
        padding-bottom: 60px;
    }
}

@media (max-width: 420px) {
    .tc-content {
        font-size: 1rem;
    }

    .tc-author-avatar {
        width: 44px;
        height: 44px;
    }
}
