/* Logo rows marked with the vg-logos-defilants class (footer texts): they scroll on their own
   on phones. Larger screens keep the theme's centred row. */

/* Larger screens: the logos stay direct items of the theme's flex row */
.vg-logos-piste {
  display: contents;
}
.vg-logos-copie {
  display: none;
}

@media (max-width: 767px) {
  /* Less empty space around the logo block once the rows no longer stack */
  #custom-text {
    margin: 0;
    padding-top: 30px;
    padding-bottom: 10px;
  }
  #custom-text .vg-logos-defilants {
    display: block;
    overflow: hidden;
    /* Full screen width, whatever the paddings of the footer blocks */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
  }
  .vg-logos-piste {
    display: flex;
    align-items: center;
    width: max-content;
    animation: vg-logos-defile 20s linear infinite;
  }
  .vg-logos-defilants:hover .vg-logos-piste {
    animation-play-state: paused;
  }
  .vg-logos-piste > a,
  .vg-logos-copie > a {
    flex: none;
  }
  .vg-logos-piste img {
    flex: none;
    width: auto;
    max-width: none;
    height: 60px;
    margin: 0 20px;
  }
  .vg-logos-copie {
    display: contents;
  }
}

/* Half the track is the copy, so moving by half loops without a jump */
@keyframes vg-logos-defile {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .vg-logos-piste {
    flex-wrap: wrap;
    justify-content: center;
    width: auto;
    animation: none;
  }
  .vg-logos-copie {
    display: none;
  }
}
