/*
 * InspireSphere Theme — How Does It Work Section
 *
 * Desktop: centred header (title + subtitle) then a 4-column grid of steps.
 *          Steps have a dark-navy numbered circle at top, step title, and
 *          description below. A CSS dashed green line connects all circles.
 * Mobile:  header then vertical step list; circles on the left with a
 *          vertical dashed green connector between them.
 *
 * Spacing: gap between header and steps — 73px desktop / 57px mobile.
 */

/* ── Section wrapper ─────────────────────────────────────────────── */
.section--how-it-works {
  padding-block: 0;
}

/* ── Outer column ────────────────────────────────────────────────── */
.how-it-works__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 73px;
}

/* ── Header (title + subtitle) ───────────────────────────────────── */
.how-it-works__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 654px;
  text-align: center;
}

.how-it-works__title {
  font-size: var(--font-size-h2);
  /* 36px */
  font-weight: var(--font-weight-semibold);
  /* 600 */
  color: var(--color-black);
  line-height: 1.2;
}

.how-it-works__subtitle {
  font-size: var(--font-size-body-md);
  /* 16px */
  color: var(--color-black);
  opacity: 0.7;
  line-height: 1.6;
}

/* ── Steps grid ──────────────────────────────────────────────────── */
/* 4 equal columns; the dashed line is drawn via ::before             */
.how-it-works__steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  width: 100%;
  position: relative;
}

/* Dashed green horizontal connector — spans center-to-center of
   the outer two circles, rendered behind circles via z-index.        */
.how-it-works__steps::before {
  content: '';
  position: absolute;
  top: 36px;
  /* midpoint of 73px circle      */
  left: 12.5%;
  /* center of first column       */
  right: 12.5%;
  /* center of last column        */
  height: 0;
  border-top: 2px dashed var(--color-green);
  pointer-events: none;
}

/* ── Individual step ─────────────────────────────────────────────── */
.how-it-works__step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
}

/* ── Numbered circle ─────────────────────────────────────────────── */
.how-it-works__step-number {
  width: 73px;
  height: 73px;
  border-radius: 50%;
  background: var(--color-dark-navy);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  /* render above the dashed connector line             */
}

.how-it-works__step-number span {
  font-size: var(--font-size-h1);
  /* 40px */
  font-weight: var(--font-weight-bold);
  /* 700 */
  color: var(--color-white);
  line-height: 1;
}

/* ── Step body (title + description) ────────────────────────────── */
.how-it-works__step-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.how-it-works__step-title {
  font-size: var(--font-size-body-lg);
  /* 20px */
  font-weight: var(--font-weight-regular);
  color: var(--color-black);
  line-height: 1.4;
}

.how-it-works__step-desc {
  font-size: var(--font-size-body-md);
  /* 16px */
  color: var(--color-black);
  opacity: 0.7;
  max-width: 223px;
  line-height: 1.5;
}

/* ── Mobile (≤ 768px) ────────────────────────────────────────────── */
@media (max-width: 768px) {
  .how-it-works__inner {
    gap: 57px;
  }

  .how-it-works__header {
    max-width: none;
  }

  .how-it-works__title {
    font-size: var(--font-size-h2-mobile);
    /* 24px */
    font-weight: var(--font-weight-bold);
  }

  /* Switch to single-column vertical list */
  .how-it-works__steps {
    grid-template-columns: 1fr;
    gap: 48px;
    padding-block: 0;
    /* no extra padding needed */
  }

  /* Vertical dashed green connector — runs along the left beside circles */
  .how-it-works__steps::before {
    top: 50px;
    /* below centre of first circle (25px centre + 25px) */
    left: 24px;
    /* 1px offset left of 50px circle centre for 2px line */
    right: auto;
    bottom: 50px;
    /* stops above centre of last circle               */
    width: 2px;
    height: auto;
    border-top: none;
    border-left: 2px dashed var(--color-green);
  }

  /* Each step: circle left, title+desc stacked right */
  .how-it-works__step {
    flex-direction: row;
    align-items: flex-start;
    text-align: left;
    gap: 27px;
  }

  .how-it-works__step-number {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
  }

  .how-it-works__step-number span {
    font-size: 27px;
    /* matches Figma mobile spec (27.4px) */
  }

  .how-it-works__step-body {
    flex: 1;
    gap: 16px;
  }

  .how-it-works__step-desc {
    max-width: none;
  }
}