/* Brand Marquee — cwbrandmarquee
   Tout est préfixé cw-bm pour ne jamais entrer en conflit avec le thème. */

.cw-bm {
  --cw-bm-h: 60px;
  --cw-bm-gap: 2.25rem;
  margin: 2.5rem 0;
  clear: both;
}

.cw-bm--bg {
  background-color: var(--cw-bm-bg);
  padding: 1.75rem 0;
}

.cw-bm__title {
  text-align: center;
  margin-bottom: 1.25rem;
}

.cw-bm__viewport {
  position: relative;
  overflow: hidden;
  padding: 0.75rem 0;
  /* fondu sur les bords : fonctionne quelle que soit la couleur de fond */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}

.cw-bm__track {
  display: flex;
  width: max-content;
  animation: cw-bm-scroll var(--cw-bm-duration, 48s) linear infinite;
  will-change: transform;
}

.cw-bm--reverse .cw-bm__track {
  animation-direction: reverse;
}

.cw-bm__viewport:hover .cw-bm__track,
.cw-bm__viewport:focus-within .cw-bm__track {
  animation-play-state: paused;
}

.cw-bm__group {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cw-bm__item {
  flex: 0 0 auto;
  margin: 0;
  padding: 0 var(--cw-bm-gap);
  list-style: none;
}

.cw-bm__item::before,
.cw-bm__item::after {
  /* certains thèmes ajoutent des puces ou séparateurs aux li */
  content: none !important;
}

.cw-bm__link {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  text-decoration: none;
  border: 0;
}

.cw-bm__link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

.cw-bm__logo {
  display: block;
  height: var(--cw-bm-h);
  width: auto;
  max-width: calc(var(--cw-bm-h) * 2.8);
  max-height: none;
  margin: 0;
  object-fit: contain;
  transition: filter 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
}

/* Style « fondu » : le blanc des logos disparaît sur fond clair */
.cw-bm--blend .cw-bm__logo {
  mix-blend-mode: multiply;
}

/* Style « pastille » : tuile blanche, lisible sur fond sombre ou coloré */
.cw-bm--card {
  --cw-bm-gap: 0.75rem;
}

.cw-bm--card .cw-bm__link {
  background: #fff;
  padding: 0.75rem 1.25rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: box-shadow 0.25s ease;
}

.cw-bm--card .cw-bm__link:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

/* Niveaux de gris, couleurs au survol */
.cw-bm--gray .cw-bm__logo {
  filter: grayscale(1);
  opacity: 0.7;
}

.cw-bm__link:hover .cw-bm__logo,
.cw-bm__link:focus-visible .cw-bm__logo {
  filter: none;
  opacity: 1;
  transform: scale(1.06);
}

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

@media (max-width: 767px) {
  .cw-bm { margin: 1.75rem 0; --cw-bm-gap: 1.25rem; }
  .cw-bm--card { --cw-bm-gap: 0.5rem; }
  .cw-bm__logo { height: calc(var(--cw-bm-h) * 0.75); }
}

/* Visiteurs ayant désactivé les animations : liste fixe, défilable à la main */
@media (prefers-reduced-motion: reduce) {
  .cw-bm__viewport {
    overflow-x: auto;
    -webkit-mask-image: none;
            mask-image: none;
  }
  .cw-bm__track { animation: none; }
  .cw-bm__group[aria-hidden="true"] { display: none; }
}
