/* ==========================================================================
   Insight article: /insights/building-fm-ai-with-claude-code (v2 design)
   Page classes use the `ia-` prefix. Colours: --v2-* tokens, or the page
   tokens below (defined for both themes).
   ========================================================================== */
/* Page tokens (both themes). Accent/ink come from --v2-*; the amber "warning"
   series and the green "ok" tick of the original charts have no v2 token, so
   they are defined here per theme (same approach as total-fm.css). */
:root,
[data-theme="light"] {
  --ia-acc: var(--v2-accent);            /* accent shapes: bars, dots, lines */
  --ia-acc-text: var(--v2-accent-ink);   /* accent text inside charts */
  --ia-on-acc: #211E28;                  /* ink on accent fills (both themes) */
  --ia-warn: #D9821A;
  --ia-warn-text: #A3540B;
  --ia-ok: #3E8A40;
  --ia-term: var(--v2-surface);
}
[data-theme="dark"] {
  --ia-warn: #F8B042;
  --ia-warn-text: #F8B042;
  --ia-ok: #8FD98F;
}

/* ---------------------------------------------------------------- Layout */
.ia-wrap { max-width: calc(820px + 2 * var(--v2-gutter)); }

/* ---------------------------------------------------------------- Hero */
.ia-hero { padding-bottom: clamp(2.5rem, 1.75rem + 2.5vw, 4rem); }
.ia-hero__inner { display: grid; gap: 22px; justify-items: start; }
.ia-back {
  font-family: var(--v2-font-display);
  font-size: var(--v2-fs-small);
  font-weight: 600;
  color: var(--v2-text-muted);
  text-decoration: none;
  transition: color var(--v2-dur) ease;
}
.ia-back:hover { color: var(--v2-accent-ink); }
.ia-back:focus-visible { outline: 2px solid var(--v2-focus); outline-offset: 4px; border-radius: 4px; }
.ia-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.ia-pill {
  display: inline-block;
  padding: 7px 14px;
  border-radius: var(--v2-r-pill);
  border: 1px solid var(--v2-chip-border);
  font-size: var(--v2-fs-xs);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.04em;
  color: var(--v2-text);
}
.ia-pill--primary { background: var(--v2-accent); border-color: var(--v2-accent); color: var(--ia-on-acc); }
.ia-title {
  margin: 0;
  font-size: clamp(2.125rem, 1.6rem + 2.2vw, 3.75rem);   /* 34 → 60 */
  text-wrap: balance;
}
.ia-deck { margin: 0; }
.ia-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  width: 100%;
  margin-top: 6px;
  padding: 14px 0;
  border-top: 1px solid var(--v2-line-soft);
  border-bottom: 1px solid var(--v2-line-soft);
  font-family: var(--v2-font-display);
  font-size: var(--v2-fs-small);
  color: var(--v2-text-muted);
}
.ia-meta strong { color: var(--v2-text); font-weight: 600; }
.ia-meta__dot { opacity: 0.6; }

/* ---------------------------------------------------------------- Figures (inline SVG charts) */
.ia-figure {
  margin: 0;
  padding: clamp(12px, 0.2rem + 3vw, 36px);
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-card);
  background: var(--v2-card-bg);
  min-width: 0;
}
.ia-figure--hero { box-shadow: var(--v2-shadow-frame); background: var(--v2-glass-bg); }
.ia-figure--inline { margin: 36px 0; }
.ia-figure svg { display: block; width: 100%; height: auto; overflow: visible; }

