/* ===========================================================================
   Capistrano — Insights article typography & visual system.
   Loaded AFTER the main bundle so these rules win on equal specificity. Tailwind's
   prose plugin uses :where() (0 specificity), so plain .prose selectors override it.
   Scope: the article body  <div class="... prose prose-navy">.
   Palette (site brand): navy 205 70% 15% · ivory 38 33% 95% · brass/gold 35 41% 52%
                         · charcoal 210 18% 16% · stone 35 22% 90% · muted 210 12% 44%
   =========================================================================== */

:root {
  --ins-navy: 205 70% 15%;
  --ins-gold: 35 41% 52%;
  --ins-ink: 210 18% 18%;
  --ins-stone: 35 22% 88%;
  --ins-muted: 210 12% 42%;
  --ins-cream: 38 36% 97%;
}

/* ---- Measure & base rhythm ------------------------------------------------ */
.prose {
  font-family: var(--font-sans, "Inter", system-ui, sans-serif);
  color: hsl(var(--ins-ink));
  font-size: 1.075rem;
  line-height: 1.8;
  max-width: 44rem;
}
.prose > * + * { margin-top: 0; }
.prose p {
  margin: 0 0 1.4rem;
  color: hsl(var(--ins-ink));
}

/* Lead paragraph — sets the tone, with an elegant drop cap. */
.prose > p:first-of-type {
  font-size: 1.32rem;
  line-height: 1.65;
  color: hsl(var(--ins-navy));
  margin-bottom: 1.9rem;
}
.prose > p:first-of-type::first-letter {
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 3.6em;
  font-weight: 600;
  float: left;
  line-height: 0.72;
  padding: 0.06em 0.12em 0 0;
  color: hsl(var(--ins-gold));
}

/* ---- Section headings — the core ask: bigger, bolder, clearly above body -- */
.prose h2 {
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 2.05rem;
  line-height: 1.15;
  font-weight: 600;
  color: hsl(var(--ins-navy));
  margin: 3rem 0 1rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid hsl(var(--ins-stone));
}
/* gold kicker rule above each section header for visual rhythm */
.prose h2::before {
  content: "";
  display: block;
  width: 2.4rem;
  height: 3px;
  margin-bottom: 0.9rem;
  background: hsl(var(--ins-gold));
  border-radius: 2px;
}
.prose h2:first-child { margin-top: 0; }

.prose h3 {
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.4rem;
  line-height: 1.25;
  font-weight: 600;
  color: hsl(var(--ins-navy));
  margin: 2rem 0 0.6rem;
}

