/* ================================================================
   Overflow marquee ("treadmill") — shared by the site and the admin.

   Usage: add data-marquee to any single-line text element.
   marquee.js measures it; only when the text is wider than its box
   does it add .mq--on and scroll it right → left in a seamless loop.
   Without JS the text simply ends in "…".
================================================================ */
[data-marquee] {
  display: block;
  min-width: 0;
  /* An 8px "runway" on the left, pulled back with a negative margin so
     the text stays exactly where it was. The left fade lives in this
     runway, so resting text is never dimmed. */
  --mq-pad: 8px;
  margin-left: calc(var(--mq-pad) * -1);
  padding-left: var(--mq-pad);
  max-width: calc(100% + var(--mq-pad));
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.mq--on {
  text-overflow: clip;
  /* soft fade at both edges so text never hard-clips */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 var(--mq-pad), #000 calc(100% - 28px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 var(--mq-pad), #000 calc(100% - 28px), transparent 100%);
}

.mq__track {
  display: inline-flex;
  vertical-align: top;
  will-change: transform;
}

.mq__copy {
  flex: none;
  white-space: nowrap;
}

.mq--on .mq__copy {
  padding-right: var(--mq-gap, 48px);
}

/* The track holds two identical copies; moving it exactly -50% lands
   copy 2 where copy 1 started, so the loop never jumps. */
.mq--on .mq__track {
  animation: bnMq var(--mq-dur, 12s) linear var(--mq-delay, 1.2s) infinite;
}

.mq--on:hover .mq__track,
.mq--paused .mq__track,
.mq--offscreen .mq__track {
  animation-play-state: paused;
}

@keyframes bnMq {
  from { transform: translate3d(0, 0, 0); }
  to   { transform: translate3d(-50%, 0, 0); }
}

/* Reduced motion: marquee.js keeps scrolling but at a slower speed. */
