/* The release note's article: the "On this page" rail and the blocks under it, as
   components/hub_update_article.html renders them (with components/hub_ship_list.html's
   "What shipped"). Two pages render those macros and both link this sheet: the public
   update page (hub_update_detail.html) and the Roadmap editor, whose preview of a saved
   update is the same fragment (_render_update_preview_fragment in src/main.py). While
   these rules lived in the public page's inline <style>, the preview drew every block
   unstyled, under the editor's own mock of them (#6387).

   Everything is scoped to .hub-update-sx, the page's root, which carries its own palette
   and mirrors the site theme onto its data-theme. The preview sets data-theme="light" on
   its own .hub-update-sx, because its card is white in both themes. What belongs to the
   page rather than the article stays in the page: its background, the hero, the grid
   that sets the rail beside the article, the sticky rail, the aside and the bars under
   the article. */

.hub-update-sx {
  --sx-bg: #0B0D12;
  --sx-bg-2: #0F1218;
  --sx-surface: #14181F;
  --sx-surface-2: #1A1F28;
  --sx-line: #232936;
  --sx-line-2: #2C3342;
  --sx-text: #E7EAF0;
  --sx-text-2: #AAB2C0;
  --sx-text-3: #858DA0;
  --sx-mute: #4A5161;
  --sx-brand: #3D4DFF;
  --sx-brand-2: #1A1F6B;
  --sx-brand-3: #6B78FF;
  --sx-brand-ink: #FFFFFF;
  --sx-accent: #7CE3D4;
  --sx-warn: #F5B454;
  --sx-danger: #F47B7B;
  --sx-ok: #6EE7A1;
  /* The status fills' ink halves, as base.html declares them: a fill read as
     light-theme text falls below AA (#6423). In dark they are the fills. */
  --sx-ok-text: #6EE7A1;
  --sx-warn-text: #F5B454;
  --sx-accent-text: #7CE3D4;
  --sx-font-display: 'Geist','Inter',ui-sans-serif,system-ui,sans-serif;
  --sx-font-body: 'Geist','Inter',ui-sans-serif,system-ui,sans-serif;
  --sx-font-mono: 'JetBrains Mono',ui-monospace,monospace;
  --sx-r-sm: 6px; --sx-r-md: 10px; --sx-r-lg: 14px; --sx-r-xl: 20px;

  font-family: var(--sx-font-body);
  color: var(--sx-text);
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.005em;
  line-height: 1.5;
  display: block;
}
.hub-update-sx[data-theme="light"] {
  --sx-bg: #FAFAFB;
  --sx-bg-2: #F4F5F8;
  --sx-surface: #FFFFFF;
  --sx-surface-2: #F7F8FB;
  --sx-line: #E6E8EE;
  --sx-line-2: #D6D9E1;
  --sx-text: #0E1320;
  --sx-text-2: #4B5263;
  --sx-text-3: #616879;
  --sx-mute: #B7BCC8;
  --sx-brand: #2A33C4;
  --sx-brand-2: #1A1F6B;
  --sx-brand-3: #3D4DFF;
  /* The ink the light rules below read. On the public page the root follows the site
     theme, so base.html's value always agreed with it; the Roadmap preview is light
     inside a page that may be dark, where base.html's value is the dark #A9B4FF. */
  --sx-brand-text: #1A1F6B;
  --sx-accent: #14B8A6;
  --sx-warn: #C77800;
  --sx-danger: #DC2C50;
  --sx-ok: #1F9D55;
  --sx-ok-text: #146B3A;
  --sx-warn-text: #8C5600;
  --sx-accent-text: #0C7065;
}
.hub-update-sx, .hub-update-sx * { box-sizing: border-box; }
.hub-update-sx a { color: inherit; text-decoration: none; }
.hub-update-sx h1, .hub-update-sx h2, .hub-update-sx h3, .hub-update-sx h4 {
  font-family: var(--sx-font-display); margin: 0;
  letter-spacing: -0.02em; line-height: 1.15;
}
.hub-update-sx p { margin: 0; }

