/* DESIGN TRIAL (2026-09-25): Home and About in the Nameless Card Errata page's look.
 *
 * Jasper will judge this from screenshots and then decide whether it spreads site-wide, so
 * it is built to be removable in one move: delete this file, and the two {% block %} lines
 * in home.html and about.html that opt in. Nothing else on the site loads it.
 *
 * Borrowed from reference/errata.css, not linked to it: Barlow Condensed 500/700 for display,
 * Source Sans 3 400/600 for body, IBM Plex Mono 500 for figures, navy ink, the eyebrow / lede /
 * chip / table-box shapes. errata.css is not edited and not loaded here.
 *
 * GREEN, NOT RED (Jasper, 2026-09-26: "the red is just a poor look to me, I would prefer more
 * of a green like the current somworld.com logo"). The logo's green is #56F8CC; it is used as
 * is on dark grounds. On the light page it is far too pale for text, so light mode uses
 * #0C6E54, the same hue at a lower lightness: 6.22:1 on white, 5.70:1 on the page ground,
 * 5.61:1 on the mint tint (WCAG AA is 4.5). accounts/tests_design_trial.py measures these.
 *
 * The MENU is no longer styled here: it is static/menu.css, on every page.
 *
 * TWO RULES THAT KEEP IT CONTAINED (accounts/tests_design_trial.py pins both):
 *
 * 1. EVERY selector names body.ew, the class only Home and About put on <body>, so no other
 *    page body changes. And every rule other than the tokens and the body itself is under
 *    `body.ew main`, so NOTHING here reaches the menu, which menu.css draws on every page.
 *    Measured 2026-09-26: a plain `body.ew a` (0,1,2) beat menu.css's `nav a` (0,0,2) and
 *    painted the menu's links navy on the navy bar, on these two pages only.
 * 2. EVERY custom property is --ew-*. site.css keeps --bg, --accent, --muted and friends on
 *    :root, and errata.css had to be scoped because the same names collided (an earlier
 *    unscoped copy turned every link on the site red). A prefix makes the collision
 *    impossible rather than merely avoided.
 *
 * Dark mode uses the site's two doors, with the same values in each: the account's choice
 * (:root[data-theme="dark"]) and the device's (prefers-color-scheme, unless the account
 * chose light). A token defined under one door and not the other is the drift that
 * DarkModeCellRuleTests guards in site.css; the trial's own test guards it here.
 *
 * STATS PAGES AND PLAYER PAGES (lane stats-pages, 2026-10-05; Jasper: "stats pages AND player
 * pages move to it"). The stat-table block at the end of this file styles the tables that
 * static/statstoggle.js switches, under the same two containment rules. It overrides
 * site.css's table rules (which still load) only inside body.ew main.
 *
 * Fonts are the site's self-hosted copies in static/fonts/ (the same files menu.css declares;
 * declaring them here too keeps this file working on its own). Static storage is WhiteNoise's
 * CompressedStaticFilesStorage, which does not rewrite url()s, so /static/trial/../fonts/
 * resolves to /static/fonts/. No request to Google, and no dependency on the reference app.
 */

