/* The public site.
 *
 * Requires tokens.css and components.css, and adds nothing to them: the
 * chamber, the composition bars and the coalition builder here are the same
 * components the back office renders, from the same `charts.py`.
 *
 * The layout departs from the back office in one way that matters. This is a
 * publication, so the page is a column of prose that figures break out of,
 * rather than a grid of panels. There are no cards: sections are separated by
 * a heading and a rule, which is how a printed page has always done it and
 * what stops a reading page looking like a dashboard.
 */

/* ---- chrome ------------------------------------------------------------ */

.pub-head {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in oklab, var(--ground) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}

.pub-head-inner {
  width: min(var(--page), 100% - 3rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem 0;
}

.wordmark {
  font-family: var(--display);
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
}

.pub-nav { display: flex; gap: 1.5rem; }

.pub-nav a {
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--muted);
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
}

.pub-nav a:hover { color: var(--ink); }
.pub-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--bloc-a); }

.pub-controls { margin-inline-start: auto; display: flex; align-items: center; gap: 0.6rem; }

.lang-switch { display: flex; border: 1px solid var(--rule); border-radius: 999px; overflow: hidden; }

.lang-switch a {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.3rem 0.7rem;
  text-decoration: none;
  color: var(--muted);
}

.lang-switch a[aria-current="true"] { background: var(--ink); color: var(--ground); }
.lang-switch a:not([aria-current]):hover { color: var(--ink); }

.pub-controls .theme-toggle {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  cursor: pointer;
}

.pub-controls .theme-toggle:hover { color: var(--ink); border-color: var(--ink); }

main { width: min(var(--page), 100% - 3rem); margin: 0 auto; }

/* ---- the hero ---------------------------------------------------------- */

/* The front page opens on the forecast itself, because that is the most
   characteristic thing this publication has: not a photograph of a politician,
   but a sentence about a number and the number beside it. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: center;
  padding: 4rem 0 3.5rem;
  border-bottom: 1px solid var(--rule);
}
.hero-inner { max-width: 38rem; }
.hero-chamber svg { width: 100%; height: auto; display: block; }

@media (max-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .hero-chamber { order: -1; }
}

.eyebrow,
.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--bloc-a);
  margin: 0 0 1rem;
}

.hero h1 {
  font-family: var(--prose);
  font-variation-settings: "opsz" 60;
  font-size: clamp(2rem, 1.35rem + 2.4vw, 3.2rem);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 2rem;
  text-wrap: balance;
}

.hero-blocs { display: flex; flex-wrap: wrap; gap: 2.5rem; margin-bottom: 2rem; }
.hero-blocs > div { padding-top: 0.6rem; border-top: 2px solid var(--rule); min-width: 8rem; }
.hero-blocs b {
  display: block;
  font-family: var(--display);
  font-variation-settings: "wdth" 118;
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.hero-blocs span { display: flex; align-items: center; gap: 0.4rem; font-size: 0.9rem; margin-top: 0.35rem; }
.hero-blocs em {
  display: block;
  font-family: var(--mono);
  font-style: normal;
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.hero-meta { font-family: var(--mono); font-size: 0.76rem; color: var(--muted); margin: 0 0 1.5rem; }

.cta {
  display: inline-block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ground);
  background: var(--ink);
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
}

.cta:hover { background: var(--bloc-a); }

/* ---- the stream -------------------------------------------------------- */

.stream { padding: 3.5rem 0 4rem; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 2rem;
  padding-bottom: 0.9rem;
  border-bottom: 2px solid var(--ink);
  margin-bottom: 2.25rem;
}

.section-head h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 108;
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0;
}

.section-head a {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  text-decoration: none;
}

.section-head a:hover { color: var(--ink); }

/* Asymmetric on purpose: the newest piece is the one being published, and a
   grid of equal tiles says nothing is more important than anything else. */
.stream-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem 2rem; }
.card.lead { grid-column: span 2; grid-row: span 2; }

.card a { text-decoration: none; color: inherit; display: block; }
.card h3 {
  font-family: var(--prose);
  font-variation-settings: "opsz" 28;
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.22;
  margin: 0 0 0.5rem;
}
.card.lead h3 { font-size: 2rem; font-variation-settings: "opsz" 44; line-height: 1.12; }
.card a:hover h3 { color: var(--bloc-a); }
.card .dek { font-size: 0.92rem; color: var(--muted); margin: 0; line-height: 1.5; }
.card.lead .dek { font-size: 1.05rem; }
.card .meta { font-family: var(--mono); font-size: 0.7rem; color: var(--muted); margin: 0.75rem 0 0; }
.card .kicker { margin-bottom: 0.5rem; }

/* Bounded rather than proportional: the lead card is twice the width and
   twice the height of its neighbours, and a figure that scaled with it would
   arrive as a wall of colour with three shapes on it. */
.post-fig {
  display: block;
  width: 100%;
  height: 148px;
  background: var(--surface-sunken);
  border-radius: 3px;
  margin-bottom: 1rem;
  padding: 0.75rem;
}
.card.lead .post-fig { height: 208px; }
.article-figure .post-fig { height: 200px; }

/* ---- articles ---------------------------------------------------------- */

