/* faq.css */

.faq-archive {
    margin: 0;
    padding: 114px 20px 100px;
}

.faq-archive__heading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin: 0 0 30px;
}

.faq-archive__heading .faq-archive__heading-icon {
    display: block;
    width: 66.95px;
    height: 67.65px;
}

.faq-archive__heading-text {
    margin: 0;
    color: #000;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 48px;
    font-weight: 500;
    line-height: 43px;
}

.faq-archive__tabs {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin: 0 0 60px;
}

.faq-archive__tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 24px 2px;
    border-radius: 4.427px;
    background: #17bae5;
    color: #fff;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 22px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.faq-archive__tab:hover {
    background: #0e94b8;
}

.faq-archive__section {
    max-width: 976px;
    margin: 0 auto 110px;
    /* タブクリック時のスムーススクロール先が固定ヘッダーの下に隠れないようにする */
    scroll-margin-top: var(--site-header-height, 51px);
}

.faq-archive__section-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 0 0 27px;
    color: #000;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 30px;
    font-weight: 600;
}

.faq-archive__section-heading::before {
    content: "";
    display: block;
    flex-shrink: 0;
    width: 7px;
    height: 46px;
    background: #17bae5;
}

.faq-archive__list {
    display: flex;
    flex-direction: column;
    gap: 35px;
}

.faq-archive__empty {
    margin: 0;
    color: #000;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 18px;
    font-weight: 400;
}

.faq-card {
    border: 1px solid #000;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.faq-card__question {
    display: flex;
    align-items: center;
    gap: 16px;
    width: 100%;
    padding: 20px 24px;
    border: none;
    background: none;
    appearance: none;
    cursor: pointer;
    text-align: left;
}

.faq-card__mark {
    flex-shrink: 0;
    font-family: "Roboto Condensed", sans-serif;
    font-weight: 700;
    font-size: 44px;
    line-height: 1;
}

.faq-card__mark--q {
    color: #17bae5;
}

.faq-card__mark--a {
    color: #fd7aae;
}

.faq-card__question-text {
    flex: 1 1 auto;
    color: #000;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 20px;
    font-weight: 500;
}

.faq-card__toggle {
    position: relative;
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    border: 1px solid #000;
    border-radius: 50%;
    background: #fff;
}

.faq-card__toggle::before,
.faq-card__toggle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    background: #000;
    transform: translate(-50%, -50%);
}

.faq-card__toggle::before {
    width: 12px;
    height: 1px;
}

.faq-card__toggle::after {
    width: 1px;
    height: 12px;
    transition: opacity 0.2s ease;
}

.faq-card__question[aria-expanded="true"] .faq-card__toggle::after {
    opacity: 0;
}

/* heightを0⇄実測値でアニメーションさせて開閉する。border/paddingを内側の
   .faq-card__answer-innerに逃がしておくことで、閉じた時(height:0)に
   境界線がはみ出して見えてしまうのを防ぐ */
.faq-card__answer {
    height: 0;
    overflow: hidden;
    transition: height 0.25s ease;
}

.faq-card__answer-inner {
    display: flex;
    /* Aの文字と、回答文の1行目の位置を揃える（2行目以降はその下に自然に流れる） */
    align-items: baseline;
    gap: 16px;
    padding: 20px 24px;
    border-top: 1px solid #000;
}

.faq-card__answer-text p {
    /* 親テーマのリセットCSSでp要素に text-wrap: pretty; が指定されており、
       Safariだとこれが原因で段落が本来の幅まで広がらないことがあるため、
       この段落だけ打ち消す（サイト全体には適用しない） */
    text-wrap: wrap;
}

.faq-card__answer-text {
    /* flex-basisをautoのままにすると、Safariでコンテンツ量に応じて
       伸びきらないことがあるため、0にしてflex-growの余白配分だけに任せる */
    flex: 1 1 0;
    min-width: 0;
    color: #000;
    font-family: "Noto Sans JP", sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 27px;
    /* Aの文字(44px)は行送りが大きく、baseline基準だと本文側が下がって見えるため微調整。
       marginだと中の要素(p:first-childなど)のmarginと干渉しうるため、
       影響を受けないtransformで位置だけずらす */
    transform: translateY(-8px);
}

.faq-card__answer-text > * {
    /* 回答本文を管理画面で貼り付けた際、貼り付け元のインラインwidth指定が
       段落に残ってしまうことがあり、右側に不自然な余白ができる原因になる。
       常に親幅いっぱいに広がるよう強制する */
    width: 100% !important;
}