/* TOC */
.hub-update-sx .post-toc {
  display: flex; flex-direction: column; gap: 2px;
}
.hub-update-sx .post-toc-head {
  font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sx-text-3); font-weight: 600;
  padding: 4px 10px 10px;
}
.hub-update-sx .post-toc a {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px; border-radius: var(--sx-r-sm);
  color: var(--sx-text-3); font-size: 13px; font-weight: 500;
  border-left: 2px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
  line-height: 1.35;
}
.hub-update-sx .post-toc a:hover { color: var(--sx-text); background: var(--sx-surface); }
.hub-update-sx .post-toc a.is-active {
  color: var(--sx-text);
  background: var(--sx-surface);
  border-left-color: var(--sx-brand-3);
}
.hub-update-sx .post-toc a .num {
  font-family: var(--sx-font-mono); font-size: 11px; color: var(--sx-text-3);
  min-width: 18px;
}
/* Body sub-headings sit under their parent section in the rail. */
.hub-update-sx .post-toc a[data-level="3"] { padding-left: 22px; }
.hub-update-sx .post-toc a[data-level="4"] { padding-left: 34px; }
.hub-update-sx .post-toc-empty {
  padding: 6px 10px; color: var(--sx-text-3); font-size: 13px;
}

/* Article column */
.hub-update-sx .post-article { min-width: 0; max-width: 720px; }
.hub-update-sx .post-article > * + * { margin-top: 24px; }

/* Article body — applied to rendered markdown */
.hub-update-sx .post-article .listing-markdown-content > * + * { margin-top: 18px; }
.hub-update-sx .post-article .listing-markdown-content h1,
.hub-update-sx .post-article .listing-markdown-content h2 {
  font-size: 26px; font-weight: 600;
  margin-top: 48px; scroll-margin-top: 96px;
  color: var(--sx-text);
}
.hub-update-sx .post-article .listing-markdown-content h3 {
  font-size: 18px; font-weight: 600;
  margin-top: 28px; scroll-margin-top: 96px;
  color: var(--sx-text);
}
.hub-update-sx .post-article .listing-markdown-content p {
  font-size: 16px; line-height: 1.7; color: var(--sx-text-2);
}
.hub-update-sx .post-article .listing-markdown-content strong,
.hub-update-sx .post-article .listing-markdown-content b {
  color: var(--sx-text); font-weight: 600;
}
.hub-update-sx .post-article .listing-markdown-content a {
  color: var(--sx-brand-3);
  border-bottom: 1px solid rgba(91,124,255,0.35);
}
.hub-update-sx[data-theme="light"] .post-article .listing-markdown-content a {
  color: var(--sx-brand-text);
  border-bottom-color: rgba(26,31,107,0.35);
}
.hub-update-sx .post-article .listing-markdown-content a:hover {
  color: var(--sx-text); border-bottom-color: var(--sx-text-2);
}
.hub-update-sx .post-article .listing-markdown-content ul,
.hub-update-sx .post-article .listing-markdown-content ol {
  margin: 0; padding: 0 0 0 22px;
  display: grid; gap: 8px;
  font-size: 16px; line-height: 1.7; color: var(--sx-text-2);
}
.hub-update-sx .post-article .listing-markdown-content li::marker { color: var(--sx-text-3); }
.hub-update-sx .post-article .listing-markdown-content code,
.hub-update-sx .post-article .listing-markdown-content kbd {
  font-family: var(--sx-font-mono); font-size: 13px;
  padding: 1px 6px; border-radius: 4px;
  background: var(--sx-bg); color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.hub-update-sx .post-article .listing-markdown-content pre {
  padding: 16px; border-radius: var(--sx-r-md);
  background: var(--sx-bg); color: var(--sx-text);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  overflow: auto; font-family: var(--sx-font-mono); font-size: 13px;
}
.hub-update-sx .post-article .listing-markdown-content blockquote {
  position: relative;
  padding: 14px 18px 14px 22px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text); font-size: 15px; line-height: 1.6;
}
.hub-update-sx .post-article .listing-markdown-content blockquote::before {
  content: ""; position: absolute; top: 14px; bottom: 14px; left: 0;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--sx-accent), var(--sx-brand-3));
}
.hub-update-sx .post-article .listing-markdown-content img {
  max-width: 100%; height: auto;
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}

