/* The Board.
 * ---------------------------------------------------------------------------
 * The exchange half. Same tokens, same type, same trust vocabulary as the rest
 * of the site - this is a second room in the same building, not a second site.
 *
 * The one new idea: direction has a colour AND a glyph (▲ ▼ ▬). Red/green alone
 * is the oldest accessibility failure in finance, and roughly one man in twelve
 * cannot read it. The glyph survives greyscale, forced colours and a photocopy.
 */

/* The masthead nav used to live here. It moved to styles.css, where the cellar
   can see it too - this file is loaded by two pages of the three, and the bar
   is on all of them. */

/* ================================ THE INDEX =============================== */
.idx { margin: 22px 0 10px; }
.idx-name {
  font-family: var(--font-display); font-size: clamp(1.5rem, 5.4vw, 2.125rem);
  line-height: 1; letter-spacing: .02em; color: var(--ink); font-weight: 400;
}
.idx-sub { color: var(--ink-soft); font-size: 0.78125rem; margin-top: 6px; max-width: 52ch; }

.idx-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap; margin: 18px 0 10px;
}
.idx-fig { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; }
.idx-now {
  font-family: var(--font-fig-lg); font-variant-numeric: tabular-nums lining-nums;
  font-size: clamp(2.75rem, 11vw, 4rem); font-weight: 700; color: var(--gold);
  line-height: .9; letter-spacing: .01em;
}
.idx-now .cur {
  font-family: var(--font-fig); font-size: .38em; font-weight: 500;
  color: var(--ink-soft); margin-right: 2px;
}
.idx-chg {
  font-family: var(--font-fig); font-variant-numeric: tabular-nums lining-nums;
  font-size: 1rem; font-weight: 500; white-space: nowrap;
}
.idx-pct { color: var(--ink-soft); font-size: .85em; }
.is-up { color: var(--coral); }      /* dearer is bad news for a drinker */
.is-down { color: var(--sea); }      /* cheaper is good news */
.is-flat { color: var(--ink-soft); }

.idx-meta {
  display: flex; flex-direction: column; gap: 3px; text-align: right;
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
  font-size: 0.75rem; color: var(--ink-soft);
}

.idx-chart {
  background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--r-object); padding: 12px 12px 8px; box-shadow: var(--lift);
}
.idx-svg { width: 100%; height: auto; display: block; overflow: visible; }
.idx-grid { stroke: var(--edge-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.idx-line {
  fill: none; stroke: var(--gold); stroke-width: 2.5;
  vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round;
}
.idx-area { fill: var(--gold-wash); stroke: none; }
.idx-dot { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.idx-axis {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-fig); font-size: 0.6875rem; color: var(--ink-soft);
}

/* ================================ MOVERS ================================== */
.movers { margin-top: 30px; }
.mover-cols { display: grid; gap: 14px; grid-template-columns: 1fr; margin-top: 10px; }
@media (min-width: 720px) { .mover-cols { grid-template-columns: 1fr 1fr; } }
.mover-col h3 {
  font-family: var(--font-fig); font-size: 0.6875rem; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-soft); margin-bottom: 9px;
}
.mover {
  display: grid; grid-template-columns: 3.5rem 1fr auto; gap: 11px; align-items: center;
  width: 100%; text-align: left; cursor: pointer; min-height: var(--tap);
  background: var(--surface); border: 1px solid var(--edge);
  border-radius: var(--r-control); padding: 9px 13px; margin-bottom: 6px;
  color: inherit; transition: border-color .14s ease, background .14s ease;
}
.mover:hover { border-color: var(--gold); background: var(--gold-wash); }
.mover-code {
  font-family: var(--font-fig); font-size: 0.75rem; font-weight: 600;
  letter-spacing: .06em; color: var(--gold);
}
.mover-main { min-width: 0; }
.mover-name {
  display: block; font-family: var(--font-display); font-size: 0.9375rem;
  line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mover-sub {
  display: block; font-family: var(--font-fig); font-size: 0.6875rem;
  color: var(--ink-soft); font-variant-numeric: tabular-nums;
}
.mover-chg {
  font-family: var(--font-fig); font-variant-numeric: tabular-nums;
  font-size: 0.8125rem; font-weight: 500; white-space: nowrap;
}

/* ================================ THE BOARD =============================== */
.board { margin-top: 32px; }
/* A wide table on a narrow phone scrolls inside its own box; the page never
   scrolls sideways. */
.board-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  border: 1px solid var(--edge); border-radius: var(--r-object);
  background: var(--surface);
}
.ticker { width: 100%; border-collapse: collapse; min-width: 560px; }
.ticker th, .ticker td { padding: 9px 12px; text-align: left; }
.ticker thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--sunk); border-bottom: 1px solid var(--edge);
}
.ticker th button {
  background: none; border: 0; padding: 4px 0; cursor: pointer;
  font: 500 0.6875rem/1 var(--font-fig); letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-soft); min-height: 32px;
}
.ticker th button:hover { color: var(--ink); }
.ticker th button.is-on { color: var(--gold); }
.ticker th button.is-on::after { content: " ↓"; }
.ticker th[aria-sort="ascending"] button.is-on::after { content: " ↑"; }

