/*
  SessionM — strategy and feature articles (Strategies/*, Features/*).

  Registered in documentation.json under "customCss" next to styles/home.css
  and styles/footer.css.

  HOW IT IS SCOPED
  Every selector carries an "sm-" class that only these articles use, set via
  the className prop of the platform's <Image> component or on a plain <div>
  wrapper in the MDX. Nothing here can touch any other page.

  THEME
  Only the platform's own colour variables are used (--brand, --heading,
  --body, --border-muted, --background), so light and dark mode are handled
  by the platform and no colour is hard-coded.

  CLASSES
    .sm-intro        flex row: .sm-intro-text (intro + Strategy) left, .sm-hero right
    .sm-hero         the hero image inside .sm-intro
    .sm-module       one tile in the "Key modules" two-column grid
    .sm-module-icon  the 80px module icon inside a tile
    .sm-figure       a centred screenshot / diagram (add .sm-figure-md for a smaller cap)
    .sm-takeaways    wrapper around the "Key takeaways" callout

  PAGE WIDTH
  These pages use "content-width": "wide" in documentation.json, which removes
  the platform's article max-width entirely. The rule below puts a sensible
  cap back. Change the one number to adjust the reading width of every
  strategy / feature article at once.
*/

/* ── Article width cap (pages that contain a .sm-figure) ── */
:root:has(.sm-figure) .dai-article {
  max-width: 1040px !important;
}

/* ── Intro: opening paragraphs + "Strategy" on the left, hero image on the right ── */
.sm-intro {
  display: flex;
  align-items: flex-start;
  gap: 36px;
  margin-bottom: 8px;
}
.sm-intro-text {
  flex: 1 1 auto;
  min-width: 0;
}
.sm-intro-text > :first-child {
  margin-top: 0 !important;
}
.sm-hero {
  flex: 0 0 270px;
  width: 270px;
  margin: 6px 0 0 !important;           /* !important: the platform sets figure margins with !important */
}
.sm-hero img {
  border: 1px solid var(--border-muted, #e5e5e5);
}
.sm-hero figcaption {
  display: none;                        /* alt text stays for screen readers, no visible caption */
}
@media (max-width: 640px) {
  .sm-intro {
    flex-direction: column-reverse;      /* image first, then the text, on phones */
    align-items: center;
    gap: 20px;
  }
  .sm-hero {
    flex-basis: auto;
    width: 100%;
    max-width: 300px;
    margin: 0 !important;
  }
}

/* ── Key modules: two tiles, icon + title + list ── */
.sm-module {
  padding: 22px 24px 18px;
  border: 1px solid var(--border-muted, #e5e5e5);
  border-radius: 14px;
  background: var(--background, #fff);
}
.sm-module .sm-module-icon {
  width: 56px;
  margin: 0 0 12px !important;
  pointer-events: none;                 /* an icon should not open the image zoom */
}
.sm-module .sm-module-icon img {
  border-radius: 12px;
}
.sm-module .sm-module-icon figcaption {
  display: none;
}
.sm-module h4 {
  display: inline-block;
  margin: 0 0 12px !important;
  padding-bottom: 6px;
  font-size: 17px;
  color: var(--heading, #181821);
  border-bottom: 2px solid var(--brand, #cf4500);
}
.sm-module ul {
  margin: 0 !important;
  padding-left: 18px !important;
}
.sm-module li {
  margin: 4px 0;
  color: var(--body, #363747);
}

/* ── Centred figures: fill a capped width so screenshots read at a useful size ── */
.sm-figure {
  width: 100%;
  max-width: 760px;
  text-align: center;
  margin-left: auto !important;
  margin-right: auto !important;
}
.sm-figure > div {
  display: block;                       /* the platform wraps the image in an inline-block; make it fill the figure */
}
.sm-figure img {
  width: 100%;
  height: auto;
  border: 1px solid var(--border-muted, #e5e5e5);
}
.sm-figure figcaption {
  display: none;
}
.sm-figure-md {
  max-width: 600px;                     /* diagrams close to their natural size, not upscaled */
}

/* ── Key takeaways callout: bold label on the icon line (same style as "Take note"), two columns below ── */
.sm-takeaways .dai-callout-body > p:first-child {
  margin-top: 0 !important;
  margin-bottom: 10px !important;
  color: var(--heading, #181821);
}
.sm-takeaways [data-component="Columns"] {
  margin-bottom: 0 !important;
}
.sm-takeaways [data-component="Columns"] h4 {
  margin: 0 0 6px !important;
  font-size: 16px;
  color: var(--heading, #181821);
}
.sm-takeaways [data-component="Columns"] p {
  margin: 0;
}
