/* =============================================================
   AICSS Project 1 — Homepage donation-activity ticker
   Sits inside the dark-forest .hero, directly below the hero
   copy + CTA row and above the curved .hero-bottom edge. Uses
   only existing design tokens (graphite band, hairline-dark
   borders, the single vivid-teal accent, Inter UI type).
   Markup: index.html  ·  Behaviour: js/donation-ticker.js
   Shows verified entries only; .is-empty = neutral static message.
   ============================================================= */

.donation-ticker {
  position: relative;
  z-index: 1;
  /* Occupies the space the hero grid already reserves under the CTA
     row, so the hero height and layout stay as approved. */
  margin-top: -64px;
  padding-bottom: 56px;
  font-family: var(--font-gt-standard-s);
  color: #fff;
}
.donation-ticker[hidden] { display: none; }

.donation-ticker .dt-shell {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 8px 8px 8px 14px;
  border: 1px solid var(--color-hairline-dark);
  border-radius: var(--radius-nav-pill, 999px);
  background: rgba(255, 255, 255, 0.05);
}

/* "Verified donations" label */
.donation-ticker .dt-label {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.72);
  white-space: nowrap;
}
.donation-ticker .dt-label::before {
  content: "";
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-vivid-teal);
  opacity: 0.85;
}
.donation-ticker .dt-label[hidden] { display: none; }

.donation-ticker .dt-viewport {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius-nav-pill, 999px);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 36px, #000 calc(100% - 36px), transparent 100%);
}

.donation-ticker .dt-track {
  display: flex;
  width: max-content;
  will-change: transform;
}
.donation-ticker.is-ready .dt-track {
  animation: dt-scroll var(--dt-duration, 30s) linear infinite;
}
.donation-ticker .dt-viewport:hover .dt-track,
.donation-ticker .dt-viewport:focus-within .dt-track { animation-play-state: paused; }

.donation-ticker .dt-list {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
  margin: 0;
  padding: 0 10px 0 0;   /* trailing gap equals item gap → seamless seam */
  list-style: none;
}

.donation-ticker .dt-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--color-hairline-dark);
  border-radius: var(--radius-nav-pill, 999px);
  background: rgba(13, 18, 18, 0.18);
  font-size: 13px;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.9);
  white-space: nowrap;
}
.donation-ticker .dt-icon { color: var(--color-vivid-teal); font-size: 13px; line-height: 1; }
.donation-ticker .dt-name { font-weight: 600; color: #fff; }
.donation-ticker .dt-amount { font-weight: 700; color: var(--color-vivid-teal); }

/* Neutral empty state: static text, no motion, no names or amounts. */
.donation-ticker .dt-empty {
  margin: 0;
  padding: 6px 12px;
  font-size: 12.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.78);
}
.donation-ticker.is-empty .dt-track { width: auto; animation: none !important; transform: none !important; }
.donation-ticker.is-empty .dt-label::before { background: rgba(255, 255, 255, 0.45); }
.donation-ticker.is-empty .dt-viewport { -webkit-mask-image: none; mask-image: none; }

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

/* Tablet / mobile: label sits above the strip so neither is cramped. */
@media (max-width: 760px) {
  .donation-ticker { margin-top: -40px; padding-bottom: 46px; }
  .donation-ticker .dt-shell {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px;
    border-radius: 20px;
  }
  .donation-ticker .dt-label { padding-left: 4px; }
  .donation-ticker .dt-item { font-size: 12.5px; padding: 6px 12px; }
}

/* Reduced motion: no scrolling. Show the entries once as a static,
   wrapping row; hide the duplicate copy and any loop-fill repeats. */
@media (prefers-reduced-motion: reduce) {
  .donation-ticker .dt-track,
  .donation-ticker.is-ready .dt-track { animation: none !important; transform: none !important; width: auto; }
  .donation-ticker .dt-viewport { -webkit-mask-image: none; mask-image: none; overflow: visible; }
  .donation-ticker .dt-clone,
  .donation-ticker .dt-item[aria-hidden="true"] { display: none !important; }
  .donation-ticker .dt-list { flex-wrap: wrap; flex: 1 1 auto; padding: 0; gap: 8px; }
}
