/* Client logo carousel: one row, endless right-to-left scroll under the "Přes 10 let zkušeností" heading.
   The #ajax-content-wrap prefix and !important are needed because the theme forces
   `display: inline-block` / `display: block !important; margin: 0 !important` on lists inside
   `.centered-text` columns (style.css, responsive.css). */
#ajax-content-wrap .fl-marquee {
  --fl-w: clamp(110px, 13.3vw, 192px);
  --fl-gap: clamp(8px, 1vw, 16px);
  display: block !important;
  /* the heading row has 25vw side padding; break out of it */
  margin: 1.4em -20vw 0 !important;
  padding: 1.2em 0;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 9%, #000 91%, transparent);
}

#ajax-content-wrap .fl-track {
  display: flex !important;
  width: max-content;
  margin: 0 !important;
  padding: 0;
  list-style: none;
}

#ajax-content-wrap .fl-track .fl-tile {
  flex: 0 0 auto;
  width: calc(var(--fl-w) + var(--fl-gap));
  margin: 0;
  padding: 0 var(--fl-gap) 0 0;
  list-style: none;
}

.fl-card {
  display: block;
  aspect-ratio: 4 / 3;
  border-radius: clamp(10px, 1.1vw, 16px);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(45, 24, 84, .10);
  box-shadow: 0 2px 4px rgba(45, 24, 84, .04), 0 8px 22px rgba(45, 24, 84, .08);
  transition: scale .4s cubic-bezier(.2, .9, .3, 1.3), box-shadow .4s ease;
}

.fl-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* muted by default so mismatched brand colours sit calmly next to the purple palette */
  filter: grayscale(1);
  opacity: .8;
  transition: filter .4s ease, opacity .4s ease;
}

.fl-tile:hover .fl-card {
  scale: 1.07;
  box-shadow: 0 4px 8px rgba(126, 34, 206, .10), 0 16px 36px rgba(126, 34, 206, .22);
}

.fl-tile:hover img {
  filter: none;
  opacity: 1;
}

/* Without JS (or with reduced motion) the row is a plain swipeable strip. */
#ajax-content-wrap .fl-marquee {
  overflow-x: auto;
  scrollbar-width: none;
}

#ajax-content-wrap .fl-marquee::-webkit-scrollbar {
  display: none;
}

/* Animated state only exists once the script has cloned the logos for a seamless loop. */
#ajax-content-wrap .fl-marquee.fl-ready {
  overflow: hidden;
  opacity: 0;
  translate: 0 28px;
  transition: opacity .8s ease, translate .9s cubic-bezier(.2, .9, .3, 1.1);
}

#ajax-content-wrap .fl-marquee.fl-ready.is-in {
  opacity: 1;
  translate: 0 0;
}

.fl-ready .fl-track {
  animation: fl-scroll 40s linear infinite;
  animation-play-state: paused;
}

.fl-ready.is-in .fl-track {
  animation-play-state: running;
}

.fl-ready:hover .fl-track,
.fl-ready.is-paused .fl-track {
  animation-play-state: paused;
}

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

@media only screen and (max-width: 690px) {
  #ajax-content-wrap .fl-marquee {
    margin-inline: -15vw !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #ajax-content-wrap .fl-marquee.fl-ready {
    opacity: 1;
    translate: none;
    transition: none;
  }
  .fl-ready .fl-track {
    animation: none;
  }
}
