/**
 * Smoco Essentials V2 — Animated Testimonials (Aceternity UI pattern).
 */

.cmp-animated-testimonials {
    --at-max-width: min(100%, 56rem);
    --at-gap: clamp(3rem, 8vw, 5rem);
    --at-stack-height: clamp(16rem, 42vw, 20rem);
    --at-photo-radius: 1.5rem;
    --at-name-size: clamp(1.35rem, 2.4vw, 1.5rem);
    --at-quote-size: clamp(1rem, 1.8vw, 1.125rem);
    --at-nav-size: 1.75rem;
    --at-nav-bg: var(--gray-100, #f1f5f9);
    --at-nav-color: var(--cmp-heading, var(--regal, #003f7d));
    --at-bounce: -5rem;

    color: var(--cmp-body, var(--gray-500));
}

.cmp-animated-testimonials__inner {
    max-width: var(--at-max-width);
    margin-inline: auto;
    padding-inline: clamp(1rem, 3vw, 3rem);
}

.cmp-animated-testimonials__layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--at-gap);
    align-items: start;
}

.cmp-animated-testimonials__media {
    width: 100%;
}

.cmp-animated-testimonials__stack {
    position: relative;
    height: var(--at-stack-height);
    width: 100%;
    perspective: 1200px;
}

.cmp-animated-testimonials__photo {
    position: absolute;
    inset: 0;
    margin: 0;
    transform-origin: center bottom;
    opacity: 0.7;
    transform: scale(0.95) rotate(var(--at-rotate, 0deg));
    transition:
        opacity 0.4s ease,
        transform 0.4s ease,
        filter 0.4s ease;
    will-change: transform, opacity;
    z-index: var(--at-z-index, 1);
}

.cmp-animated-testimonials__photo.is-active {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    z-index: var(--at-z-index, 20);
    animation: cmp-at-photo-bounce 0.55s ease-in-out;
}

.cmp-animated-testimonials__photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    border-radius: var(--at-photo-radius);
    box-shadow:
        0 18px 40px -12px rgba(0, 63, 125, 0.16),
        0 6px 16px -8px rgba(15, 23, 42, 0.08);
    user-select: none;
    -webkit-user-drag: none;
}

.cmp-animated-testimonials__content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 2rem;
    min-height: 100%;
    padding-block: 1rem;
}

.cmp-animated-testimonials__slides {
    position: relative;
}

.cmp-animated-testimonials__slide {
    animation: cmp-at-slide-in 0.25s ease both;
}

.cmp-animated-testimonials__slide[hidden] {
    display: none;
}

.cmp-animated-testimonials__name {
    margin: 0;
    font-size: var(--at-name-size);
    line-height: 1.25;
    font-weight: 700;
    color: var(--cmp-heading, var(--regal, #003f7d));
}

.cmp-animated-testimonials__designation {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--cmp-muted, var(--gray-400));
}

.cmp-animated-testimonials__quote {
    margin: clamp(1.5rem, 4vw, 2rem) 0 0;
    padding: 0;
    border: 0;
    font-size: var(--at-quote-size);
    line-height: 1.65;
    color: var(--cmp-body, var(--gray-500));
}

.cmp-animated-testimonials__word {
    display: inline-block;
    margin-right: 0.28em;
    opacity: 0;
    filter: blur(8px);
    transform: translateY(5px);
    animation: cmp-at-word-in 0.22s ease forwards;
    animation-delay: calc(var(--word-index, 0) * 20ms);
}

.cmp-animated-testimonials__nav {
    display: flex;
    gap: 1rem;
    margin-top: clamp(1rem, 2.5vw, 1.5rem);
}

.cmp-animated-testimonials__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--at-nav-size);
    height: var(--at-nav-size);
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: var(--at-nav-bg);
    color: var(--at-nav-color);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.2s ease;
}

.cmp-animated-testimonials__arrow svg {
    width: 1.15rem;
    height: 1.15rem;
}

.cmp-animated-testimonials__arrow:hover,
.cmp-animated-testimonials__arrow:focus-visible {
    outline: none;
    background: color-mix(in srgb, var(--at-nav-bg) 88%, var(--at-nav-color));
}

.cmp-animated-testimonials__arrow--prev:hover svg,
.cmp-animated-testimonials__arrow--prev:focus-visible svg {
    transform: rotate(-12deg);
}

.cmp-animated-testimonials__arrow--next:hover svg,
.cmp-animated-testimonials__arrow--next:focus-visible svg {
    transform: rotate(12deg);
}

.cmp-animated-testimonials__arrow svg {
    transition: transform 0.3s ease;
}

@keyframes cmp-at-photo-bounce {
    0%,
    100% {
        transform: scale(1) rotate(0deg) translateY(0);
    }

    40% {
        transform: scale(1) rotate(0deg) translateY(var(--at-bounce));
    }
}

@keyframes cmp-at-slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cmp-at-word-in {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

@media (min-width: 768px) {
    .cmp-animated-testimonials__layout {
        grid-template-columns: 1fr 1fr;
    }

    .cmp-animated-testimonials {
        --at-bounce: -5rem;
    }
}

@media (max-width: 767px) and (orientation: portrait) {
    .cmp-animated-testimonials {
        --at-gap: clamp(1.25rem, 5vw, 2rem);
        --at-stack-height: clamp(12rem, 52vw, 16rem);
        --at-bounce: -2rem;
    }

    .cmp-animated-testimonials__content {
        gap: 0;
        justify-content: flex-start;
        min-height: 0;
        padding-block: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cmp-animated-testimonials__photo,
    .cmp-animated-testimonials__slide,
    .cmp-animated-testimonials__word,
    .cmp-animated-testimonials__arrow svg {
        animation: none !important;
        transition: none !important;
    }

    .cmp-animated-testimonials__photo {
        opacity: 0.85;
        transform: scale(0.97);
    }

    .cmp-animated-testimonials__photo.is-active {
        opacity: 1;
        transform: scale(1);
    }

    .cmp-animated-testimonials__word {
        opacity: 1;
        filter: none;
        transform: none;
    }
}

html.is-dark .cmp-animated-testimonials {
    --at-nav-bg: rgba(255, 255, 255, 0.08);
    --at-nav-color: var(--cmp-heading, #fff);
}
