/* ============================ LONG/SHORT STRATEGY PAGE ===========================
   /long-short/<key> (templates/long_short/strategy.html). The hero, readout and chart
   are the home page's (theme.css, hero_growth.css); this file adds
   the charts drawn by static/js/long_short.js and the positions card. Tokens only, so it follows the theme.
   ============================================================================== */
/* No width of its own: the page is as wide as the home page, so the switch between them moves nothing. */

/* The sentence under the headline: the yearly return and how it compares, either way. */
.uf-ls .uz-hero .ls-lede { margin: 0 0 8px; max-width: 72ch; font-size: 14px; line-height: 1.45; color: var(--tx-2); }
.uf-ls .uz-hero .cta { margin-top: 14px; }

/* Where the growth chart's third line is the index of real funds, it has a colour of its own
   and a solid stroke: it is one of the lines the strategy is read against, not a faint reference. */
.uf-ls .uz-hero.is-peer .hg { --hg-ref: var(--ls-c); }
.uf-ls .uz-hero.is-peer .hg-ser .sw.is-ref { border-top-style: solid; }
.uf-ls .uz-hero.is-peer .hg-chart .hg-line.is-ref { stroke-dasharray: none; }
.uf-ls .uz-hero .fine a { color: inherit; text-decoration: underline; }

/* Cards: the .uf card header, with a real h2 in it. */
.uf-ls .card .ch { flex-wrap: wrap; gap: 4px 12px; }
.uf-ls .card .ch h2 { margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--tx); }

/* Tables: labels left, figures right in the mono face; the strategy on show is tinted. */
/* theme.css gives every .uf table a fixed layout; these size their columns to the figures and
   scroll sideways inside .table-responsive when a phone is too narrow for them. */
.uf-ls .ls-table { font-size: 13px; table-layout: auto; }
.uf-ls .ls-table th, .uf-ls .ls-table td { padding: 8px 10px; vertical-align: middle; white-space: nowrap; }
.uf-ls .ls-table thead th { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--tx-2); border-top: 0; }
.uf-ls .ls-table thead th:first-child { text-align: left; }
/* Row labels: theme.css styles every .uf th as a small right-aligned caps header. */
.uf-ls .ls-table tbody th { font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; text-align: left; color: var(--tx); }
.uf-ls .ls-table td, .uf-ls .ls-table thead th:not(:first-child) { text-align: right; }
.uf-ls .ls-table .is-on { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.uf-ls .ls-table thead .is-on { color: var(--brand); }
.uf-ls .ls-table .ls-todate { font-family: var(--font-ui); font-size: 11px; font-weight: 400; color: var(--tx-3); }

/* Positions: the period menu in the card header, then the book's caption. */
.uf-ls .ls-period { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.uf-ls .ls-period label { margin: 0; font-size: 12px; font-weight: 600; color: var(--tx-2); }
.uf-ls .ls-period select {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--tx);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
}
.uf-ls .ls-period select:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
.uf-ls .ls-bookcap { margin: 0 0 12px; font-size: 12.5px; color: var(--tx-2); }
.uf-ls .ls-bookbody { transition: opacity .12s; }
.uf-ls .ls-bookbody.is-loading { opacity: .45; }

/* A book: long and short side by side, one under the other on a phone. */
.uf-ls .ls-books { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.uf-ls .ls-book h3 { margin: 0 0 6px; font-size: 13.5px; font-weight: 700; color: var(--tx); }
.uf-ls .ls-book h3 .sub { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--tx-3); }
.uf-ls .ls-book.is-long h3 { color: var(--up); }
.uf-ls .ls-book.is-short h3 { color: var(--down); }
.uf-ls .ls-table .ls-co, .uf-ls .ls-table thead th.ls-co { text-align: left; white-space: normal; font-family: var(--font-ui); color: var(--tx-2); }
.uf-ls .ls-note { margin: 12px 0 0; font-size: 12px; color: var(--tx-3); }
@media (max-width: 760px) {
  .uf-ls .ls-books { grid-template-columns: 1fr; }
}

/* The Premium prompt in place of the book. No blurred stand-in rows: nothing is in the page. */
.uf-ls .ls-lock { max-width: 420px; margin: 6px auto; padding: 18px; text-align: center; border: 1px solid var(--line); border-radius: var(--radius); }
.uf-ls .ls-lock .lk { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--tx-2); }
.uf-ls .ls-lock p { margin: 8px 0 12px; font-size: 13px; color: var(--tx-2); }
.uf-ls .ls-lock .up,
.uf-ls .ls-lock .up.upgrade-sidebar-btn {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--brand) !important;
  border-radius: var(--radius-sm);
  background: var(--brand) !important;
  color: var(--on-brand) !important;
  font-size: 13px;
  font-weight: 700 !important;
  text-decoration: none;
}

