/* gradjazza.org city pulse (shared widget) */

.gj-pulse {
  /* Inverted tape (light surface, dark text) */
  --gj-bg: rgba(255, 255, 255, 0.82);
  --gj-fg: rgba(12, 12, 16, 0.92);
  --gj-dim: rgba(24, 24, 32, 0.62);
  --gj-up: rgba(12, 122, 70, 0.98);
  --gj-down: rgba(170, 24, 40, 0.98);

  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  background: var(--gj-bg);
  color: var(--gj-fg);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.12);
  overflow: hidden;
  position: relative;
  display: block;
  width: 100%;
  min-height: 42px;
  line-height: 1.25;
}

/* When mounted inside the Flarum header, keep it on its own row */
.gj-pulse-wrap {
  width: 100%;
  clear: both;
  margin-top: 0.6rem;
  padding-bottom: 0.6rem;
}

/* Forum: mount above the fixed header */
.gj-pulse-wrap--above {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2000;
  margin: 0;
  padding: 0.5rem 0;
  background: transparent;
}

.gj-pulse-wrap--above .gj-pulse {
  border-radius: 18px;
}

.gj-pulse::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(420px 120px at 16% 50%, rgba(246, 200, 58, 0.18) 0%, rgba(246, 200, 58, 0) 70%),
    radial-gradient(520px 160px at 84% 50%, rgba(0, 0, 0, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  opacity: 0.9;
}

.gj-pulse-track {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  white-space: nowrap;
  font-feature-settings: "tnum" 1, "ss01" 1;
  font-variant-numeric: tabular-nums;
  position: relative;
}

.gj-pulse-seq {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
}

.gj-pulse.is-animated .gj-pulse-track {
  will-change: transform;
  animation: gjTicker 42s linear infinite;
}

.gj-pulse:hover .gj-pulse-track {
  animation-play-state: paused;
}

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

.gj-pulse-item {
  display: inline-flex;
  align-items: baseline;
  gap: 0.55rem;
  padding: 0.2rem 0.1rem;
}

.gj-pulse-city {
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.84rem;
}

.gj-pulse-dot {
  opacity: 0.38;
}

.gj-pulse-kv {
  font-size: 0.92rem;
  opacity: 0.92;
}

.gj-pulse-kv b {
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.76rem;
  opacity: 0.9;
}

.gj-pulse-chg {
  font-weight: 750;
}

.gj-pulse-chg.up {
  color: var(--gj-up);
}

.gj-pulse-chg.down {
  color: var(--gj-down);
}

.gj-pulse-chg.flat {
  color: rgba(24, 24, 32, 0.62);
}

.gj-pulse-blip {
  opacity: 0.78;
  max-width: 44ch;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gj-pulse-note {
  opacity: 0.8;
  color: var(--gj-dim);
}

@media (prefers-reduced-motion: reduce) {
  .gj-pulse.is-animated .gj-pulse-track {
    animation: none;
  }
  .gj-pulse {
    overflow-x: auto;
  }
  .gj-pulse-track {
    width: max-content;
  }
}

@media (max-width: 600px) {
  .gj-pulse-track {
    padding: 0.6rem 0.7rem;
  }
  .gj-pulse-blip {
    max-width: 28ch;
  }
}
