/* =========================================
   Diagram Component (CLEAN + CORRECT)
   - Top diagram: truly centered
   - Bottom band: 100vw full-bleed
   - Bigger avatars + bigger type
   - Responsive: desktop/tablet/mobile
   - Mobile cards: Image -> Title -> Description (NO CONFLICT)
   ========================================= */

.diagram {
  background: var(--dg-bg, #f0efe2);
  padding: clamp(32px, 5vw, 84px) 0;
}

/* -------------------------
   Header
   ------------------------- */
.diagram__header {
  text-align: center;
  max-width: 1100px;
  margin: 0 auto clamp(18px, 3vw, 42px);
}

.diagram__eyebrow {
  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;

  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  color: rgba(17, 17, 17, 0.72);
  margin-bottom: 10px;
}

.diagram__title {
  margin: 0 0 12px;
  font-family: "Optima", "URW Classico", "Segoe UI", serif;
  font-weight: 700;

  font-size: clamp(30px, 3.4vw, 52px);
  line-height: 1.08;
  color: #111;
}

.diagram__intro {
  max-width: 820px;
  margin: 0 auto;
  color: rgba(17, 17, 17, 0.8);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.75;

  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
}

.diagram__intro p {
  margin: 0;
}

/* =========================================================
   TOP DIAGRAM: centered group
   ========================================================= */

.diagram__stage {
  --labelsW: clamp(260px, 20vw, 360px);
  --gap: clamp(18px, 3vw, 56px);
  --imgW: clamp(520px, 44vw, 760px);
  --imgH: clamp(360px, 36vw, 560px);

  width: 100%;
  display: flex;
  justify-content: center;
}

.diagram__labels {
  position: relative;
  width: var(--labelsW);
  height: var(--imgH);
  margin-right: var(--gap);
}

.diagram__figure {
  margin: 0;
  width: var(--imgW);
}

.diagram__imgWrap {
  position: relative;
  width: 100%;
  height: var(--imgH);

  display: flex;
  align-items: center;
  justify-content: center;

  /* allow shifted images without clipping */
  overflow: visible;
}

.diagram__img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;

  /* optional visual shift (set via inline CSS var on .diagram) */
  transform: translateX(var(--img-shift-x, 0px));
  transform-origin: center center;
}

/* label rows positioned by y% */
.diagram__labelRow {
  position: absolute;
  left: 0;
  top: var(--y, 50%);
  transform: translateY(-50%);
  width: 100%;

  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  column-gap: 14px;

  pointer-events: none;
}

.diagram__labelText {
  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;

  font-size: clamp(15px, 1.25vw, 18px);
  color: #0f172a;
  white-space: nowrap;
}

.diagram__labelLine {
  height: 2px;
  width: 100%;
  background: var(--accent, #2a5bd7);
  border-radius: 999px;
  opacity: 0.85;
}

/* dots on image */
.diagram__dot {
  position: absolute;
  left: var(--x, 20%);
  top: var(--y, 50%);
  transform: translate(-50%, -50%);

  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--accent, #2a5bd7);

  /* outer ring */
  box-shadow: 0 0 0 6px rgba(42, 91, 215, 0.18);
}

/* =========================================================
   BOTTOM BAND: FULL WIDTH (100vw), not limited by gutter
   ========================================================= */

.diagram__cards {
  margin-top: clamp(28px, 5vw, 70px);
}

/* full-bleed band */
.diagram__cardsInner {
  width: 100vw;
  position: relative;
  left: 50%;
  transform: translateX(-50%);

  background: var(--cardBg, #fffef2);
  border-radius: clamp(14px, 2vw, 18px);

  padding: clamp(26px, 3.2vw, 46px) clamp(18px, 4vw, 56px);

  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 48px);

  align-items: start;
}

.diagram__card {
  text-align: center;
  padding: clamp(8px, 1vw, 14px);
}

/* circular images */
.diagram__cardImg {
  width: clamp(86px, 8vw, 120px);
  height: clamp(86px, 8vw, 120px);
  margin: 0 auto 16px;

  border-radius: 999px;
  
  border: 2px solid rgba(0,0,0,0.08);

  overflow: hidden;
  background: #f0efe2;

  display: grid;
  place-items: center;
}

.diagram__cardImg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.diagram__cardTitle {
  margin: 0 0 12px;

  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 700;

  font-size: clamp(16px, 1.55vw, 22px);
  line-height: 1.25;
  color: #0f172a;
}

.diagram__cardText {
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.75;
  color: rgba(15, 23, 42, 0.82);

  max-width: 44ch;
  margin: 0 auto;

  font-family: "Suisse Int'l", "Suisse Intl", "Inter", -apple-system,
    BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-weight: 400;
}

.diagram__cardText p {
  margin: 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Large desktop */
@media (min-width: 1400px) {
  .diagram__stage {
    --labelsW: 380px;
    --imgW: 820px;
    --imgH: 600px;
    --gap: 64px;
  }
}

/* Tablet */
@media (max-width: 1024px) {
  .diagram__stage {
    --labelsW: 300px;
    --imgW: 640px;
    --imgH: 520px;
    --gap: 38px;
  }

  /* band becomes 2 columns */
  .diagram__cardsInner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px;
    padding: 28px 22px;
  }
}

/* Mobile */
@media (max-width: 820px) {
  .diagram__stage {
    flex-direction: column;
    align-items: center;
  }

  /* image first, labels list second */
  .diagram__labels {
    order: 2;
    width: min(520px, 100%);
    height: auto;
    margin: 14px 0 0 0;
  }

  .diagram__figure {
    order: 1;
    width: min(620px, 100%);
  }

  .diagram__imgWrap {
    height: auto;
  }

  .diagram__img {
    width: 100%;
    max-height: none;
    transform: none; /* remove shift on mobile */
  }

  /* callouts list */
  .diagram__labelRow {
    position: static;
    transform: none;

    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 0;
  }

  .diagram__labelText {
    font-size: 16px;
  }

  .diagram__labelLine {
    flex: 1 1 auto;
  }

  .diagram__dot {
    display: none;
  }

  /* band becomes 1 column */
  .diagram__cardsInner {
    grid-template-columns: 1fr;
    padding: 22px 18px;
    gap: 18px;
  }

  /* cards become vertical stack: Image -> Title -> Text */
  .diagram__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;

    row-gap: 10px;
    padding: 14px 10px;
  }

  .diagram__cardImg {
    margin: 0;
    width: 92px;
    height: 92px;
    border: 2px solid rgba(0,0,0,0.08);
  }

  .diagram__cardTitle {
    margin: 0;
  }

  .diagram__cardText {
    margin: 0;
    max-width: 42ch;
  }
}

/* Very small phones */
@media (max-width: 420px) {
  .diagram__cardImg {
    width: 78px;
    height: 78px;
  }
}