.faq-card__answer-text a {
    color: #008cd5;
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.faq-card__answer-text a:hover {
    text-decoration: none;
    opacity: 0.7;
}

.faq-card__answer-text p:first-child {
    margin-top: 0;
}

.faq-card__answer-text p:last-child {
    margin-bottom: 0;
}

/* 782px〜1279px：PC版(1366px基準)のサイズ感をvwでそのまま縮小 */
@media (max-width: 1279px) {
    .faq-archive {
        padding: 8.346vw 1.464vw 7.321vw;
    }

    .faq-archive__heading {
        gap: 1.757vw;
        margin-bottom: 2.196vw;
    }

    .faq-archive__heading .faq-archive__heading-icon {
        width: 4.902vw;
        height: 4.953vw;
    }

    .faq-archive__heading-text {
        font-size: 3.514vw;
        line-height: 3.148vw;
    }

    .faq-archive__tabs {
        gap: 1.464vw;
        margin-bottom: 4.392vw;
    }

    .faq-archive__tab {
        height: 3.221vw;
        padding: 0 1.757vw 0.146vw;
        border-radius: 0.324vw;
        font-size: 1.611vw;
    }

    .faq-archive__section {
        max-width: 71.45vw;
        margin-bottom: 8.053vw;
    }

    .faq-archive__section-heading {
        gap: 1.025vw;
        margin-bottom: 1.977vw;
        font-size: 2.196vw;
    }

    .faq-archive__section-heading::before {
        width: 0.512vw;
        height: 3.368vw;
    }

    .faq-archive__list {
        gap: 2.562vw;
    }

    .faq-archive__empty {
        font-size: 1.318vw;
    }

    .faq-card__question {
        gap: 1.171vw;
        padding: 1.464vw 1.757vw;
    }

    .faq-card__mark {
        font-size: 3.221vw;
    }

    .faq-card__question-text {
        font-size: 1.464vw;
    }

    .faq-card__toggle {
        width: 1.903vw;
        height: 1.903vw;
    }

    .faq-card__answer-inner {
        gap: 1.171vw;
        padding: 1.464vw 1.757vw;
    }

    .faq-card__answer-text {
        font-size: 1.171vw;
        line-height: 1.977vw;
    }
}

/* 375px(Figmaスマホ実測値)基準：782pxまでvwで滑らかに拡大縮小する */
/* 602〜782pxはヘッダーがまだposition:fixedのまま（header.css参照）で、
   この幅ではヘッダー自体もvwで拡大するため、通常の隙間分(5.333vw)だけでは
   タイトルがヘッダーに隠れてしまう。ヘッダー実高さ(padding 3.6vw×2 + ロゴ5.333vw +
   border-bottom 1px = 12.533vw + 1px)を上乗せしたフルオフセットをここで確保する。
   600px以下でヘッダーがstickyに変わった時の分は下の@media(max-width:600px)で減らす */
@media (max-width: 782px) {
    .faq-archive {
        padding: calc(17.866vw + 1px) 4.267vw 14.933vw;
    }

    .faq-archive__section {
        scroll-margin-top: calc(12.533vw + 1px);
    }

    .faq-archive__heading {
        gap: 3.2vw;
        margin-bottom: 5.333vw;
    }

    .faq-archive__heading .faq-archive__heading-icon {
        width: 12.507vw;
        height: 12.637vw;
    }

    .faq-archive__heading-text {
        font-size: 8vw;
        line-height: 8vw;
    }

    .faq-archive__tabs {
        gap: 2.4vw;
        margin-bottom: 8vw;
    }

    .faq-archive__tab {
        height: 5.867vw;
        padding: 0 2.667vw 0.533vw;
        border-radius: 0.708vw;
        font-size: 3.525vw;
    }

    .faq-archive__section {
        max-width: 100%;
        margin-bottom: 16vw;
    }

    .faq-archive__section-heading {
        gap: 1.867vw;
        margin-bottom: 5.333vw;
        font-size: 5.867vw;
    }

    .faq-archive__section-heading::before {
        width: 1.333vw;
        height: 9.6vw;
    }

    .faq-archive__list {
        gap: 8vw;
    }

    .faq-archive__empty {
        text-wrap: wrap;
        font-size: 4.8vw;
    }

    /* SPはPCの角丸10pxに対して8px */
    .faq-card {
        border-radius: 2.133vw;
    }

    .faq-card__question {
        gap: 2.4vw;
        padding: 4.8vw 3.2vw;
    }

    .faq-card__mark {
        font-size: 10.667vw;
    }

    .faq-card__question-text {
        font-size: 4.267vw;
        line-height: 6.4vw;
    }

    .faq-card__toggle {
        width: 5.333vw;
        height: 5.333vw;
    }

    .faq-card__toggle::before {
        width: 2.461vw;
    }

    .faq-card__toggle::after {
        height: 2.461vw;
    }

    .faq-card__answer-inner {
        gap: 2.4vw;
        padding: 4.8vw 3.2vw;
    }

    .faq-card__answer-text {
        font-size: 4vw;
        line-height: 6.933vw;
    }
}

/* 600px以下：header.css側でヘッダーがposition:stickyに切り替わり、通常フロー上の
   高さを持つようになるため、上のscroll-margin-topで確保していた固定ヘッダー分の
   隙間は不要（そのまま残すと二重にオフセットされ、スクロール先が下にずれる） */
@media (max-width: 600px) {
    .faq-archive {
        padding-top: 5.333vw;
    }

    .faq-archive__section {
        scroll-margin-top: 0;
    }
}