.ticker tbody tr {
  border-top: 1px solid var(--edge-soft); cursor: pointer;
  transition: background .12s ease;
}
.ticker tbody tr:hover { background: var(--gold-wash); }
.ticker tbody tr:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.num { text-align: right !important; font-variant-numeric: tabular-nums lining-nums; }

.tick-code {
  font-family: var(--font-fig); font-size: 0.75rem; font-weight: 600;
  letter-spacing: .06em; color: var(--gold); white-space: nowrap;
}
.tick-name span { display: block; font-size: 0.875rem; line-height: 1.25; }
.tick-name small { display: block; font-size: 0.6875rem; color: var(--ink-soft); }
.tick-seed { color: var(--coral); }
.tick-last {
  font-family: var(--font-fig-lg); font-size: 1.125rem; font-weight: 700; color: var(--gold);
}
.tick-last .cur { font-family: var(--font-fig); font-size: .6em; font-weight: 500; color: var(--ink-soft); }
.tick-chg { font-family: var(--font-fig); font-size: 0.8125rem; font-weight: 500; white-space: nowrap; }
.spark-col { width: 108px; }
.tick-spark { width: 100px; height: 28px; display: block; }
.tick-spark.is-up { color: var(--coral); }
.tick-spark.is-down { color: var(--sea); }
.spark-none { color: var(--ink-soft); }

/* $/std is the second-most useful column and the first to go when it won't fit. */
@media (max-width: 620px) {
  .sd-col { display: none; }
  .ticker { min-width: 460px; }
}

/* --------------------------------------------------------- the venue panel */
.vp-chart { width: 100%; height: auto; display: block; overflow: visible; }
.pt-real { fill: var(--gold); stroke: var(--bg); stroke-width: 2; }
.pt-seed { fill: var(--bg); stroke: var(--coral); stroke-width: 2; }
.vp-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.vp-table th {
  text-align: left; font: 500 0.6875rem/1 var(--font-fig);
  letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft);
  padding-bottom: 7px; border-bottom: 1px solid var(--edge);
}
.vp-table td {
  padding: 8px 0; font-size: 0.8125rem; border-bottom: 1px solid var(--edge-soft);
  font-variant-numeric: tabular-nums lining-nums;
}

/* ------------------------------------------------------------ forced colours */
@media (forced-colors: active) {
  .idx-line, .tick-spark { color: CanvasText; stroke: CanvasText; }
  .idx-area { fill: Canvas; }
  .idx-dot, .pt-real { fill: CanvasText; }
  .pt-seed { fill: Canvas; stroke: CanvasText; }
  .idx-grid { stroke: CanvasText; }
  /* Colour is gone entirely here, which is exactly why direction also has a
     glyph. Nothing below depends on hue to be readable. */
  .is-up, .is-down, .is-flat { color: CanvasText; }
  .mover, .board-scroll { border: 1px solid CanvasText; }
}

@media (prefers-reduced-motion: reduce) {
  .mover, .ticker tbody tr { transition: none; }
}

/* Axis labels. The chart does not start at zero — on a $2 range across 18
   months a zero baseline flattens the line to a straight edge — so the range
   is stated rather than left to be inferred from a filled area. */
.idx-ylab {
  font-family: var(--font-fig); font-size: 10px;
  font-variant-numeric: tabular-nums lining-nums;
  fill: var(--ink-soft);
}
.idx-zero { color: var(--ink-soft); font-style: italic; }
@media (max-width: 520px) {
  /* No room for the aside between two dates; the axis labels still carry it. */
  .idx-zero { display: none; }
}
@media (forced-colors: active) { .idx-ylab { fill: CanvasText; } }
