/* The Omaha Iwaku — newspaper sheet styles (v6)
   Only the two theme colours below are used. No colour values anywhere else.
   Dimensions never go in the theme block (theme = colour only).
   v5: figures use tabular numerals everywhere they stack; Japanese prose
   uses strict kinsoku line breaking; scene art is printed onto the paper
   with mix-blend-mode: multiply over white-normalised ink images.
   v6: numeric cells switch to the --num stack (equal-width figures by
   default); tabular-nums alone did not align digits in the rendered
   sheet — see the --num note in :root. */
:root {
  --paper: #FFBE9D;
  --ink: #111111;
}

/* No web fonts: one local serif newspaper stack for everything (v3).
   Body, tables, modal, captions and headings all use the same serif stack;
   there is no second typeface anywhere on the sheet. */
:root {
  --serif: "Hiragino Mincho ProN", "Hiragino Mincho Pro", "YuMincho", "Yu Mincho",
    "Noto Serif JP", Georgia, serif;
  /* v6: figures get their own serif stack. The v5 claim that tabular-nums
     alone aligns digits was false in the rendered sheet: the text stack
     resolves (via system substitution) to faces whose lining figures are
     PROPORTIONAL — the digit 1 is narrower than 0, 2–9 — and which carry
     no 'tnum' feature at all, so font-variant-numeric: tabular-nums was a
     silent no-op and stacked digits drifted (measured: up to ~4px of drift
     across the rows of the Table 2 window column at 12.5px). Every face
     named here has equal-width lining figures BY DEFAULT (verified by
     rendering and measuring digit advances), so columns align digit by
     digit without depending on the 'tnum' feature: Noto Serif and
     Noto Serif CJK JP (Linux), Times New Roman (macOS / Windows).
     Still serif-only, still no web fonts. */
  --num: "Noto Serif", "Noto Serif CJK JP", "Times New Roman", Georgia,
    "DejaVu Serif", serif;
}

* { box-sizing: border-box; }

html { margin: 0; padding: 0; }

body {
  margin: 0;
  padding: 0 0 56px 0; /* room for the fixed guidance bar */
  background-color: var(--paper);
  background-image: url("assets/paper.webp");
  background-repeat: repeat;
  background-size: 768px 768px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: 15px;
  line-height: 1.45;
  /* v5: every figure on the sheet uses tabular numerals, so digits keep
     one width and stack in straight columns wherever numbers align. */
  font-variant-numeric: tabular-nums;
  /* v5: strict Japanese line breaking (kinsoku) for the whole sheet:
     small kana (ャ ュ ョ ッ etc.), closing punctuation and similar
     characters may not start a line. Inherited by all prose below. */
  line-break: strict;
}

.sheet {
  max-width: 1180px;
  margin: 0 auto;
  padding: 12px 22px 28px;
  border-left: 1px solid var(--ink);
  border-right: 1px solid var(--ink);
}

/* ---------- Nameplate (wide and short) ---------- */
.top-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 4px;
}
/* Each strip item is one unit: it may move to another row, never split. */
.top-strip span, .date-strip span { white-space: nowrap; }

.masthead { text-align: center; padding: 6px 0 2px; }
.masthead h1 {
  margin: 0;
  font-weight: 900;
  font-size: clamp(30px, 5.4vw, 58px);
  letter-spacing: 0.1em;
  line-height: 1.0;
  white-space: nowrap;
  text-transform: uppercase;
}
.masthead .masthead-sub {
  font-size: 11px;
  letter-spacing: 0.5em;
  /* Compensate the trailing letter-space so the sub stays optically centred. */
  padding-left: 0.5em;
  margin-top: 1px;
}

.date-strip {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 3px 2px;
  margin-top: 6px;
  font-size: 12px;
}
.date-strip .slogan { letter-spacing: 0.18em; text-align: center; }

/* ---------- Headlines ---------- */
.kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  text-wrap: balance;
  margin: 14px 0 4px;
}
.lead-headline {
  font-weight: 900;
  font-size: clamp(27px, 4.4vw, 47px);
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
  margin: 0 0 6px;
}
.standfirst {
  font-size: 15px;
  line-height: 1.45;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 8px;
  margin: 0 0 10px;
}
h2.section-title {
  font-weight: 900;
  font-size: 22px;
  margin: 0 0 2px;
  letter-spacing: 0.03em;
}
.section-head {
  border-top: 3px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 5px 0 4px;
  margin: 20px 0 10px;
}
.section-head .section-sub { font-size: 12px; margin: 0; line-height: 1.4; }

.byline {
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 6px;
}