@font-face{font-family:"Barlow Condensed";font-style:normal;font-weight:500;font-display:swap;src:url("../fonts/barlow-condensed-latin-500-normal.woff2") format("woff2")}
@font-face{font-family:"Barlow Condensed";font-style:normal;font-weight:700;font-display:swap;src:url("../fonts/barlow-condensed-latin-700-normal.woff2") format("woff2")}
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:400;font-display:swap;src:url("../fonts/source-sans-3-latin-400-normal.woff2") format("woff2")}
@font-face{font-family:"Source Sans 3";font-style:normal;font-weight:600;font-display:swap;src:url("../fonts/source-sans-3-latin-600-normal.woff2") format("woff2")}
@font-face{font-family:"IBM Plex Mono";font-style:normal;font-weight:500;font-display:swap;src:url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2")}

/* ---- tokens -------------------------------------------------------------- */

body.ew {
  --ew-bg: #F3F5F8;
  --ew-surface: #FFFFFF;
  --ew-ink: #14213D;
  --ew-muted: #566079;
  --ew-rule: #D5DBE5;
  --ew-accent: #0C6E54;
  --ew-accent-soft: #E2F8F2;
  --ew-stripe: #EEF1F6;
  --ew-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --ew-body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --ew-mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.ew {
    color-scheme: dark;
    --ew-bg: #0F1522;
    --ew-surface: #172035;
    --ew-ink: #E6EAF2;
    --ew-muted: #9AA4B8;
    --ew-rule: #2A3550;
    --ew-accent: #56F8CC;
    --ew-accent-soft: #123A30;
    --ew-stripe: #1B2640;
  }
}
:root[data-theme="dark"] body.ew {
  color-scheme: dark;
  --ew-bg: #0F1522;
  --ew-surface: #172035;
  --ew-ink: #E6EAF2;
  --ew-muted: #9AA4B8;
  --ew-rule: #2A3550;
  --ew-accent: #56F8CC;
  --ew-accent-soft: #123A30;
  --ew-stripe: #1B2640;
}

/* ---- page ---------------------------------------------------------------- */

body.ew {
  background: var(--ew-bg);
  color: var(--ew-ink);
  font: 17px/1.6 var(--ew-body);
  min-height: 100vh;
}
body.ew main {
  max-width: 70rem;
  padding: 32px 16px 64px;
}
body.ew main a { color: var(--ew-ink); text-decoration: underline; text-decoration-color: var(--ew-muted); text-underline-offset: 3px; }
body.ew main a:hover { color: var(--ew-accent); text-decoration-color: var(--ew-accent); text-decoration-thickness: 2px; }
body.ew main a:focus-visible,
body.ew main button:focus-visible { outline: 2px solid var(--ew-accent); outline-offset: 2px; }
body.ew main small,
body.ew main .muted { color: var(--ew-muted); }
body.ew main p { margin: 0 0 12px; }

body.ew main h1 {
  font: 700 clamp(46px, 10vw, 92px)/0.92 var(--ew-display);
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}
body.ew main h2 {
  font: 700 21px/1.1 var(--ew-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}
body.ew main h2::after { content: ""; flex: 1; border-top: 1px solid var(--ew-rule); }

/* The red kicker above a headline. */
body.ew main .ew-eyebrow {
  font: 700 14px/1.3 var(--ew-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ew-accent);
  margin: 0;
}
body.ew main .ew-eyebrow strong { font-weight: 700; }
body.ew main .ew-lede { max-width: 60ch; color: var(--ew-muted); font-size: 19px; margin: 0; }

/* ---- masthead ------------------------------------------------------------ */

body.ew main .ew-mast {
  display: grid;
  gap: 14px;
  padding: 8px 0 28px;
  margin-bottom: 28px;
  border-bottom: 3px solid var(--ew-ink);
}

/* The "rebuilt from the ground up" teaser: one line, set off like a notice. */
body.ew main .ew-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  background: var(--ew-accent-soft);
  border-left: 4px solid var(--ew-accent);
  border-radius: 0 8px 8px 0;
  padding: 12px 16px;
  margin: 0 0 32px;
}
body.ew main .ew-note p { margin: 0; }

/* ---- chips (errata's filter chips, used here as links) -------------------- */

body.ew main .ew-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--ew-rule);
  background: var(--ew-surface);
  color: var(--ew-ink);
  border-radius: 999px;
  padding: 6px 14px;
  font: 600 15px/1.3 var(--ew-body);
  text-decoration: none;
  max-width: 100%;
}
body.ew main .ew-chip:hover { border-color: var(--ew-accent); color: var(--ew-accent); }
body.ew main .ew-chip::after { content: "\2192"; color: var(--ew-accent); }
body.ew main .ew-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
/* The current page in a chip row (the AL | NL | MLB switch, 2026-10-07): the chip's shape,
   filled in the accent, no arrow, not a link. */
