/* ==================================== */
/* faq.css: MONOID FAQ (Floating Menu & Perfect Alignment) */
/* ==================================== */

/* 1. 全体レイアウト */
.faq-page-layout {
    padding: 100px 0;
    background: #fcfcfc;
}

.faq-flex-container {
    display: flex;
    gap: 60px;
    align-items: start;
}

/* 2. 左側：カテゴリーメニュー (PC用 Sticky) */
.faq-sidebar {
    width: 280px;
    position: sticky;
    top: 100px;
    flex-shrink: 0;
    z-index: 10;
}

.nav-title {
    background: var(--primary-blue);
    color: #fff;
    padding: 18px 20px;
    font-size: 0.8rem;
    letter-spacing: 0.25em;
    font-weight: 800;
    text-transform: uppercase;
}

.faq-nav ul {
    list-style: none;
    border: 1px solid var(--glass-border);
    background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}

.faq-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 20px;
    color: var(--text-dark);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid #f2f2f2;
    transition: all 0.3s ease;
}

.faq-nav li:last-child a { border-bottom: none; }

.faq-nav li a i {
    color: var(--primary-blue);
    font-size: 0.75rem;
    opacity: 0.6;
}

.faq-nav li a:hover {
    background: var(--bg-f8);
    color: var(--primary-blue);
    padding-left: 25px;
}

/* 3. モバイル用フローティングボタン & 吹き出し */
.faq-mobile-trigger {
    display: none; /* デフォルト非表示 */
}

/* 4. 右側：QAコンテンツエリア (崩れ防止対策) */
.faq-main-content {
    flex: 1; /* 残りの幅をすべて埋める */
    min-width: 0; /* フレックスアイテムのオーバーフロー防止 */
}

.faq-category-group {
    margin-bottom: 100px;
    scroll-margin-top: 120px;
}

.category-label {
    font-size: 1.8rem;
    margin-bottom: 40px;
    color: var(--text-dark);
    border-bottom: 2px solid var(--primary-blue);
    padding-bottom: 12px;
    font-weight: 700;
}

/* 質問項目 (Card Style) */
.faq-item {
    background: #fff;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid var(--glass-border);
    border-radius: 4px;
    overflow: hidden;
}

/* 質問エリア (Summary) */
.faq-q {
    display: flex;
    align-items: flex-start;
    padding: 25px 30px;
    cursor: pointer;
    list-style: none;
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.faq-q::-webkit-details-marker { display: none; }

.q-badge, .a-badge {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.2rem;
    width: 30px;
    flex-shrink: 0;
    margin-right: 20px;
    line-height: 1.2;
}
.q-badge { color: var(--primary-blue); }
.a-badge { color: var(--mono-silver); }

.q-text {
    flex: 1; /* テキスト領域を最大化 */
    min-width: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1.5;
    padding-right: 40px; /* アイコン用スペース */
}

.faq-q::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 30px;
    top: 30px;
    font-size: 0.8rem;
    color: var(--mono-silver);
    transition: transform 0.3s ease;
}

details[open] .faq-q::after { transform: rotate(180deg); color: var(--primary-blue); }

/* 回答エリア (Answer - 崩れ解消構造) */
.faq-a {
    display: flex;
    align-items: flex-start;
    padding: 25px 30px 35px;
    border-top: 1px solid #f9f9f9;
    width: 100%;
    box-sizing: border-box;
}

.a-text {
    flex: 1;
    min-width: 0; /* これによりテキストの折り返しが正常化される */
}

.a-text p {
    color: var(--text-muted-dark);
    line-height: 1.8;
    font-size: 1rem;
    margin-bottom: 15px;
}

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

.inline-link {
    color: var(--primary-blue);
    text-decoration: underline;
    font-weight: 700;
}

/* 5. ページ下部CTA */
.faq-footer-cta {
    margin-top: 60px;
    padding: 60px;
    background: var(--bg-f8);
    text-align: center;
    border-radius: 8px;
}

.cta-actions { display: flex; justify-content: center; gap: 20px; }

/* ==================================== */
/* 6. レスポンシブ調整 (Mobile Navigation) */
/* ==================================== */
@media (max-width: 1024px) {
    .faq-sidebar { display: none; } /* サイドバーを隠す */

    /* フローティングボタンを表示 */
    .faq-mobile-trigger {
        display: flex;
        position: fixed;
        bottom: 30px;
        right: 20px;
        z-index: 2000;
        background: var(--primary-blue);
        color: #fff;
        width: 65px;
        height: 65px;
        border-radius: 50%;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        box-shadow: 0 8px 25px rgba(29, 76, 107, 0.4);
        cursor: pointer;
    }

    .faq-mobile-trigger span { font-size: 0.6rem; font-weight: 800; margin-top: 2px; }

    /* 吹き出しメニュー */
    .mobile-nav-bubble {
        position: absolute;
        bottom: 85px;
        right: 0;
        background: #fff;
        border: 1px solid var(--glass-border);
        border-radius: 15px;
        width: 200px;
        padding: 10px 0;
        box-shadow: 0 15px 40px rgba(0,0,0,0.2);
        opacity: 0;
        visibility: hidden;
        transform: translateY(15px);
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 2001; /* ボタン（2000）より少し高く */
        pointer-events: auto; /* クリックを確実に拾う */
    }

    .mobile-nav-bubble::after {
        content: '';
        position: absolute;
        bottom: -10px;
        right: 22px;
        border-left: 10px solid transparent;
        border-right: 10px solid transparent;
        border-top: 10px solid #fff;
    }

    .faq-mobile-trigger.is-active .mobile-nav-bubble {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .mobile-nav-bubble ul { list-style: none; }
    .mobile-nav-bubble li a {
        display: block;
        padding: 14px 20px;
        color: var(--text-dark);
        font-size: 0.9rem;
        font-weight: 700;
        border-bottom: 1px solid #f2f2f2;
        position: relative;
        z-index: 2002;
        display: block; /* 当たり判定を広げる */
    }

    /* メインコンテンツ幅調整 */
    .faq-main-content { width: 100%; max-width: 100%; }
    .faq-flex-container { display: block; }
}

@media (max-width: 768px) {
    .faq-q, .faq-a { padding-left: 15px; padding-right: 15px; }
    .q-badge, .a-badge { margin-right: 15px; width: 24px; }
    .q-text { font-size: 1rem; padding-right: 20px; }
    .faq-footer-cta { padding: 40px 20px; }
    .cta-actions { flex-direction: column; }
}