/* Lede drop-cap (#3229) — the opening paragraph of the rendered body gets a
   gradient drop-cap on its first letter, mirroring `.post-lede::first-letter`
   in Sigrix_new/Hub - Post.html. The body is markdown-driven, so this is pure
   CSS scoped to the first child paragraph (it no-ops when the body opens with
   a heading rather than a lede). */
.hub-update-sx .post-article .listing-markdown-content > p:first-child {
  font-size: 19px; line-height: 1.6;
  color: var(--sx-text); letter-spacing: -0.005em;
}
.hub-update-sx .post-article .listing-markdown-content > p:first-child::first-letter {
  font-family: var(--sx-font-display);
  font-weight: 600; font-size: 56px; line-height: 0.9;
  float: left; margin: 6px 12px -2px 0;
  color: var(--sx-text);
  background: linear-gradient(135deg, var(--sx-brand-3), var(--sx-brand-2));
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Per-H2 number markers (#3229) — auto-number the rendered body's H2 sections
   "01", "02", … via a CSS counter, mirroring the prototype's
   `<span class="h-marker">`. Markdown emits bare <h2>, so the marker is a
   counter-driven ::before scoped to the body container. */
.hub-update-sx .post-article .listing-markdown-content { counter-reset: post-h2; }
.hub-update-sx .post-article .listing-markdown-content h2 { counter-increment: post-h2; }
.hub-update-sx .post-article .listing-markdown-content h2::before {
  /* The counter is the no-JS default; the detail page's script overrides
     --post-h2-num so the marker matches the heading's position in the
     server-rendered TOC, which also counts the non-markdown blocks. */
  content: var(--post-h2-num, counter(post-h2, decimal-leading-zero));
  display: inline-block;
  font-family: var(--sx-font-mono);
  font-size: 13px; font-weight: 500;
  color: var(--sx-text-3);
  margin-right: 12px;
  vertical-align: middle;
}

/* "Why it matters" callout */
.hub-update-sx .post-callout {
  position: relative;
  padding: 22px 24px 22px 28px;
  background:
    radial-gradient(500px 200px at 100% 0%, rgba(124,227,212,0.08), transparent 60%),
    var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.hub-update-sx .post-callout::before {
  content: ""; position: absolute; top: 18px; bottom: 18px; left: 0;
  width: 3px; border-radius: 3px;
  background: linear-gradient(180deg, var(--sx-accent), var(--sx-brand-3));
}
.hub-update-sx .post-callout .lbl {
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sx-accent); font-weight: 600; margin-bottom: 8px;
}
.hub-update-sx[data-theme="light"] .post-callout .lbl { color: #0E8576; }
.hub-update-sx .post-callout p { color: var(--sx-text); font-size: 15px; line-height: 1.65; }

/* What shipped — per-feature tag list */
.hub-update-sx .post-what-shipped { margin: 28px 0; }
.hub-update-sx .post-what-shipped h2 {
  font-size: 22px; letter-spacing: -0.01em; margin: 0 0 14px;
  color: var(--sx-text);
}
.hub-update-sx .post-ships {
  list-style: none; padding: 0; margin: 0; display: grid; gap: 12px;
}
.hub-update-sx .post-ships > li {
  display: grid; grid-template-columns: 64px 1fr; gap: 16px;
  padding: 14px 16px; background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.hub-update-sx .post-ships .tag {
  font-family: var(--sx-font-mono); font-size: 10px;
  letter-spacing: 0.06em; text-transform: uppercase;
  height: 20px; display: inline-flex; align-items: center; justify-content: center;
  padding: 0 8px; border-radius: 3px;
  background: var(--sx-bg); box-shadow: 0 0 0 1px var(--sx-line) inset;
  color: var(--sx-text-3); align-self: start;
}
.hub-update-sx .post-ships .tag--new {
  color: var(--sx-ok-text);
  box-shadow: 0 0 0 1px rgba(110,231,161,0.3) inset;
  background: rgba(110,231,161,0.06);
}
.hub-update-sx .post-ships .tag--imp {
  color: var(--sx-brand-3);
  box-shadow: 0 0 0 1px rgba(91,124,255,0.30) inset;
  background: rgba(91,124,255,0.06);
}
.hub-update-sx .post-ships .tag--fix {
  color: var(--sx-warn-text);
  box-shadow: 0 0 0 1px rgba(245,180,84,0.3) inset;
  background: rgba(245,180,84,0.06);
}
.hub-update-sx .post-ships .tag--lab {
  color: var(--sx-accent-text);
  box-shadow: 0 0 0 1px rgba(124,227,212,0.3) inset;
  background: rgba(124,227,212,0.06);
}
.hub-update-sx .post-ships .ship-title {
  color: var(--sx-text); font-weight: 600; font-size: 14px; margin-bottom: 4px;
}
.hub-update-sx .post-ships .ship-text {
  color: var(--sx-text-2); font-size: 14px; line-height: 1.55;
}

/* TL;DR card (#3229) — mirrors Sigrix_new/Hub - Post.html. */
.hub-update-sx .post-tldr {
  padding: 22px 24px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-lg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: grid; grid-template-columns: auto 1fr; gap: 18px;
  align-items: start;
}
.hub-update-sx .post-tldr-stamp {
  font-family: var(--sx-font-mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--sx-text-3); font-weight: 600;
  padding: 4px 8px;
  background: var(--sx-bg);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  border-radius: 4px;
  align-self: start;
  margin-top: 2px;
}
.hub-update-sx .post-tldr ul { display: grid; gap: 8px; list-style: none; padding: 0; margin: 0; }
.hub-update-sx .post-tldr li {
  position: relative;
  padding-left: 20px;
  font-size: 14px; color: var(--sx-text); line-height: 1.55;
}
.hub-update-sx .post-tldr li::before {
  content: ""; position: absolute;
  left: 0; top: 9px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sx-brand-3), var(--sx-brand-2));
}

/* "In testing / Lab" callout (#3229) — hatched strip. */
.hub-update-sx .post-testing {
  padding: 20px 22px;
  border-radius: var(--sx-r-lg);
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgba(124,227,212,0.04) 14px 15px),
    var(--sx-surface);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
}
.hub-update-sx .post-testing-head {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.hub-update-sx .post-testing-head .lbl {
  font-family: var(--sx-font-mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sx-accent); font-weight: 600;
}
.hub-update-sx[data-theme="light"] .post-testing-head .lbl { color: #0E8576; }
.hub-update-sx .post-testing h3 { font-size: 17px; margin: 0; color: var(--sx-text); }
.hub-update-sx .post-testing p { color: var(--sx-text-2); font-size: 14px; line-height: 1.6; margin-top: 8px; }

/* Numbered "highlights" grid (#3229) — mirrors Sigrix_new/Hub - Post.html. */
.hub-update-sx .post-highlights {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.hub-update-sx .post-hl {
  padding: 18px;
  background: var(--sx-surface);
  border-radius: var(--sx-r-md);
  box-shadow: 0 0 0 1px var(--sx-line) inset;
  display: flex; flex-direction: column; gap: 6px;
}
.hub-update-sx .post-hl .num {
  font-family: var(--sx-font-mono);
  font-size: 11px; color: var(--sx-text-3); letter-spacing: 0.04em;
}
.hub-update-sx .post-hl .ttl { font-size: 15px; font-weight: 600; color: var(--sx-text); letter-spacing: -0.01em; }
.hub-update-sx .post-hl p { font-size: 13px; color: var(--sx-text-2); line-height: 1.55; margin: 0; }

/* Responsive */
@media (max-width: 820px) {
  .hub-update-sx .post-highlights { grid-template-columns: 1fr; }
}