/* ---- Lists — generous spacing, gold markers, readable lead-ins ----------- */
.prose ul, .prose ol { margin: 0 0 1.6rem; padding-left: 0; }
.prose ul { list-style: none; }
.prose ul li {
  position: relative;
  padding-left: 1.6rem;
  margin-bottom: 0.85rem;
  line-height: 1.7;
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0.1rem;
  top: 0.72em;
  width: 7px;
  height: 7px;
  background: hsl(var(--ins-gold));
  transform: rotate(45deg);
}
.prose ol { list-style: none; counter-reset: ins-ol; }
.prose ol li {
  position: relative;
  padding-left: 2.2rem;
  margin-bottom: 0.85rem;
  line-height: 1.7;
  counter-increment: ins-ol;
}
.prose ol li::before {
  content: counter(ins-ol);
  position: absolute;
  left: 0;
  top: 0.05em;
  width: 1.55rem;
  height: 1.55rem;
  background: hsl(var(--ins-navy));
  color: #fff;
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.prose li strong, .prose li b { color: hsl(var(--ins-navy)); }

/* ---- Links, emphasis ----------------------------------------------------- */
.prose a {
  color: hsl(var(--ins-gold));
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:hover { color: hsl(var(--ins-navy)); }
.prose strong { color: hsl(var(--ins-navy)); font-weight: 600; }

/* ---- Blockquote → pull-callout ------------------------------------------- */
.prose blockquote {
  margin: 2rem 0;
  padding: 0.4rem 0 0.4rem 1.4rem;
  border-left: 3px solid hsl(var(--ins-gold));
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.45rem;
  font-style: italic;
  line-height: 1.4;
  color: hsl(var(--ins-navy));
}
.prose blockquote p { margin: 0; color: inherit; }

/* ---- Tables -------------------------------------------------------------- */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8rem 0;
  font-size: 0.98rem;
}
.prose th, .prose td {
  border: 1px solid hsl(var(--ins-stone));
  padding: 0.7rem 0.9rem;
  text-align: left;
  vertical-align: top;
}
.prose thead th {
  background: hsl(var(--ins-navy));
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
}
.prose tbody tr:nth-child(even) { background: hsl(var(--ins-cream)); }

/* ---- Divider ------------------------------------------------------------- */
.prose hr {
  border: 0;
  height: 1px;
  background: hsl(var(--ins-stone));
  margin: 2.8rem 0;
  position: relative;
  overflow: visible;
}
.prose hr::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 7px;
  height: 7px;
  background: hsl(var(--ins-gold));
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ===========================================================================
   VISUAL BLOCKS — the writer agent emits these for callouts, stats, steps,
   comparisons, and diagrams. All self-contained so they render anywhere in the body.
   =========================================================================== */

/* Callout / key-takeaway */
.cap-callout {
  background: hsl(var(--ins-cream));
  border: 1px solid hsl(var(--ins-stone));
  border-left: 3px solid hsl(var(--ins-gold));
  border-radius: 12px;
  padding: 1.1rem 1.3rem;
  margin: 1.9rem 0;
}
.cap-callout .cap-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: hsl(var(--ins-gold));
  margin-bottom: 0.45rem;
}
.cap-callout p:last-child { margin-bottom: 0; }

/* Key-stats grid */
.cap-keystats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.9rem;
  margin: 1.9rem 0;
}
.cap-stat {
  background: #fff;
  border: 1px solid hsl(var(--ins-stone));
  border-radius: 12px;
  padding: 1rem 1.1rem;
}
.cap-stat b, .cap-stat strong {
  display: block;
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 600;
  color: hsl(var(--ins-gold));
}
.cap-stat span {
  display: block;
  font-size: 0.8rem;
  color: hsl(var(--ins-muted));
  margin-top: 0.4rem;
  line-height: 1.35;
}

/* Numbered steps */
.cap-steps { display: grid; gap: 0.7rem; margin: 1.9rem 0; counter-reset: cap-step; }
.cap-step {
  position: relative;
  background: hsl(var(--ins-cream));
  border: 1px solid hsl(var(--ins-stone));
  border-radius: 10px;
  padding: 0.95rem 1.1rem 0.95rem 3.2rem;
  counter-increment: cap-step;
}
.cap-step::before {
  content: counter(cap-step);
  position: absolute;
  left: 0.9rem;
  top: 0.9rem;
  width: 1.7rem;
  height: 1.7rem;
  background: hsl(var(--ins-navy));
  color: #fff;
  font-family: var(--font-serif, "Cormorant Garamond", Georgia, serif);
  font-weight: 600;
  border-radius: 999px;
  display: grid;
  place-items: center;
}
.cap-step b, .cap-step strong { color: hsl(var(--ins-navy)); font-weight: 600; }

/* Figure / diagram wrapper (for inline SVG charts) */
.cap-figure {
  margin: 1.9rem 0;
  background: #fff;
  border: 1px solid hsl(var(--ins-stone));
  border-radius: 12px;
  padding: 1.2rem;
  text-align: center;
}
.cap-figure svg { width: 100%; height: auto; display: block; }
.cap-figure figcaption {
  font-size: 0.8rem;
  color: hsl(var(--ins-muted));
  margin-top: 0.7rem;
  text-align: center;
}

/* ---- Mobile ------------------------------------------------------------- */
@media (max-width: 640px) {
  .prose { font-size: 1.02rem; }
  .prose h2 { font-size: 1.7rem; }
  .prose > p:first-of-type { font-size: 1.18rem; }
  .prose blockquote { font-size: 1.25rem; }
}
