/*
 * article.css - CSS module for the SEO-first blog post template.
 * All rules are gated under `body[data-page^="article-"]` so they never bleed onto
 * non-article pages even if this stylesheet is loaded site-wide. Theming uses the
 * site's existing CSS variables (--color-primary, --shadow-md, etc.) so a brand
 * swap is purely a :root variable override on the consuming site.
 * Loaded by base.njk via <link rel="stylesheet"> - no @import to keep CSS budget
 * predictable.
 * */
body[data-page^="article-"] .article-page {
  --article-measure: 75ch; /* prose reading width - applied to <p>/<ul>/<ol>/<blockquote> only */
  --article-prose-leading: 1.75;
  --article-h2-spacing: 3.5rem;
  --article-section-spacing: 4rem;
  --article-rail-width: 220px;
  --article-rail-gap: 1.75rem;
  --article-header-clearance: 88px; /* sticky-header height (85px) + safety; used for TOC top + scroll-margin */
}
/* Inside the article body, hub articles wrap each <section> child in <div class="container">
   for legacy-marketing-page styling. That double-containerizes content already constrained by
   .article-shell__main, narrowing it by 40px and shifting it 20px right. Neutralize: keep the
   wrapper element but strip its width/padding/centering so it becomes a no-op. */
body[data-page^="article-"] .article-body .container {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}
/* Tighten the first section's top padding - the hero already provides breathing room
   above. Site-default .section padding is 6rem; halve it to drop the post-hero air gap. */
body[data-page^="article-"] .article-body > section:first-child,
body[data-page^="article-"] .article-body > section.section:first-child {
  padding-top: 2rem;
}
/* Inside articles, neutralize the alternating-band backgrounds that ship with
   the marketing-page section variants (.section--light, .section--alt). Hub
   articles port these from the legacy WP layout and they create hard-edged
   "blue blocks" inside the 1220px container instead of full-bleed bands.
   Section separation is already handled by the border-top + spacing on
   consecutive `<section>` siblings (see B2 above). */
body[data-page^="article-"] .article-body section,
body[data-page^="article-"] .article-body section.section--light,
body[data-page^="article-"] .article-body section.section--alt {
  background: transparent;
}
/* .process-steps wrapper has no rule in site.css, so its .process-step children
   stack with zero inter-card spacing. Keep step tiles in balanced rows. */