/* The closing small print. */
.uf-ls .ls-fine { max-width: 96ch; margin: 4px 2px 0; font-size: 12px; line-height: 1.5; color: var(--tx-3); }

/* ---------------------------------- Charts ----------------------------------
   One colour per entity on every chart of the page: the strategy on show (brand), its benchmark
   (the theme's second series; amber in dark, as in the hero, because the dark second-series
   cyan sits too close to the brand blue), the long-only model in the muted text grey (present
   as a reference, behind the two it is read against), and the index of real funds in magenta.
   Checked for colour-blind separation and contrast on both surfaces. Up/down colours appear only where
   the colour means ahead or behind, and always beside a signed number. */
.uf-ls {
  --ls-a: var(--brand);
  --ls-b: var(--brand-2);
  --ls-ref: var(--tx-3);
  --ls-c: #a8327e;
}
:root[data-theme="dark"] .uf-ls { --ls-a: #6b8df2; --ls-b: #bf8730; --ls-c: #d862a9; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .uf-ls { --ls-a: #6b8df2; --ls-b: #bf8730; --ls-c: #d862a9; }
}

.uf-ls .lsc-title { margin: 0 0 6px; font-size: 13px; font-weight: 700; color: var(--tx); }
.uf-ls .lsc-title small { margin-left: 6px; font-size: 11.5px; font-weight: 400; color: var(--tx-3); }
.uf-ls .lsc + .lsc-title, .uf-ls .lsc + .ls-figures { margin-top: 22px; }

/* Legend and tooltip keys: a block for columns, a stroke for lines. Names stay in text colours. */
.uf-ls .lsc-legend { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 6px; font-size: 12px; color: var(--tx-2); }
.uf-ls .lsc-legend span { display: inline-flex; align-items: center; gap: 6px; }
.uf-ls i.k { flex: none; width: 10px; height: 10px; border-radius: 2px; }
.uf-ls i.k.is-line { width: 14px; height: 3px; }
.uf-ls i.k.is-a { background: var(--ls-a); }
.uf-ls i.k.is-b { background: var(--ls-b); }
.uf-ls i.k.is-ref { background: var(--ls-ref); }
.uf-ls i.k.is-ref.is-line { height: 0; background: none; border-top: 2px dashed var(--ls-ref); border-radius: 0; }
.uf-ls i.k.is-up { background: var(--up); }
.uf-ls i.k.is-down { background: var(--down); }

