﻿/* 
 * VEKS Testimonials Module 
 */

.veks-testimonials {
    padding: 120px 0;
    background-color: #111111;
    color: #f7f7f7;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.veks-testimonials__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Header */
.veks-testimonials__header {
    margin-bottom: 60px;
    max-width: 800px;
}

.veks-testimonials__eyebrow {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #d59a57;
    margin-bottom: 20px;
    font-weight: 600;
}

.veks-testimonials__heading {
    font-family: var(--veks-heading-font);
    font-size: clamp(41px, 2vw, 82px);
    font-weight: 400;
    line-height: 1.2;
    margin: 0;
    color: #ffffff;
}

/* Slider */
.veks-testimonials__slider-wrapper {
    position: relative;
    width: 100%;
}

.veks-testimonials__slider {
    position: relative;
    min-height: 400px; /* Adjust based on content */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.veks-testimonials__slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateX(40px);
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.6s;
    pointer-events: none;
    padding: 0 80px;
    box-sizing: border-box;
}

.veks-testimonials__slide.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
    pointer-events: auto;
    position: relative; /* Take up space */
}

/* Slide Left (Previous) */
.veks-testimonials__slide.is-sliding-left-out {
    transform: translateX(-40px);
}
.veks-testimonials__slide.is-sliding-left-in {
    transform: translateX(-40px);
}

/* Slide Right (Next) */
.veks-testimonials__slide.is-sliding-right-out {
    transform: translateX(40px);
}
.veks-testimonials__slide.is-sliding-right-in {
    transform: translateX(40px);
}

/* Rating */
.veks-testimonials__rating {
    margin-bottom: 30px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

/* Quote */
.veks-testimonials__quote {
    margin: 0 auto 40px auto;
    padding: 0;
    font-size: clamp(20px, 2.5vw, 32px);
    line-height: 1.4;
    font-weight: 400;
    font-style: italic;
    color: #ffffff;
    max-width: 900px;
}

.veks-testimonials__quote p {
    margin: 0;
}

/* Author */
.veks-testimonials__author {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.veks-testimonials__avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.veks-testimonials__avatar img,
.veks-testimonials__avatar-fallback {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.veks-testimonials__avatar-fallback {
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
}

.veks-testimonials__cite {
    font-style: normal;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.veks-testimonials__name {
    font-weight: 600;
    font-size: 18px;
    color: #ffffff;
    letter-spacing: 0.5px;
}

.veks-testimonials__location {
    font-size: 14px;
    color: #aaaaaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Controls */
.veks-testimonials__controls {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    transform: translateY(-50%);
    pointer-events: none;
    z-index: 10;
}

.veks-testimonials__prev,
.veks-testimonials__next {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.3s ease;
    padding: 0;
}

.veks-testimonials__prev:hover,
.veks-testimonials__next:hover {
    border-color: #d59a57;
    color: #d59a57;
    transform: scale(1.05);
}

.veks-testimonials__prev:focus-visible,
.veks-testimonials__next:focus-visible {
    outline: 2px solid #d59a57;
    outline-offset: 4px;
}

/* Offset buttons out of the text area */
.veks-testimonials__prev {
    transform: translateX(0);
}
.veks-testimonials__next {
    transform: translateX(0);
}

.veks-testimonials__prev:hover {
    transform: scale(1.05);
}
.veks-testimonials__next:hover {
    transform: scale(1.05);
}

/* Dots */
.veks-testimonials__dots {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 40px;
}

.veks-testimonials__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
    /* Touch target padding trick */
    position: relative;
}

.veks-testimonials__dot::before {
    content: '';
    position: absolute;
    top: -15px; left: -15px; right: -15px; bottom: -15px;
}

.veks-testimonials__dot:hover {
    background: rgba(255, 255, 255, 0.5);
}

.veks-testimonials__dot.is-active {
    background: #d59a57;
    transform: scale(1.3);
}

.veks-testimonials__dot:focus-visible {
    outline: 2px solid #d59a57;
    outline-offset: 2px;
}

/* Intersection Observer Animations */
.veks-testimonials.is-visible .veks-testimonials__eyebrow { animation: veksFadeInUp 0.8s ease forwards; }
.veks-testimonials.is-visible .veks-testimonials__heading { animation: veksFadeInUp 0.8s ease 0.1s forwards; }
.veks-testimonials.is-visible .veks-testimonials__slider-wrapper { animation: veksFadeInUp 0.8s ease 0.2s forwards; }

.veks-testimonials__eyebrow,
.veks-testimonials__heading,
.veks-testimonials__slider-wrapper {
    opacity: 0;
    transform: translateY(20px);
}

@keyframes veksFadeInUp {
    to { opacity: 1; transform: translateY(0); }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .veks-testimonials__eyebrow,
    .veks-testimonials__heading,
    .veks-testimonials__slider-wrapper {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .veks-testimonials__slide {
        transition: opacity 0.3s ease, visibility 0.3s;
        transform: none !important;
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .veks-testimonials__prev { transform: translateX(0); }
    .veks-testimonials__next { transform: translateX(0); }
    .veks-testimonials__prev:hover { transform: scale(1.05); }
    .veks-testimonials__next:hover { transform: scale(1.05); }
    .veks-testimonials__slide { padding: 0 40px; }
}

@media (max-width: 768px) {
    .veks-testimonials { padding: 80px 0; }
    
    .veks-testimonials__slide { padding: 0; }
    
    .veks-testimonials__quote {
        font-size: 20px;
    }

    /* On mobile, controls should be below, not overlapping */
    .veks-testimonials__controls {
        position: static;
        transform: none;
        justify-content: center;
        gap: 20px;
        margin-top: 30px;
    }
    
    .veks-testimonials__dots {
        margin-top: 20px;
    }

    .veks-testimonials__slider {
        min-height: auto;
    }
}

