/* =====================================================================
   Explainer Cards (icons/images + CTAs) — Figma 6190:24450
   A bordered white card locked to the 1240 area: header (H2 Medium 32/45 +
   Large Body 18/25 lead), a 3-up row of small feature cards, then an optional
   footer (normal-body line + a single centred CTA).

   Variants (content-flag -> root modifier class):
     default              — icon cards on a soft-blue gradient + soft-blue
                            border; shared footer CTA (Type=Icons, CTA=1).
     --cta-per-card       — gray-bordered cards, each with its own CTA button;
                            no shared footer (Type=Icons, CTA=3).
     --images             — media-panel cards (gray border) instead of icons
                            (Type=Images, CTA=1).
   Desktop styles + a mobile block (<=767.98px) that stacks the 3-up row into a
   single column and reduces the heading type. Tokens only — no raw hex where a
   token exists.
   ===================================================================== */

.explainer-cards {
  background: var(--gray-0);
  padding-block: var(--home-sec-pad-y);
}

.explainer-cards__inner {
  display: flex;
  flex-direction: column;
}

/* ---- Outer card: white, gray border, 8px radius, 40px padding ---- */
.explainer-cards__card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--cb-gap); /* 20px */
  width: 100%;
  padding: var(--redeem-adv-card-pad); /* 40px */
  background: var(--gray-0);
  border: var(--redeem-rule-w) solid var(--color-border-soft);
  border-radius: var(--radius-8);
}

/* ---- Header (centred): H2 + Large Body lead ---- */
.explainer-cards__header {
  display: flex;
  flex-direction: column;
  gap: var(--cb-gap); /* 20px */
  width: 100%;
  text-align: center;
}

/* Heading — OG Desktop H2 (Axiforma Medium 32/45) */
.explainer-cards__heading {
  margin: 0;
  font-weight: var(--fw-medium);
  font-size: var(--fs-32);
  line-height: var(--lh-45);
  color: var(--gray-8);
  word-break: break-word;
}

/* Lead — OG Desktop Large Body (Axiforma Regular 18/25) */
.explainer-cards__lead {
  margin: 0;
  font-weight: var(--fw-regular);
  font-size: var(--fs-18);
  line-height: var(--lh-25);
  color: var(--gray-8);
  word-break: break-word;
}

/* ---- Feature row: 3 small cards across, 20px gap ---- */
.explainer-cards__row {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--cb-gap); /* 20px */
  width: 100%;
  align-items: stretch;
}

/* ---- Small feature card ---- */
.explainer-cards__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--redeem-adv-content-gap); /* 10px */
  padding: var(--home-compare-pad); /* 20px */
  text-align: center;
  border: var(--redeem-rule-w) solid var(--soft-blue);
  border-radius: var(--radius-8);
  /* Default (Type=Icons): white -> soft-blue vertical gradient. */
  background: var(--explainer-cards-icon-grad);
}

/* CTA-per-card + Image variants: plain gray-bordered cards on white. */
.explainer-cards__card--cta-per-card .explainer-cards__item,
.explainer-cards__card--images .explainer-cards__item {
  background: var(--gray-0);
  border-color: var(--color-border-soft);
}
/* CTA-per-card spaces the icon/title/body/button at 20px. */
.explainer-cards__card--cta-per-card .explainer-cards__item {
  gap: var(--cb-gap); /* 20px */
}

