/* ==========================================================================
   Block: Logo Strip
   File:   css/blocks/logo-strip.css
   Markup: includes/blocks/logo-strip.php

   Continuously scrolling accreditation marquee sitting directly under the
   hero. The track travels -50%, so half of it must be at least viewport
   width or a gap opens at the end of each cycle - hence six copies.

   The band is cream rather than navy because these are third-party logos
   with their own baked-in white backgrounds - they cannot be recoloured.
   ========================================================================== */

.logo-strip {
  /* Wide logos are width-constrained and keep their current size; square
     artwork is height-constrained, so it needs a taller cap to match. */
  --ls-logo-height: 74px;
  --ls-square-height: 104px;
  --ls-item-width: 190px;
  --ls-gap: 64px;
  --ls-speed: 45s;

  width: 100%;
  margin: 0;
  padding: 0;
  background-color: var(--vir-white);
  border-top: 4px solid var(--vir-gold);
  border-bottom: 4px solid var(--vir-gold);
  box-sizing: border-box;
}

/* --- Viewport ------------------------------------------------------------ */

.logo-strip__viewport {
  position: relative;
  width: 100%;
  padding: 12px 0;
  overflow: hidden;
}

/* Soften both ends so logos enter and leave rather than being clipped. */
.logo-strip__viewport::before,
.logo-strip__viewport::after {
  content: "";
  position: absolute;
  top: 0;
  z-index: 2;
  width: 90px;
  height: 100%;
  pointer-events: none;
}

.logo-strip__viewport::before {
  left: 0;
  background: linear-gradient(to right, var(--vir-white), rgba(255, 255, 255, 0));
}

.logo-strip__viewport::after {
  right: 0;
  background: linear-gradient(to left, var(--vir-white), rgba(255, 255, 255, 0));
}

/* --- Track --------------------------------------------------------------- */

.logo-strip__track {
  display: flex;
  width: max-content;
  animation: logo-strip-scroll var(--ls-speed) linear infinite;
  will-change: transform;
}

.logo-strip__viewport:hover .logo-strip__track {
  animation-play-state: paused;
}

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

.logo-strip__set {
  display: flex;
  align-items: center;
  gap: var(--ls-gap);
  margin: 0;
  padding: 0 calc(var(--ls-gap) / 2);
  list-style: none;
}

.logo-strip__item {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--ls-item-width);
  width: var(--ls-item-width);
  height: var(--ls-square-height);
  margin: 0;
  padding: 0;
  font-size: 0;
  letter-spacing: normal;
}

.logo-strip__item img {
  display: block;
  max-width: 100%;
  max-height: var(--ls-logo-height);
  width: auto;
  height: auto;
  object-fit: contain;
  filter: saturate(0.2) opacity(0.75);
  transition: filter 0.4s ease;
}

.logo-strip__item img:hover {
  filter: saturate(1) opacity(1);
}

.logo-strip__item--square img {
  max-height: var(--ls-square-height);
}

/* --- Reduced motion: no travel, just a centred static row ---------------- */

@media (prefers-reduced-motion: reduce) {
  .logo-strip__track {
    animation: none;
    width: 100%;
    justify-content: center;
  }

  .logo-strip__set:not(:first-child) {
    display: none;
  }

  .logo-strip__set {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }
}

/* --- Responsive ---------------------------------------------------------- */

@media (max-width: 991px) {
  .logo-strip {
    --ls-logo-height: 62px;
    --ls-square-height: 88px;
    --ls-item-width: 150px;
    --ls-gap: 48px;
    --ls-speed: 34s;
  }

  .logo-strip__viewport {
    padding: 10px 0;
  }
}

@media (max-width: 575px) {
  .logo-strip {
    --ls-logo-height: 52px;
    --ls-square-height: 74px;
    --ls-item-width: 124px;
    --ls-gap: 36px;
    --ls-speed: 26s;
  }

  .logo-strip__viewport {
    padding: 8px 0;
  }

  .logo-strip__viewport::before,
  .logo-strip__viewport::after {
    width: 44px;
  }
}
