/* Artiweave article pages (guides, hubs, /about/ and /guides/).
   Loaded AFTER /assets/fonts.css and the homepage's /style.css, which supply
   the fonts, the header (.nav, .wordmark, .nav-action) and the footer, so
   both match the homepage exactly. This file adds only the reading layout.
   Everything is scoped under body.page.

   Colour pairs (WCAG 2.2 contrast, AA needs 4.5:1 for body-size text):
     --text  #2a2931 on #fafafa 13.78:1   on --tint #f3f0ff 12.82:1
     --muted #636170 on #fafafa  5.79:1   on #ffffff 6.04:1
     --link  #5b3fd9 on #fafafa  6.37:1   on --tint 5.93:1, on #ffffff 6.65:1
     code    #3b2f6b on --tint  10.37:1
     dark panels (--night #111116, #221e40 at the violet glow's strongest):
       #c5b8ff 8.79:1, #d3d1dc 10.26:1, #aaa4b8 6.56:1 (all at the glow)
     button  #15151c on #ffffff 18.17:1
     footer links #625d6b on #fafafa 6.10:1
   --violet #7157ff (4.46:1) is decoration only: rules, markers, borders. */

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url(/assets/ibm-plex-mono-400.woff2) format('woff2');
}

body.page {
  --text: #2a2931;
  --muted: #636170;
  --violet: #7157ff;
  --link: #5b3fd9;
  --tint: #f3f0ff;
  --night: #111116;
  --card: #fff;
  --measure: 38rem;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  background: #fafafa;
  color: var(--text);
}