body[data-page^="article-"] .article-body .process-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
@media (min-width: 1024px) {
  body[data-page^="article-"] .article-body .process-steps:has(> .process-step:nth-child(5):last-child) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  body[data-page^="article-"] .article-body .process-steps:has(> .process-step:nth-child(5):last-child) > .process-step {
    grid-column: span 2;
  }
  body[data-page^="article-"] .article-body .process-steps:has(> .process-step:nth-child(5):last-child) > .process-step:nth-child(4) {
    grid-column: 1 / span 3;
  }
  body[data-page^="article-"] .article-body .process-steps:has(> .process-step:nth-child(5):last-child) > .process-step:nth-child(5) {
    grid-column: 4 / span 3;
  }
  body[data-page^="article-"] .article-body .process-steps:has(> .process-step:nth-child(4):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 1023px) {
  body[data-page^="article-"] .article-body .process-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 768px) {
  body[data-page^="article-"] .article-body .process-steps {
    grid-template-columns: 1fr;
  }
}
/* Hub articles use <div class="step-number"> inside .process-step but the styled
   badge in site.css targets .process-step__num. Match the badge styling for the
   article-level class so numbered cards read as proper steps, not raw text. */
body[data-page^="article-"] .article-body .process-step .step-number {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: 1.15rem;
}
/* Article shell - full-width single column (no rail)
   Decision (2026-05-02): drop the right rail entirely. The 2-col layout was
   constraining body width and breaking the visual rhythm with full-bleed
   sections (FAQ band, CTA band) below - a "narrow body, wide band, narrow
   body" lurch. Article body now uses the full container width like the rest
   of the site. TOC + rail-cta partials remain in DOM but are hidden via CSS
   so removing them is reversible (just toggle display). */
body[data-page^="article-"] .article-shell { padding: 0; }
body[data-page^="article-"] .article-shell__inner {
  display: block;
  margin-top: 0;
}
body[data-page^="article-"] .article-shell__main { min-width: 0; }
body[data-page^="article-"] .article-shell__rail { display: none; }
/* Hero */
body[data-page^="article-"] .article-hero {
  padding: 3rem 0 1rem;
  background:
    radial-gradient(1200px 400px at 90% -10%, var(--color-primary-light) 0%, transparent 60%),
    radial-gradient(800px 300px at 0% 10%, var(--color-primary-soft) 0%, transparent 70%);
}
/* B1. Hero 2-column composition */
/* At >=1024px, when an image is present, switch the hero to a 2-col grid:
   .article-hero__text (breadcrumb → meta) on the left, .article-hero__figure on
   the right. Wrapping text in a single grid cell avoids the implicit-row trap
   where `grid-row: 1 / -1` collapses to a single row and the figure floats above
   the text. AEO definition-first DOM order is preserved (text comes first).
   Falls back to single column on smaller viewports OR when no image is set. */
@media (min-width: 1024px) {
  body[data-page^="article-"] .article-hero:has(.article-hero__figure) > .container {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 3rem;
    align-items: center;
  }
  body[data-page^="article-"] .article-hero:has(.article-hero__figure) .article-hero__figure {
    margin: 0;
    align-self: center;
  }
  /* Image renders at its natural size - only width fills column, height stays
     proportional. No max-height clamp, no aspect override. Vertical centering
     comes from align-self:center on the figure cell above. */
  /* H1 + lede stay narrower in 2-col mode to avoid awkward wrap-with-image-beside */
  body[data-page^="article-"] .article-hero:has(.article-hero__figure) .article-h1 { max-width: none; }
}
/* When no image: .article-hero__text is just a passthrough wrapper. */
body[data-page^="article-"] .article-hero__text { display: contents; }
@media (min-width: 1024px) {
  body[data-page^="article-"] .article-hero:has(.article-hero__figure) .article-hero__text {
    display: block; /* becomes a real grid cell so its children stack vertically */
  }
}
body[data-page^="article-"] .article-breadcrumb {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
body[data-page^="article-"] .article-breadcrumb a {
  color: inherit;
  text-decoration: none;
}
body[data-page^="article-"] .article-breadcrumb a:hover {
  color: var(--color-primary);
}
body[data-page^="article-"] .article-breadcrumb__sep {
  color: var(--color-text-soft);
}
body[data-page^="article-"] .article-breadcrumb__current {
  color: var(--color-text);
  font-weight: 600;
}
body[data-page^="article-"] .article-tag {
  display: inline-block;
  background: var(--color-primary-light);
  color: var(--color-primary-ink);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}
body[data-page^="article-"] .article-h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 1.25rem;
  max-width: 22ch;
  color: var(--color-text);
}
body[data-page^="article-"] .article-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  max-width: var(--article-measure);
}
body[data-page^="article-"] .article-lede-support {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
  max-width: var(--article-measure);
}
body[data-page^="article-"] .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.85rem;
  color: var(--color-text);
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  align-items: center;
}
body[data-page^="article-"] .article-meta > * {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
}
/* Subtle dot separator between meta items (skip the first child) */
body[data-page^="article-"] .article-meta > * + *::before {
  content: "·";
  color: var(--color-text-soft);
  font-weight: 600;
  margin-right: 0.6rem;
}
body[data-page^="article-"] .article-meta__label {
  color: var(--color-text-soft);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-page^="article-"] .article-meta time {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
}
body[data-page^="article-"] .article-meta__readtime {
  color: var(--color-text-muted);
}
body[data-page^="article-"] .article-byline--compact {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
body[data-page^="article-"] .article-byline__avatar {
  border-radius: var(--radius-pill);
  object-fit: cover;
  width: 24px;
  height: 24px;
}
body[data-page^="article-"] .article-byline__monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--color-primary-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  flex-shrink: 0;
}
body[data-page^="article-"] .article-byline__name {
  color: var(--color-text);
  font-weight: 600;
  text-decoration: none;
}
body[data-page^="article-"] .article-byline__name:hover {
  color: var(--color-primary);
}
body[data-page^="article-"] .article-hero__figure {
  margin: 2.5rem 0 0;
}
body[data-page^="article-"] .article-hero__image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
/* TOC */
body[data-page^="article-"] .article-toc {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}
body[data-page^="article-"] .article-toc__title {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-soft);
  margin: 0 0 0.75rem;
}
body[data-page^="article-"] .article-toc__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
body[data-page^="article-"] .article-toc__link {
  color: var(--color-text);
  text-decoration: none;
  font-size: 0.95rem;
  border-left: 2px solid transparent;
  padding-left: 0.75rem;
  display: block;
  line-height: 1.45;
  transition: color var(--transition), border-color var(--transition);
}
body[data-page^="article-"] .article-toc__link:hover,
body[data-page^="article-"] .article-toc__link[aria-current="true"] {
  color: var(--color-primary);
  border-left-color: var(--color-primary);
}
/* TOC no longer individually sticky - its containing rail is the sticky unit
   (see .article-shell__rail rule below). Keeps TOC + rail-cta locked together so
   they never overlap when the article body is much taller than the rail. */
