/* ==========================================================================
   Flow (ご入居までの流れ)
   ========================================================================== */
.flow {
  padding: 32px 0;
  background-color: var(--color-base);
}

.flow__head {
  text-align: center;
}

.flow__title {
  font-weight: 900;
  font-size: 2rem;
  letter-spacing: 0.04em;
}

.flow__lead {
  margin-top: 8px;
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 0.04em;
}

.flow__steps {
  margin-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.flow__step {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

/* SP版: Step間の矢印。塗りつぶし三角形(clip-path)から、正方形を
   border-right+border-bottomの2辺だけ残して45度回転させるV字
   シェブロン技法に変更し、位置もセクション幅全体に対して
   left:50%+translateXで中央揃えしている。
   縦位置は .flow__step(position:relative、この矢印の配置基準)の
   「下端」からの距離を bottom で指定する仕組みで、bottom の値が
   大きい(よりマイナス)ほど基準の下端からさらに下へ離れる、
   つまり値を大きくするほど下に、小さくするほど上に動く。
   前回 -28px→-38px と数値を大きくしてしまったため、意図と逆に
   下(次のStepラベル直前)へ移動してしまっていた。
   Step間の余白(.flow__stepsのgap:40px)のうち、中央付近に矢印の
   中心が来るよう、値を大幅に小さく(上へ)修正する。 */
.flow__step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -18px;
  width: 14px;
  height: 14px;
  border-right: 2.5px solid var(--color-main);
  border-bottom: 2.5px solid var(--color-main);
  border-radius: 0 0 2px 0;
  transform: translateX(-50%) rotate(45deg);
}

.flow__step-img {
  width: 150px;
  height: 150px;
  object-fit: cover;
  flex-shrink: 0;
}

.flow__step-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding-top: 4px;
}

.flow__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 14px 5px;
  background-color: var(--color-main);
  color: var(--color-base);
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 2rem;
}

.flow__step-title {
  font-weight: 700;
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}

.flow__step-desc {
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.5;
}

.flow__step-desc em {
  font-style: normal;
  color: var(--color-accent);
}

/* SP版: Step3のみ「安心のアフターサポート付き。」が
   テキスト幅180pxに対して195px相当となり、「き。」だけが2行目へ
   はみ出していた。画像・全体レイアウトは変更しないという条件のため、
   Step3のこのem要素だけに絞ってwhite-space:nowrapと、視認性を
   損なわない範囲のわずかなletter-spacingで幅を180px以内に収める。
   :last-childでStep3のみに限定し、Step1・Step2には影響させない。 */
.flow__step:last-child .flow__step-desc em {
  white-space: nowrap;
  letter-spacing: -0.09em;
}

@media (min-width: 768px) {
  .flow {
    padding: 76px 0;
  }

  .flow__title {
    font-size: 3.2rem;
  }

  .flow__lead {
    margin-top: 16px;
    font-size: 2rem;
  }

  .flow__steps {
    position: relative;
    z-index: 0;
    flex-direction: row;
    justify-content: center;
    gap: 100px;
    margin-top: 32px;
    text-align: center;
  }

  .flow__steps::before {
    content: "";
    position: absolute;
    top: 356px;
    left: 231.5px;
    right: 231.5px;
    height: 2px;
    background-color: var(--color-main);
    z-index: -1;
  }

  .flow__step {
    flex-direction: column;
    align-items: center;
    width: 300px;
    gap: 0;
  }

  .flow__step:not(:last-child)::after {
    display: none;
  }

  .flow__step-img {
    width: 300px;
    height: 300px;
  }

  .flow__step-text {
    align-items: center;
    padding-top: 32px;
    gap: 16px;
  }

  .flow__step-num {
    width: 163px;
    height: 48px;
    padding: 0;
    font-size: 3.2rem;
  }

  .flow__step-title {
    margin-top: 16px;
    font-size: 3.2rem;
  }

  .flow__step-desc {
    font-size: 1.6rem;
    text-align: center;
  }

  .flow__step:last-child .flow__step-desc em {
    /* PC版はSP用のnowrap/letter-spacingを打ち消し、従来通りに戻す */
    white-space: normal;
    letter-spacing: normal;
  }
}

