/*
 * rml-marquee: the client logo strip (#11), drawn as the live "Logo Scroller"
 * (saved section 15618, after https://ryanmulligan.dev/blog/css-marquee/):
 * two copies of the list side by side, 1rem apart, each at least as wide as the
 * strip, sliding left by their own width in 40s (setting), linear and endless.
 * Logos at 85% of their natural width in 0.5rem/2rem cells, at half opacity,
 * full on hover. Measured on the live site at 1440, 1024 and 390px, 2026-11-21.
 *
 * Added for WCAG 2.2.2: a 25px pause/play button (bottom right). With
 * prefers-reduced-motion the logos do not move: one copy, wrapped and centred,
 * and no button.
 */

.rml-marquee {
  --_gap: 1rem;
  position: relative;
}

.rml-marquee__viewport {
  position: relative;
  display: flex;
  gap: var(--_gap);
  overflow: hidden;
  user-select: none;
}

.rml-marquee__list {
  display: flex;
  flex-shrink: 0;
  justify-content: space-around;
  gap: var(--_gap);
  min-width: 100%;
  margin: 0;
  padding: 0 0 0 40px;
  list-style: none;
  animation: rml-marquee-scroll var(--rml-marquee-duration, 40s) linear infinite;
}

.rml-marquee__item {
  flex: 0 0 auto;
  margin: auto;
  padding: 0.5rem 2rem;
  /* The page text the live cells inherit; it sets the line box under each logo. */
  font-family: var(--font-heading);
  font-size: 16px;
  line-height: 24px;
}

.rml-marquee__logo {
  /* Inline, as live: the line box under each logo is part of the cell height. */
  display: inline;
  width: 85%;
  height: auto;
  opacity: 0.5;
  transition: opacity 0.3s ease-in-out;
}

.rml-marquee__logo:hover {
  opacity: 1;
}

@keyframes rml-marquee-scroll {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(calc(-100% - var(--_gap)));
  }
}

.rml-marquee[data-pause-on-hover]:hover .rml-marquee__list,
.rml-marquee.is-paused .rml-marquee__list {
  animation-play-state: paused;
}

/* Pause / play */
.rml-marquee__toggle {
  position: absolute;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  width: 25px;
  height: 25px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--neutral-800);
  cursor: pointer;
}

.rml-marquee__toggle:focus-visible {
  outline: 2px solid var(--brand-primary);
  outline-offset: 2px;
}

.rml-marquee .rml-icon {
  display: block;
  width: 100%;
  height: 100%;
}

.rml-marquee__toggle .rml-icon--play,
.rml-marquee.is-paused .rml-marquee__toggle .rml-icon--pause {
  display: none;
}

.rml-marquee.is-paused .rml-marquee__toggle .rml-icon--play {
  display: block;
}

@media (prefers-reduced-motion: reduce) {
  .rml-marquee__list {
    flex-wrap: wrap;
    justify-content: center;
    flex-shrink: 1;
    padding: 0;
    animation: none;
  }

  .rml-marquee__list[aria-hidden="true"],
  .rml-marquee__toggle {
    display: none;
  }
}

/* Theme guard (#14, as #13). Hello Elementor's reset gives every button a pink
   background and white text on :hover and :focus ([type=button]:hover,
   specificity 0,2,0). These rules (html button[type]:where(...), 0,2,2 and up)
   beat it and restate this element's own state colours. */
html button[type]:where(.rml-marquee__toggle):is(:hover, :focus) {
  background-color: transparent;
  color: var(--neutral-800);
}