/* Icon — 40px brand glyph (size from img width/height attributes). */
.explainer-cards__icon {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.explainer-cards__icon img {
  display: block;
  object-fit: contain;
}

/* Media panel — full-width, 360px tall, gray placeholder behind the image. */
.explainer-cards__media {
  flex: none;
  margin: 0;
  width: 100%;
  height: var(--explainer-cards-media-h);
  border-radius: var(--radius-8);
  overflow: hidden;
  background: var(--gray-7);
}
.explainer-cards__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Item title — OG Desktop H4 (Axiforma SemiBold 20) */
.explainer-cards__item-title {
  margin: 0;
  font-weight: var(--fw-semibold);
  font-size: var(--fs-20);
  line-height: normal;
  color: var(--gray-8);
  word-break: break-word;
}

/* Item body — OG Normal Body (Axiforma Regular 16) */
.explainer-cards__item-body {
  margin: 0;
  font-weight: var(--fw-regular);
  font-size: var(--fs-16);
  line-height: normal;
  color: var(--gray-8);
  word-break: break-word;
}

/* Per-card CTA pinned to the bottom of the card so buttons align across the row. */
.explainer-cards__item-cta {
  flex: none;
  margin-top: auto;
}

/* ---- Footer note — OG Normal Body, centred ---- */
.explainer-cards__note {
  margin: 0;
  width: 100%;
  font-weight: var(--fw-regular);
  font-size: var(--fs-16);
  line-height: normal;
  color: var(--gray-8);
  text-align: center;
  word-break: break-word;
}

/* Shared footer CTA — reuses .btn / .btn--primary; layout override only. */
.explainer-cards__cta {
  flex: none;
}

/* =====================================================================
   --limit variant (Figma 8759:26793) — limit-orders "Why use limit orders"
   block. Scoped entirely behind .explainer-cards--limit so the default look
   (how-it-works/contact/vaulted-platinum/gallery) is unaffected.
     - Outer card: flush (no border, no 40px padding); radius retained.
     - Header: lead-only, centred (page omits the heading).
     - Feature cards: FLAT pale-blue fill, soft-blue border, card glow.
     - Card title: blue gradient text. Card body: Normal Body, centred.
     - Two-button CTA row, centred, each button fixed 160px wide, no arrow.
   ===================================================================== */
.explainer-cards--limit .explainer-cards__card {
  border: 0;
  padding: 0;
  /* The flush card drops the default 40px framing, so loosen the vertical
     rhythm between lead <-> card row <-> CTAs (was a cramped 20px). */
  gap: 40px;
}

/* Lead — Axiforma Regular 18/25, --gray-8, centred (header already centred). */
.explainer-cards--limit .explainer-cards__lead {
  font-size: var(--fs-18);
  line-height: var(--lh-25);
}

/* Feature card — flat pale-blue, soft-blue border, glow. Roomier padding/gap
   so the icon, title and body aren't cramped. */
.explainer-cards--limit .explainer-cards__item {
  gap: 14px;
  padding: 28px 24px;
  background: var(--pale-blue);
  border-color: var(--soft-blue);
  box-shadow: var(--explainer-cards-card-glow);
}

/* Card title — Axiforma SemiBold 20 rendered as blue gradient text. */
.explainer-cards--limit .explainer-cards__item-title {
  background: var(--explainer-cards-title-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Two-button CTA row — centred, wraps; buttons fixed 160px, no trailing arrow. */
.explainer-cards__ctas {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--redeem-adv-content-gap); /* 10px */
  width: 100%;
}
.explainer-cards__ctas-btn {
  flex: none;
  width: 160px;
}

/* ---- Tablet (600–1023px): 3-up → 2-up grid ---- */
@media (max-width: 1023.98px) {
  .explainer-cards__row {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---- Large-mobile / phone (<=599.98px): stack to single column, reduce heading type ---- */
@media (max-width: 599.98px) {
  .explainer-cards {
    padding-block: var(--ta-pad-y-mobile); /* 50px */
  }

  .explainer-cards__card {
    padding: var(--home-compare-pad); /* 20px */
  }

  /* --limit outer card stays flush (no border/padding) on mobile too. */
  .explainer-cards--limit .explainer-cards__card {
    padding: 0;
  }

  .explainer-cards__row {
    grid-template-columns: 1fr;
  }

  .explainer-cards__heading {
    font-size: var(--fs-26);
    line-height: var(--lh-36);
  }

  /* Media panel shrinks with the column; keep it from dominating the stack. */
  .explainer-cards__media {
    height: auto;
    aspect-ratio: 4 / 3;
  }
}