/* ---------- Columns ---------- */
.cols { columns: 3; column-gap: 22px; column-rule: 1px solid var(--ink); }
.cols p { margin: 0 0 7px; text-align: justify; }
@media (max-width: 900px) { .cols { columns: 2; } }
@media (max-width: 620px) {
  .cols { columns: 1; }
  .sheet { padding: 10px 12px 24px; border-left: none; border-right: none; }

  /* --- Mobile header (v4): deliberate breaks, no mid-phrase splits --- */
  /* Top strip: the three units wrap as whole units, centred, never split. */
  .top-strip {
    flex-wrap: wrap;
    justify-content: center;
    column-gap: 18px;
    row-gap: 2px;
    font-size: 9.5px;
    text-align: center;
  }
  /* Nameplate: one line at any width — the size is fluid (vw-based) so
     "THE OMAHA IWAKU" never wraps between words or overflows. */
  .masthead h1 {
    font-size: clamp(23px, 8.4vw, 40px);
    letter-spacing: 0.06em;
    white-space: nowrap;
  }
  .masthead .masthead-sub { font-size: 10px; letter-spacing: 0.44em; padding-left: 0.44em; }
  /* Date strip: date and edition note share the first row as whole units;
     the slogan takes its own full centred row instead of being squeezed
     between them and breaking mid-phrase. */
  .date-strip { font-size: 11px; row-gap: 2px; }
  .date-strip .slogan { order: 3; flex-basis: 100%; letter-spacing: 0.14em; }
  /* Lead block: tighter tracking and balanced lines, so the kicker and the
     headline break at even, phrase-sized boundaries. */
  .kicker { letter-spacing: 0.18em; line-height: 1.5; }
  .lead-headline { font-size: clamp(24px, 7.4vw, 34px); line-height: 1.12; }
  .standfirst { font-size: 14px; line-height: 1.55; }

  /* --- Rest of the front page: worst mobile break offenders --- */
  .section-head .section-sub { line-height: 1.55; }
  h2.section-title { font-size: 20px; }
  .verdict h2 { font-size: 18px; line-height: 1.25; text-wrap: balance; }
  .scene .scene-title { letter-spacing: 0.12em; line-height: 1.4; }
  caption { line-height: 1.5; }
  .guidance-bar { font-size: 11px; padding: 6px 10px; }
}

/* ---------- Scene illustration (v3: roughly half the v2 width) ---------- */
.scene {
  border: 1px solid var(--ink);
  padding: 8px 8px 4px;
  margin: 12px 0 4px;
  text-align: center;
}
.scene img {
  display: block;
  width: min(520px, 100%);
  height: auto;
  margin: 0 auto;
  /* v5: print the illustration ON the paper. The scene files are now
     white-ground black-ink greyscale (ground normalised to pure white),
     so multiply drops the ground out completely (the ground times the
     paper texture is the paper itself), and only the ink darkens it.
     No rectangular edge or tone step remains against the sheet. */
  mix-blend-mode: multiply;
}
.scene figcaption { text-align: center; padding-top: 6px; }
.scene .scene-title {
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 14px;
}
.scene .scene-note { font-size: 12px; margin: 2px 0 3px; line-height: 1.4; }

/* ---------- Tables (horizontal rules only) ---------- */
.table-wrap { overflow-x: auto; }
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 12.5px;
  line-height: 1.35;
  /* v5: tabular numerals in every table (front page, verdict box,
     modal and detail pages alike) so stacked figures align by digit. */
  font-variant-numeric: tabular-nums;
}
caption {
  text-align: left;
  font-size: 10.5px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding-bottom: 4px;
}
th, td {
  border-top: 1px solid var(--ink);
  padding: 3px 6px 3px 2px;
  text-align: left;
  vertical-align: top;
}
thead th { border-top: 2px solid var(--ink); border-bottom: 1px solid var(--ink); font-size: 11.5px; letter-spacing: 0.05em; }
tbody tr:last-child td { border-bottom: 2px solid var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--num); }
td .sub { display: block; font-size: 11px; }

/* ---------- Quotes ---------- */
.quotes { columns: 2; column-gap: 22px; column-rule: 1px solid var(--ink); }
@media (max-width: 620px) { .quotes { columns: 1; } }
blockquote {
  margin: 0 0 10px;
  break-inside: avoid;
  font-size: 13.5px;
  line-height: 1.45;
}
blockquote p { margin: 0; text-align: justify; }
blockquote footer {
  font-size: 10.5px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  margin-top: 3px;
}
/* v5: the source link is one unbreakable unit (its spaces are nbsp in the
   markup as well), so "(ORIGINAL LETTER)" can never drop alone onto the
   footer's second line; the whole link moves, or nothing does. */
blockquote footer .source-link { white-space: nowrap; }
/* v5: strict kinsoku, stated on the Japanese prose itself (standfirst,
   body columns, section notes, captions, modal and verdict text), so a
   small kana or closing mark never lands at the start of a line. */
.standfirst, .cols p, .section-sub, .scene-note, blockquote p,
.stock-dialog p, .verdict p, .note, .colophon p, .chart-caption { line-break: strict; }

a { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* Clickable text must read as newspaper text, never as a boxed control:
   underlines and weight carry the cue, and focus shows as an offset
   outline plus a heavier underline, not as a filled or bordered box. */
a:focus-visible,
.stock-open:focus-visible,
.dialog-close:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
  text-decoration-thickness: 2px;
}

/* ---------- Verdict box (reversed) ---------- */
.verdict {
  background: var(--ink);
  color: var(--paper);
  padding: 12px 16px 9px;
  margin: 18px 0 4px;
}
.verdict h2 {
  margin: 0 0 4px;
  font-weight: 900;
  font-size: 21px;
  letter-spacing: 0.03em;
}
.verdict table { color: var(--paper); font-size: 13px; }
.verdict th, .verdict td { border-top: 1px solid var(--paper); }
.verdict thead th { border-top: 2px solid var(--paper); border-bottom: 1px solid var(--paper); }
.verdict tbody tr:last-child td { border-bottom: 2px solid var(--paper); }
.verdict p { margin: 6px 0; text-align: justify; font-size: 13.5px; }
/* v5: a verdict word (「通らない」 / 「通る」) is never split across lines:
   nowrap keeps the whole word on one line instead of orphaning its
   final 「い」 on the next line at narrow widths. */
.verdict .verdict-word { font-size: 17px; font-weight: 900; white-space: nowrap; }

/* ---------- Passing-stocks list and modal ---------- */
.stock-open {
  font: inherit;
  font-weight: 700;
  background: none;
  border: none;
  padding: 3px 4px;
  margin: -3px -4px;
  cursor: pointer;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  letter-spacing: 0.04em;
}
.stock-dialog {
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  max-width: 660px;
  width: calc(100% - 28px);
  padding: 16px 18px 12px;
  max-height: 86vh;
  overflow-y: auto;
}
.stock-dialog::backdrop { background: var(--ink); opacity: 0.55; }
.stock-dialog h3 {
  font-weight: 900;
  font-size: 24px;
  margin: 2px 0 4px;
  line-height: 1.1;
}
.stock-dialog .dialog-close {
  font: inherit;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: none;
  border: none;
  color: var(--ink);
  padding: 4px 6px;
  margin: -4px -6px -4px 0;
  cursor: pointer;
  float: right;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.stock-dialog p { font-size: 13.5px; line-height: 1.45; margin: 6px 0; text-align: justify; }

/* ---------- Cumulative return chart (per-stock figure) ---------- */
/* Same figure treatment as the scene illustration: a hairline frame on the
   paper, an English title, and a Japanese caption. The line is a single ink
   stroke with a filled dot at each observed point; no gridlines. The SVG is
   a small inset: capped at 300px wide, viewBox drawn near display size. */
.chart-figure {
  border: 1px solid var(--ink);
  padding: 8px 8px 4px;
  margin: 12px 0;
  text-align: center;
}
.chart-figure svg { display: block; width: min(300px, 100%); margin: 0 auto; height: auto; }
.chart-title {
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-size: 13px;
  margin-bottom: 4px;
}
.chart-line { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.chart-axis { stroke: var(--ink); stroke-width: 1; }
.chart-dot { fill: var(--ink); }
.chart-year, .chart-value { font-family: var(--num); font-size: 11px; fill: var(--ink); }
.chart-caption { font-size: 12px; margin: 4px 0 3px; line-height: 1.4; text-align: left; }

/* ---------- Stock detail page ---------- */
.detail-headline {
  font-weight: 900;
  font-size: clamp(28px, 4.4vw, 46px);
  line-height: 1.05;
  margin: 12px 0 6px;
}
.radar-wrap { text-align: center; margin: 6px 0; }
.radar-grid { stroke: var(--ink); fill: none; stroke-width: 1; }
.radar-axis { stroke: var(--ink); stroke-width: 1; }
.radar-shape { fill: var(--ink); fill-opacity: 0.22; stroke: var(--ink); stroke-width: 2; }
.radar-dot { fill: var(--ink); }
.radar-label { font-family: var(--serif); font-size: 12.5px; font-weight: 700; fill: var(--ink); }
.radar-value { font-family: var(--serif); font-size: 11px; fill: var(--ink); }
.back-link { font-size: 11.5px; letter-spacing: 0.13em; text-transform: uppercase; }

.note { font-size: 12.5px; text-align: justify; line-height: 1.45; }
.hairline { border: none; border-top: 1px solid var(--ink); margin: 16px 0; }

/* ---------- Colophon and fixed guidance ---------- */
.colophon { border-top: 3px solid var(--ink); margin-top: 22px; padding-top: 7px; font-size: 12px; }
.colophon p { margin: 3px 0; text-align: justify; }

/* Last line of the sheet: visit counter on the left, build version on the right. */
.site-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  font-size: 11px;
  letter-spacing: 0.04em;
}
.site-foot [hidden] { display: none; }

.guidance-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--ink);
  color: var(--paper);
  font-size: 12px;
  line-height: 1.4;
  padding: 6px 12px;
  text-align: center;
  z-index: 10;
}