body.ew main .ew-chip.ew-chip-current {
  border-color: var(--ew-accent);
  background: var(--ew-accent-soft);
  color: var(--ew-accent);
}
body.ew main .ew-chip.ew-chip-current::after { content: none; }

/* A figure in the mono face, on the accent-soft ground: the errata page's placeholder tag. */
body.ew main .ew-tag {
  font: 500 14px var(--ew-mono);
  background: var(--ew-accent-soft);
  color: var(--ew-accent);
  padding: 1px 7px;
  border-radius: 4px;
  white-space: nowrap;
}

/* ---- home: latest + side panel ------------------------------------------- */

body.ew main .ew-grid { display: grid; gap: 28px; }
@media (min-width: 860px) {
  body.ew main .ew-grid { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; }
}

body.ew main .ew-box {
  background: var(--ew-surface);
  border: 1px solid var(--ew-rule);
  border-radius: 8px;
  overflow: hidden;
}
body.ew main ol.ew-latest { list-style: none; margin: 0; padding: 0; }
body.ew main ol.ew-latest li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px 16px;
  align-items: baseline;
  padding: 11px 16px;
  border-bottom: 1px solid var(--ew-rule);
}
body.ew main ol.ew-latest li:last-child { border-bottom: 0; }
body.ew main ol.ew-latest a { font-weight: 600; text-decoration: none; }
body.ew main ol.ew-latest a:hover { text-decoration: underline; }
body.ew main ol.ew-latest small {
  font: 500 13px var(--ew-mono);
  color: var(--ew-muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
@media (max-width: 560px) {
  body.ew main ol.ew-latest li { grid-template-columns: minmax(0, 1fr); }
}

/* The Save / Saved toggle a signed-in member gets on each row (2026-10-17): home, the year
   pages and the sport shelves share the row (content/_article_row.html). The list gets
   ew-with-save only for a member, so a visitor's rows keep the two columns above. The
   button sits in its own column whether or not the row has a date. On a phone the title
   takes the whole first line and the date and the button share the second. */
body.ew main ol.ew-latest.ew-with-save li { grid-template-columns: minmax(0, 1fr) auto auto; }
body.ew main ol.ew-latest .ew-save { grid-column: 3; margin: 0; }
body.ew main ol.ew-latest .ew-save button {
  font: 600 13px/1.2 var(--ew-body);
  background: var(--ew-surface);
  color: var(--ew-ink);
  border: 1px solid var(--ew-rule);
  border-radius: 999px;
  padding: 3px 11px;
  cursor: pointer;
  white-space: nowrap;
}
body.ew main ol.ew-latest .ew-save button:hover { border-color: var(--ew-accent); color: var(--ew-accent); }
body.ew main ol.ew-latest .ew-save button[aria-pressed="true"] {
  background: var(--ew-accent-soft);
  color: var(--ew-accent);
  border-color: var(--ew-accent);
}
body.ew main ol.ew-latest .ew-save button:disabled { opacity: 0.6; cursor: progress; }
@media (max-width: 560px) {
  body.ew main ol.ew-latest.ew-with-save li { grid-template-columns: minmax(0, 1fr) auto; }
  body.ew main ol.ew-latest.ew-with-save li > a { grid-column: 1 / -1; }
  body.ew main ol.ew-latest .ew-save { grid-column: 2; }
}

body.ew main .ew-panel {
  background: var(--ew-surface);
  border: 1px solid var(--ew-rule);
  border-top: 4px solid var(--ew-accent);
  border-radius: 8px;
  padding: 18px 20px;
}
body.ew main .ew-panel .ew-eyebrow { margin-bottom: 10px; }
body.ew main .ew-panel p:last-child { margin-bottom: 0; }
body.ew main ul.ew-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
body.ew main ul.ew-links li { padding: 10px 0; border-bottom: 1px solid var(--ew-rule); color: var(--ew-muted); font-size: 15.5px; }
body.ew main ul.ew-links li:first-child { padding-top: 0; }
body.ew main ul.ew-links li:last-child { border-bottom: 0; padding-bottom: 0; }
body.ew main ul.ew-links a {
  display: block;
  font: 700 19px/1.2 var(--ew-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ew-ink);
}
body.ew main ul.ew-links a:hover { color: var(--ew-accent); }

body.ew main .ew-foot {
  margin: 40px 0 0;
  padding-top: 14px;
  border-top: 1px solid var(--ew-rule);
  font-size: 15px;
}

/* ---- about --------------------------------------------------------------- */

body.ew main .ew-section { margin: 0 0 40px; }
body.ew main .ew-cards { display: grid; gap: 14px; }
@media (min-width: 760px) {
  body.ew main .ew-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
body.ew main .ew-cards p {
  margin: 0;
  background: var(--ew-surface);
  border: 1px solid var(--ew-rule);
  border-top: 4px solid var(--ew-ink);
  border-radius: 8px;
  padding: 16px 18px;
  font-size: 16px;
}
body.ew main .ew-cards p:first-child { border-top-color: var(--ew-accent); }

body.ew main .ew-intro { display: grid; gap: 8px 36px; }
@media (min-width: 860px) {
  body.ew main .ew-intro { grid-template-columns: 17rem minmax(0, 1fr); }
}
body.ew main .ew-pull {
  font: 700 30px/1.08 var(--ew-display);
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: balance;
}
body.ew main .ew-prose { max-width: 66ch; }

body.ew main .ew-owed {
  background: var(--ew-accent-soft);
  border-left: 4px solid var(--ew-accent);
  border-radius: 0 8px 8px 0;
  padding: 14px 18px;
  margin: 0;
  max-width: 66ch;
}

/* ---- stat tables: stats pages and player pages (2026-10-05) ---------------
 * The stats pages and the player page put main in ew-wide: a 26-column batting table needs
 * the screen, and the page's huge Home headline is scaled down to a page title. Figures are
 * tabular in the mono face; every column after the label is right-aligned (one label column
 * on the stats pages, .ew-stat; two, Season and Tm, on the player page, which site.css
 * already aligns). Total rows are bold on the stripe ground. The toggle buttons are the
 * switch statstoggle.js builds. Light and dark come from the --ew-* tokens above. */

body.ew main.ew-wide { max-width: 84rem; }
body.ew main.ew-wide h1 { font-size: clamp(34px, 6vw, 60px); line-height: 1; }
body.ew main.ew-wide .ew-mast { padding-bottom: 20px; margin-bottom: 24px; }
body.ew main h3 {
  font: 700 19px/1.2 var(--ew-display);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 22px 0 6px;
}
body.ew main h4 { font: 600 16px/1.3 var(--ew-body); margin: 14px 0 0; }
body.ew main h5 {
  font: 700 15px/1.2 var(--ew-display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ew-muted);
  margin: 0 0 4px;
}

body.ew main .ew-eyebrow a { color: var(--ew-accent); text-decoration: none; }
body.ew main .ew-eyebrow a:hover { text-decoration: underline; }
body.ew main .ew-stats-facts { font-size: 18px; margin: 0; }
body.ew main .ew-stats-facts .ew-tag { margin-right: 6px; }
body.ew main .ew-stats-note,
body.ew main .ew-stats-words { color: var(--ew-muted); font-size: 15px; max-width: 75ch; }
body.ew main .ew-stats-note { border-left: 3px solid var(--ew-accent); padding-left: 10px; }
body.ew main ul.ew-chips { list-style: none; padding: 0; }
body.ew main .player-fullname { color: var(--ew-muted); }

/* The tables. site.css makes every table a scrolling block; that stays. */
body.ew main .stat-table table {
  font: 500 13.5px/1.35 var(--ew-mono);
  font-variant-numeric: tabular-nums;
  background: var(--ew-surface);
  border: 1px solid var(--ew-rule);
  margin: 8px 0 12px;
}
body.ew main .stat-table th,
body.ew main .stat-table td { border: 0; border-bottom: 1px solid var(--ew-rule); padding: 4px 8px; }
body.ew main .stat-table thead th {
  font: 700 13px/1.2 var(--ew-body);
  letter-spacing: 0.04em;
  background: var(--ew-stripe);
  color: var(--ew-ink);
  border-bottom: 2px solid var(--ew-ink);
}
body.ew main .stat-table td:first-child { font-family: var(--ew-body); font-weight: 600; }
body.ew main .ew-stat td:nth-child(n+2),
body.ew main .ew-stat th:nth-child(n+2) { text-align: right; }
body.ew main .ew-stat td.ew-text { text-align: left; font-family: var(--ew-body); }
body.ew main .stat-table tbody tr:hover td { background: var(--ew-accent-soft); }
body.ew main .stat-table tr.stat-total td,
body.ew main .stat-table tr.stat-career td,
body.ew main .stat-table tr.stat-team td:first-child { font-weight: 700; }
body.ew main .stat-table tr.stat-total td,
body.ew main .stat-table tr.stat-career td {
  background: var(--ew-stripe);
  border-top: 2px solid var(--ew-ink);
}
body.ew main .stat-table tr.stat-footnote td { font: 400 13px/1.4 var(--ew-body); color: var(--ew-muted); white-space: normal; }
body.ew main .stat-table a { text-decoration-color: var(--ew-rule); }

/* Hover notes on headings. The words are also on the page: a title never shows on a phone. */
body.ew main abbr[title] { text-decoration: underline dotted var(--ew-muted); text-underline-offset: 3px; cursor: help; }

/* The Overall / vs L / vs R switch statstoggle.js builds. */
body.ew main .stat-toggle { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; }
body.ew main .stat-toggle button {
  font: 600 14px/1.2 var(--ew-body);
  background: var(--ew-surface);
  color: var(--ew-ink);
  border: 1px solid var(--ew-rule);
  border-radius: 999px;
  padding: 5px 14px;
  cursor: pointer;
}
body.ew main .stat-toggle button:hover { border-color: var(--ew-accent); color: var(--ew-accent); }
body.ew main .stat-toggle button[aria-pressed="true"] {
  background: var(--ew-ink);
  color: var(--ew-surface);
  border-color: var(--ew-ink);
}

/* Standings side by side where they fit; leader boards in a grid of small tables. */
body.ew main .ew-standings,
body.ew main .ew-boards { display: grid; gap: 4px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
body.ew main .ew-standings h3 { margin-top: 8px; }
body.ew main .ew-board { margin: 10px 0 0; min-width: 0; }
body.ew main .ew-leaders table { width: 100%; display: table; }
body.ew main .ew-leaders td { white-space: nowrap; }
body.ew main .ew-leaders td:nth-child(2) { width: 100%; text-align: left; white-space: normal; }
body.ew main .ew-leaders td.ew-rank { color: var(--ew-muted); font-family: var(--ew-mono); font-weight: 500; text-align: right; }

/* The stats index: seasons in columns, franchises in columns. */
body.ew main ul.ew-season-grid,
body.ew main ul.ew-franchise-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 4px 18px;
  grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr));
  font-variant-numeric: tabular-nums;
}
body.ew main ul.ew-franchise-list { grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }

/* The data credits, full size (Jasper, 2026-10-04), closing the page. */
body.ew main .data-credits {
  margin-top: 40px;
  padding-top: 14px;
  border-top: 1px solid var(--ew-rule);
  color: var(--ew-muted);
}
body.ew main .data-credits h2 { color: var(--ew-ink); }

/* The player page's info block keeps its tight lines (site.css 0.15rem), which the trial's
   paragraph spacing above would otherwise open up. */
body.ew main .player-bio p { margin: 2px 0; }
