/*
 * .journey-steps — centred head + numbered step cards
 * (template-parts/flexible/journey-steps.php).
 * Figma: /resources D 337:11865 + 337:11871 / M 337:11636…337:11642.
 *
 * Phones and tablets: cards one under another. From 1025 px: one row, and
 * thin arrows lead from each number tile to the next card
 * (Figma vectors 337:11936…337:11939): out of a card — down from the tile,
 * then right; into a card — from the left, then up into the tile.
 */

.journey-steps {
  padding-top: var(--nv-section-y);
  padding-bottom: var(--nv-section-y);
}

/* .listing + .journey-steps — "Show more" → eyebrow 80 → 200 px with the listing's own 50 (hub Figma 337:11860 → 337:11866) */
.listing + .journey-steps {
  padding-top: clamp(1.875rem, -0.7909rem + 11.3744vw, 9.375rem);

  /* @media (width >= 48em) .listing + .journey-steps — hairline between the two white
     sections (Figma hub D 1574:12939; the phone frame has none) */
  @media (width >= 48em) {
    border-top: 0.0625rem solid rgba(26, 121, 191, 0.1);
  }
}

/* .journey-steps__container — head → cards: 40 → 75 px (Figma 337:11865 bottom padding) */
.journey-steps__container {
  display: flex;
  flex-direction: column;
  gap: clamp(2.5rem, 1.7225rem + 3.3176vw, 4.6875rem);
}

/* .journey-steps__head — eyebrow → heading: 40 → 50 px */
.journey-steps__head {
  display: flex;
  flex-direction: column;
  gap: var(--nv-flow-gap);
}

/* .journey-steps__head--center */
.journey-steps__head--center {
  align-items: center;
  text-align: center;
}

/* .journey-steps__eyebrow */
.journey-steps__eyebrow {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.3125rem;
  padding: calc(0.625rem - 0.14em) 0.625rem;
  color: var(--nv-green);
  font-weight: 500;
  font-size: clamp(1rem, 0.9111rem + 0.3792vw, 1.25rem);
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;

  /* @media (width >= 48em) .journey-steps__eyebrow — the phone mocks track 5 %, the desktop ones 10 % */
  @media (width >= 48em) {
    letter-spacing: 0.1em;
  }

  /* .journey-steps__eyebrow::before — rhomb */
  &::before {
    content: "";
    flex-shrink: 0;
    width: 0.53rem;
    height: 0.53rem;
    margin-top: calc(0.5lh - 0.265rem);
    background: url("../../img/icons/rhomb.svg") center / contain no-repeat;
  }
}

/* .journey-steps__title — 40 → 90 px */
.journey-steps__title {
  margin-top: -0.14em;
  margin-bottom: -0.14em;
  max-width: 82rem;
  color: var(--nv-navy);
  font-weight: 400;
  font-size: clamp(2.5rem, 1.3892rem + 4.7393vw, 5.625rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;

  & strong {
    color: var(--nv-green);
    font-weight: inherit;
  }
}

/* .journey-steps__list — number tile 64 → 84 px tall (arrows start under it) */
.journey-steps__list {
  --journey-steps-tile: clamp(4rem, 3.5556rem + 1.8957vw, 5.25rem);
  --journey-steps-pad: clamp(1.25rem, 1.0278rem + 0.9479vw, 1.875rem);
  --journey-steps-drop: 3.0625rem;

  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;

  /* @media (width >= 64.0625em) .journey-steps__list — all steps in one row */
  @media (width >= 64.0625em) {
    grid-auto-columns: minmax(0, 1fr);
    grid-auto-flow: column;
  }
}

/* .journey-steps__item — light card; navy arrows */
.journey-steps__item {
  --journey-steps-line: var(--nv-navy);

  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.9375rem;
  min-width: 0;
  border: 0.0625rem solid var(--nv-ice);
  border-radius: var(--nv-radius-s);
  padding: var(--journey-steps-pad);
  background: linear-gradient(180deg, rgba(204, 219, 232, 0.3) 0%, rgba(246, 247, 249, 0.5) 100%), var(--nv-white);
  color: var(--nv-navy);
  text-align: center;

  /* @media (width >= 64.0625em) .journey-steps__item — 300 px, text at the bottom, room for the arrows */
  @media (width >= 64.0625em) {
    justify-content: space-between;
    gap: 3.75rem;
    min-height: 18.75rem;
    border-radius: var(--nv-radius-m);
  }
}

/* .journey-steps__item--active — blue gradient, white text, green number and arrows */
.journey-steps__item--active {
  --journey-steps-line: var(--nv-green);

  border-color: transparent;
  background: linear-gradient(171deg, rgba(19, 33, 50, 0) 34%, rgba(19, 33, 50, 0.6) 76%, var(--nv-blue-light) 100%), var(--nv-blue);
  color: var(--nv-white);
}

/* .journey-steps__number — tinted tile */
.journey-steps__number {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--journey-steps-tile);
  border-radius: var(--nv-radius-s);
  background-color: rgba(26, 121, 191, 0.1);
}

