/*========================================
  IEHIMEぴったり診断
  デザイン幅 1600px

  質問に答えていくと、最後に建築会社を紹介するページ。
  ステップの出し分けは public/js/house_diagnosis.js が行う。
========================================*/
.hd {
    padding-bottom: 118px;
}

/*----------------------------------------
  ページ見出し（他の一覧ページと同じ作り）
----------------------------------------*/
.hd__head {
    padding-top: 18px;
    text-align: center;
}

.hd__icon {
    display: block;
    width: 53px;
    height: auto;
    margin: 0 auto;
}

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

.hd__line {
    display: block;
    width: 153.23px;
    height: auto;
    margin: 23px auto 0;
}

/*----------------------------------------
  キャラクター＋ふきだし（各ステップの先頭）
----------------------------------------*/
.hd__lead-block {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 32px;
    margin-top: 24px;
}

.hd__character {
    flex: 0 0 auto;
    width: 231px;
    height: auto;
}

/* セリフを囲むカギカッコ。左上と右下に1本ずつ置く */
.hd__lead {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 358px;
    min-height: 258px;
    padding: 19px 13px;
}

.hd__lead::before,
.hd__lead::after {
    content: "";
    position: absolute;
    width: 89px;
    height: 112px;
    border: 0 solid #cecccc;
}

.hd__lead::before {
    top: 0;
    left: 0;
    border-top-width: 3px;
    border-left-width: 3px;
}

.hd__lead::after {
    right: 0;
    bottom: 0;
    border-right-width: 3px;
    border-bottom-width: 3px;
}

/* 行はそれぞれ左揃えで、かたまりを枠の中央に置く。
   改行位置はデザイン通りに <br> で決めるので、勝手に折り返させない */
.hd__lead-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 2.6;
    white-space: nowrap;
}

/*----------------------------------------
  Q1：デザインを写真から選ぶ
  1マス目が質問（ピンク）、2マス目以降が選択肢
----------------------------------------*/
.hd__designs {
    display: grid;
    /* minmax(0,1fr) にしないと、質問カードの文字幅で1列目だけ広がってしまう */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 24px;
    row-gap: 30px;
    max-width: 1200px;
    margin: 60px auto 0;
}

/* 質問（ピンクのカード） */
.hd-design__card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 1;
    padding: 0 20px 0 36px;
    border-radius: 24px;
    background: #e28383;
    color: #fff;
}

