/* =====================================================================
   D - Content Block — generic rich-text block (Figma 10159:3723 /
   10159:3724 / 10159:3764). Heading (H2/H3) + optional rich body +
   optional list. Designed to be rendered ~20x per page via {{#each}}.
   Desktop locked to the 1240 content area; fluid below via --container.
   Tokens only.
   ===================================================================== */

.content-block {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--cb-gap);
  color: var(--cb-text);
  word-break: break-word;
  /* The FIRST content-block in a run follows a different section (a title-banner,
     stats band, etc.) which owns its own padding-block; without this the heading
     butts right against that section. Consecutive blocks reset it (rule below) and
     keep the tight --cb-block-gap rhythm instead. */
  padding-block-start: var(--cb-section-pad-top);
}

/* Vertical rhythm BETWEEN consecutive blocks. Each block is its own <section>,
   so the internal flex gap doesn't separate one block from the next — without
   this, a heading butts against the previous block's last paragraph. (Mobile
   separates blocks via padding-block, so this is reset there.) */
.content-block + .content-block { margin-top: var(--cb-block-gap); padding-block-start: 0; }
/* A content-block that ends the page needs bottom padding so it doesn't butt the footer. */
.content-block:last-child { padding-block-end: var(--cb-section-pad-top); }

/* ---- Heading (Axiforma Medium) ---- */
.content-block__heading {
  margin: 0;
  font-weight: var(--fw-medium);
  color: var(--cb-text);
}
.content-block__heading--h2 {
  font-size: var(--fs-32);
  line-height: var(--lh-45);
}
.content-block__heading--h3 {
  font-size: var(--fs-24);
  line-height: 1.2;
}
.content-block__heading--h4 {
  font-size: var(--fs-20);
  font-weight: var(--fw-semibold);
  line-height: 1.3;
}

/* ---- Body (Axiforma Regular 16/normal); rich text via {{{raw}}} ---- */
.content-block__body {
  font-size: var(--fs-16);
  font-weight: var(--fw-regular);
  line-height: normal;
}
.content-block__body p {
  margin: 0 0 var(--cb-gap);
}
.content-block__body p:last-child {
  margin-bottom: 0;
}
/* Inline emphasis runs inside the body (e.g. lead term set in bold). */
.content-block__body strong,
.content-block__body b {
  font-weight: var(--fw-bold);
  font-size: var(--fs-18);
  line-height: var(--lh-25);
}
.content-block__body a {
  color: var(--dusty-blue);
  text-decoration: underline;
}

/* ---- Comparison tables (e.g. ETF tickers + expense ratios) ---- */
.content-block__body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--cb-gap) 0;
  font-size: var(--fs-16);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-10);
  overflow: hidden;
}
.content-block__body th,
.content-block__body td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--color-border);
  vertical-align: top;
  line-height: var(--lh-25);
}
.content-block__body thead th {
  background: var(--pale-blue);
  font-weight: var(--fw-semibold);
  color: var(--gray-8);
}
.content-block__body tbody tr:last-child td { border-bottom: 0; }
.content-block__body tbody tr:nth-child(even) { background: var(--pale-blue); }
/* horizontal scroll for wide tables on small screens */
@media (max-width: 767.98px) {
  .content-block__body table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ---- Optional list ---- */
.content-block__list {
  display: flex;
  flex-direction: column;
  gap: var(--cb-list-gap);
  font-size: var(--fs-16);
  line-height: normal;
}
.content-block__item {
  position: relative;
  padding-left: var(--cb-bullet-pad);
}
.content-block__item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5em;
  width: var(--cb-bullet-size);
  height: var(--cb-bullet-size);
  border-radius: 50%;
  background: var(--cb-text);
}

/* ---- Tablet (768–1023): step heading and section padding ---- */
@media (max-width: 1023.98px) {
  .content-block__heading--h2 {
    font-size: var(--fs-28);
    line-height: 1.3;
  }
  .content-block {
    padding-block-start: 48px;
  }
  .content-block:last-child {
    padding-block-end: 48px;
  }
}

/* =====================================================================
   Mobile — M - Content Block (Figma 10159:4439…) 360-wide.
   Block gap 10px, vertical pad 20px. H2 is the OG-Mobile H2 (26/36).
   Body stays 16px; the inline bold lead drops from 18px to 16px (mobile
   has no enlarged lead run). New tokens reported: --fs-26, --lh-36.
   ===================================================================== */
@media (max-width: 767.98px) {
  .content-block { gap: 10px; padding-block: 20px; }
  .content-block + .content-block { margin-top: 0; } /* padding-block already separates blocks */
  .content-block__heading--h2 { font-size: 26px; line-height: 36px; }
  .content-block__heading--h3 {
    font-size: clamp(20px, 5.6vw, var(--fs-24));
  }
  .content-block__body strong,
  .content-block__body b {
    font-size: var(--fs-16);
    line-height: normal;
  }
}

/* ---- Phone (≤599): restore last-child padding-block-end — matches main ≤599 ---- */
@media (max-width: 599.98px) {
  .content-block:last-child {
    padding-block-end: var(--cb-section-pad-top); /* 56px — tablet's 48px leaked via 1023.98 */
  }
}