/* ---------- Footer: the homepage's footer, with readable link colour ---------- */
/* style.css gives footer links #89838e (3.53:1 on #fafafa); darken them here. */
body.page footer > div { color: #625d6b; font-size: 12px; flex-wrap: wrap; justify-content: flex-end; gap: 10px 22px; }
body.page footer > div a:hover { color: var(--link); }
body.page footer .wordmark svg { height: 28px; }

/* ---------- Title panel: the homepage's dark hero, scaled to an article ---------- */
.article-main { padding-bottom: 24px; }
.article-head {
  margin: 0 24px;
  padding: 64px max(28px, calc(50% - var(--measure) / 2)) 56px;
  background:
    radial-gradient(ellipse 60% 90% at 100% 0%, #7157ff2e, transparent 70%),
    var(--night);
  color: #fff;
  border-radius: 12px;
}
.article-head .ap-crumb { font-size: 13px; color: #aaa4b8; margin: 0 0 22px; }
.article-head .ap-crumb a { color: #d3d1dc; text-decoration: underline; text-decoration-color: #ffffff40; text-underline-offset: 3px; }
.article-head .ap-crumb a:hover { color: #fff; }
body.page .article-head .eyebrow {
  margin: 0; font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: #c5b8ff;
}
.article-head h1 {
  font: 500 clamp(34px, 4.4vw, 52px)/1.06 var(--display);
  letter-spacing: -.045em;
  margin: 18px 0 0;
  text-wrap: balance;
}
.article-meta {
  display: flex; flex-wrap: wrap; gap: 6px 20px;
  margin: 22px 0 0; font-size: 13px; color: #aaa4b8;
}
.article-lede {
  margin: 22px 0 0;
  font-size: 18px; line-height: 1.65; color: #d3d1dc;
}

/* ---------- Reading column ---------- */
.article-body {
  max-width: calc(var(--measure) + 56px);
  margin: 0 auto;
  padding: 40px 28px 72px;
}
.article-body > * + * { margin-top: 20px; }
.article-body p, .article-body li { font-size: 18px; line-height: 1.7; color: var(--text); }
.article-body p { margin: 0; }
.article-body * + p { margin-top: 18px; }
.article-body h2 {
  font: 500 clamp(26px, 3vw, 34px)/1.15 var(--display);
  letter-spacing: -.035em; color: var(--ink);
  margin: 60px 0 0; text-wrap: balance;
}
.article-body h3 {
  font: 500 21px/1.3 var(--display);
  letter-spacing: -.02em; color: var(--ink);
  margin: 36px 0 0;
}
.article-body h2 + *, .article-body h3 + * { margin-top: 14px; }
.article-body ul, .article-body ol { padding-left: 24px; margin-bottom: 0; }
.article-body li { margin-top: 8px; padding-left: 4px; }
.article-body li::marker { color: var(--violet); }
.article-body ol > li::marker { font-weight: 600; }
.article-body a {
  color: var(--link);
  text-decoration: underline; text-decoration-thickness: 1px;
  text-decoration-color: #5b3fd966; text-underline-offset: 3px;
}
.article-body a:hover { text-decoration-color: currentColor; }
.article-body strong { font-weight: 600; color: var(--ink); }
/* Footnote markers: keep them from opening up the line spacing. */
.article-body sup { font-size: .7em; line-height: 0; vertical-align: super; }
.article-body figure { margin: 32px 0; }
.article-body code {
  font-family: var(--mono); font-size: .86em;
  background: var(--tint); color: #3b2f6b;
  padding: .1em .35em; border-radius: 4px;
  overflow-wrap: anywhere;
}

/* ---------- Callout / key answer ---------- */
.ap-callout {
  background: var(--tint);
  border: 1px solid #e3dcff;
  border-left: 3px solid var(--violet);
  border-radius: 0 10px 10px 0;
  padding: 22px 26px;
  margin: 36px 0;
}
.article-body .ap-callout-kicker {
  font-size: 12px; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--link); margin: 0 0 8px;
}
.ap-callout p + p { margin-top: 10px; }

/* ---------- Big stat blocks ---------- */
.ap-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin: 32px 0; }
.ap-stat { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px 20px 18px; }
.ap-stat-num {
  display: block; font: 500 34px/1.1 var(--display);
  letter-spacing: -.04em; color: var(--link);
  font-variant-numeric: tabular-nums;
}
.ap-stat-label { display: block; font-size: 14px; line-height: 1.5; color: var(--text); margin-top: 8px; }
.ap-stat-src { display: block; font-size: 13px; margin-top: 10px; }
.article-body .ap-stat-src a { color: var(--muted); }

/* ---------- Tables ---------- */
.ap-table-scroll { overflow-x: auto; margin: 32px 0; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.ap-table { border-collapse: collapse; width: 100%; font-size: 15px; line-height: 1.55; }
.ap-table th {
  font-size: 12px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-align: left; vertical-align: bottom;
  padding: 14px 18px 10px; border-bottom: 1px solid var(--line);
}
.ap-table td { padding: 12px 18px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--text); }
.ap-table tr:last-child td { border-bottom: 0; }
.ap-table td:first-child { font-weight: 500; color: var(--ink); }
/* On wide screens, tables may run a little wider than the text measure. */
@media (min-width: 900px) { .ap-table-scroll { margin-left: -56px; margin-right: -56px; } }

/* ---------- FAQ and sources ---------- */
.ap-faq { margin: 36px 0; }
.ap-faq h3 { margin-top: 28px; font-size: 19px; }
.ap-faq h3 + p { margin-top: 8px; }
.ap-sources { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--line); }
.article-body .ap-sources h2 { font-size: 22px; margin-top: 0; }
.ap-sources ol { margin-top: 12px; }
.article-body .ap-sources li { font-size: 14px; line-height: 1.6; color: var(--muted); overflow-wrap: anywhere; }

/* ---------- Call to action: the homepage's dark panel and white button ---------- */
.ap-cta {
  background: radial-gradient(ellipse 70% 120% at 100% 100%, #7157ff33, transparent 70%), var(--night);
  color: #fff; border-radius: 12px;
  padding: 40px 36px; margin: 60px 0 0;
}
.article-body .ap-cta h2 { margin-top: 0; font-size: clamp(26px, 3vw, 32px); color: #fff; }
.article-body .ap-cta p { color: #d3d1dc; font-size: 16px; margin-top: 12px; }
.article-body .ap-cta .capture { margin-top: 22px; }
.article-body .ap-cta a.btn-primary {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px; margin-top: 8px; border-radius: 6px;
  background: #fff; color: #15151c;
  font-size: 14px; font-weight: 600; text-decoration: none;
}
.article-body .ap-cta a.btn-primary:hover { box-shadow: 0 5px 25px #7157ff55; transform: translateY(-1px); }
.article-body .ap-cta .capture-note { font-size: 14px; }
.article-body .ap-cta .capture-note a { color: #fff; text-decoration-color: #ffffff66; }

/* ---------- Guides index (/guides/) ---------- */
.guide-hub { margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--line); }
.guide-hub:first-of-type { margin-top: 32px; }
.article-body .guide-hub h2 { margin-top: 0; }
.article-body .guide-hub > p { color: var(--muted); font-size: 17px; }
.article-body .guide-list { list-style: none; padding: 0; margin: 18px 0 0; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.article-body .guide-list li { margin: 0; padding: 0; border-top: 1px solid var(--line); font-size: 17px; }
.article-body .guide-list li:first-child { border-top: 0; }
.article-body .guide-list a {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 18px; color: var(--ink); text-decoration: none; font-weight: 500;
}
.article-body .guide-list a::after { content: '\2197' / ''; color: var(--link); flex: none; }
.article-body .guide-list a:hover { color: var(--link); background: #faf9ff; }

@media (max-width: 640px) {
  .article-head { margin: 0 12px; padding: 40px 22px 36px; border-radius: 10px; }
  .article-head h1 { font-size: 32px; letter-spacing: -.04em; }
  .article-lede { font-size: 17px; }
  .article-body { padding: 28px 20px 56px; }
  .article-body p, .article-body li { font-size: 17px; }
  .article-body h2 { margin-top: 48px; font-size: 26px; }
  .ap-callout { padding: 18px 20px; }
  .ap-cta { padding: 30px 22px; }
  body.page footer { margin: 0 6%; }
  body.page footer > div { justify-content: flex-start; font-size: 13px; gap: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .article-body .ap-cta a.btn-primary:hover { transform: none; }
}
