/* ==========================================================================
   RSI / Shadow articles - article.css
   Prose styles for a rendered Markdown article, plus the 11 approved
   components of docs/content-contract.md section 6 (HTML for each one is in
   docs/article-components.md).

   Linked ONLY by pages that render an article (today: article-style-guide.php),
   after css.php, so it loads after style.css, theme.css and my.css. Every rule
   starts with .rsi-article, so it cannot reach any other page.

   Built from the tokens in theme.css only: no colour or shadow value is
   defined here, and radii use --rsi-radius except a few small fixed ones
   (4px bars and thumbnails, 6px type badge, 50px pill) the tokens do not
   offer. The 90deg gradients are the blue-to-purple accent bars built from
   the two brand tokens. Logical properties throughout (RTL-ready), with one
   deliberate exception: overflow-x on .rsi-compare, because overflow-inline
   is not yet well supported.

   Contrast, computed with the WCAG formula (AA needs 4.5 for text, 3 for
   large text and borders):
     --rsi-ink-900 on white 18.7, on surface-100 18.0   headings
     --rsi-ink-700 on white 10.2, on surface-200 9.2    body text, captions
     --rsi-brand-primary-dark on white 7.1, surface-100 6.8   all links
     --rsi-brand-primary on white 4.57 (eyebrow text, white-on-blue buttons).
       Only 4.4 on surface-100, so it is not used for text there. This
       includes the outline button: inside .rsi-download it is recoloured to
       primary-dark (see section 11).
     --rsi-brand-secondary on surface-100 4.6   large stat figures only
     --rsi-ink-400 is 3.15 on white: BORDERS only, never text.
     --rsi-brand-accent (gold) is 2.4 on white: a border only, never text.
   ========================================================================== */

/* -----------------------------------------------------------------------
   Later languages: CJK font fallbacks. Not active; remove the comment marks
   when Japanese or Chinese content goes live. System fonts only, so no
   download is added. Dosis and Catamaran have no CJK glyphs, so the browser
   falls through to these.

   .rsi-article:lang(ja) {
     --rsi-font-display: "Dosis", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
     --rsi-font-body: "Catamaran", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
   }
   .rsi-article:lang(zh-Hans) {
     --rsi-font-display: "Dosis", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
     --rsi-font-body: "Catamaran", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
   }
   .rsi-article:lang(zh-Hant) {
     --rsi-font-display: "Dosis", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
     --rsi-font-body: "Catamaran", "PingFang TC", "Microsoft JhengHei", "Noto Sans TC", sans-serif;
   }
   (CJK text has no word spaces; add  overflow-wrap: anywhere  and a larger
   line-height of about 1.8 for those languages when they arrive.)
   ----------------------------------------------------------------------- */


/* -----------------------------------------------------------------------
   Wrapper and reading measure
   The 65ch measure gives roughly 65 to 75 characters a line at the body size
   below. The whole article is one centred column, so components share it.
   padding-block-start clears the site header, which is absolutely positioned
   over the top of the page (assets/css/style.css .navbar-area).
   ----------------------------------------------------------------------- */

.rsi-article {
  box-sizing: border-box;
  max-inline-size: 65ch;
  margin-inline: auto;
  padding-inline: var(--space-2);
  padding-block: calc(var(--space-8) + var(--space-2)) var(--space-8);
  font-family: var(--rsi-font-body);
  font-size: var(--step-0);
  line-height: 1.7;
  color: var(--rsi-ink-700);
  background: var(--rsi-surface-0);
  overflow-wrap: break-word;
}

.rsi-article *,
.rsi-article *::before,
.rsi-article *::after {
  box-sizing: border-box;
}

@media (min-width: 48em) {
  .rsi-article {
    font-size: var(--step-1);
    padding-block-start: calc(var(--space-8) + var(--space-8));
  }
}


/* -----------------------------------------------------------------------
   Header: eyebrow, the page's only h1, byline
   ----------------------------------------------------------------------- */

.rsi-article .rsi-article__header {
  margin-block-end: var(--space-4);
}