/* Official sources */
body[data-page^="article-"] .article-sources {
  padding: 1rem 0 2.5rem;
}
body[data-page^="article-"] .article-sources .container {
  border-top: 1px solid var(--color-border);
  padding-top: 1.25rem;
}
body[data-page^="article-"] .article-sources__title {
  margin: 0 0 0.85rem;
  color: var(--color-text-soft);
  font-family: var(--font-display);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
body[data-page^="article-"] .article-sources__list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
body[data-page^="article-"] .article-sources__list a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface);
  color: var(--color-primary-dark);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
}
body[data-page^="article-"] .article-sources__list a:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
/* Article body - prose typography */
body[data-page^="article-"] .article-body {
  font-size: 1.05rem;
  line-height: var(--article-prose-leading);
  color: var(--color-text);
}
/* In-body icon container - pill bubble used at the top of card-with-icon blocks */
body[data-page^="article-"] .article-body .card-icon {
  width: 56px;
  height: 56px;
  border-radius: 999px;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
}
body[data-page^="article-"] .article-body .card-icon svg {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* In-body callout - neutral surface band, no AI-quartet color tints */
body[data-page^="article-"] .article-body .article-callout {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
body[data-page^="article-"] .article-body .article-callout > :first-child { margin-top: 0; }
body[data-page^="article-"] .article-body .article-callout > :last-child { margin-bottom: 0; }
body[data-page^="article-"] .article-body .article-callout__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}
body[data-page^="article-"] .article-body > .container > h2,
body[data-page^="article-"] .article-body h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  line-height: 1.25;
  font-weight: 700;
  margin: var(--article-h2-spacing) 0 1rem;
  letter-spacing: -0.01em;
  scroll-margin-top: calc(var(--article-header-clearance) + 1rem);
}
body[data-page^="article-"] .article-body h3 {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.3;
  font-weight: 700;
  margin: 2rem 0 0.75rem;
  scroll-margin-top: calc(var(--article-header-clearance) + 1rem);
}
body[data-page^="article-"] .article-body p {
  margin: 0 0 1.25rem;
  max-width: var(--article-measure);
}
body[data-page^="article-"] .article-body ul,
body[data-page^="article-"] .article-body ol {
  margin: 0 0 1.5rem 1.25rem;
  padding: 0;
}
body[data-page^="article-"] .article-body li {
  margin-bottom: 0.5rem;
}
body[data-page^="article-"] .article-body a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(26, 115, 232, 0.4);
  transition: text-decoration-color var(--transition), text-decoration-thickness var(--transition);
}
body[data-page^="article-"] .article-body a:hover {
  text-decoration-thickness: 2px;
  text-decoration-color: var(--color-primary);
}
body[data-page^="article-"] .article-body strong {
  font-weight: 700;
  color: var(--color-text);
}
body[data-page^="article-"] .article-body blockquote {
  border-left: 4px solid var(--color-primary);
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.25rem;
  font-style: italic;
  color: var(--color-text-muted);
}
body[data-page^="article-"] .article-body img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  margin: 1.5rem 0;
}
/* FAQ */
body[data-page^="article-"] .article-faq {
  margin: var(--article-section-spacing) 0;
  padding: 3rem 0;
  background: var(--color-surface-alt);
}
body[data-page^="article-"] .article-faq__title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.4vw, 1.85rem);
  font-weight: 700;
  margin: 0 0 2rem;
  text-align: left;
  /* Title aligns with the article body column above (left-anchored) on desktop;
     falls back to full container width on mobile. */
  max-width: 100%;
}
body[data-page^="article-"] .article-faq__list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  /* List width matches the article main column above so the FAQ visually
     continues the article body. On mobile the rail collapses, so the list
     spans the full container. */
  max-width: 100%;
  margin: 0;
}
/* FAQ now matches full article body width since the rail is gone. No special
   desktop calc needed - the full container width is the active column. */
