/* Unvarnish — Ticker (bandeau d'actualité)
   Full-width scrolling headlines injected under the header nav.
   Tokens (--unv-*) are dark-aware (flipped by unvarnish-dark.css). */

.unv-ticker{
  display:flex;
  align-items:stretch;
  width:100vw;
  /* flush against the nav (kill the theme's block-gap top margin) + full-bleed */
  margin:0 0 0 calc(50% - 50vw) !important;   /* relies on .wp-site-blocks{overflow-x:clip} */
  background:var(--unv-paper,#fff);
  border-bottom:1px solid var(--unv-line,#e6e6e6);
  overflow:hidden;
  font-size:.7rem;
  line-height:1;
}

/* scrolling viewport with soft edge fades */
.unv-ticker__viewport{
  position:relative;
  flex:1 1 auto;
  overflow:hidden;
  -webkit-mask-image:linear-gradient(90deg,transparent 0,#000 2.5rem,#000 calc(100% - 2.5rem),transparent 100%);
          mask-image:linear-gradient(90deg,transparent 0,#000 2.5rem,#000 calc(100% - 2.5rem),transparent 100%);
}
.unv-ticker__track{
  display:inline-flex;
  align-items:center;
  white-space:nowrap;
  will-change:transform;
  animation-name:unv-ticker-scroll;
  animation-timing-function:linear;
  animation-iteration-count:infinite;
  /* animation-duration is set inline (scales with content length) */
}
.unv-ticker__set{ display:inline-flex; align-items:center; }

.unv-ticker__item{
  position:relative;
  display:inline-block;
  padding:.7rem 0;
  margin:0 1.15rem;
  color:var(--unv-ink,#111);
  text-decoration:none;
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.04em;
}
/* red diamond separator before each headline */
.unv-ticker__item::before{
  content:"";
  position:absolute;
  left:-1.15rem;top:50%;
  width:.34rem;height:.34rem;
  transform:translate(-50%,-50%) rotate(45deg);
  background:var(--unv-red,#E2001A);
  opacity:.7;
}
.unv-ticker__item:hover,
.unv-ticker__item:focus-visible{
  color:var(--unv-red,#E2001A);
  text-decoration:underline;
  text-underline-offset:3px;
  outline:none;
}

/* pause so the reader can catch / click a headline */
.unv-ticker:hover .unv-ticker__track,
.unv-ticker:focus-within .unv-ticker__track{ animation-play-state:paused; }

@keyframes unv-ticker-scroll{
  from{ transform:translateX(0); }
  to  { transform:translateX(-50%); }   /* one full set (content duplicated ×2) */
}
/* accessibility: honour reduced-motion → no scroll, manual swipe, no duplicate */
@media (prefers-reduced-motion: reduce){
  .unv-ticker__track{ animation:none; }
  .unv-ticker__viewport{ overflow-x:auto; }
  .unv-ticker__set:nth-child(2){ display:none; }
}

@media (max-width:600px){
  .unv-ticker{ font-size:.7rem; }
  .unv-ticker__item{ margin:0 .9rem; }
}
