/* Preview E1 — Phase 1: readability, structure, visual comprehension.
   Scope note: this file is Phase 1 only. The investigation infrastructure (evidence drawer, global
   search, backlinks, edge provenance) is Phase 2 and is deliberately absent.
   Sections are numbered to match the build script so a reviewer can find each change.
 */

/* 0 — More menu sits beside the scrolling tab strip ---------------------------------------------
   The utility tab buttons had to move INSIDE the tablist (role="tab" outside a role="tablist" is
   invalid), which meant the More wrapper — a <div> — had to move OUT of it. That left More as a child
   of nav.tabs rather than of the scrolling .tabsrow, and because .tabsrow is what scrolls, More was
   laid out as a full-width block and jumped to the far right edge of the viewport. nav.tabs is made a
   flex row so the strip scrolls and More stays pinned at the right end, on the same line. */
nav.tabs { display: flex; align-items: stretch; gap: 0; }
/* flex:0 1 auto, NOT 1 1 auto. .tabsrow is also the shared .wrap element, so a grow factor of 1 makes
   it claim every spare pixel and pushes More to the far edge with a large empty gap after Claims.
   Sizing it to content keeps the tabs and More adjacent; it can still shrink below its content width,
   so the strip scrolls internally on a phone instead of widening the page. */
nav.tabs > .tabsrow { flex: 0 1 auto; min-width: 0; margin-right: 10px; }
nav.tabs > .moremenu { flex: 0 0 auto; display: flex; align-items: center; padding-right: 18px; }

/* 1 — Utility tab buttons: present for state and focus, invisible on screen. ---------------------
   The `hidden` attribute was rejected here deliberately: it removes the button from the tab
   accessibility tree and makes it unfocusable, which strands a keyboard user who opened a utility
   view from the More menu with no tab to return from.
   clip-path alone is not enough: the buttons are inline-level by default, so they still occupied a
   line of height above the fold. display:block plus the clip is what removes them from flow. */
