@charset "utf-8";

/* =========================================================
    よくあるご質問（page-faq.php）
    ・質問・回答は talkappi から取り込んだもの（inc/faq.php）
    ・検索欄 → 左にカテゴリ（SP は上に横並び）、右にカテゴリごとの Q&A（アコーディオン）
    ・開け閉めは main.js の「FAQアコーディオン」、検索・AIチャットのボタンも main.js
========================================================= */
/* 和柄（1332×461px）を背景として敷く（縮小せず中央に置き、はみ出しは切る）
    カンプどおり、見出しが丸の上の方に入る位置に置く（丸の上は少しヘッダーに隠れる）
    スクロールしても画面の同じ位置にとどめる（iPhone で効かない background-attachment: fixed は使わず、固定した ::before に敷く） */
.faq-page {
    position: relative;
    isolation: isolate;
    padding: 96px 0 128px;
    background: var(--bg);
}

.faq-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background: url(../img/common/bg-room.webp) no-repeat center 16px / 1332px auto;
    pointer-events: none;
}

/* ---------- 検索 ---------- */
.faq-search {
    max-width: 640px;
    margin: 3rem auto 0; /* 48px auto 0 */
}

.faq-search-input {
    width: 100%;
    padding: 0.9em 1.5em 0.9em 3.2em;
    border: 1px solid var(--warm-gray);
    border-radius: 999px;
    background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 1.3em center / 1.15em;
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
}

.faq-search-input::placeholder {
    color: var(--gray-b3);
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--yellow);
}

.faq-search-result {
    margin-top: 1rem; /* 16px */
    color: var(--gray);
    font-size: 0.875rem;
    text-align: center;
}

/* ---------- カテゴリ＋Q&A ---------- */
.faq-body {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 3.5rem; /* 56px */
    margin-top: 4rem; /* 64px */
}

/* カテゴリ：スクロールしても左に残す */
.faq-nav {
    position: sticky;
    top: 120px;
    align-self: start;
}

.faq-nav-title {
    padding-bottom: 0.6em; /* 12px */
    border-bottom: 2px solid var(--text);
    font-family: var(--Mincho);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.08em;
}

.faq-nav-list a {
    display: block;
    position: relative;
    padding: 0.9333em 0 0.9333em 1.2em; /* 14px 0 14px 18px */
    border-bottom: 1px solid var(--warm-gray);
    font-size: 0.9375rem;
    line-height: 1.5;
}

/* 項目の頭の小さな黄色い四角 */
.faq-nav-list a::before {
    content: "";
    position: absolute;
    top: calc(14px + 0.75em - 3px);
    left: 2px;
    width: 6px;
    height: 6px;
    background: var(--yellow);
    transform: rotate(45deg);
}

@media (hover: hover) {
    .faq-nav-list a:hover {
        opacity: 0.6;
    }
}

/* カテゴリごとのまとまり */
.faq-cat {
    scroll-margin-top: 120px;
}

.faq-cat + .faq-cat {
    margin-top: 4rem; /* 64px */
}

.faq-cat-title {
    margin: 0;
    padding-left: 0.6667em; /* 16px */
    border-left: 4px solid var(--yellow);
    font-family: var(--Mincho);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: 0.06em;
}

.faq-cat-desc {
    margin-top: 0.5rem; /* 8px */
    color: var(--gray);
    font-size: 0.875rem;
}

/* Q&A 1 件 */
.faq {
    margin-top: 0.75rem; /* 12px */
    border-radius: 8px;
    background: var(--white);
}

.faq-cat-desc + .faq,
.faq-cat-title + .faq {
    margin-top: 1.5rem; /* 24px */
}

.faq dt {
    display: flex;
    align-items: flex-start;
    gap: 1rem; /* 16px */
    position: relative;
    padding: 1.25rem 3.75rem 1.25rem 1.5rem; /* 20px 60px 20px 24px */
    font-weight: 500;
    line-height: 1.6;
    cursor: pointer;
}

.faq-mark {
    flex-shrink: 0;
    width: 1em;
    font-family: var(--Mincho);
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1.2;
}

.faq dt .faq-mark {
    color: var(--yellow);
}

.faq dd .faq-mark {
    color: var(--green);
}

.faq-question {
    padding-top: 0.05em;
}

/* 開け閉めの印（＋ → －） */
.faq-icon {
    position: absolute;
    top: 50%;
    right: 24px;
    width: 14px;
    height: 14px;
    margin-top: -0.4375rem; /* -7px */
}

.faq-icon::before,
.faq-icon::after {
    content: "";
    position: absolute;
    top: 6px;
    left: 0;
    width: 14px;
    height: 2px;
    background: var(--text);
    transition: transform 0.3s ease;
}

.faq-icon::after {
    transform: rotate(90deg);
}

.faq-icon.is-open::after {
    transform: rotate(0deg);
}

/* 回答（main.js が高さを動かす） */
.faq dd {
    height: 0;
    overflow: hidden;
}

.faq-answer {
    display: flex;
    gap: 1rem; /* 16px */
    margin: 0 1.5rem; /* 0 24px */
    padding: 1.25em 0 1.5em; /* 20px 0 24px */
    border-top: 1px solid var(--bg);
}