body[data-page^="article-"] .article-faq__item {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: box-shadow var(--transition), border-color var(--transition);
}
body[data-page^="article-"] .article-faq__item[open],
body[data-page^="article-"] .article-faq__item:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-border-strong);
}
body[data-page^="article-"] .article-faq__summary {
  list-style: none;
  cursor: pointer;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
body[data-page^="article-"] .article-faq__summary::-webkit-details-marker { display: none; }
body[data-page^="article-"] .article-faq__question {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.4;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
  flex: 1;
}
body[data-page^="article-"] .article-faq__chevron {
  color: var(--color-primary);
  flex-shrink: 0;
  transition: transform var(--transition);
}
body[data-page^="article-"] .article-faq__item[open] .article-faq__chevron {
  transform: rotate(180deg);
}
body[data-page^="article-"] .article-faq__answer {
  padding: 0 1.5rem 1.5rem;
  color: var(--color-text-muted);
  line-height: 1.65;
}
body[data-page^="article-"] .article-faq__answer p {
  margin: 0;
}
/* On desktop, force-open all FAQ items for in-DOM crawler visibility + better UX. */
@media (min-width: 768px) {
  body[data-page^="article-"] .article-faq__chevron { display: none; }
  body[data-page^="article-"] .article-faq__summary { cursor: default; }
}
/* CTA bands */
body[data-page^="article-"] .article-cta {
  margin: var(--article-section-spacing) 0;
  padding: 3rem 0;
  text-align: center;
}
body[data-page^="article-"] .article-cta--primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: var(--color-surface);
}
body[data-page^="article-"] .article-cta--primary .article-cta__title { color: var(--color-surface); }
body[data-page^="article-"] .article-cta--primary .article-cta__copy { color: rgba(255,255,255,0.9); }
body[data-page^="article-"] .article-cta__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
}
body[data-page^="article-"] .article-cta__copy {
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 600px;
  margin: 0 auto 1.5rem;
}
body[data-page^="article-"] .article-cta__actions {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}
/* Related articles */
body[data-page^="article-"] .article-related {
  margin: var(--article-section-spacing) 0 2rem;
  padding: 2rem 0;
}
body[data-page^="article-"] .article-related__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 2rem;
  text-align: center;
}
body[data-page^="article-"] .article-related__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  align-items: stretch;
}
body[data-page^="article-"] .article-related__card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 100%;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
body[data-page^="article-"] .article-related__card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-strong);
}
body[data-page^="article-"] .article-related__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}
body[data-page^="article-"] .article-related__cardtitle {
  font-family: var(--font-display);
  font-size: 1.1rem;
  line-height: 1.3;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
}
body[data-page^="article-"] .article-related__excerpt {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
body[data-page^="article-"] .article-related__cta {
  display: inline-block;
  margin-top: auto;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--color-primary);
}
@media (max-width: 900px) {
  body[data-page^="article-"] .article-related__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 640px) {
  body[data-page^="article-"] .article-related__grid {
    grid-template-columns: 1fr;
  }
}
/* Author card (end of article, expanded mode) */
body[data-page^="article-"] .article-author-card {
  display: flex;
  gap: 1.5rem;
  padding: 2rem;
  background: var(--color-surface-alt);
  border-radius: var(--radius-md);
  margin: 2rem 0;
  align-items: flex-start;
}
body[data-page^="article-"] .article-author-card__avatar {
  border-radius: var(--radius-pill);
  object-fit: cover;
  flex-shrink: 0;
}
body[data-page^="article-"] .article-author-card__body { flex: 1; }
body[data-page^="article-"] .article-author-card__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--color-text);
}
body[data-page^="article-"] .article-author-card__role {
  font-size: 0.9rem;
  color: var(--color-text-soft);
  margin: 0.2rem 0 0.75rem;
}
body[data-page^="article-"] .article-author-card__bio {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0 0 0.75rem;
}
body[data-page^="article-"] .article-author-card__link {
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 0.92rem;
}
/*
 * PHASE B - layout polish (added 2026-05-01 night)
 * Goals: kill visual monotony across sections, give cards depth, add an
 * editorial vocabulary (.article-stat / .article-warning / .article-compare-table),
 * and tighten the secondary CTA + mobile TOC affordances.
 * */
/* B2. Section rhythm */
/* Subtle chapter-break rule between consecutive sections. The first section
   (typically the intro callout) has no rule above it. */
