/**
 * @file
 * Sponsors (Figma: Sponsors, Sponsor Marquee, Sponsor Tile).
 *
 * The list is duplicated in the template; the track scrolls by one list
 * width and loops. Hovering pauses it (tile hover: primary/400 border +
 * Shadow/Medium).
 */

.sra-sponsors {
  background: var(--sra-gray-50);
}

.sra-sponsors .sra-section__header {
  margin-bottom: 32px;
}

.sra-sponsors__marquee {
  position: relative;
  overflow: hidden;
  /* Room for the tiles' hover shadow (Shadow/Medium), so the clipping edge
     does not cut it into a rectangle; the negative margins keep the layout. */
  margin: -20px 0 -40px;
  padding: 25px 0 44px;
}

.sra-sponsors__marquee::before,
.sra-sponsors__marquee::after {
  position: absolute;
  z-index: 1;
  top: 0;
  bottom: 0;
  width: 72px;
  content: "";
  pointer-events: none;
}

.sra-sponsors__marquee::before {
  left: 0;
  background: linear-gradient(to right, var(--sra-gray-50), rgba(248, 248, 240, 0));
}

.sra-sponsors__marquee::after {
  right: 0;
  background: linear-gradient(to left, var(--sra-gray-50), rgba(248, 248, 240, 0));
}

.sra-sponsors__track {
  display: flex;
  width: max-content;
  animation: sra-marquee 30s linear infinite;
}

/* Too few logos to scroll: a static row. */
.sra-sponsors__marquee.is-static::before,
.sra-sponsors__marquee.is-static::after {
  display: none;
}

.sra-sponsors__marquee.is-static {
  overflow: visible;
}

.sra-sponsors__marquee.is-static .sra-sponsors__track {
  width: auto;
  animation: none;
}

.sra-sponsors__marquee.is-static .sra-sponsors__list {
  flex-wrap: wrap;
  padding: 0;
}

.sra-sponsors__marquee:hover .sra-sponsors__track {
  animation-play-state: paused;
}

[dir="rtl"] .sra-sponsors__track {
  animation-name: sra-marquee-rtl;
}

@keyframes sra-marquee {
  to {
    transform: translateX(-50%);
  }
}

@keyframes sra-marquee-rtl {
  to {
    transform: translateX(50%);
  }
}

.sra-sponsors__list {
  display: flex;
  gap: 24px;
  margin: 0;
  padding: 0 12px;
  list-style: none;
}

.sra-sponsors__tile {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 232px;
  height: 112px;
  border: 1px solid var(--sra-gray-50);
  border-radius: var(--sra-radius-md);
  background: var(--sra-white);
  box-shadow: 0 0 4px rgba(2, 45, 48, 0.06), 0 0 1px rgba(2, 45, 48, 0.06);
  transition: border-color 0.25s, box-shadow 0.25s;
}

.sra-sponsors__tile:hover {
  border-color: var(--sra-primary-400);
  box-shadow: var(--sra-shadow-medium);
}

.sra-sponsors__tile img {
  display: block;
  width: 160px;
  height: 76px;
  object-fit: contain;
}

@media (prefers-reduced-motion: reduce) {
  .sra-sponsors__track {
    flex-wrap: wrap;
    width: auto;
    animation: none;
  }

  .sra-sponsors__list[aria-hidden="true"] {
    display: none;
  }

  .sra-sponsors__list {
    flex-wrap: wrap;
  }
}