.rsi-article .rsi-article__header::after {
  content: "";
  display: block;
  inline-size: var(--space-8);
  block-size: 4px;
  margin-block-start: var(--space-3);
  border-radius: 4px;
  background: linear-gradient(90deg, var(--rsi-brand-primary), var(--rsi-brand-secondary));
}

.rsi-article .rsi-article__eyebrow {
  display: block;
  margin: 0 0 var(--space-1);
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: .85rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rsi-brand-primary);
}

.rsi-article .rsi-article__title {
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-3);
  line-height: 1.2;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-article__meta {
  margin: var(--space-2) 0 0;
  font-size: .9rem;
  line-height: 1.5;
  letter-spacing: 0;
  color: var(--rsi-ink-700);
}

@media (min-width: 48em) {
  .rsi-article .rsi-article__title {
    font-size: var(--step-5);
  }
}

/* An answer's summary, under its h1 (the visible text of the first
   question's answer in its FAQPage data). */
.rsi-article .rsi-article__summary {
  margin: var(--space-2) 0 0;
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--rsi-ink-900);
}

/* "The figures in this article are illustrative examples, not measured
   results." Under the header of a news article marked figures_illustrative
   (D-097): quiet like the meta line, ordinary text, a thin border-only rule
   (ink-400 as a border, never as text) so it reads as a note. */
.rsi-article .rsi-article__figures-note {
  margin: 0 0 var(--space-4);
  padding-inline-start: var(--space-2);
  border-inline-start: 4px solid var(--rsi-ink-400);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--rsi-ink-700);
}

/* "Draft, not published": printed only in the owner's local drafts preview
   (content-item-body.php), never on the live site. Plain and unmissable:
   dark text on the light surface, a thick warning-colour frame. */
.rsi-article .rsi-article__draft {
  margin: 0 0 var(--space-3);
  padding: var(--space-2);
  border: 4px solid var(--rsi-warning);
  border-radius: var(--rsi-radius);
  background: var(--rsi-surface-100);
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.3;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rsi-ink-900);
}

/* "Draft" beside a draft in the answers listing and hubs (answers-body.php),
   local drafts preview only: the same warning frame, small. */
.rsi-article .rsi-article__draft-tag {
  display: inline-block;
  margin-inline-start: .4em;
  padding: 0 .4em;
  border: 2px solid var(--rsi-warning);
  border-radius: var(--rsi-radius);
  font-weight: 700;
  font-size: .8em;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--rsi-ink-900);
}

/* Optional lead image, between the header and the body. */
.rsi-article .rsi-article__lead {
  margin-block: 0 var(--space-4);
}


/* -----------------------------------------------------------------------
   Prose: paragraphs, headings, lists, links, emphasis, code, rules
   Direct children of .rsi-article__body are prose; components are their own
   elements, so list resets in components are not fought by these rules.
   ----------------------------------------------------------------------- */

.rsi-article .rsi-article__body > * + * {
  margin-block-start: var(--space-3);
}

.rsi-article p {
  margin: 0;
  font-size: inherit;
  line-height: inherit;
  letter-spacing: .2px;
  color: var(--rsi-ink-700);
}

/* The answer-first opening paragraph (content contract section 5). */
.rsi-article .rsi-article__body > p:first-child {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--rsi-ink-900);
}

@media (min-width: 48em) {
  .rsi-article .rsi-article__body > p:first-child {
    font-size: var(--step-2);
  }
}

.rsi-article h2,
.rsi-article h3,
.rsi-article h4 {
  font-family: var(--rsi-font-display);
  font-weight: 700;
  line-height: 1.25;
  color: var(--rsi-ink-900);
  /* The sticky site header would otherwise cover a heading reached by anchor. */
  scroll-margin-block-start: calc(var(--space-8) + var(--space-4));
}

.rsi-article .rsi-article__body > h2 {
  margin-block: var(--space-6) 0;
  font-size: var(--step-2);
}

.rsi-article .rsi-article__body > h3 {
  margin-block: var(--space-4) 0;
  font-size: var(--step-1);
}