body[data-page^="article-"] .article-body section + section {
  border-top: 1px solid var(--color-border);
  margin-top: 1.5rem;
  padding-top: 1.5rem;
}
/* B3. Card elevation tier */
/* Resting cards now sit on --shadow-soft instead of --shadow-sm or none. Hover
   lifts to --shadow-md. Replaces the flat-ghost-panel look. Scoped to article
   body so marketing-page card density stays untouched. */
body[data-page^="article-"] .article-body .card,
body[data-page^="article-"] .article-body .process-step {
  box-shadow: var(--shadow-soft);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
}
body[data-page^="article-"] .article-body .grid-2,
body[data-page^="article-"] .article-body .grid-3,
body[data-page^="article-"] .article-body .feature-grid {
  align-items: stretch;
}
body[data-page^="article-"] .article-body .grid-2 > .card,
body[data-page^="article-"] .article-body .grid-3 > .card,
body[data-page^="article-"] .article-body .feature-grid > .card,
body[data-page^="article-"] .article-body .process-steps > .process-step {
  display: flex;
  flex-direction: column;
  height: 100%;
}
body[data-page^="article-"] .article-body .grid-2 > .card > :last-child,
body[data-page^="article-"] .article-body .grid-3 > .card > :last-child,
body[data-page^="article-"] .article-body .feature-grid > .card > :last-child,
body[data-page^="article-"] .article-body .process-steps > .process-step > :last-child {
  margin-bottom: 0;
}
body[data-page^="article-"] .article-body .card:hover,
body[data-page^="article-"] .article-body .card.hover-lift:hover,
body[data-page^="article-"] .article-body .process-step:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--color-border-strong);
}
/* B4. Editorial components - .article-stat / .article-warning / .article-compare-table */
/* Big-number stat callout. Use for rate / limit / timing facts the article cites.
   Pairs naturally next to a dense paragraph or as a floating right-aligned block. */
body[data-page^="article-"] .article-body .article-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 1rem 1.25rem;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  background: var(--color-primary-soft);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
}
body[data-page^="article-"] .article-body .article-stat__value {
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1;
  color: var(--color-primary-ink);
  letter-spacing: -0.02em;
  white-space: nowrap;
}
body[data-page^="article-"] .article-body .article-stat__label {
  font-size: 0.95rem;
  line-height: 1.4;
  color: var(--color-text);
  font-weight: 600;
}
body[data-page^="article-"] .article-body .article-stat__note {
  grid-column: 2;
  font-size: 0.82rem;
  color: var(--color-text-soft);
  margin-top: -0.4rem;
}
/* Regulatory-note / warning callout. Amber tint distinguishes it from the
   neutral .article-callout (blue-left) and stat (blue-soft). Use for Loi 25,
   s.347 plafond, and similar regulatory cautions. */
body[data-page^="article-"] .article-body .article-warning {
  background: #fff8e6;
  border: 1px solid #f4d97c;
  border-left: 4px solid var(--color-warning);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  color: var(--color-text);
}
body[data-page^="article-"] .article-body .article-warning__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--color-text);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
body[data-page^="article-"] .article-body .article-warning__title::before {
  content: "⚠";
  font-size: 1.1em;
  line-height: 1;
}
body[data-page^="article-"] .article-body .article-warning > :last-child { margin-bottom: 0; }
/* Comparison table - clean 2-column rows, used in vs-style articles
   (pret-temperament-vs-payday, prets-court-vs-long-terme, etc.). The article
   body has no real <table> styles otherwise. */
body[data-page^="article-"] .article-body .article-compare-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.75rem 0;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.95rem;
}
body[data-page^="article-"] .article-body .article-compare-table th,
body[data-page^="article-"] .article-body .article-compare-table td {
  padding: 0.85rem 1.25rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.5;
  border-top: 1px solid var(--color-border);
}
body[data-page^="article-"] .article-body .article-compare-table thead th {
  background: var(--color-primary-soft);
  color: var(--color-primary-ink);
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-top: 0;
}
body[data-page^="article-"] .article-body .article-compare-table tbody tr:first-child th,
body[data-page^="article-"] .article-body .article-compare-table tbody tr:first-child td {
  border-top-color: var(--color-border-strong);
}
body[data-page^="article-"] .article-body .article-compare-table th[scope="row"] {
  font-weight: 700;
  color: var(--color-text);
  background: var(--color-surface-alt);
  width: 30%;
}
/* B5. CTA secondary button - ghost-on-blue */
/* Inside the primary CTA band only, the secondary button drops its filled style
   and becomes an outlined ghost button. Visual hierarchy returns: primary is
   the white pill, secondary is the transparent border-only. */
