/* ===================================================================
   Market movers board

   Colour note. Every other part of the page reserves amber for "sources
   disagreed". Finance convention needs a colour for losses, so losses get
   a cool-leaning rose (hue ~345°) — well clear of the amber at ~40°.
   Direction is always also carried by ▲/▼ and the sign, so nothing here
   depends on telling red from green.
   =================================================================== */

:root { --up: #13795A; --down: #B3345F; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --up: #4FD9A0; --down: #F27C9F; }
}
:root[data-theme="dark"] { --up: #4FD9A0; --down: #F27C9F; }

.movers {
  margin: clamp(2.5rem, 6vh, 4rem) 0 clamp(3rem, 7vh, 4.5rem);
  padding-top: 2rem;
  border-top: 1px solid var(--hairline);
}

.movers-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  margin-bottom: 1.75rem;
}

.movers-kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 0.5rem;
}

.movers-head h2 {
  font-family: Newsreader, Georgia, serif;
  font-weight: 400;
  font-size: var(--step-2);
  line-height: 1.08;
  letter-spacing: -0.025em;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}

.movers-prov {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  line-height: 1.6;
  color: var(--ink-3);
  text-align: right;
  margin: 0;
  white-space: nowrap;
}

.movers-prov b { color: var(--ink-2); font-weight: 500; }

/* --- three columns on wide screens, stacked on narrow --------------- */

.movers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(19rem, 1fr));
  gap: 1.25rem clamp(1.5rem, 3vw, 2.75rem);
}

.mv-col-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  margin: 0 0 0.25rem;
  padding-bottom: 0.625rem;
  border-bottom: 1px solid var(--hairline);
}

.mv-col[data-dir="up"]    .mv-glyph { color: var(--up); }
.mv-col[data-dir="down"]  .mv-glyph { color: var(--down); }
.mv-col[data-dir="mixed"] .mv-glyph { color: var(--ink-3); }

.mv-count {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-3);
  margin-left: auto;
}

.mv-list { list-style: none; margin: 0; padding: 0; }

.mv-row {
  position: relative;
  padding: 0.875rem 0 0.9rem;
  border-bottom: 1px solid var(--hairline);
}

.mv-line {
  display: grid;
  grid-template-columns: 3.75rem minmax(0, 1fr) auto auto;
  align-items: baseline;
  gap: 0.75rem;
}

.mv-sym {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.mv-name {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.8125rem;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mv-price {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  color: var(--ink-2);
  text-align: right;
}

.mv-chg {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  min-width: 5.25rem;
  text-align: right;
  padding: 0.15rem 0.45rem;
  border-radius: 2px;
}

.is-up   .mv-chg { color: var(--up);   background: color-mix(in srgb, var(--up) 13%, transparent); }
.is-down .mv-chg { color: var(--down); background: color-mix(in srgb, var(--down) 13%, transparent); }

/* magnitude bar — length relative to the biggest move in the column */
.mv-bar {
  display: block;
  height: 2px;
  margin-top: 0.6rem;
  width: calc(var(--m, 0) * 100%);
  border-radius: 1px;
  transform-origin: 0 50%;
  transition: transform 0.8s var(--ease);
}

.is-up   .mv-bar { background: color-mix(in srgb, var(--up) 55%, transparent); }
.is-down .mv-bar { background: color-mix(in srgb, var(--down) 55%, transparent); }

.movers:not(.lit) .mv-bar { transform: scaleX(0); }

.mv-why {
  font-family: Newsreader, Georgia, serif;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--ink-2);
  margin: 0.55rem 0 0;
}

.mv-why.none {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.75rem;
  font-style: italic;
  color: var(--ink-3);
}

.mv-src { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.5rem 0 0; }

.mv-src a {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.6875rem;
  font-weight: 500;
  color: var(--ink-3);
  text-decoration: none;
  padding: 0.15rem 0.45rem;
  border: 1px solid var(--hairline);
  border-radius: 2px;
}

.mv-src a:hover { color: var(--ink); border-color: var(--ink-3); }

.mv-row:hover { background: linear-gradient(to right,
  color-mix(in srgb, var(--ink) 3%, transparent), transparent); }

.movers-note {
  font-family: 'Schibsted Grotesk', system-ui, sans-serif;
  font-size: 0.75rem;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 60ch;
  margin: 1.5rem 0 0;
}

/* compact mode: drop explanations, keep the numbers */
.compact .mv-why, .compact .mv-src, .compact .movers-note { display: none; }
.compact .mv-row { padding: 0.5rem 0 0.55rem; }

@media (max-width: 40rem) {
  .movers-head { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
  .movers-prov { text-align: left; }
  .mv-line { grid-template-columns: 3.25rem minmax(0, 1fr) auto; }
  .mv-price { display: none; }
}

@media (prefers-reduced-motion: reduce) { .mv-bar { transition: none; } }

@media print {
  .movers:not(.lit) .mv-bar { transform: none; }
  .mv-src a::after { content: " (" attr(href) ")"; font-size: 7pt; }
}
