/* Scrolling "Trusted by" strip, shared by the home and AI pages */

.logo-strip {
  padding: 3.5rem 0 4rem;
  overflow: hidden;
}

.logo-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;

  & h2 {
    margin: 0;
    color: var(--burgundy);
  }
}

button.logo-marquee-toggle {
  padding: 0.25rem 1rem;
  font: inherit;
  color: var(--burgundy);
  background: transparent;
  border: 1px solid currentColor;
  cursor: pointer;
}

.logo-marquee {
  display: flex;
  width: 100%;
  /* the mask isolates this box, so the logos' multiply blend needs a backdrop
     inside it to hide their white backgrounds */
  background: var(--off-white);
  /* fade the logos in and out at the edges */
  mask-image: linear-gradient(to right, transparent, #000 8%, #000 92%, transparent);
}

.logo-track {
  display: flex;
  flex-shrink: 0;
  gap: 3rem;
  margin: 0;
  padding: 0 3rem 0 0;
  list-style: none;

  & li {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 140px;
    height: 140px;
    max-width: none;
    margin: 0;
    padding: 0.5rem;
  }

  & img {
    max-width: 100%;
    max-height: 100%;
    /* some logo files have a white background; blend it into the page */
    mix-blend-mode: multiply;
  }
}

/* only animate once JavaScript has set up the pause button; without it the logos sit still */
@media (prefers-reduced-motion: no-preference) {
  .logo-marquee.is-ready .logo-track {
    animation: logo-scroll 110s linear infinite;
  }
}

.logo-marquee:not(.is-ready) {
  mask-image: none;

  & .logo-track {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
  }

  & .logo-track[aria-hidden="true"] {
    display: none;
  }
}

.logo-marquee:hover .logo-track,
.logo-marquee:focus-within .logo-track,
.logo-marquee.is-paused .logo-track {
  animation-play-state: paused;
}

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

@media (prefers-reduced-motion: reduce) {
  .logo-marquee {
    mask-image: none;
  }

  .logo-track {
    animation: none;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
  }

  .logo-track[aria-hidden="true"],
  button.logo-marquee-toggle {
    display: none;
  }
}
