/* ==========================================================================
   style-faq.css — faq.php 전용 스타일
   ========================================================================== */

/* ── 페이지 헤더 ── */
.faq-page-header {
    background: linear-gradient(135deg, #1f3b64 0%, #102a43 100%);
    color: white; padding: 60px 0 50px; text-align: center;
}
.faq-page-header .breadcrumb {
    font-size: 13px; color: #93c5fd; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center; gap: 6px;
}
.faq-page-header h1 { font-size: 34px; font-weight: 700; letter-spacing: -1px; margin-bottom: 14px; }
.faq-page-header p { font-size: 16px; color: #cbd5e1; max-width: 600px; margin: 0 auto 28px; line-height: 1.8; word-break: keep-all; }

/* 검색창 */
.faq-search-wrap { max-width: 520px; margin: 0 auto; position: relative; }
.faq-search-wrap input {
    width: 100%; padding: 16px 52px 16px 20px;
    border: none; border-radius: 12px;
    font-size: 15px; font-family: 'Pretendard', sans-serif;
    outline: none; box-shadow: 0 4px 20px rgba(0,0,0,0.15); color: #1e293b;
}
.faq-search-wrap .search-icon {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    color: #94a3b8; font-size: 16px; pointer-events: none;
}
.search-no-result { display: none; text-align: center; padding: 48px 20px; color: #94a3b8; font-size: 15px; }

/* ── 본문 레이아웃 ── */
.faq-body { padding: 60px 0 80px; }
.faq-layout { display: grid; grid-template-columns: 220px 1fr; gap: 40px; align-items: start; }

/* ── 카테고리 사이드 탭 (PC 전용) ── */
.faq-cat-nav {
    background: white; border: 1px solid #e2e8f0;
    border-radius: 14px; overflow: hidden; position: sticky; top: 80px;
}
.faq-cat-nav-title {
    padding: 16px 20px; font-size: 13px; font-weight: 700;
    color: #64748b; letter-spacing: 0.06em;
    background: #f8fafc; border-bottom: 1px solid #e2e8f0;
}

/* scroll 래퍼 — PC에서는 그냥 block */
.faq-cat-nav-scroll { display: block; }

.faq-cat-btn {
    display: flex; align-items: center; gap: 10px;
    width: 100%; padding: 13px 20px;
    font-size: 14px; font-weight: 600; color: #52606d;
    border: none; background: none; cursor: pointer;
    border-bottom: 1px solid #f1f5f9; text-align: left; transition: 0.15s;
    flex-direction: row; /* PC: 가로 */
}
.faq-cat-btn:last-child { border-bottom: none; }
.faq-cat-btn:hover { background: #f8fafc; color: #1f3b64; }
.faq-cat-btn.active { background: #eff6ff; color: #1f3b64; font-weight: 700; }
.faq-cat-btn .cat-icon { font-size: 15px; width: 20px; text-align: center; }
.faq-cat-btn .cat-count {
    margin-left: auto; background: #e2e8f0; color: #64748b;
    font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
}
.faq-cat-btn.active .cat-count { background: #1f3b64; color: white; }

/* ── FAQ 섹션 ── */
.faq-section { margin-bottom: 44px; }
.faq-section:last-child { margin-bottom: 0; }
.faq-section-header {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px; padding-bottom: 14px; border-bottom: 2px solid #1f3b64;
}
.faq-section-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.faq-section-header h2 { font-size: 18px; font-weight: 700; color: #102a43; }
.faq-section-header .section-count { margin-left: auto; font-size: 12px; color: #94a3b8; font-weight: 600; }

/* ── 아코디언 ── */
.faq-item { background: white; border: 1px solid #e2e8f0; border-radius: 12px; margin-bottom: 10px; overflow: hidden; transition: box-shadow 0.2s; }
.faq-item:hover { box-shadow: 0 4px 14px rgba(0,0,0,0.06); }
.faq-item.open { box-shadow: 0 6px 20px rgba(31,59,100,0.10); border-color: #bfdbfe; }

.faq-question { display: flex; align-items: flex-start; gap: 14px; padding: 18px 20px; cursor: pointer; background: none; border: none; width: 100%; text-align: left; }
.faq-q-badge { width: 28px; height: 28px; border-radius: 8px; background: #dbeafe; color: #1e40af; font-size: 14px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.faq-item.open .faq-q-badge { background: #1f3b64; color: white; }
.faq-q-text { font-size: 15px; font-weight: 700; color: #1e293b; line-height: 1.6; word-break: keep-all; flex: 1; padding-top: 2px; }
.faq-toggle-icon { color: #94a3b8; font-size: 13px; flex-shrink: 0; margin-top: 4px; transition: transform 0.25s; }
.faq-item.open .faq-toggle-icon { transform: rotate(180deg); color: #1f3b64; }

.faq-answer { max-height: 0; overflow: hidden; transition: max-height 0.35s ease; padding: 0 20px 0 62px; }
.faq-item.open .faq-answer { max-height: 1200px; padding: 0 20px 20px 62px; }
.faq-answer-inner { font-size: 14.5px; color: #52606d; line-height: 1.88; word-break: keep-all; border-top: 1px solid #f1f5f9; padding-top: 16px; }
.faq-answer-inner p + p { margin-top: 12px; }
.faq-answer-inner strong { color: #1f3b64; }
.faq-answer-inner .answer-verdict { background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 14px 0; font-size: 14px; color: #1e40af; line-height: 1.75; word-break: keep-all; }
.faq-answer-inner .answer-verdict strong { color: #1e40af; }
.faq-answer-inner .related-link { display: inline-flex; align-items: center; gap: 5px; margin-top: 12px; font-size: 13px; font-weight: 700; color: #1f3b64; background: #f1f5f9; padding: 7px 14px; border-radius: 6px; transition: 0.15s; }
.faq-answer-inner .related-link:hover { background: #e2e8f0; }

mark { background: #fef08a; border-radius: 3px; padding: 0 2px; }
.back-to-top { display: block; text-align: center; margin-top: 48px; color: #94a3b8; font-size: 13px; font-weight: 600; cursor: pointer; }
.back-to-top:hover { color: #1f3b64; }


/* ==========================================================================
   모바일 (860px 이하)
   ========================================================================== */
@media (max-width: 860px) {
    .faq-page-header h1 { font-size: 26px; }
    .faq-page-header { padding: 40px 0 36px; }

    /* 레이아웃 세로 전환 */
    .faq-layout { grid-template-columns: 1fr; gap: 20px; }

    /* 카테고리 nav 재정의 */
    .faq-cat-nav { position: static; border-radius: 12px; }
    .faq-cat-nav-title { display: none; }

    /* scroll 래퍼: 가로 스크롤 flex */
    .faq-cat-nav-scroll {
        display: flex !important;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .faq-cat-nav-scroll::-webkit-scrollbar { display: none; }

    /* 버튼: 세로 정렬, 가로 나열 */
    .faq-cat-btn {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 4px;
        width: auto !important;
        min-width: 64px;
        flex-shrink: 0;
        padding: 12px 10px;
        font-size: 11px;
        border-bottom: none !important;
        border-right: 1px solid #f1f5f9;
        white-space: nowrap;
        text-align: center;
    }
    .faq-cat-btn:last-child { border-right: none; }
    .faq-cat-btn .cat-icon { font-size: 18px; width: auto !important; }
    .faq-cat-btn .cat-count { margin-left: 0 !important; font-size: 10px; padding: 1px 5px; }
    .faq-cat-btn.active { background: #1f3b64 !important; color: white !important; }
    .faq-cat-btn.active .cat-count { background: rgba(255,255,255,0.25); color: white; }

    /* 답변 패딩 */
    .faq-answer { padding: 0 14px 0 14px !important; }
    .faq-item.open .faq-answer { padding: 0 14px 18px 14px !important; }
    .faq-q-text { font-size: 14px; }
}