/* ---------------------------------------------------------------- Body copy */
.ia-body {
  padding-top: clamp(2.5rem, 2rem + 2vw, 3.5rem);
  font-size: var(--v2-fs-body);
  line-height: 1.8;
  color: var(--v2-text-body);
  min-width: 0;
}
.ia-body > p { margin: 0 0 22px; }
.ia-body h2 {
  margin: clamp(3rem, 2.5rem + 2vw, 4rem) 0 18px;
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: clamp(1.75rem, 1.5rem + 1vw, 2.5rem);   /* 28 → 40 */
  line-height: var(--v2-lh-heading);
  letter-spacing: -0.02em;
  color: var(--v2-text);
  text-wrap: balance;
}
.ia-body > h2:first-child { margin-top: 0; }
.ia-h3 {
  margin: 40px 0 12px;
  font-family: var(--v2-font-display);
  font-weight: 600;
  font-size: var(--v2-fs-h4);
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--v2-text);
}
.ia-body strong { color: var(--v2-text); font-weight: 650; }
.ia-body a:not(.v2-btn) {
  color: var(--v2-accent-ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}
.ia-body a:not(.v2-btn):hover { text-decoration-thickness: 2px; }
.ia-body a:focus-visible { outline: 2px solid var(--v2-focus); outline-offset: 2px; border-radius: 2px; }
.ia-list { margin: 18px 0 26px; padding-left: 1.3em; display: grid; gap: 8px; line-height: 1.7; }
.ia-list li::marker { color: var(--v2-accent); }

/* Sources */
.ia-sources {
  margin: 14px 0 10px;
  padding-left: 1.4em;
  display: grid;
  gap: 10px;
  font-size: var(--v2-fs-small);
  line-height: 1.7;
  color: var(--v2-text-muted);
}
.ia-sources strong { color: var(--v2-text-lead); }
.ia-body > p.ia-disclaimer {
  margin: 10px 0 0;
  font-size: var(--v2-fs-xs);
  font-style: italic;
  line-height: 1.6;
  color: var(--v2-text-muted);
}

/* Pull quote */
.ia-quote {
  display: grid;
  gap: 14px;
  margin: 40px 0;
  padding: clamp(22px, 1rem + 1.5vw, 30px) clamp(22px, 1rem + 2vw, 34px);
  border-left: 3px solid var(--v2-accent);
  border-radius: 0 var(--v2-r-banner) var(--v2-r-banner) 0;
  background: var(--v2-accent-tint);
}
.ia-quote__text {
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.875rem);   /* 22 → 30 */
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: var(--v2-text);
}
.ia-quote__attr {
  font-size: var(--v2-fs-eyebrow);
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v2-accent-ink);
}

/* Stat row */
.ia-stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 36px 0;
}
@media (min-width: 700px) { .ia-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ia-stat {
  display: grid;
  gap: 10px;
  align-content: start;
  padding: 26px 22px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-card);
  background: var(--v2-card-bg);
  text-align: center;
}
.ia-stat__num {
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 2.2rem + 2vw, 4rem);   /* 44 → 64 */
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--v2-accent-ink);
}
.ia-stat__lbl { font-size: var(--v2-fs-small); line-height: 1.5; color: var(--v2-text-muted); }

/* Comparison table (div grid; cells get data-label from the page script for phones) */
.ia-table {
  margin: 36px 0;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-card);
  background: var(--v2-card-bg);
  overflow: hidden;
}
.ia-table__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-top: 1px solid var(--v2-line-soft);
}
.ia-table__row:first-child { border-top: 0; }
.ia-table__row > div {
  padding: 16px 20px;
  font-size: var(--v2-fs-ui);
  line-height: 1.55;
  color: var(--v2-text-body);
}
.ia-table__row > div + div { border-left: 1px solid var(--v2-line-soft); }
.ia-table__head { background: var(--v2-banner-bg); }
.ia-table__head > div {
  padding-block: 14px;
  font-size: var(--v2-fs-eyebrow);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--v2-text-muted);
}
.ia-table__row > .ia-table__key { font-family: var(--v2-font-display); font-weight: 600; color: var(--v2-text); }
.ia-table__row > .ia-table__best { color: var(--v2-accent-ink); font-weight: 600; background: var(--v2-accent-tint); }
@media (max-width: 699px) {
  .ia-table__row { grid-template-columns: 1fr; }
  .ia-table__row > div + div { border-left: 0; border-top: 1px dashed var(--v2-line-soft); }
  .ia-table__head { display: none; }
  .ia-table__row:nth-child(2) { border-top: 0; }
  .ia-table__row > div[data-label]::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    font-family: var(--v2-font-display);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--v2-text-muted);
  }
  .ia-table__row > .ia-table__key {
    padding-block: 10px;
    background: var(--v2-banner-bg);
    font-size: var(--v2-fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
}

/* Closing CTA */
.ia-divider { margin: 56px 0; }
.ia-cta {
  display: grid;
  justify-items: center;
  gap: 14px;
  margin: 56px 0 0;
  padding: clamp(28px, 1rem + 3vw, 52px) clamp(22px, 1rem + 3vw, 48px);
  border: 1px solid var(--v2-accent-tint-border);
  border-radius: var(--v2-r-panel);
  background: var(--v2-grad-hero);
  text-align: center;
}
.ia-divider + .ia-cta { margin-top: 0; }
.ia-cta h3 {
  margin: 0;
  font-family: var(--v2-font-display);
  font-weight: 500;
  font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);   /* 24 → 36 */
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: var(--v2-text);
  text-wrap: balance;
}
.ia-cta p { margin: 0 0 8px; max-width: 580px; font-size: var(--v2-fs-ui); line-height: 1.6; color: var(--v2-text-body); }

