/* Automatinator — case study / testimonial cards */

.auto-testimonials {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px 32px;
  box-sizing: border-box;
}

.auto-testimonials__subline {
  text-align: center;
  font-family: Manrope, sans-serif;
  font-size: clamp(14px, 2vw, 16px);
  color: rgba(255, 255, 255, 0.75);
  margin: -8px auto 28px;
  max-width: 520px;
}

.auto-testimonials__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

.auto-testimonials__card {
  position: relative;
  border-radius: 1.25rem;
  padding: 24px;
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  overflow: hidden;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  background-size: cover;
  background-position: center;
}

.auto-testimonials__card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.65) 0%,
    rgba(0, 0, 0, 0.4) 45%,
    rgba(0, 0, 0, 0.6) 100%
  );
  z-index: 0;
}

.auto-testimonials__card > * {
  position: relative;
  z-index: 1;
}

.auto-testimonials__header {
  margin: 0 0 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  text-align: center;
}

.auto-testimonials__quote {
  font-family: Manrope, sans-serif;
  font-size: clamp(14px, 1.8vw, 16px);
  line-height: 1.55;
  color: #fff;
  margin: 0;
  flex: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.auto-testimonials__quote strong {
  font-weight: 800;
  color: #fff;
}

.auto-testimonials__company {
  display: block;
  font-family: "Bebas Neue", sans-serif;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: 0.03em;
  color: #fff;
  text-transform: uppercase;
  line-height: 1.1;
  text-align: center;
}

.auto-testimonials__role {
  display: block;
  font-family: Manrope, sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.85);
  margin-top: 4px;
  text-align: center;
}

/* Dance Place (background via data-bg-* + lazy-media.js) */
.auto-testimonials__card--danceplace {
  background-color: #6b2d4a;
  background-repeat: no-repeat;
}

.auto-testimonials__card--danceplace::before {
  background: linear-gradient(
    to bottom,
    rgba(60, 15, 45, 0.2) 0%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

.auto-testimonials__card--danceplace .auto-testimonials__corner-logo {
  width: auto;
  height: 72px;
  background: none;
  border-radius: 0;
  overflow: visible;
}

.auto-testimonials__card--danceplace .auto-testimonials__corner-logo img {
  width: auto;
  height: 100%;
  max-width: 48px;
  object-fit: contain;
  object-position: left top;
}

/* Suomen Koripalloliito */
.auto-testimonials__card--koripallo {
  background-color: #0d2137;
}

.auto-testimonials__card--koripallo::before {
  background: linear-gradient(
    to bottom,
    rgba(13, 33, 55, 0.35) 0%,
    rgba(0, 0, 0, 0.72) 100%
  );
}

.auto-testimonials__card--koripallo .auto-testimonials__corner-logo {
  width: calc(65px * 0.84);
  height: calc(65px * 0.84);
  background: none;
  border-radius: 0;
  overflow: visible;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auto-testimonials__card--koripallo .auto-testimonials__corner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center 50%;
  transform: translateY(2px);
}

/* Automated / AI agency (hero background via data-bg-* + lazy-media.js) */
.auto-testimonials__card--automated {
  background-color: #0a0101;
  background-repeat: no-repeat;
}

.auto-testimonials__card--automated::before {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.35) 0%,
    rgba(0, 0, 0, 0.65) 100%
  );
}

.auto-testimonials__card--automated .auto-testimonials__corner-logo {
  width: 56px;
  height: 56px;
  background: none;
  border-radius: 0;
  overflow: visible;
}

/* Daynite product card */
.auto-testimonials__card--daynite {
  background-color: hsl(222.2, 84%, 4.9%);
}

.auto-testimonials__card--daynite::before {
  background: rgba(0, 0, 0, 0.5);
}

.auto-testimonials__corner-logo {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 2;
  width: 56px;
  height: 56px;
  pointer-events: none;
  background: none;
  border: none;
  box-shadow: none;
  overflow: visible;
}

.auto-testimonials__corner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border: none;
  box-shadow: none;
}

/* Mobile carousel (swipe + dots + arrows; scrollbar hidden) */
@media (max-width: 900px) {
  .auto-testimonials {
    padding-inline: 0;
  }

  .auto-testimonials__subline {
    padding-inline: 16px;
  }

  .auto-testimonials__carousel {
    position: relative;
  }

  .auto-testimonials__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-inline: max(16px, calc((100% - min(88vw, 340px)) / 2));
    outline: none;
  }

  .auto-testimonials__viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .auto-testimonials__viewport:focus-visible {
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.35);
    border-radius: 1.25rem;
  }

  .auto-testimonials__grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 16px;
    margin: 0;
    padding: 4px max(16px, calc((100% - min(88vw, 340px)) / 2)) 8px;
  }

  .auto-testimonials__card {
    flex: 0 0 min(88vw, 340px);
    scroll-snap-align: center;
    scroll-snap-stop: always;
    min-height: 320px;
    transform: scale(0.94);
    opacity: 0.78;
    transition:
      transform 0.4s cubic-bezier(0.33, 1, 0.68, 1),
      opacity 0.4s ease,
      box-shadow 0.4s ease;
  }

  .auto-testimonials__card.is-active {
    transform: scale(1);
    opacity: 1;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55);
  }

  .auto-testimonials__dots {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    padding: 0 16px 8px;
  }

  .auto-testimonials__dot {
    display: block;
    flex-shrink: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.28);
    transition: background 0.25s ease, opacity 0.25s ease;
  }

  .auto-testimonials__dot.is-active {
    background: #fff;
    opacity: 1;
  }
}

@media (max-width: 900px) {
  @media (prefers-reduced-motion: reduce) {
    .auto-testimonials__viewport {
      scroll-behavior: auto;
    }

    .auto-testimonials__card {
      transition: none;
    }
  }
}

/* Desktop: hide carousel chrome */
@media (min-width: 901px) {
  .auto-testimonials__dots {
    display: none;
  }
}