.hd-design__num {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.hd-design__text {
    margin-top: 14px;
    font-size: 22px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.3;
}

/* 選択肢（写真＋ラベル）
   button は中身を上下中央に置くので、ラベルが2行のカードと高さが揃わない。
   flex にして上から順に積む */
.hd-design {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-align: center;
}

.hd-design__thumb {
    display: block;
    overflow: hidden;
    aspect-ratio: 1;
    border-radius: 24px;
}

.hd-design__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.hd-design__label {
    display: block;
    margin-top: 12px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/*----------------------------------------
  Q2以降：テキストから選ぶ
----------------------------------------*/
.hd__question {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
}

.hd__question-num {
    color: #f08278;
    font-size: 64px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1;
}

.hd__question-text {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

.hd__options {
    display: grid;
    grid-template-columns: repeat(3, 338px);
    justify-content: center;
    gap: 27px;
    margin-top: 28px;
}

/* 選択肢・診断結果に共通する、クリーム色の角丸ボタン */
.hd-option,
.hd-result {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cecccc;
    border-radius: 10.76px;
    background: #fcf5e3;
    box-shadow: 4px 4px 8px rgba(0, 0, 0, 0.3);
    text-align: center;
    transition:
        background 0.3s,
        box-shadow 0.3s;
}

.hd-option {
    min-height: 192px;
    padding: 24px 20px;
    font-size: 21px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.7;
}

/*----------------------------------------
  診断結果
----------------------------------------*/
.hd__result-title {
    margin-top: 48px;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: 0.05em;
    line-height: 1.4;
    text-align: center;
}

.hd__results {
    display: grid;
    justify-content: center;
    gap: 38px;
    margin-top: 46px;
}

.hd-result {
    width: 855px;
    max-width: 100%;
    min-height: 100px;
    padding: 16px 24px;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.08em;
    line-height: 1.5;
}

/* 表示中の会社をまとめて資料請求（色は他ページの資料請求ボタンと同じ） */
.hd__request {
    margin-top: 56px;
    text-align: center;
}

.hd__request-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 412px;
    max-width: 100%;
    height: 70px;
    border-radius: 7.73px;
    background: #e28383;
    color: #fff;
    font-size: 24px;
    font-weight: 500;
    letter-spacing: 0.21em;
    line-height: 1;
    text-indent: 0.21em;
    transition: opacity 0.3s;
}

.hd__result-empty {
    margin-top: 46px;
    font-size: 18px;
    line-height: 1.8;
    text-align: center;
}

@media (hover: hover) {
    .hd-design:hover .hd-design__thumb img {
        transform: scale(1.1);
    }

    .hd-option:hover,
    .hd-result:hover {
        background: #f7ecd2;
        box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    }

    .hd__request-btn:hover {
        opacity: 0.7;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hd-design__thumb img {
        transition: none;
    }
}

/*========================================
  SP / タブレット（1023px 以下）
========================================*/
@media screen and (max-width: 1023px) {
    .hd {
        padding-bottom: 56px;
    }

    .hd__head {
        padding-top: 8px;
    }

    .hd__icon {
        width: 40px;
    }

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

    .hd__line {
        width: 110px;
        margin-top: 14px;
    }

    /* キャラクターは上、セリフは下に積む */
    .hd__lead-block {
        flex-direction: column;
        align-items: center;
        gap: 8px;
        margin-top: 16px;
        padding: 0 16px;
    }

    .hd__character {
        width: 128px;
    }

    /* カギカッコがセリフから離れないよう、幅は中身に合わせる */
    .hd__lead {
        width: auto;
        max-width: 100%;
        min-height: 0;
        padding: 16px 20px;
    }

    .hd__lead::before,
    .hd__lead::after {
        width: 32px;
        height: 32px;
        border-width: 0;
    }

    .hd__lead::before {
        border-top-width: 3px;
        border-left-width: 3px;
    }

    .hd__lead::after {
        border-right-width: 3px;
        border-bottom-width: 3px;
    }

    /* 画面が狭いときは、デザインの改行位置にこだわらず折り返す */
    .hd__lead-text {
        font-size: 14px;
        line-height: 2;
        white-space: normal;
    }

    /* 写真は3列。質問カードは横幅いっぱいに寝かせる */
    .hd__designs {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        column-gap: 10px;
        row-gap: 16px;
        max-width: 600px;
        margin: 32px auto 0;
        padding: 0 16px;
    }

    .hd-design__card {
        grid-column: 1 / -1;
        aspect-ratio: auto;
        padding: 20px 24px;
        border-radius: 16px;
    }

    .hd-design__num {
        font-size: 32px;
    }

    .hd-design__text {
        margin-top: 8px;
        font-size: 20px;
    }

    .hd-design__thumb {
        border-radius: 12px;
    }

    .hd-design__label {
        margin-top: 8px;
        font-size: 12px;
        letter-spacing: 0.02em;
    }

    .hd__question {
        flex-direction: column;
        align-items: center;
        gap: 4px;
        margin-top: 20px;
        padding: 0 16px;
    }

    .hd__question-num {
        font-size: 36px;
    }

    .hd__question-text {
        font-size: 18px;
        text-align: center;
    }

    .hd__options {
        grid-template-columns: 1fr;
        gap: 16px;
        max-width: 600px;
        margin: 20px auto 0;
        padding: 0 16px;
    }

    .hd-option {
        min-height: 88px;
        padding: 16px;
        font-size: 16px;
        line-height: 1.6;
    }

    .hd__result-title {
        margin-top: 32px;
        padding: 0 16px;
        font-size: 18px;
    }

    .hd__results {
        gap: 16px;
        max-width: 600px;
        margin: 24px auto 0;
        padding: 0 16px;
    }

    .hd-result {
        width: 100%;
        min-height: 64px;
        font-size: 17px;
    }

    .hd__request {
        margin-top: 32px;
        padding: 0 16px;
    }

    .hd__request-btn {
        width: 100%;
        max-width: 340px;
        height: 56px;
        font-size: 16px;
        letter-spacing: 0.12em;
        text-indent: 0.12em;
    }

    .hd__result-empty {
        margin-top: 24px;
        padding: 0 16px;
        font-size: 15px;
    }

    .hd-option,
    .hd-result {
        box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.25);
    }
}