/* ---------------------------------------------------------------- Page overrides */
/* The pitch figures are ranges with long footnoted labels: smaller numerals, left-aligned. */
.ia-stat { text-align: left; }
.ia-stat__num { font-size: clamp(1.75rem, 1.5rem + 1vw, 2.375rem); letter-spacing: -0.03em; }
/* Line item | pitch / reality: give the long second column the room. */
@media (min-width: 700px) {
  .ia-table__row { grid-template-columns: minmax(0, 0.38fr) minmax(0, 1fr); }
}

/* ---------------------------------------------------------------- "Update, 15 May 2026" callout */
.ia-update {
  margin: 0 0 32px;
  padding: 18px 22px;
  border-left: 3px solid var(--v2-accent);
  border-radius: 0 var(--v2-r-sm) var(--v2-r-sm) 0;
  background: var(--v2-accent-tint);
}
.ia-body .ia-update__text { margin: 0; font-size: var(--v2-fs-small); line-height: 1.65; color: var(--v2-text-body); }
.ia-body .ia-update__lbl { color: var(--v2-accent-ink); }

/* ---------------------------------------------------------------- Office layer / trade line / FM layer */
.ia-layers { margin: 36px 0; border-radius: var(--v2-r-card); overflow: hidden; }
.ia-layer { padding: clamp(20px, 1rem + 1vw, 26px); }
.ia-layer--office {
  border: 1px solid var(--v2-border);
  border-bottom: 0;
  border-radius: var(--v2-r-card) var(--v2-r-card) 0 0;
  background: var(--v2-card-bg);
}
.ia-layer--fm {
  border: 1px solid var(--v2-accent-tint-border);
  border-top: 0;
  border-radius: 0 0 var(--v2-r-card) var(--v2-r-card);
  background: var(--v2-accent-tint);
}
.ia-layer__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 12px;
  margin-bottom: 18px;
}
.ia-layer__label {
  font-family: var(--v2-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--v2-text-muted);
}
.ia-layer__label--acc { color: var(--v2-accent-ink); }
.ia-layer__note { font-size: 14px; line-height: 1.4; color: var(--v2-text-muted); }
.ia-layer__pills { display: flex; flex-wrap: wrap; gap: 8px; }
.ia-lpill {
  display: inline-block;
  padding: 7px 13px;
  border: 1px solid var(--v2-border);
  border-radius: var(--v2-r-pill);
  background: var(--v2-card-bg);
  font-size: 14px;
  line-height: 1.4;
  color: var(--v2-text-body);
}
.ia-lpill--acc { border-color: var(--v2-accent-tint-border); background: var(--v2-accent-tint); color: var(--v2-text); }
.ia-layer__foot { margin-top: 16px; font-size: 13px; font-style: italic; line-height: 1.5; color: var(--v2-text-muted); }
.ia-layer__foot--acc { color: var(--v2-accent-ink); }
.ia-tradeline {
  position: relative;
  padding: 14px 0;
  border-left: 1px solid var(--v2-border);
  border-right: 1px solid var(--v2-border);
  background: var(--v2-bg);
  text-align: center;
}
.ia-tradeline__line {
  position: absolute;
  top: 50%;
  left: 6%;
  right: 6%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--v2-accent), transparent);
}
.ia-tradeline__label {
  position: relative;
  display: inline-block;
  padding: 0 16px;
  background: var(--v2-bg);
  font-family: var(--v2-font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--v2-accent-ink);
}

/* ---------------------------------------------------------------- SVG chart colours (generated from the original palette) */
.ia-svg .f-acc { fill: var(--ia-acc); }
.ia-svg .f-acct { fill: var(--ia-acc-text); }
.ia-svg .f-bg { fill: var(--v2-bg); }
.ia-svg .f-ink { fill: var(--v2-text); }
.ia-svg .f-ink-14 { fill: var(--v2-text); fill-opacity: 0.14; }
.ia-svg .f-ink-45 { fill: var(--v2-text); fill-opacity: 0.45; }
.ia-svg .f-mute { fill: var(--v2-text-muted); }
.ia-svg .f-term { fill: var(--ia-term); }
.ia-svg .f-warnt { fill: var(--ia-warn-text); }
.ia-svg .s-acc { stroke: var(--ia-acc); }
.ia-svg .s-ink-10 { stroke: var(--v2-text); stroke-opacity: 0.1; }
.ia-svg .s-ink-12 { stroke: var(--v2-text); stroke-opacity: 0.12; }
.ia-svg .s-ok { stroke: var(--ia-ok); }
.ia-svg .s-warn { stroke: var(--ia-warn); }
.ia-svg .sc-acc { stop-color: var(--ia-acc); }
.ia-svg .sc-ink { stop-color: var(--v2-text); }
