/*
 * .logo-strip — client logos on white tiles (template-parts/global/logo-strip.php).
 * Figma: Story D 337:13610 / M 337:13801.
 *
 * The row scrolls in a loop: the track holds the list twice and moves by
 * half its width. A list of few logos repeats them (--repeat), so it is
 * always wider than the strip. --few (up to six logos) stands still on wide screens.
 * Reduced motion: no scrolling, the logos wrap into rows.
 */

.logo-strip {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 2.2778rem + 0.9479vw, 3.125rem);
}

/* .logo-strip__title — 23/120 % → 140 %, trimmed to cap / baseline (Figma 1574:14779 / 1574:14468) */
.logo-strip__title {
  margin-top: -0.24em;
  margin-bottom: -0.24em;
  font-size: 1.4375rem;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-align: center;

  /* @media (width >= 48em) .logo-strip__title */
  @media (width >= 48em) {
    margin-top: -0.34em;
    margin-bottom: -0.34em;
    line-height: 1.4;
  }
}

/* .logo-strip__viewport — bleeds to the screen edge on phones */
.logo-strip__viewport {
  margin-inline: -1.25rem;
  overflow: hidden;
}

/* .logo-strip__track */
.logo-strip__track {
  display: flex;
  width: max-content;
  animation: logo-strip-scroll 40s linear infinite;
}

/* .logo-strip__list — gap repeated after the last tile keeps the loop seamless */
.logo-strip__list {
  display: flex;
  gap: clamp(0.625rem, 0.4028rem + 0.9479vw, 1.25rem);
  padding-right: clamp(0.625rem, 0.4028rem + 0.9479vw, 1.25rem);
}

/* .logo-strip__item — 105 × 40 → 216 × 80 */
.logo-strip__item {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: clamp(6.5625rem, 4.0966rem + 10.5213vw, 13.5rem);
  height: clamp(2.5rem, 1.6114rem + 3.7915vw, 5rem);
  border-radius: 0.5rem;
  background-color: var(--nv-white);
}

/* .logo-strip__image */
.logo-strip__image {
  max-width: 80%;
  max-height: 70%;
  width: auto;
  height: auto;
  object-fit: contain;
}

/* .logo-strip--few — one still row from 1430 px */
.logo-strip--few {
  /* @media (width >= 89.375em) .logo-strip--few */
  @media (width >= 89.375em) {
    & .logo-strip__viewport {
      margin-inline: 0;
    }

    & .logo-strip__track {
      justify-content: center;
      width: auto;
      animation: none;
    }

    & .logo-strip__list {
      padding-right: 0;
    }

    & .logo-strip__list[aria-hidden="true"],
    & .logo-strip__item--repeat {
      display: none;
    }
  }
}

/* @media (hover: hover) .logo-strip__viewport:hover — pause */
@media (hover: hover) and (pointer: fine) {
  .logo-strip__viewport:hover .logo-strip__track {
    animation-play-state: paused;
  }
}

/* @media (prefers-reduced-motion: reduce) .logo-strip — still rows */
@media (prefers-reduced-motion: reduce) {
  .logo-strip__viewport {
    margin-inline: 0;
  }

  .logo-strip__track {
    width: auto;
    animation: none;
  }

  .logo-strip__list {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding-right: 0;
  }

  .logo-strip__list[aria-hidden="true"],
  .logo-strip__item--repeat {
    display: none;
  }
}

@keyframes logo-strip-scroll {
  to {
    transform: translateX(-50%);
  }
}