/* Plot. The height is reserved before the script runs so the card does not jump. */
.uf-ls .lsc { position: relative; min-width: 0; min-height: 250px; }
.uf-ls .lsc.is-tall { min-height: 280px; }
@media (max-width: 620px) {
  .uf-ls .lsc { min-height: 210px; }
  .uf-ls .lsc.is-tall { min-height: 220px; }
}
.uf-ls .lsc svg { display: block; width: 100%; overflow: visible; touch-action: pan-y; }
.uf-ls .lsc text { font-family: var(--font-ui); font-size: 11px; fill: var(--tx-3); }
.uf-ls .lsc .lsc-num, .uf-ls .lsc .lsc-cap { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.uf-ls .lsc .lsc-cap { font-size: 10.5px; fill: var(--tx-2); }
.uf-ls .lsc .lsc-grid { stroke: var(--line); stroke-width: 1; opacity: .6; }
.uf-ls .lsc .lsc-zero { stroke: var(--tx-3); stroke-width: 1; opacity: .7; }
.uf-ls .lsc .lsc-bar.is-a { fill: var(--ls-a); }
.uf-ls .lsc .lsc-bar.is-b { fill: var(--ls-b); }
.uf-ls .lsc .lsc-bar.is-ref { fill: var(--ls-ref); }
.uf-ls .lsc .lsc-bar.is-up { fill: var(--up); }
.uf-ls .lsc .lsc-bar.is-down { fill: var(--down); }
.uf-ls .lsc .lsc-band { fill: var(--tx); opacity: .07; pointer-events: none; }
.uf-ls .lsc .lsc-hit { fill: transparent; outline: none; }
.uf-ls .lsc .lsc-hit:focus-visible { stroke: var(--brand); stroke-width: 2; }
.uf-ls .lsc .lsc-line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.uf-ls .lsc .lsc-line.is-a { stroke: var(--ls-a); }
.uf-ls .lsc .lsc-line.is-b { stroke: var(--ls-b); }
.uf-ls .lsc .lsc-line.is-ref { stroke: var(--ls-ref); stroke-width: 1.5; stroke-dasharray: 5 4; }
/* Twelve years of days on a phone: thinner strokes, or the lines close up into a block. */
.uf-ls .lsc svg.is-dense .lsc-line { stroke-width: 1.25; }
.uf-ls .lsc svg.is-dense .lsc-line.is-ref { stroke-width: 1; stroke-dasharray: 3 3; }
.uf-ls .lsc .lsc-dot { stroke: var(--surface); stroke-width: 2; }
.uf-ls .lsc .lsc-dot.is-a { fill: var(--ls-a); }
.uf-ls .lsc .lsc-dot.is-b { fill: var(--ls-b); }
.uf-ls .lsc .lsc-dot.is-ref { fill: var(--ls-ref); }
.uf-ls .lsc .lsc-cross { stroke: var(--tx-2); stroke-width: 1; }
.uf-ls .lsc-note { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; margin: 0; padding: 0 16px; text-align: center; font-size: 13px; color: var(--tx-3); }

.uf-ls .lsc-tip {
  position: absolute;
  top: 4px;
  z-index: 2;
  min-width: 150px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .16);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
}
.uf-ls .lsc-tip[hidden] { display: none; }
.uf-ls .lsc-tip .t { margin-bottom: 4px; font-weight: 700; color: var(--tx); }
.uf-ls .lsc-tip .r { display: flex; align-items: center; gap: 7px; color: var(--tx-2); }
.uf-ls .lsc-tip .r b { min-width: 52px; font-family: var(--font-mono); font-weight: 700; font-variant-numeric: tabular-nums; color: var(--tx); }
.uf-ls .lsc-tip .f { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); color: var(--tx-2); }

/* The year-by-year figures, behind a toggle under the charts drawn from them. */
.uf-ls .ls-figures summary { width: fit-content; padding: 4px 0; font-size: 12.5px; font-weight: 600; color: var(--tx-2); cursor: pointer; }
.uf-ls .ls-figures summary:hover { color: var(--tx); }
.uf-ls .ls-figures[open] summary { margin-bottom: 8px; }
.uf-ls .ls-table thead th.ls-span { text-align: center; border-bottom: 1px solid var(--line); }

/* One sentence above a chart that says what the chart shows, in figures. */
.uf-ls .ls-say { max-width: 86ch; margin: 0 0 12px; font-size: 13.5px; line-height: 1.5; color: var(--tx); }

@media (max-width: 560px) {
  .uf-ls .ls-table th, .uf-ls .ls-table td { padding: 7px 8px; }
}
