@use 'abstracts';

@keyframes card-fade-up {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.testimonials {
  padding-block: calc(var(--space-4) * 2);
  background-color: var(--bg-muted);

  &__wrapper {
    @include abstracts.container-wrapper;
    width: 100%;
  }

  &__header {
    text-align: center;
    margin-bottom: calc(var(--space-4) * 1.5);

    h2 {
      font-size: var(--font-size-xl);
      margin-bottom: var(--space-2);
    }
  }

  &__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-3);

    @include abstracts.breakpoint('md') {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  &__card {
    position: relative;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: var(--space-4);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
                box-shadow 0.25s ease;

    animation: card-fade-up 0.55s cubic-bezier(0.22, 1, 0.36, 1) var(--delay, 0ms) both;

    &:hover {
      transform: translateY(-4px);
      box-shadow: 0 12px 32px oklch(0% 0 0 / 0.08);
    }
  }

  &__quote-icon {
    color: var(--accent);
    opacity: 0.6;
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
  }

  &__stars {
    display: flex;
    gap: 2px;
    font-size: 1rem;
    color: var(--border-color);

    .filled {
      color: oklch(75% 0.18 45);
    }
  }

  &__text {
    font-size: var(--font-size-base);
    line-height: 1.7;
    color: var(--text-main);
    font-style: normal;
    flex: 1;
    margin: 0;
  }

  &__author {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-color);
  }

  &__avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-on-accent);
    flex-shrink: 0;
  }

  &__author-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  &__name {
    font-weight: 700;
    font-size: var(--font-size-base);
    color: var(--text-main);
  }

  &__role {
    font-size: 0.8rem;
    color: var(--text-muted);
  }
}