.faq-answer-body {
    flex: 1;
    min-width: 0;
    font-size: 0.9375rem;
    line-height: 1.9;
}

.faq-answer-text a {
    color: var(--green);
    text-decoration: underline;
    word-break: break-all;
}

.faq-answer-text p + p {
    margin-top: 0.8em;
}

/* AIチャットで続きを見るボタン */
.faq-chat-lead {
    margin-top: 0.75rem; /* 12px */
    font-size: 0.875rem;
}

.faq-chat-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem; /* 8px */
    margin-top: 0.75rem; /* 12px */
}

.faq-chat-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem; /* 8px */
    padding: 0.4286em 1.1429em 0.4286em 0.5714em; /* 6px 16px 6px 8px */
    border: 1px solid var(--green);
    border-radius: 999px;
    background: var(--white);
    color: var(--green);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.faq-chat-btn img {
    width: 24px;
}

@media (hover: hover) {
    .faq-chat-btn:hover {
        opacity: 0.6;
    }
}

.faq-empty {
    padding: 2.5em 1.5em; /* 40px 24px */
    border-radius: 8px;
    background: var(--white);
    text-align: center;
}

/* ---------- 見つからないとき：AIチャットへ ---------- */
.faq-more {
    margin-top: 5rem; /* 80px */
    text-align: center;
}

.faq-more-text {
    font-family: var(--Mincho);
    font-size: 1.125rem;
    font-weight: 600;
    line-height: 1.8;
}

.faq-more .btn {
    margin-top: 1.5rem; /* 24px */
    font-family: inherit;
    cursor: pointer;
}

/* ---------- ページの先頭へ戻る ----------
    AIチャットのアイコン（header.css の --side-chat-*）と同じ大きさ・右の位置で、その 12px 上に置く */
.faq-page-top {
    position: fixed;
    right: var(--side-chat-right);
    bottom: calc(var(--side-chat-bottom) + var(--side-chat-size) + 12px);
    z-index: 150;
    width: var(--side-chat-size);
    height: var(--side-chat-size);
    border: 1px solid #8e8e8e; /* AIチャットのアイコン（画像を縮小して表示）の外枠の見え方に合わせる */
    border-radius: 50%;
    background: var(--white);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.faq-page-top.is-shown {
    opacity: 1;
    visibility: visible;
}

/* ↑ の矢印（縦の線＋山形） */
.faq-page-top::before,
.faq-page-top::after {
    content: "";
    position: absolute;
    left: 50%;
}

.faq-page-top::before {
    top: 32%;
    width: 2px;
    height: 38%;
    margin-left: -1px;
    background: var(--text);
}

.faq-page-top::after {
    top: 32%;
    width: 30%;
    aspect-ratio: 1;
    border-top: 2px solid var(--text);
    border-left: 2px solid var(--text);
    transform: translateX(-50%) rotate(45deg);
    transform-origin: center;
    margin-top: 1px;
}

/* ---------- SP ---------- */
@media (max-width: 1023px) {
    .faq-body {
        grid-template-columns: 180px 1fr;
        gap: 2.5rem; /* 40px */
    }
}

@media (max-width: 767px) {
    /* SP は和柄を 800px に縮める */
    .faq-page {
        padding: 150px 0 88px;
    }

    .faq-page::before {
        background-position: center 115px;
        background-size: 800px auto;
    }

    .faq-search {
        margin-top: 2rem; /* 32px */
    }

    .faq-body {
        display: block;
        margin-top: 2rem; /* 32px */
    }

    /* カテゴリは横に並べて、指で横にスクロール */
    .faq-nav {
        position: static;
        margin-inline: -5vw;
    }

    .faq-nav-title {
        display: none;
    }

    .faq-nav-list {
        display: flex;
        gap: 0.5rem; /* 8px */
        padding: 0 5vw 0.25rem; /* 0 5vw 4px */
        overflow-x: auto;
        scrollbar-width: none;
    }

    .faq-nav-list::-webkit-scrollbar {
        display: none;
    }

    .faq-nav-list a {
        padding: 0.4286em 1.1429em; /* 6px 16px */
        border: 1px solid var(--warm-gray);
        border-radius: 999px;
        background: var(--white);
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .faq-nav-list a::before {
        display: none;
    }

    .faq-list {
        margin-top: 2.5rem; /* 40px */
    }

    .faq-cat + .faq-cat {
        margin-top: 3rem; /* 48px */
    }

    .faq-cat-title {
        font-size: 1.25rem;
    }

    .faq dt {
        gap: 0.75rem; /* 12px */
        padding: 1rem 3rem 1rem 1rem; /* 16px 48px 16px 16px */
        font-size: 0.9375rem;
    }

    .faq-icon {
        right: 18px;
    }

    .faq-answer {
        gap: 0.75rem; /* 12px */
        margin: 0 1rem; /* 0 16px */
        padding: 1em 0 1.25em; /* 16px 0 20px */
    }

    .faq-more {
        margin-top: 3.75rem; /* 60px */
    }

    .faq-more .btn {
        width: 100%;
        max-width: 330px;
    }
}
