/* The Woe Street Stock Exchange: the financial pages, in the journal's paper and ink. */
:root {
  --wsx-up: #2f6b3a;
  --wsx-down: #9b2c2c;
  --wsx-flat: #625a48;
  --wsx-figures: "Source Serif 4", Georgia, serif;
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  padding: 20px 0 0;
  background: #c6a464 url("images/testbg2.jpg") center/cover no-repeat fixed;
  color: #111;
  font-family: Georgia, serif;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 100vh;
}
.login-strip { width: 100%; background: #111; color: #fffef9; font-size: 15px; letter-spacing: .3px; display: flex; justify-content: space-between; align-items: center; padding: 8px 20px; position: fixed; top: 0; left: 0; z-index: 999; }
.login-strip a { color: #fffef9; text-decoration: underline; cursor: pointer; }
body.has-login-strip { padding-top: 44px; }
nav { margin-top: 6px; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; font-size: 18px; letter-spacing: .5px; margin-bottom: 30px; padding: 0 16px; }
nav a { text-decoration: none; color: #111; font-weight: 500; }
nav a:hover { text-decoration: underline; }
.footer-container { margin: 20px 0 40px; width: 100%; text-align: center; }
.footer-text { font-size: 14px; letter-spacing: 1px; }

.exchange { width: min(1040px, calc(100% - 32px)); padding: 32px clamp(16px, 4vw, 44px) 40px; margin-bottom: 40px; color: var(--journal-ink); }
.exchange a { color: inherit; }
.figures, .exchange table td.num, .stat-value { font-family: var(--wsx-figures); font-variant-numeric: tabular-nums lining-nums; }

/* Header */
.exchange-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; border-bottom: 3px double var(--journal-ink); padding-bottom: 14px; }
.exchange-head .eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .25em; text-transform: uppercase; color: var(--journal-muted); }
.exchange-head h1 { font-family: "Playfair Display", Georgia, serif; font-weight: 600; font-size: clamp(30px, 5vw, 46px); line-height: 1.1; margin: 0; }
.session { flex: none; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; border: 1px solid var(--journal-ink); padding: 6px 10px; white-space: nowrap; }
.session::before { content: "●"; margin-right: 6px; color: var(--wsx-flat); }
.session.open::before { color: var(--wsx-up); }
.disclaimer { margin: 10px 0 0; font-size: 14px; font-style: italic; color: var(--journal-muted); }

/* Ticker tape */
.tape { display: flex; gap: 22px; overflow-x: auto; padding: 10px 2px; margin: 14px 0 0; border-bottom: 1px solid var(--journal-rule); scrollbar-width: thin; }
.tape a { flex: none; text-decoration: none; font-size: 14px; white-space: nowrap; }
.tape b { letter-spacing: .06em; margin-right: 6px; }

.up { color: var(--wsx-up); }
.down { color: var(--wsx-down); }
.flat { color: var(--wsx-flat); }

/* Period switches */
.periods { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.periods button { font: 13px/1 Georgia, serif; letter-spacing: .08em; padding: 8px 12px; min-height: 36px; min-width: 44px; border: 1px solid transparent; background: none; color: var(--journal-ink); border-radius: 999px; cursor: pointer; }
.periods button[aria-pressed="true"] { background: var(--journal-ink); color: #f4ead2; }
.periods button:focus-visible { outline: 2px solid #315c9b; outline-offset: 2px; }

.section-bar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 34px 0 12px; border-bottom: 1px solid var(--journal-ink); padding-bottom: 6px; }
.section-bar h2 { font-family: "Playfair Display", Georgia, serif; font-weight: 600; font-size: 24px; margin: 0; }

/* Index cards */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.stat { background: #f6eedb; border: 1px solid var(--journal-rule); padding: 14px 16px; min-width: 0; }
.stat-label { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--journal-muted); margin: 0 0 6px; }
.stat-value { font-size: clamp(26px, 4vw, 36px); line-height: 1.1; margin: 0; overflow-wrap: anywhere; }
.stat-value.words { font-family: "Playfair Display", Georgia, serif; font-size: clamp(22px, 3vw, 28px); }
.stat-note { font-size: 14px; margin: 6px 0 0; }

/* Charts */
.chart-wrap { background: #f6eedb; border: 1px solid var(--journal-rule); padding: 10px 8px 4px; }
.wsx-chart { display: block; width: 100%; height: auto; }
.wsx-chart .grid line { stroke: var(--journal-rule); stroke-width: 1; }
.wsx-chart text { font: 12px var(--wsx-figures); fill: var(--journal-muted); font-variant-numeric: tabular-nums; }
.wsx-chart .line { fill: none; stroke-width: 2.5; stroke-linejoin: round; }
.wsx-chart .area { opacity: .12; }
.wsx-chart .dots circle { stroke: #f6eedb; stroke-width: 1.5; }
.wsx-chart.down .line { stroke: var(--wsx-down); } .wsx-chart.down .area, .wsx-chart.down circle { fill: var(--wsx-down); }
.wsx-chart.up .line { stroke: var(--wsx-up); } .wsx-chart.up .area, .wsx-chart.up circle { fill: var(--wsx-up); }
.wsx-chart.flat .line { stroke: var(--journal-ink); } .wsx-chart.flat .area, .wsx-chart.flat circle { fill: var(--journal-ink); }
.chart-empty { text-align: center; font-style: italic; color: var(--journal-muted); padding: 40px 0; }
.spark { display: block; }
.spark polyline { fill: none; stroke: var(--wsx-flat); stroke-width: 1.5; }
.spark circle { fill: var(--wsx-flat); }
.spark.up polyline { stroke: var(--wsx-up); } .spark.down polyline { stroke: var(--wsx-down); }

/* Woeltaire's bulletin */
.bulletin { background: #fbf6ea; border: 1px solid var(--journal-ink); box-shadow: 3px 3px 0 var(--journal-ink); padding: 18px 22px; margin-top: 34px; }
.bulletin h2 { font-family: "Playfair Display", Georgia, serif; font-size: 20px; margin: 0 0 2px; }
.bulletin .dateline { font-size: 12px; letter-spacing: .15em; text-transform: uppercase; color: var(--journal-muted); margin: 0 0 10px; }
.bulletin-body { font-size: 17px; line-height: 1.6; }
.bulletin-body p { margin: 0 0 12px; }
.bulletin-lede { font-family: "Playfair Display", Georgia, serif; font-size: 21px; line-height: 1.4; border-bottom: 1px solid var(--journal-rule); padding-bottom: 12px; }
.bulletin-para { font-style: italic; }
.ticker-mention { font-style: normal; letter-spacing: .05em; font-family: var(--wsx-figures); }
.period-note { margin: -4px 0 10px; font-size: 14px; font-style: italic; color: var(--journal-muted); }

/* The special bulletin: a front-page banner for a historic day on the index. */
.special-bulletin { margin: 24px 0 8px; padding: 0 20px; background: #fbf6ea; border: 1px solid var(--journal-ink); text-align: center; }
.special-kicker, .special-foot { margin: 0; padding: 10px 0; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; }
.special-kicker { border-bottom: 1px solid var(--journal-rule); }
.special-foot { border-top: 1px solid var(--journal-rule); }
.special-bulletin h2 { font-family: "Playfair Display", Georgia, serif; font-size: clamp(24px, 4.5vw, 36px); text-transform: uppercase; letter-spacing: .04em; margin: 16px 0 6px; line-height: 1.15; }
.special-bulletin[data-kind="calm"] h2 { color: var(--wsx-up); }
.special-bulletin[data-kind="record"] h2, .special-bulletin[data-kind="melodrama"] h2 { color: var(--wsx-down); }
.special-deck { margin: 0 auto 16px; max-width: 60ch; font-style: italic; line-height: 1.5; }
.bulletin .signature { text-align: right; margin: 8px 0 0; }

/* Tables */
.movers { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; }
.wsx-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.wsx-table th { font-size: 11px; font-weight: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--journal-muted); text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--journal-ink); }
.wsx-table td { padding: 9px 8px; border-bottom: 1px solid var(--journal-rule); vertical-align: middle; }
.wsx-table th.num, .wsx-table td.num { text-align: right; white-space: nowrap; }
.wsx-table .ticker { font-weight: bold; letter-spacing: .06em; text-decoration: none; }
.wsx-table .ticker:hover, .wsx-table .ticker:focus-visible { text-decoration: underline; }
.wsx-table .woe-name { display: block; font-size: 13px; color: var(--journal-muted); max-width: 32ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-row td { text-align: center; font-style: italic; color: var(--journal-muted); padding: 18px 8px; }

.filters { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: end; margin-bottom: 8px; }
.filters label { display: grid; gap: 4px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; color: var(--journal-muted); }
.filters select { font: 15px Georgia, serif; padding: 8px 10px; min-height: 40px; border: 1px solid var(--journal-rule); background: #fbf6ea; color: var(--journal-ink); }

.methodology { margin-top: 34px; border-top: 1px solid var(--journal-rule); padding-top: 12px; }
.methodology summary { cursor: pointer; font-family: "Playfair Display", Georgia, serif; font-size: 20px; padding: 6px 0; }
.methodology p, .methodology li { line-height: 1.6; }
.methodology code { font-family: var(--wsx-figures); font-size: 15px; background: #f6eedb; padding: 2px 6px; }
.status-line { font-style: italic; color: var(--journal-muted); }

/* Quote page */
.quote-head .ticker-symbol { font-family: var(--wsx-figures); font-size: 14px; letter-spacing: .25em; margin: 0 0 4px; }
/* Room for the headline's descenders above the byline. */
.quote-head h1 { line-height: 1.2; margin: 0 0 10px; overflow-wrap: anywhere; }
.quote-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; margin: 18px 0 4px; }
.quote-price .price { font-size: clamp(36px, 7vw, 54px); line-height: 1; }
.quote-price .move { font-size: 20px; }
.meta { color: var(--journal-muted); font-size: 15px; margin: 0; }
.breakdown td:first-child { width: 60%; }
.breakdown tr.total td { border-top: 2px solid var(--journal-ink); font-weight: bold; }
.tape-list { list-style: none; margin: 0; padding: 0; }
.tape-list li { display: grid; grid-template-columns: 9.5em 1fr auto; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--journal-rule); align-items: baseline; }
.tape-list + .meta { margin-top: 10px; font-size: 14px; font-style: italic; }
.tape-list time { font-size: 13px; color: var(--journal-muted); }
.read-link { display: inline-block; margin-top: 18px; font-size: 17px; }

@media (max-width: 760px) {
  .stats { grid-template-columns: 1fr; }
  .movers { grid-template-columns: 1fr; }
  .exchange-head { flex-direction: column; align-items: flex-start; }
  /* The full listings table reads as stacked rows on a phone. */
  .listings thead { display: none; }
  .listings tr { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "asset asset spark" "price change spark"; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--journal-rule); }
  .listings tr.empty-row { display: block; }
  .listings td { border: 0; padding: 0; min-width: 0; }
  .listings td.writer, .listings td.sector { display: none; }
  .listings td.asset { grid-area: asset; }
  .listings td.price { grid-area: price; text-align: left; }
  .listings td.change { grid-area: change; text-align: left; }
  .listings td.spark-cell { grid-area: spark; align-self: center; }
  /* Titles wrap rather than push the figures off a narrow sheet. */
  .wsx-table .woe-name { max-width: none; white-space: normal; overflow-wrap: anywhere; }
  .wsx-table th, .wsx-table td { padding-left: 4px; padding-right: 4px; }
  .wsx-chart text { font-size: 22px; }
  .tape-list li { grid-template-columns: 1fr auto; }
  .tape-list time { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  nav { gap: 8px 18px; margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) { .tape { scroll-behavior: auto; } }
