/* ============================================================
   tw-fx-ticker.css — Sitewide top strip. Ambient diaspora infrastructure.
   Newsroom-native. Calm motion. Cream-compatible. Not fintech.
   2026-05-27.
   ============================================================ */

.tw-fx-ticker {
  position: relative;
  width: 100%;
  background: #f6efde;                 /* slightly warmer than --tw-cream so it reads as a band */
  border-bottom: 1px solid #e8dec3;
  border-top: 1px solid #e8dec3;
  font-family: 'Inter', system-ui, sans-serif;
  color: #2a2418;
  overflow: hidden;
  z-index: 50;
}

.tw-fx-ticker__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: stretch;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 38px;
}

/* ── Left label: "Corridors" with a calm pulse dot ────────── */
.tw-fx-ticker__label {
  display: flex;
  align-items: center;
  gap: .5rem;
  padding-right: 1rem;
  border-right: 1px solid #e0d4b5;
  text-decoration: none;
  color: inherit;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.tw-fx-ticker__label:hover { color: var(--tw-c-ocean, #1f6f8b); }
.tw-fx-ticker__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--tw-c-sunset, #e8773a);
  box-shadow: 0 0 0 0 rgba(232,119,58,.55);
  animation: tw-fx-pulse 2.8s ease-in-out infinite;
}
@keyframes tw-fx-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,119,58,.55); }
  50%      { box-shadow: 0 0 0 6px rgba(232,119,58,0); }
}

/* ── Centre track: the marquee. Two identical sequences flow end-to-end. ── */
.tw-fx-ticker__track {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  mask-image: linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 32px, black calc(100% - 32px), transparent 100%);
}
.tw-fx-ticker__seq {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 2.25rem;
  padding: 0 1.5rem;
  animation: tw-fx-scroll 72s linear infinite;
  will-change: transform;
}
@keyframes tw-fx-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
.tw-fx-ticker:hover .tw-fx-ticker__seq { animation-play-state: paused; }

/* ── Each pair: code · rate · change ────────────────────────── */
.tw-fx-pair {
  display: inline-flex;
  align-items: baseline;
  gap: .5rem;
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tw-fx-pair__code {
  font-weight: 700;
  letter-spacing: .04em;
  color: #2a2418;
}
.tw-fx-pair__rate {
  font-weight: 600;
  color: #1a1a1a;
}
.tw-fx-pair__chg {
  display: inline-flex;
  align-items: center;
  gap: .2rem;
  font-size: .76rem;
  font-weight: 600;
}
.tw-fx-pair__arrow { font-size: .6rem; line-height: 1; }

.tw-fx-pair--up   .tw-fx-pair__chg { color: var(--tw-up,   #2e8b57); }
.tw-fx-pair--down .tw-fx-pair__chg { color: var(--tw-down, #c84b4b); }
.tw-fx-pair--flat .tw-fx-pair__chg { color: var(--tw-flat, #888); }

/* ── Right CTA: into the remittance comparator ──────────────── */
.tw-fx-ticker__cta {
  display: flex;
  align-items: center;
  padding-left: 1rem;
  border-left: 1px solid #e0d4b5;
  text-decoration: none;
  color: #2a2418;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tw-fx-ticker__cta:hover { color: var(--tw-c-ocean, #1f6f8b); }

/* ── Mobile: preserve the ticker, simplify chrome ───────────── */
@media (max-width: 720px) {
  .tw-fx-ticker__inner {
    grid-template-columns: auto 1fr;
    padding: 0 .75rem;
    min-height: 34px;
  }
  .tw-fx-ticker__label {
    padding-right: .65rem;
    font-size: .65rem;
    letter-spacing: .12em;
  }
  .tw-fx-ticker__label-text { display: none; }   /* dot only on narrow */
  .tw-fx-ticker__seq {
    gap: 1.5rem;
    padding: 0 .85rem;
    animation-duration: 56s;
  }
  .tw-fx-pair { font-size: .78rem; gap: .35rem; }
  .tw-fx-pair__chg { font-size: .72rem; }
  .tw-fx-ticker__cta { display: none; }
}

/* ── Reduce motion: hide the marquee animation; show a static row ── */
@media (prefers-reduced-motion: reduce) {
  .tw-fx-ticker__seq { animation: none; }
  .tw-fx-ticker__track { overflow-x: auto; }
}