.utility-tab {
  display: block; position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

/* 1b — Collapsed "About this explainer" band ---------------------------------------------------------
   This block was a full-width paragraph above the navigation, so methodology and AI-process caveats
   were the first thing a reader met. It is now a one-line disclosure below the tab strip. */
.e1-disc { border-bottom: 1px solid var(--line); background: rgba(240,180,41,0.05); }
.e1-disc > summary {
  cursor: pointer; padding: 9px 18px; font-size: 12.5px; color: var(--ink3);
  background: var(--bg); max-width: none;
}
.e1-disc > summary:hover { color: var(--ink); }
.e1-disc > summary:focus-visible { outline: 2px solid #6cc4ff; outline-offset: -2px; }
.e1-disc[open] > summary { color: var(--ink2); border-bottom: 1px solid var(--line); }
.e1-disc .wrap { padding: 12px 18px; }

/* 2 — More menu --------------------------------------------------------------------------------- */
.moremenu { position: relative; flex: 0 0 auto; }
/* .moretab deliberately does not carry class="tab" (app.js's switchTab would mark it as a selected
   tab), so it repeats the tab's own box styling here. Kept adjacent to the .tab rule intent: same
   padding, colour and radius, so the strip still reads as one row of equal controls. */
.moretab {
  display: inline-flex; align-items: center; gap: 4px; background: none; cursor: pointer;
  border: 1px solid transparent; border-radius: 9px; padding: 9px 13px;
  color: var(--ink2); font: inherit; font-size: 14px; white-space: nowrap;
}
.moretab:hover { color: var(--ink); background: #131c26; }
.moretab:focus-visible { outline: 2px solid #6cc4ff; outline-offset: 2px; }
.moretab .caret { font-size: 10px; opacity: .7; transition: transform .15s ease; }
.moretab[aria-expanded="true"] .caret { transform: rotate(180deg); }

/* has-active marks that a utility view is the current one. The More button is not a view, so it must
   never take the .active class app.js assigns to tabs — a distinct class keeps that distinction. */
.moretab.has-active { color: var(--ink); border-color: #2f4a63; background: #16202c; }

/* contain:paint is load-bearing. Without it the absolutely-positioned menu escapes .tabsrow's
   min-width:0 and widens the whole document on a phone — the same defect the tab strip had. */
.morewrap {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60; min-width: 232px;
  background: #131c26; border: 1px solid #2b3d52; border-radius: 10px; padding: 5px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, .55); contain: paint;
}
.morelnk {
  display: block; width: 100%; text-align: left; background: none; border: 0;
  color: var(--ink); font: inherit; font-size: 14px; padding: 9px 10px; border-radius: 7px;
  cursor: pointer;
}
.morelnk:hover, .morelnk:focus-visible { background: #1b2836; color: #fff; outline: none; }
.morelnk:focus-visible { outline: 2px solid #6cc4ff; outline-offset: -2px; }

/* 3 — Reading measure ------------------------------------------------------------
   Long-form prose in a single column of full window width is hard to read: the eye loses the line on
   return sweeps. Capping the measure keeps line length in the readable band without a layout change. */
.view > .wrap > * { max-width: 74ch; }
.view > .wrap > .labrange,
.view > .wrap > .labhead,
.view > .wrap > .wide { max-width: none; }

/* 4 — Section rhythm ----------------------------------------------------------------
   Consistent vertical spacing between sections so the page reads as ordered blocks rather than one
   undifferentiated column. */
.view > .wrap > section { margin-bottom: 34px; }
.view > .wrap > section > h2 { margin-bottom: 10px; }

/* 5 — Overview (guided tour) --------------------------------------------------------------------
   The opening is the 30-second answer. Hero, four status cards and one plain-English finding stay
   visible; everything else sits behind disclosure. */
.ov-stats {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(158px, 100%), 1fr)); gap: 10px;
  margin: 0 0 20px;
}
/* The stat is a <div> holding an inline <b> and an inline <span>. With no rule for it they flowed
   together on one line and read as "Guiltyall serious breach charges". Both parts are forced onto
   their own line, with the value dimmed so the label stays the thing you read first. */
.ov-stat {
  border: 1px solid #24374b; background: #0f1720; border-radius: 10px;
  padding: 11px 13px; display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.ov-stat > b { display: block; font-size: 17px; line-height: 1.25; color: var(--ink); }
.ov-stat > span { display: block; font-size: 12.5px; line-height: 1.35; color: var(--ink2); }
.ov-stat.t-bad > b { color: #ff9aa2; }
.ov-stat.t-ok > b { color: #7ee2b8; }
.ov-step {
  border: 1px solid #24374b; background: #0f1720; border-radius: 12px; padding: 14px 15px;
  margin-bottom: 10px;
}
.ov-step > summary { cursor: pointer; font-weight: 650; color: var(--ink); font-size: 15px;
  display: flex; gap: 9px; align-items: baseline; list-style: none; }
.ov-step > summary::-webkit-details-marker { display: none; }
.ov-step > summary::before {
  content: counter(ovstep, decimal-leading-zero); counter-increment: ovstep;
  font-variant-numeric: tabular-nums; color: var(--pl); font-size: 12px; flex: 0 0 auto;
}
.ov-steps { counter-reset: ovstep; }
.ov-step[open] > summary { margin-bottom: 8px; }
.ov-body { color: var(--ink2); font-size: 14.5px; line-height: 1.62; }
.ov-body p { margin: 0 0 9px; }
.ov-key {
  display: inline-block; font-variant-numeric: tabular-nums; font-weight: 700; color: #fff;
  background: #16202c; border: 1px solid #2b3d52; border-radius: 8px; padding: 7px 11px;
  margin: 0 0 9px; font-size: 14px;
}
.ov-more { margin-top: 4px; }
.ov-more > summary { cursor: pointer; color: var(--ink3); font-size: 13.5px; }
.ov-more[open] > summary { margin-bottom: 7px; }

/* 6 — What Next: four live tracks ----------------------------------------------------------------
   Each track states status, next step and what is unknown. A status word alone would read as a
   conclusion, so status is always paired with what it is based on. */
.track {
  border: 1px solid #24374b; background: #0f1720; border-radius: 12px; padding: 14px 15px;
  margin-bottom: 10px;
}
.track > summary { cursor: pointer; display: flex; gap: 10px; align-items: center; list-style: none; }
.track > summary::-webkit-details-marker { display: none; }
.track-name { font-weight: 650; color: var(--ink); }
.track-status {
  font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase; padding: 3px 8px;
  border-radius: 999px; border: 1px solid #2b3d52; color: var(--ink2); white-space: nowrap;
}
.track-status[data-s="open"] { color: #ffd28a; border-color: #6b4d1e; background: #2a2013; }
.track-status[data-s="decided"] { color: #9fe6a8; border-color: #245c34; background: #14251b; }
.track-grid { display: grid; gap: 10px; margin-top: 11px; }
@media (min-width: 720px) { .track-grid { grid-template-columns: repeat(3, 1fr); } }
.track-cell h3 { margin: 0 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink3); font-weight: 600; }
.track-cell p { margin: 0; font-size: 13.5px; color: var(--ink2); line-height: 1.55; }

/* 7 — Timeline ----------------------------------------------------------------------------------
   Eight to ten turning points by default. The full timeline is one disclosure away, so nothing is
   deleted — only deferred. */
.tl-item { border-left: 2px solid #24374b; padding: 0 0 14px 14px; margin-left: 5px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-when { font-size: 12px; color: var(--pl); font-variant-numeric: tabular-nums; }
.tl-what { font-size: 14px; color: var(--ink); margin-top: 2px; }

/* 6b — Findings: the charge matrix -----------------------------------------------------------------
   One table replaces two card taxonomies. Row height is kept tight and separators are light, so a
   nine-row matrix reads as a list rather than a grid of boxes. Result is carried by a word as well as
   colour: a red-green reader must still be able to tell proved from not proved. */
.matrix-wrap { overflow-x: auto; margin: 0 0 18px; }
.cmatrix { width: 100%; border-collapse: collapse; font-size: 14px; }
.cmatrix caption { text-align: left; font-size: 13px; color: var(--ink3); padding-bottom: 8px; }
.cmatrix th[scope="col"] {
  text-align: left; font-size: 11.5px; letter-spacing: .05em; text-transform: uppercase;
  color: var(--ink3); font-weight: 600; padding: 0 12px 8px 0; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.cmatrix tbody th { font-weight: 600; color: var(--ink); white-space: nowrap; padding-right: 12px; }
.cmatrix td { padding: 10px 12px 10px 0; border-bottom: 1px solid #1b2430; vertical-align: top;
  color: var(--ink2); }
.cm-out { font-weight: 650; white-space: nowrap; }
.cm-yes .cm-out { color: #ff9b9b; }
.cm-no  .cm-out { color: #9fe6a8; }
.cm-no th { color: #9fe6a8; }

/* 6c — Money headline ------------------------------------------------------------------------------ */
.money-head { margin: 0 0 20px; }
.money-stats { margin-bottom: 12px; }
.toggle { display: flex; gap: 6px; margin: 0 0 10px; }
.toggle .btn[aria-pressed="true"] { background: #1d3a52; border-color: var(--pl); color: #fff; }

/* 6d — People ---------------------------------------------------------------------------------------- */
.people-more { margin-top: 16px; }
.people-rest { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr));
  margin-top: 10px; }

/* 8b — People category filters -----------------------------------------------------------------
   The brief asks for six groupings. They sit in one wrapping row above the grid, and use
   aria-pressed rather than a tablist because these filter one list rather than switch a panel: a
   tablist would promise a tabpanel that does not exist. */
.pfilterbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.pfilter {
  background: #131c26; border: 1px solid #2b3d52; color: var(--ink2); font: inherit;
  font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.pfilter:hover { color: var(--ink); border-color: #3d5670; }
.pfilter:focus-visible { outline: 2px solid #6cc4ff; outline-offset: 2px; }
.pfilter[aria-pressed="true"] { background: #1d3a52; color: #fff; border-color: #6cc4ff; }
/* Touch target: the default padding clears the 24px minimum for the smallest filter labels. */
.people-rest { margin-top: 12px; }

/* 8 — People -------------------------------------------------------------------------------------
   Eight to twelve key actors first. Every actor remains reachable: the full set sits behind the same
   disclosure pattern, so nothing is dropped to make the default view shorter. */
.people-grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(min(232px, 100%), 1fr)); }
.pcard {
  border: 1px solid #24374b; background: #0f1720; border-radius: 11px; padding: 12px 13px;
  min-width: 0;
}
.pcard-name { font-weight: 650; color: var(--ink); font-size: 14.5px; }
.pcard-role { font-size: 12.5px; color: var(--ink3); margin-top: 2px; }
.pcard-why { font-size: 13px; color: var(--ink2); margin-top: 7px; line-height: 1.5; }
.pcard-src { font-size: 11.5px; color: var(--ink3); margin-top: 8px; }
.pfilters { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 14px; min-width: 0; }
.pfilter {
  background: #16202c; border: 1px solid #2b3d52; color: var(--ink2); font: inherit; font-size: 13px;
  padding: 7px 11px; border-radius: 999px; cursor: pointer;
}
.pfilter[aria-pressed="true"] { background: #1d3a52; color: #fff; border-color: var(--pl); }

/* 9 — Reduced motion ------------------------------------------------------------------------------
   Honour the preference rather than animating regardless. Transform and opacity only: these are the
   properties that do not trigger layout, so suppressing them is cheap. */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
      transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .moretab .caret { transition: none; }
}

/* 10 — Touch targets -----------------------------------------------------------------------------
   44px is the accepted minimum. The tab strip and every chip are raised to it on coarse pointers,
   where a finger is the input device and a mouse-sized target is a miss. */
@media (pointer: coarse) {
  .tab, .morelnk, .pfilter, .btn, .btn-more, .btn-det { min-height: 44px; }
  .morelnk { display: flex; align-items: center; }
}

/* 11 — Mobile ------------------------------------------------------------------------------------ */
@media (max-width: 560px) {
  .moretab { padding: 10px 12px; }
  .morewrap { min-width: 0; right: -2px; }
  .ov-stats { grid-template-columns: repeat(auto-fit, minmax(min(138px, 100%), 1fr)); }
}

/* 9 — Arguments by issue ------------------------------------------------------------------------
   Two equal columns per issue: the Commission's finding and the case City ran, never merged. The
   columns are a CSS grid rather than the legacy flex split, because flex splits prose into narrow
   ribbons at phone widths — the same defect check_prose_flex.py guards against elsewhere. */
.issue { margin: 0 0 22px; padding: 0 0 18px; border-bottom: 1px solid #1b2430; }
.issue:last-child { border-bottom: 0; }
.issuetwo { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
.issuecol { min-width: 0; }
.issuelbl {
  margin: 0 0 8px; font-size: 11.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--ink3);
}
@media (max-width: 760px) {
  /* One column on a phone: two side-by-side columns of legal prose are unreadable at 390px. */
  .issuetwo { grid-template-columns: 1fr; }
}

/* 10 — Focused views of the map -----------------------------------------------------------------
   Sits directly above the existing type filters, so the reader sees a named question first and the
   underlying type toggles second. */
.mapviewbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 14px 0 10px; }
.mapview {
  background: #131c26; border: 1px solid #2b3d52; color: var(--ink2); font: inherit;
  font-size: 13px; padding: 7px 12px; border-radius: 999px; cursor: pointer;
}
.mapview:hover { color: var(--ink); border-color: #3d5670; }
.mapview:focus-visible { outline: 2px solid #6cc4ff; outline-offset: 2px; }
.mapview[aria-pressed="true"] { background: #1d3a52; color: #fff; border-color: #6cc4ff; }

/* 11 — Commentary grouped by topic, collapsed by default -----------------------------------------
   The summary is the clickable row: speaker, role and their one-line view. The long form inside is
   the original card, untouched, so affiliation and the "reads it as" rows cannot drift from the
   researched data. Grid columns keep the collapsed rows aligned; <details> itself is display:block
   and must not be forced into a grid cell, or the summary and body stop lining up. */
.com-topics { display: block; }
.comtopic { margin: 0 0 26px; }
.comcards { display: grid; gap: 10px; }
.comitem {
  border: 1px solid var(--line); border-radius: 10px; background: var(--panel, #131a22);
  overflow: hidden;
}
.comitem > summary {
  cursor: pointer; padding: 12px 14px; display: grid; gap: 3px;
  font-weight: 600; color: var(--ink); list-style: none;
}
.comitem > summary::-webkit-details-marker { display: none; }
.comitem > summary::after {
  content: "\25BE"; color: var(--ink2); font-size: 11px; margin-top: 2px;
}
.comitem[open] > summary { border-bottom: 1px solid var(--line); }
.comitem[open] > summary::after { content: "\25B4"; }
.comitem > summary:focus-visible { outline: 2px solid var(--accent, #6cc4ff); outline-offset: -2px; }
.comoneliner { font-weight: 400; font-size: 13px; color: var(--ink2); }
.comitem .comcard { border: 0; background: none; margin: 0; }
/* The card was designed as a grid child of .comgrid. Inside a details block it must behave as a
   normal block, or it inherits the grid gap/padding assumptions and renders misaligned. */
.comitem .comcard > * { margin-left: 0; margin-right: 0; }

/* 13 — Sticky-nav clearance -----------------------------------------------------------------------
   The tab strip is position:sticky at the top, so any element scrolled into view with
   scrollIntoView lands under it. A club record whose name is the first thing on the row then loses
   exactly the word that identifies it. scroll-margin-top reserves the strip's height, and
   scroll-padding-top on the scroll container covers programmatic scrolling generally. */
/* Measured, not guessed: the strip measures 51px at both 390px and 1280px. */
:root { --e1-sticky: 51px; }
.view, .view * { scroll-margin-top: calc(var(--e1-sticky) + 8px); }
html { scroll-padding-top: calc(var(--e1-sticky) + 8px); }