body[data-page^="article-"] .article-cta--primary .button--secondary {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  color: #ffffff;
  box-shadow: none;
}
body[data-page^="article-"] .article-cta--primary .button--secondary:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}
/* B7. Rail CTA tile - apply-now mini-card under the TOC */
/* Hidden on tablet/mobile (where the rail is reordered above the body, and an
   apply-now CTA there would feel intrusive). Desktop only.
   Not individually sticky - the .article-shell__rail wrapper sticks as one block. */
body[data-page^="article-"] .article-rail-cta { display: none; }
@media (min-width: 1024px) {
  body[data-page^="article-"] .article-rail-cta {
    display: block;
    margin-top: 1.25rem;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(165deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: #fff;
    border-radius: var(--radius-md);
    text-decoration: none;
    box-shadow: var(--shadow-soft);
    transition: box-shadow var(--transition), transform var(--transition);
  }
  body[data-page^="article-"] .article-rail-cta:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
  }
  body[data-page^="article-"] .article-rail-cta__eyebrow {
    display: block;
    font-family: var(--font-display);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    margin-bottom: 0.5rem;
  }
  body[data-page^="article-"] .article-rail-cta__copy {
    display: block;
    font-size: 0.92rem;
    line-height: 1.45;
    color: #fff;
    margin-bottom: 0.85rem;
  }
  body[data-page^="article-"] .article-rail-cta__cta {
    display: inline-block;
    font-size: 0.9rem;
    font-weight: 700;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.4);
    padding-bottom: 1px;
  }
}
/* B6. Mobile TOC accordion */
/* The TOC partial wraps its <ol> in <details> on every viewport. On desktop
   we force-open via the [open] toggle (set inline by partial); on mobile, the
   <details> stays closed by default so the article body breathes. */
body[data-page^="article-"] .article-toc__details[data-collapsible] > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0;
  font-family: var(--font-display);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-soft);
}
body[data-page^="article-"] .article-toc__details[data-collapsible] > summary::-webkit-details-marker { display: none; }
body[data-page^="article-"] .article-toc__chevron {
  transition: transform var(--transition);
  color: var(--color-primary);
  flex-shrink: 0;
}
body[data-page^="article-"] .article-toc__details[open] .article-toc__chevron {
  transform: rotate(180deg);
}
body[data-page^="article-"] .article-toc__details[data-collapsible]:not([open]) .article-toc__list { display: none; }
/* On desktop, the TOC always shows (force-open + hide chevron). */
@media (min-width: 1024px) {
  body[data-page^="article-"] .article-toc__details[data-collapsible] {
    /* details element renders content unconditionally when [open] is set */
  }
  body[data-page^="article-"] .article-toc__details[data-collapsible] .article-toc__chevron {
    display: none;
  }
  body[data-page^="article-"] .article-toc__details[data-collapsible] > summary {
    cursor: default;
    margin-bottom: 0.75rem;
  }
}
/* C3. Org-as-author end-of-article card */
body[data-page^="article-"] .article-org-card {
  display: flex;
  gap: 1.25rem;
  padding: 1.75rem 2rem;
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  margin: 2rem 0 1rem;
  align-items: flex-start;
}
body[data-page^="article-"] .article-org-card__monogram {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--color-primary-ink);
  color: #fff;
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
body[data-page^="article-"] .article-org-card__body { flex: 1; min-width: 0; }
body[data-page^="article-"] .article-org-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 0.5rem;
}
body[data-page^="article-"] .article-org-card__bio {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--color-text-muted);
  margin: 0 0 1rem;
  max-width: 60ch;
}
body[data-page^="article-"] .article-org-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.85rem;
}
body[data-page^="article-"] .article-org-card__reviewed {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--color-text-muted);
}
body[data-page^="article-"] .article-org-card__link {
  font-weight: 700;
  color: var(--color-primary-dark);
  text-decoration: none;
  font-size: 0.9rem;
}
body[data-page^="article-"] .article-org-card__link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}
@media (max-width: 600px) {
  body[data-page^="article-"] .article-org-card {
    padding: 1.25rem 1.5rem;
  }
  body[data-page^="article-"] .article-org-card__monogram {
    width: 40px;
    height: 40px;
    font-size: 15px;
  }
}
/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  body[data-page^="article-"] *,
  body[data-page^="article-"] *::before,
  body[data-page^="article-"] *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  body[data-page^="article-"] .article-related__card:hover {
    transform: none;
  }
}