/*========================================
  家づくりの流れ（/flow）
  デザイン幅 1600px（本文エリアは他のページと同じ 1200px）

  10ステップを2列のカードで並べる。
  カードの中は「グレーの帯＋黄色い番号」→ イラスト → 本文 の順。
========================================*/
.flow-page {
    padding-bottom: 118px;
}

/*----------------------------------------
  ページ見出し（アイコン → 見出し → 罫線。他のページと同じ作り）
----------------------------------------*/
.flow-page__head {
    padding-top: 17.7px;
    text-align: center;
}

.flow-page__icon {
    display: block;
    width: 52.19px;
    height: auto;
    margin: 0 auto;
}

.flow-page__title {
    margin-top: 13.9px;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1;
    text-indent: 0.08em;
}

.flow-page__line {
    display: block;
    width: 153.23px;
    height: auto;
    margin: 18.1px auto 0;
}

/*----------------------------------------
  カードの並び（2列）
----------------------------------------*/
.flow-page__body {
    max-width: 1200px;
    margin: 25px auto 0;
}

.flow__list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 40px;
    row-gap: 61px;
    padding: 0;
    list-style: none;
}

.flow__item {
    /* 本文の長さが違っても同じ高さでそろうように、下限を決めておく */
    display: flex;
    min-height: 676px;
    flex-direction: column;
    padding-bottom: 40px;
    border: 1px solid #999;
    border-radius: 30px;
    background: #fff;
}

/*----------------------------------------
  グレーの帯（黄色い番号＋ステップ名）
  番号は帯より少し背が高く、左端に重なる
----------------------------------------*/
.flow__head {
    display: flex;
    height: 60px;
    align-items: center;
    margin: 39px 34px 0;
    border-radius: 30px;
    background: #e6e6e6;
}

.flow__num {
    display: block;
    width: auto;
    height: 61.54px;
    flex: 0 0 auto;
    margin-left: 3px;
}

.flow__title {
    /* 番号の右側の余白の中央に置く */
    flex: 1 1 auto;
    padding: 0 8px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.4;
    text-align: center;
    text-indent: 0.08em;
}

/* 見出しの中の span。この単位で折り返させたいときに使う */
.flow__title span {
    display: inline-block;
}

/*----------------------------------------
  イラスト（画像は2倍サイズなので半分の幅で置く）
----------------------------------------*/
.flow__illust {
    display: flex;
    height: 401px;
    align-items: center;
    justify-content: center;
    padding: 0 40px;
}

.flow__illust img {
    display: block;
    width: auto;
    height: auto;
    /* 枠に収まらない幅のときは縮める */
    max-width: min(var(--illust-width, 100%), 100%);
    max-height: 100%;
    /* デザインに合わせた左右の位置調整（画像幅に対する割合なので、縮んでも比率は保つ） */
    transform: translateX(var(--illust-shift, 0));
}

/*----------------------------------------
  本文
----------------------------------------*/
.flow__text {
    margin: 0 40px;
    font-size: 20px;
    letter-spacing: 0.1em;
    line-height: 1.78;
    /* デザインどおり、行末をそろえて（両端そろえ）流し込む */
    text-align: justify;
}

/*========================================
  中間（1023px以下）。2列のままカードを詰める
========================================*/
@media screen and (max-width: 1023px) {
    .flow-page {
        padding-bottom: 56px;
    }

    .flow-page__head {
        padding-top: 8px;
    }

    .flow-page__icon {
        width: 40px;
    }

    .flow-page__title {
        margin-top: 10px;
        font-size: 20px;
    }

    .flow-page__line {
        width: 110px;
        margin-top: 12px;
    }

    .flow-page__body {
        max-width: none;
        margin-top: 20px;
        padding: 0 16px;
    }

    .flow__list {
        column-gap: 16px;
        row-gap: 24px;
    }

    .flow__item {
        min-height: 0;
        padding-bottom: 24px;
        border-radius: 20px;
    }

    .flow__head {
        height: 44px;
        margin: 20px 16px 0;
        border-radius: 22px;
    }

    .flow__num {
        height: 45px;
        margin-left: 2px;
    }

    .flow__title {
        padding: 0 4px;
        font-size: 15px;
        letter-spacing: 0.04em;
        text-indent: 0.04em;
    }

    .flow__illust {
        /* border-box なので、枠の高さは変えずに上下の余白ぶんイラストが小さくなる */
        height: 220px;
        padding: 20px 16px;
    }

    .flow__text {
        margin: 0 16px;
        font-size: 14px;
        line-height: 1.9;
    }
}

/*========================================
  SP（600px以下）。1列に切り替える
========================================*/
@media screen and (max-width: 600px) {
    .flow__list {
        grid-template-columns: minmax(0, 1fr);
        row-gap: 20px;
    }

    .flow__title {
        font-size: 16px;
    }

    .flow__illust {
        height: 240px;
        padding: 24px 16px;
    }

    .flow__text {
        font-size: 15px;
    }
}