.article { padding: 3.5rem 0 5rem; max-width: 46rem; margin: 0 auto; }
.article.wide { max-width: none; }

.article-head { margin-bottom: 2.5rem; }
.article-head h1 {
  font-family: var(--prose);
  font-variation-settings: "opsz" 54;
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3rem);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.018em;
  margin: 0 0 1rem;
  text-wrap: balance;
  max-width: 24ch;
}
.article.wide .article-head h1 { max-width: 30ch; }
.article-head .dek {
  font-family: var(--prose);
  font-variation-settings: "opsz" 18;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 1.25rem;
  max-width: 54ch;
}
.article-head .meta {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
}

.article-figure { margin-bottom: 2.5rem; }


/* An "updated" note, the way a live model page carries one. */
.update-note {
  border-inline-start: 2px solid var(--bloc-a);
  padding: 0.25rem 0 0.25rem 1.25rem;
  margin-bottom: 3rem;
}
[dir="rtl"] .update-note { padding: 0.25rem 1.25rem 0.25rem 0; }
.update-note p { margin: 0; font-size: 0.9rem; color: var(--muted); max-width: 60ch; }
.update-note .run-id { font-family: var(--mono); font-size: 0.72rem; margin-top: 0.35rem; }

.prose { font-family: var(--prose); font-variation-settings: "opsz" 15; font-size: 1.12rem; line-height: 1.68; }
.prose p { margin: 0 0 1.25rem; }
.prose h2 {
  font-family: var(--prose);
  font-variation-settings: "opsz" 30;
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.2;
  margin: 2.75rem 0 0.9rem;
  letter-spacing: -0.01em;
}
.prose strong { font-weight: 700; }
.prose a { color: var(--bloc-a); text-underline-offset: 3px; }
.prose table { width: 100%; border-collapse: collapse; font-family: var(--body); font-size: 0.92rem; margin: 1.75rem 0; }
.prose th {
  text-align: start;
  font-family: var(--mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.7rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.prose td { padding: 0.5rem 0.7rem; border-bottom: 1px solid var(--rule); }
.prose td:not(:first-child), .prose th:not(:first-child) { text-align: end; font-variant-numeric: tabular-nums; }

.article-back { margin-top: 3.5rem; padding-top: 1.5rem; border-top: 1px solid var(--rule); }
.article-back a { font-family: var(--mono); font-size: 0.78rem; color: var(--muted); text-decoration: none; }
.article-back a:hover { color: var(--ink); }

/* Figures break out of the reading column rather than being squeezed into it. */
.breakout { margin-bottom: 3.5rem; }
.article > .plate.breakout { padding-top: 2.25rem; border-top: 1px solid var(--rule); }
.plate .rail h2 {
  font-family: var(--display);
  font-variation-settings: "wdth" 104;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin: 0 0 0.75rem;
}

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th {
  text-align: start;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  padding: 0 0.75rem 0.6rem;
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
td { padding: 0.55rem 0.75rem; border-bottom: 1px solid var(--rule); }
tbody tr:last-child td { border-bottom: none; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; text-align: end; }
.scroll { overflow-x: auto; }
.empty { color: var(--muted); padding: 3rem 0; }

/* ---- footer ------------------------------------------------------------ */

.pub-foot { border-top: 1px solid var(--rule); margin-top: 3rem; padding: 3rem 0 4rem; }
.pub-foot-inner { width: min(var(--page), 100% - 3rem); margin: 0 auto; max-width: 52rem; }
.foot-mark {
  font-family: var(--display);
  font-variation-settings: "wdth" 112;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin: 0 0 0.5rem;
}
.pub-foot p { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.75rem; }
.foot-caveat { font-family: var(--prose); font-variation-settings: "opsz" 12; font-size: 0.92rem; }

:focus-visible { outline: 2px solid var(--bloc-a); outline-offset: 2px; }

@media (max-width: 1000px) {
  .stream-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card.lead { grid-column: span 2; grid-row: auto; }
}

@media (max-width: 640px) {
  .pub-head-inner { flex-wrap: wrap; gap: 0.75rem 1.25rem; }
  .pub-controls { margin-inline-start: 0; }
  main, .pub-head-inner, .pub-foot-inner { width: min(100%, 100% - 2rem); }
  .stream-grid { grid-template-columns: minmax(0, 1fr); }
  .card.lead { grid-column: auto; }
  .hero { padding: 2.5rem 0 2rem; }
}

/* The strip needs room to be a shape rather than a smear, and a little air
   under it so a spike against the left edge does not touch the row rule. */
.strip-col { width: 32%; min-width: 9rem; padding-block: 0.35rem; }
.strip-col .strip { height: 30px; }

/* ---- right-to-left ----------------------------------------------------- */

/* A meta line mixes Hebrew words with Latin dates and numerals. Without an
   isolate, the bidi algorithm reorders the run and "21 Aug 2026 · 1 min read"
   arrives as "1 21". Each figure is isolated rather than the line, so the
   Hebrew around them still reads right to left. */
[dir="rtl"] .meta,
[dir="rtl"] .hero-meta,
[dir="rtl"] .hero-blocs em,
[dir="rtl"] .update-note .run-id { unicode-bidi: isolate; }

[dir="rtl"] .cta,
[dir="rtl"] .article-back a { direction: rtl; }
