/* Roadmap 転職成功までの流れ — spec/v2/roadmap.md (pad 112/88, gap 50). Step numbers follow Figma (05 → 07). */
.flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 50px;
  padding: 109px 88px 115px; /* measured: content sits 3px higher than the nominal 112px */
  background: var(--color-white);
}

.flow__heading {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.flow__desc {
  font-size: 16px;
  line-height: 1.9;
  text-align: center;
  color: var(--color-slate);
}

.flow__timeline {
  position: relative;
  width: 100%;
  max-width: 1264px;
}

.flow__callout {
  position: absolute;
  top: -45px;
  left: calc(3 / 8 * 100% - 63.5px);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 139px;
  height: 40px;
  border-radius: 8px;
  background: var(--color-navy);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.04);
  font-weight: 900;
  font-size: 12px;
  letter-spacing: 1.38px;
  color: var(--color-white);
}

.flow__callout::after {
  content: "";
  position: absolute;
  bottom: -7px;
  left: 50%;
  border: 7px solid transparent;
  border-top-color: var(--color-navy);
  border-bottom: 0;
  transform: translateX(-50%);
}

.flow__steps {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
}

.flow-step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

/* connecting line through the middle of the 34px marker row */
.flow-step::before {
  content: "";
  position: absolute;
  top: 16px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-line);
}

.flow-step:first-child::before {
  left: 50%;
}

.flow-step:last-child::before {
  right: 50%;
}

.flow-step__num {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: var(--color-navy);
  font-family: var(--font-latin);
  font-weight: 800;
  font-size: 12px;
  line-height: 1;
  color: var(--color-white);
}

.flow-step__title {
  font-weight: 700;
  font-size: 13px;
  line-height: var(--lh-text);
  text-align: center;
  color: var(--color-navy);
}

.flow-step__note {
  font-size: 9px;
  line-height: 1.55;
  text-align: center;
  color: var(--color-slate);
}

@media (max-width: 1100px) {
  .flow {
    padding: 80px 40px;
  }
}

@media (max-width: 767px) {
  .flow {
    gap: 28px;
    padding: 56px 20px;
  }

  .flow__desc {
    font-size: 14px;
    line-height: 1.8;
  }

  .flow__timeline {
    padding-left: 0;
  }

  .flow__callout {
    position: static;
    width: auto;
    height: 32px;
    margin: 0 0 16px 50px;
    padding: 0 14px;
    display: inline-flex;
  }

  .flow__callout::after {
    left: 24px;
  }

  .flow__steps {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .flow-step {
    display: grid;
    grid-template-columns: 34px 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    align-items: center;
    padding-bottom: 20px;
  }

  .flow-step::before {
    top: 0;
    bottom: 0;
    left: 16px;
    right: auto;
    width: 2px;
    height: auto;
  }

  .flow-step:first-child::before {
    top: 17px;
    left: 16px;
  }

  .flow-step:last-child::before {
    bottom: auto;
    height: 17px;
    right: auto;
  }

  .flow-step__num {
    grid-row: 1 / 3;
  }

  .flow-step__title {
    font-size: 15px;
    text-align: left;
  }

  .flow-step__note {
    margin-top: 2px;
    padding-top: 0;
    font-size: 12px;
    text-align: left;
  }
}