.rsi-article .rsi-article__body > h4 {
  margin-block: var(--space-3) 0;
  font-size: var(--step-0);
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rsi-article .rsi-article__body > h2 + *,
.rsi-article .rsi-article__body > h3 + *,
.rsi-article .rsi-article__body > h4 + * {
  margin-block-start: var(--space-2);
}

@media (min-width: 48em) {
  .rsi-article .rsi-article__body > h2 { font-size: var(--step-3); }
  .rsi-article .rsi-article__body > h3 { font-size: var(--step-2); }
  .rsi-article .rsi-article__body > h4 { font-size: var(--step-1); }
}

/* style.css resets every list to no bullets and no padding; put them back. */
.rsi-article .rsi-article__body > ul,
.rsi-article .rsi-article__body > ol,
.rsi-article .rsi-callout__body ul,
.rsi-article .rsi-callout__body ol,
.rsi-article .rsi-takeaways ul {
  margin: 0;
  padding-inline-start: var(--space-4);
}

.rsi-article .rsi-article__body > ul,
.rsi-article .rsi-callout__body ul,
.rsi-article .rsi-takeaways ul {
  list-style: disc;
}

.rsi-article .rsi-article__body > ol,
.rsi-article .rsi-callout__body ol {
  list-style: decimal;
}

.rsi-article .rsi-article__body > ul > li,
.rsi-article .rsi-article__body > ol > li,
.rsi-article .rsi-callout__body li,
.rsi-article .rsi-takeaways li {
  margin-block-start: var(--space-1);
  padding-inline-start: .25rem;
  line-height: inherit;
}

.rsi-article .rsi-article__body > ul > li:first-child,
.rsi-article .rsi-article__body > ol > li:first-child,
.rsi-article .rsi-callout__body li:first-child,
.rsi-article .rsi-takeaways li:first-child {
  margin-block-start: 0;
}

.rsi-article .rsi-article__body li::marker,
.rsi-article .rsi-takeaways li::marker {
  color: var(--rsi-brand-primary);
  font-weight: 700;
}

/* Prose links are plain <a href> with no class (the renderer adds none), so
   the :not([class]) keeps these rules off buttons, stat sources and so on.
   style.css sets outline: 0 !important on every <a>; the focus rule below
   answers that with its own !important and a more specific selector. */
.rsi-article a:not([class]) {
  color: var(--rsi-brand-primary-dark);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}

.rsi-article a:not([class]):hover {
  color: var(--rsi-ink-900);
  text-decoration-thickness: 2px;
}

.rsi-article strong {
  font-weight: 700;
  color: var(--rsi-ink-900);
}

.rsi-article em {
  font-style: italic;
}

.rsi-article code {
  padding: .1em .4em;
  border-radius: 4px;
  background: var(--rsi-surface-200);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .875em;
  color: var(--rsi-ink-900);
}

.rsi-article hr {
  margin-block: var(--space-6);
  border: 0;
  border-block-start: 1px solid var(--rsi-border);
}

/* Not produced by the contract (no Markdown tables, no ![](), no ">" quotes),
   but kept sane for any legacy body that reaches the template. */
.rsi-article img {
  max-inline-size: 100%;
  block-size: auto;
  border-radius: var(--rsi-radius);
}

.rsi-article .rsi-article__body > table {
  inline-size: 100%;
  border-collapse: collapse;
}

.rsi-article .rsi-article__body > table th,
.rsi-article .rsi-article__body > table td {
  padding: var(--space-1) var(--space-2);
  text-align: start;
  border-block-end: 1px solid var(--rsi-border);
}


/* -----------------------------------------------------------------------
   Focus (all components): one visible ring for every interactive element.
   ----------------------------------------------------------------------- */

.rsi-article a:focus-visible,
.rsi-article summary:focus-visible,
.rsi-article .rsi-compare:focus-visible {
  outline: 3px solid var(--rsi-brand-primary) !important;
  outline-offset: 3px;
  border-radius: 4px;
}

.rsi-article .rsi-btn-primary:focus-visible,
.rsi-article .rsi-btn-outline:focus-visible {
  border-radius: 50px;
}

/* Text for screen readers only (Bootstrap's .sr-only is not guaranteed to
   survive a Bootstrap upgrade, so the article carries its own). */
.rsi-article .rsi-sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* .rsi-card lifts on hover in theme.css; an article card is not a link. */
.rsi-article .rsi-card {
  transition: none;
}

.rsi-article .rsi-card:hover {
  transform: none;
  box-shadow: none;
}


/* -----------------------------------------------------------------------
   1. Callout  (.rsi-callout--tip | --note | --warning)
   A coloured edge plus a printed type label, so meaning never rests on
   colour alone.
   ----------------------------------------------------------------------- */

.rsi-article .rsi-callout {
  padding: var(--space-3);
  border: 1px solid var(--rsi-border);
  border-inline-start-width: 4px;
  border-radius: var(--rsi-radius);
  background: var(--rsi-surface-100);
}

.rsi-article .rsi-callout--tip     { border-inline-start-color: var(--rsi-brand-primary); }
.rsi-article .rsi-callout--note    { border-inline-start-color: var(--rsi-ink-400); }
.rsi-article .rsi-callout--warning { border-inline-start-color: var(--rsi-warning); }

.rsi-article .rsi-callout__head {
  margin: 0 0 var(--space-1);
  font-family: var(--rsi-font-display);
  line-height: 1.3;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-callout__type {
  display: block;
  font-weight: 700;
  font-size: .75rem;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.rsi-article .rsi-callout__title {
  display: block;
  font-weight: 700;
  font-size: var(--step-1);
}

.rsi-article .rsi-callout__body > * + * {
  margin-block-start: var(--space-1);
}


/* -----------------------------------------------------------------------
   2. Key takeaways  (reuses .rsi-card)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-takeaways {
  position: relative;
  overflow: hidden;
  padding: var(--space-3);
  padding-block-start: calc(var(--space-3) + 4px);
  background: var(--rsi-surface-100);
}

.rsi-article .rsi-takeaways::before,
.rsi-article .rsi-cta::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  inset-block-start: 0;
  block-size: 4px;
  background: linear-gradient(90deg, var(--rsi-brand-primary), var(--rsi-brand-secondary));
}

.rsi-article .rsi-takeaways__title {
  margin: 0 0 var(--space-1);
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.3;
  color: var(--rsi-ink-900);
}


/* -----------------------------------------------------------------------
   3. Pull quote
   style.css styles every <blockquote> with a grey box, centred 24px italic
   text, 50px !important padding and two pseudo-elements. Each of those is
   undone here; the !important ones need !important back, and win on
   specificity.
   ----------------------------------------------------------------------- */

.rsi-article .rsi-quote {
  margin-inline: 0;
}

.rsi-article .rsi-quote blockquote {
  position: static;
  margin: 0;
  padding-block: 0 !important;
  padding-inline: var(--space-3) 0 !important;
  overflow: visible;
  background: none;
  text-align: start;
  border-inline-start: 4px solid var(--rsi-brand-secondary);
  border-image: linear-gradient(180deg, var(--rsi-brand-primary), var(--rsi-brand-secondary)) 1;
}

.rsi-article .rsi-quote blockquote::before,
.rsi-article .rsi-quote blockquote::after {
  content: none;
}

.rsi-article .rsi-quote blockquote p {
  font-family: var(--rsi-font-display);
  font-weight: 600;
  font-style: italic;
  font-size: var(--step-1) !important;
  line-height: 1.45;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-quote__cite {
  margin: var(--space-1) 0 0;
  padding-inline-start: var(--space-3);
  font-size: .9rem;
  color: var(--rsi-ink-700);
}

.rsi-article .rsi-quote__cite cite {
  display: inline;
  font-style: normal;
  font-weight: 600;
}

@media (min-width: 48em) {
  .rsi-article .rsi-quote blockquote p {
    font-size: var(--step-2) !important;
  }
}


/* -----------------------------------------------------------------------
   4. Stats  (reuses .rsi-card; one to four cards in a row, wrapping)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.rsi-article .rsi-stats--1 {
  grid-template-columns: minmax(0, 16rem);
}

.rsi-article .rsi-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding: var(--space-3);
  background: var(--rsi-surface-100);
}

.rsi-article .rsi-stat__value {
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-4);
  line-height: 1.1;
  /* Fallback first, for forced-colors and old browsers. */
  color: var(--rsi-brand-primary-dark);
  background: linear-gradient(90deg, var(--rsi-brand-primary), var(--rsi-brand-secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.rsi-article .rsi-stat__label {
  font-size: var(--step-0);
  line-height: 1.5;
  color: var(--rsi-ink-700);
}

.rsi-article .rsi-stat__source {
  margin-block-start: auto;
  font-size: .85rem;
  color: var(--rsi-brand-primary-dark);
  text-decoration: underline;
  text-underline-offset: .2em;
}

.rsi-article .rsi-stat__source:hover {
  color: var(--rsi-ink-900);
}


/* -----------------------------------------------------------------------
   5. FAQ  (native <details>: works without script, and the answer text is
   in the page for search engines and screen readers)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-faq__title {
  margin: 0 0 var(--space-2);
  font-size: var(--step-2);
}

.rsi-article .rsi-faq__item {
  border-block-end: 1px solid var(--rsi-border);
}

.rsi-article .rsi-faq__item:first-of-type {
  border-block-start: 1px solid var(--rsi-border);
}

.rsi-article .rsi-faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-block: var(--space-2);
  font-family: var(--rsi-font-display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.3;
  color: var(--rsi-ink-900);
  cursor: pointer;
  list-style: none;
}

.rsi-article .rsi-faq__question::-webkit-details-marker {
  display: none;
}

.rsi-article .rsi-faq__question::after {
  content: "";
  flex-shrink: 0;
  inline-size: .6rem;
  block-size: .6rem;
  margin-block-end: .25rem;
  border-inline-end: 2px solid var(--rsi-brand-primary);
  border-block-end: 2px solid var(--rsi-brand-primary);
  transform: rotate(45deg);
  transition: transform .2s ease;
}

.rsi-article .rsi-faq__item[open] > .rsi-faq__question::after {
  margin-block-end: 0;
  margin-block-start: .25rem;
  transform: rotate(-135deg);
}

.rsi-article .rsi-faq__question:hover {
  color: var(--rsi-brand-primary-dark);
}

.rsi-article .rsi-faq__answer {
  padding-block-end: var(--space-2);
}


/* -----------------------------------------------------------------------
   6. Figure with caption, 7. Side-by-side images (gallery)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-figure,
.rsi-article .rsi-gallery,
.rsi-article .rsi-video,
.rsi-article .rsi-quote {
  margin-block-end: 0;
}

.rsi-article .rsi-figure img,
.rsi-article .rsi-gallery img {
  display: block;
  inline-size: 100%;
  block-size: auto;
  border: 1px solid var(--rsi-border);
  border-radius: var(--rsi-radius);
}

.rsi-article .rsi-figure figcaption,
.rsi-article .rsi-gallery figcaption,
.rsi-article .rsi-video figcaption {
  margin-block-start: var(--space-1);
  font-size: .9rem;
  line-height: 1.5;
  color: var(--rsi-ink-700);
}

.rsi-article .rsi-gallery__items {
  /* Two or three images sit side by side when each gets at least 12rem, and
     stack on a phone, with no breakpoint needed. */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2);
  align-items: start;
}


/* -----------------------------------------------------------------------
   8. Video  (reuses .rsi-news-media and .rsi-news-media--embed from theme.css)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-video .rsi-news-media {
  margin-block-end: 0;
}

.rsi-article .rsi-video__transcript {
  margin: var(--space-1) 0 0;
  font-size: .9rem;
}


/* -----------------------------------------------------------------------
   9. Call to action  (the button is .rsi-btn-primary from theme.css)
   Light surface, not navy: the dark palette is for header, footer and hero.
   ----------------------------------------------------------------------- */

.rsi-article .rsi-cta {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
  padding-block-start: calc(var(--space-3) + 4px);
  overflow: hidden;
  border: 1px solid var(--rsi-border);
  border-radius: var(--rsi-radius);
  background: var(--rsi-surface-100);
}

.rsi-article .rsi-cta__text {
  flex: 1 1 14rem;
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 600;
  font-size: var(--step-1);
  line-height: 1.35;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-cta__button {
  flex: 0 0 auto;
}


/* -----------------------------------------------------------------------
   10. Comparison table  (the table is .rsi-compare-table from theme.css; the
   wrapper scrolls sideways on a narrow screen instead of squashing it)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-compare {
  /* Deliberate exception to "logical properties throughout": overflow-inline
     is not yet well supported. */
  overflow-x: auto;
  border: 1px solid var(--rsi-border);
  border-radius: var(--rsi-radius);
  box-shadow: var(--rsi-shadow);
}

.rsi-article .rsi-compare .rsi-compare-table {
  min-inline-size: 30rem;
  border-radius: 0;
  box-shadow: none;
  font-size: var(--step-0);
}

.rsi-article .rsi-compare .rsi-compare-table caption {
  caption-side: top;
  padding: var(--space-2) var(--space-3);
  text-align: start;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-1);
  color: var(--rsi-ink-900);
  background: var(--rsi-surface-0);
}

.rsi-article .rsi-compare .rsi-compare-table th,
.rsi-article .rsi-compare .rsi-compare-table td {
  text-align: start;
  line-height: 1.4;
}

/* Row headers keep the look theme.css gives a first-column cell. */
.rsi-article .rsi-compare .rsi-compare-table tbody th {
  font-family: var(--rsi-font-body);
  font-weight: 600;
  background: var(--rsi-surface-0);
}

.rsi-article .rsi-compare .rsi-compare-table tbody tr:last-child th,
.rsi-article .rsi-compare .rsi-compare-table tbody tr:last-child td {
  border-block-end: 0;
}


/* -----------------------------------------------------------------------
   11. Download card  (reuses .rsi-card; the button is .rsi-btn-outline)
   The type badge is the one small gold highlight: a border, never text.
   ----------------------------------------------------------------------- */

.rsi-article .rsi-download {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  padding: var(--space-3);
  background: var(--rsi-surface-100);
}

.rsi-article .rsi-download__type {
  flex: 0 0 auto;
  padding: .35rem .6rem;
  border: 2px solid var(--rsi-brand-accent);
  border-radius: 6px;
  background: var(--rsi-surface-0);
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-download__info {
  flex: 1 1 12rem;
  min-inline-size: 0;
}

.rsi-article .rsi-download__title {
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.3;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-download__desc {
  margin: .25rem 0 0;
  font-size: .95rem;
  line-height: 1.5;
}

.rsi-article .rsi-download__link {
  flex: 0 0 auto;
}

/* The theme's outline button is brand-primary text (4.4:1 on surface-100,
   below AA). Inside the card it uses primary-dark: 6.8:1 on surface-100. */
.rsi-article .rsi-download .rsi-btn-outline {
  color: var(--rsi-brand-primary-dark);
  border-color: var(--rsi-brand-primary-dark);
}

.rsi-article .rsi-download .rsi-btn-outline:hover,
.rsi-article .rsi-download .rsi-btn-outline:focus-visible {
  color: var(--rsi-surface-0);
  background: var(--rsi-brand-primary-dark);
  border-color: var(--rsi-brand-primary-dark);
}


/* -----------------------------------------------------------------------
   Contract revision 1.2 (run 4j, decision D-099): additions only. No rule
   above changed; each selector below matches only the new markup.
   ----------------------------------------------------------------------- */

/* 3. Pull quote with no cite: nothing to add (the figcaption is simply not
   printed). 9. Call to action: an optional title over the sentence, and an
   optional second button in the outline style. */
.rsi-article .rsi-cta__title {
  flex: 1 1 100%;
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-2);
  line-height: 1.25;
  color: var(--rsi-ink-900);
}

/* With two buttons, the sentence takes the full width and the buttons sit
   together under it, rather than one beside the text and one wrapped alone. */
.rsi-article .rsi-cta:has(.rsi-cta__button--secondary) {
  justify-content: flex-start;
}

.rsi-article .rsi-cta:has(.rsi-cta__button--secondary) .rsi-cta__text {
  flex-basis: 100%;
}

/* The theme's outline button is brand-primary text, 4.4:1 on surface-100;
   in the cta box it uses primary-dark (6.8:1), as the download card does. */
.rsi-article .rsi-cta .rsi-cta__button--secondary {
  color: var(--rsi-brand-primary-dark);
  border-color: var(--rsi-brand-primary-dark);
}

.rsi-article .rsi-cta .rsi-cta__button--secondary:hover,
.rsi-article .rsi-cta .rsi-cta__button--secondary:focus-visible {
  color: var(--rsi-surface-0);
  background: var(--rsi-brand-primary-dark);
  border-color: var(--rsi-brand-primary-dark);
}

/* 12. Section label: the small label printed directly above a heading. It
   is a <p>, not a heading, so the outline is unchanged. It takes the
   heading's space above it, and the heading moves up under it.
   brand-primary on white is 4.57:1 (the eyebrow uses the same). */
.rsi-article .rsi-article__body > .rsi-section-label {
  margin-block: var(--space-6) 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: .8rem;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--rsi-brand-primary);
}

.rsi-article .rsi-article__body > .rsi-section-label:has(+ h3) {
  margin-block-start: var(--space-4);
}

.rsi-article .rsi-article__body > .rsi-section-label:has(+ h4) {
  margin-block-start: var(--space-3);
}

.rsi-article .rsi-article__body > .rsi-section-label + h2,
.rsi-article .rsi-article__body > .rsi-section-label + h3,
.rsi-article .rsi-article__body > .rsi-section-label + h4 {
  margin-block-start: .35rem;
}

/* 13. Card group: two to six cards in a grid (reuses .rsi-card). Two or four
   cards sit two to a row; three, five or six sit three to a row; on a phone
   they stack. The selectors name the body so they win over the prose list
   rules (bullets, indent, item spacing). */
.rsi-article .rsi-article__body > .rsi-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: var(--space-2);
  margin-inline: 0;
  padding: 0;
  list-style: none;
}

/* The group is a <ul>, and the prose list rule sets every list's margin to
   0, so it would sit tight against the block above it. It takes the gap
   between paragraphs (after a heading, the heading's gap). */
.rsi-article .rsi-article__body > * + .rsi-cards {
  margin-block-start: var(--space-3);
}

.rsi-article .rsi-article__body > :is(h2, h3, h4) + .rsi-cards {
  margin-block-start: var(--space-2);
}

.rsi-article .rsi-article__body > .rsi-cards--2,
.rsi-article .rsi-article__body > .rsi-cards--4 {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.rsi-article .rsi-article__body > .rsi-cards > .rsi-cards__item {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  margin: 0;
  padding: var(--space-2) var(--space-2) calc(var(--space-2) + .25rem);
  background: var(--rsi-surface-100);
  line-height: 1.5;
}

/* primary-dark, not primary: brand-primary is only 4.4:1 on surface-100 */
.rsi-article .rsi-cards__label {
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: .75rem;
  line-height: 1.3;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--rsi-brand-primary-dark);
}

.rsi-article .rsi-cards__title {
  margin: 0;
  font-family: var(--rsi-font-display);
  font-weight: 700;
  font-size: var(--step-1);
  line-height: 1.25;
  color: var(--rsi-ink-900);
}

.rsi-article .rsi-cards__text {
  margin: 0;
  font-size: .95rem;
  line-height: 1.5;
  color: var(--rsi-ink-700);
}


/* -----------------------------------------------------------------------
   Sources list (printed from front matter, after the body)
   ----------------------------------------------------------------------- */

.rsi-article .rsi-sources {
  margin-block-start: var(--space-6);
  padding-block-start: var(--space-3);
  border-block-start: 1px solid var(--rsi-border);
  font-size: .9rem;
  line-height: 1.5;
}

.rsi-article .rsi-sources__title {
  margin: 0 0 var(--space-1);
  font-size: var(--step-1);
}

.rsi-article .rsi-sources ol {
  margin: 0;
  padding-inline-start: var(--space-4);
  list-style: decimal;
}

.rsi-article .rsi-sources li {
  margin-block-start: var(--space-1);
}


/* -----------------------------------------------------------------------
   Motion and forced colours
   ----------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .rsi-article .rsi-faq__question::after {
    transition: none;
  }
}

@media (forced-colors: active) {
  .rsi-article .rsi-stat__value {
    -webkit-text-fill-color: currentColor;
    background: none;
  }
  .rsi-article .rsi-takeaways::before,
  .rsi-article .rsi-cta::before {
    background: CanvasText;
  }
}