/* .journey-steps__item--active .journey-steps__number */
.journey-steps__item--active .journey-steps__number {
  background-color: rgba(255, 255, 255, 0.1);
}

/* .journey-steps__digits — 48 → 80 px, blue with a dark fade (Figma text gradient) */
.journey-steps__digits {
  background: linear-gradient(171deg, rgba(19, 33, 50, 0) 34%, rgba(19, 33, 50, 0.6) 76%, var(--nv-blue-light) 100%), var(--nv-blue);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 500;
  font-size: clamp(3rem, 2.2891rem + 3.0332vw, 5rem);
  line-height: 1;
  letter-spacing: 0.1em;
}

/* .journey-steps__item--active .journey-steps__digits — plain green */
.journey-steps__item--active .journey-steps__digits {
  background: none;
  color: var(--nv-green);
}

/* .journey-steps__body — name → text 20 px (Figma trims the line boxes) */
.journey-steps__body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* .journey-steps__name — 23 → 32 px */
.journey-steps__name {
  font-weight: 500;
  font-size: clamp(1.4375rem, 1.2375rem + 0.8531vw, 2rem);
  line-height: 1;
  letter-spacing: -0.02em;
  overflow-wrap: break-word;
}

/* .journey-steps__text — 16 → 18 px */
.journey-steps__text {
  margin-bottom: -0.24em;
  font-size: clamp(1rem, 0.9556rem + 0.1896vw, 1.125rem);
  line-height: 1.2;
  letter-spacing: -0.02em;

  & p + p {
    margin-top: 0.75rem;
  }
}

/* @media (width >= 64.0625em) .journey-steps__item — arrows between the cards */
@media (width >= 64.0625em) {
  /* .journey-steps__item:not(:last-child)::after — out: down from the tile, then right */
  .journey-steps__item:not(:last-child)::after {
    content: "";
    position: absolute;
    top: calc(var(--journey-steps-pad) + var(--journey-steps-tile));
    left: 50%;
    width: calc(50% - var(--journey-steps-pad) - 0.5625rem);
    height: var(--journey-steps-drop);
    border-bottom: 0.0625rem solid var(--journey-steps-line);
    border-left: 0.0625rem solid var(--journey-steps-line);
    border-bottom-left-radius: 1.25rem;
    pointer-events: none;
  }

  /* .journey-steps__item:not(:first-child)::before — in: from the left, then up into the tile */
  .journey-steps__item:not(:first-child)::before {
    content: "";
    position: absolute;
    top: calc(var(--journey-steps-pad) + var(--journey-steps-tile));
    right: calc(50% - 0.0625rem);
    left: var(--journey-steps-pad);
    height: var(--journey-steps-drop);
    border-right: 0.0625rem solid var(--journey-steps-line);
    border-bottom: 0.0625rem solid var(--journey-steps-line);
    border-bottom-right-radius: 1.25rem;
    pointer-events: none;
  }

  /* .journey-steps__item:not(:last-child) .journey-steps__number::after — arrowhead at the right end */
  .journey-steps__item:not(:last-child) .journey-steps__number::after {
    content: "";
    position: absolute;
    top: calc(100% + var(--journey-steps-drop) - 0.25rem);
    right: 0.625rem;
    width: 0.4375rem;
    height: 0.4375rem;
    border-top: 0.0625rem solid var(--journey-steps-line);
    border-right: 0.0625rem solid var(--journey-steps-line);
    transform: rotate(45deg);
  }

  /* .journey-steps__item:not(:first-child) .journey-steps__number::before — arrowhead into the tile */
  .journey-steps__item:not(:first-child) .journey-steps__number::before {
    content: "";
    position: absolute;
    top: calc(100% + 0.125rem);
    left: calc(50% - 0.1875rem);
    width: 0.4375rem;
    height: 0.4375rem;
    border-top: 0.0625rem solid var(--journey-steps-line);
    border-left: 0.0625rem solid var(--journey-steps-line);
    transform: rotate(45deg);
  }
}
