/* ================================================================
   FAQ 스타일 – QnA 디자인 시스템 기반 리뉴얼
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;600;700;800;900&display=swap');

:root {
    --faq-primary: #FF5D1A;
    --faq-primary-hover: #E65417;
    --faq-primary-light: rgba(255, 93, 26, 0.08);
    --faq-text-dark: #1a1a1a;
    --faq-text-title: #242424;
    --faq-text-body: #4a4a4a;
    --faq-text-sub: #b8b8b8;
    --faq-text-light: #b0b0b0;
    --faq-text-date: #9CA3AF;
    --faq-text-cat: #9B9B9B;
    --faq-border: #e5e5e5;
    --faq-border-card: #E9E9E9;
    --faq-bg-page: #fafafa;
    --faq-bg-gray: #f5f6f8;
    --faq-bg-card: #ffffff;
    --faq-shadow-card: 0 0 10.9px 0 rgba(0, 0, 0, 0.11);
    --faq-shadow-card-meta: 0 4px 16.6px 1px rgba(0, 0, 0, 0.09);
    --faq-radius: 12px;
    --faq-radius-card: 13px;
    --faq-radius-sm: 8px;
    --faq-radius-btn: 62px;
    --faq-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ─────────────────────────────────────────── */
body * {
    font-family: 'Freesentation', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif !important;
}

/* ── Utility Classes ─────────────────────────────────────── */
.faq-full-width {
    width: 100%;
}

.faq-primary-color {
    color: var(--faq-primary);
}

/* ── Top Banner (ref: qna-top-bg qna-bg-f5 qna-full-width) ── */
.faq-top-banner {
    width: 100%;
    background: var(--faq-bg-gray);
    padding: 0;
}

/* ── Container (ref: qna-container) ─────────────────────── */
/*.faq-container {*/
/*    max-width: 1360px;*/
/*    margin: 0 auto;*/
/*    padding: 0 32px;*/
/*}*/

/* ── Title Section (ref: qna-title-section) ─────────────── */
.faq-title-section {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    padding: 40px 0 0;
}

.faq-page-title {
    font-size: 49px;
    font-weight: 900;
    color: var(--faq-primary);
    letter-spacing: -1px;
    line-height: 1.2;
    margin: 0;
}

.faq-page-subtitle {
    font-size: 22px;
    color: #5b5b5b;
    font-weight: 400;
    letter-spacing: 0.5px;
}

/* ── Filter Area (ref: qna-filter-wrap) ─────────────────── */
.faq-filter-wrap {
    background: var(--faq-bg-gray);
    padding: 20px 0 24px;
    margin-bottom: 0;
    overflow-x: hidden;
}

.faq-filter-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 12px;
    max-width: 1360px;
    margin: 0 auto;
    padding: 0;
}

/* 카테고리 탭 (칩 스타일) */
.faq-category-tabs {
    display: flex;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
    justify-content: end;
}

.faq-category-tab {
    padding: 10px 22px;
    font-size: 16px;
    font-weight: 700;
    border: none;
    border-radius: 30px;
    cursor: pointer;
    transition: var(--faq-transition);
    background: #fff;
    color: var(--faq-text-body);
    white-space: nowrap;
    text-decoration: none;
    display: inline-block;
}

.faq-category-tab:hover {
    border-color: var(--faq-primary);
    color: var(--faq-primary);
}

.faq-category-tab.active {
    background: var(--faq-primary);
    color: #fff;
    border-color: var(--faq-primary);
}

.faq-filter-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* 정렬 드롭다운 */
.faq-sort-select {
    padding: 9px 0;
    width: 125px;
    border: 1.5px solid #fff;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 700;
    color: var(--faq-text-dark);
    background: #fff;
    appearance: none;
    text-align: center;
    cursor: pointer;
    transition: var(--faq-transition);
    font-family: inherit;
}

.faq-sort-select:focus {
    outline: none;
    border-color: var(--faq-primary);
}

/* 검색 박스 */
.faq-search-box {
    position: relative;
}

.faq-search-input {
    padding: 9px 48px 9px 16px;
    border: 1.5px solid #fff;
    border-radius: 30px;
    font-size: 16px;
    width: 275px;
    transition: var(--faq-transition);
    font-family: inherit;
    color: var(--faq-text-body);
    font-weight: 400;
}

.faq-search-input::placeholder {
    color: var(--faq-text-light);
}

.faq-search-input:focus {
    outline: none;
    border-color: var(--faq-primary);
    width: 275px;
}

.faq-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--faq-text-sub);
    transition: var(--faq-transition);
    background: none;
    border: none;
    padding: 0;
}

.faq-search-icon:hover {
    color: var(--faq-primary);
}

/* FAQ 작성 버튼 */
.faq-write-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    min-width: 120px;
    height: 44px;
    background: var(--faq-primary);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: 1.5px solid var(--faq-primary);
    border-radius: var(--faq-radius-btn);
    cursor: pointer;
    transition: var(--faq-transition);
    text-decoration: none;
    letter-spacing: -0.3px;
    box-shadow: 0 4px 12px rgba(255, 90, 40, 0.2);
}

.faq-write-btn:hover {
    background: var(--faq-primary-hover);
    transform: translateY(-1px);
    color: #fff;
}

/* ── Main Layout ─────────────────────────────────────────── */
.faq-main-container {
    width: 100%;
    box-sizing: border-box;
}

.faq-content-left {
    flex: 1;
    min-width: 0;
}

/* ── Sidebar (기존 유지, 스타일 업그레이드) ──────────────── */
.faq-sidebar {
    width: 260px;
    flex-shrink: 0;
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 300px);
    overflow: auto;
    border: 1px solid var(--faq-border-card);
    border-radius: var(--faq-radius-card);
    background: #fff;
    padding: 14px;
    box-shadow: var(--faq-shadow-card-meta);
}

.faq-sidebar summary {
    cursor: pointer;
    font-weight: 700;
    font-size: 17px;
    color: var(--faq-primary);
    outline: 0;
    padding: 4px 0 8px;
}

.faq-sidebar .faq-sidebar-chips {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

.faq-sidebar-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    border-radius: 0;
    color: #333;
    background: #fff;
    text-decoration: none;
    font-size: 14px;
    transition: var(--faq-transition);
}

.faq-sidebar-chip:last-child {
    border-bottom: none;
}

.faq-sidebar-chip:hover {
    color: var(--faq-primary);
    background: rgba(255, 93, 26, 0.03);
}

.faq-sidebar-chip.active {
    background: rgba(255, 93, 26, 0.05);
    color: var(--faq-primary);
    font-weight: 700;
}

.faq-sidebar-chip.active .faq-sidebar-chip-count {
    color: var(--faq-primary);
    font-weight: 600;
}

.faq-sidebar-chip-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.faq-sidebar-chip-count {
    font-size: 12px;
    font-weight: 500;
    color: #999;
    flex-shrink: 0;
}

.faq-sidebar-chip-arrow {
    font-size: 16px;
    color: #ccc;
    flex-shrink: 0;
    transition: var(--faq-transition);
}

.faq-sidebar-chip:hover .faq-sidebar-chip-arrow {
    color: var(--faq-primary);
    text-decoration: none;
}

.faq-sidebar-chip.active .faq-sidebar-chip-arrow {
    color: var(--faq-primary);
}

/* ── Card Grid (ref: qna-card-grid) ─────────────────────── */
.faq-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 36px 25px;
    align-items: flex-start;
}

/* ── Card (ref: qna-grid-item) ──────────────────────────── */
.faq-grid-item {
    background: transparent;
    border: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    transition: transform 0.3s ease;
    min-width: 0;
    max-width: 100%;
}

.faq-card-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    border-radius: var(--faq-radius-card);
    transform: translateY(0);
    transition: transform 0.65s cubic-bezier(0.22, 0.8, 0.18, 1), box-shadow 0.35s ease;
    will-change: transform;
}

.faq-grid-item:hover {
    transform: translateY(-4px);
    cursor: pointer;
    z-index: 20;
}

/* 카드 메타 (상단: 카테고리 뱃지) */
.faq-card-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 8px 14px 25px;
    border-radius: var(--faq-radius-card);
    background: var(--faq-bg-gray);
    box-shadow: var(--faq-shadow-card-meta);
    cursor: pointer;
    position: relative;
}

.faq-card-meta-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
}

/* 카테고리 뱃지 */
.faq-badge-cat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
    min-width: 44px;
    min-height: 28px;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    /*background: var(--faq-primary);*/
    opacity: 0.9;
    color: var(--faq-text-cat);
}

/* 카드 내부 본문 */
.faq-card-inner {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: var(--faq-radius-card);
    background: var(--faq-bg-card);
    box-shadow: var(--faq-shadow-card);
    overflow: hidden;
    position: relative;
    z-index: 1;
    margin-top: -16px;
    padding-top: 8px;
}

.faq-card-body {
    flex: 1;
    padding: 10px 20px 10px;
    cursor: pointer;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Q/A 행 레이아웃 */
.faq-card-qa-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.faq-card-a-row {
    display: none !important;
    /* 카드에서는 답변 완전 숨김 */
}

/* Q & A 박스 컨테이너 (미니멀 타이포) */
.faq-card-qa-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: transparent;
    border-radius: 0;
    padding: 14px 0 0 0;
    border: none;
    border-top: 1px solid #f0f0f0;
    margin-top: 14px;
}

/* 리스트 전용 Q/A 텍스트 마크 */
.faq-list-label-text-q {
    display: inline-block;
    color: var(--faq-primary);
    font-size: 17px;
    font-weight: 900;
    flex-shrink: 0;
    margin-top: 0;
    line-height: 1.5;
}

.faq-list-label-text-a {
    display: inline-block;
    color: #252E82;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
    margin-top: 0;
    line-height: 1.6;
}

/* 질문 제목 (새 상단 배치용) */
.faq-card-title {
    flex: none;
    /* 영역 높이를 고정하여 하단 border 위치를 일정하게 맞춤 */
    min-width: 0;
    word-break: break-word;
    font-size: 19px;
    font-weight: 700;
    color: var(--faq-primary);
    line-height: 1.4;
    min-height: 54px;
    /* 최소 2줄 높이에 맞게 고정하여 호버 시 점프 현상 방지 */
    max-height: 54px;
    /* 기준 높이 고정 (부드러운 애니메이션을 위함) */
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: max-height 0.6s ease-in-out;
    /* 마우스 뗄 때 (올라가는 속도: 적당히 부드럽게) */
}

/* 미리보기 텍스트 Q */
.faq-card-preview-q {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    margin: 0;
    font-size: 17px;
    font-weight: 500;
    color: var(--faq-text-dark);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 102px;
    /* 호버 전 모든 카드가 동일 크기(4줄 분량)를 점유하도록 고정 */
    max-height: 102px;
    /* 4줄에 맞게 초기 상한선 제한 (17 * 1.5 * 4 = 102) */
    transition: max-height 0.6s ease-in-out;
}

@media (min-width: 769px) {
    .faq-grid-item {
        height: 300px;
    }

    .faq-grid-item:hover .faq-card-wrap {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: auto;
        min-height: 100%;
        z-index: 5;
        transform: translateY(10px);
        box-shadow:
            0 0 0 2px var(--faq-primary),
            0 10px 22px rgba(0, 0, 0, 0.12);
    }

    .faq-grid-item:hover .faq-card-meta {
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
    }

    .faq-grid-item:hover .faq-card-inner {
        box-shadow: 0 10px 26px rgba(0, 0, 0, 0.16);
        overflow: visible;
    }

    .faq-grid-item:hover .faq-card-title {
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: hidden;
        max-height: 260px;
        /* 실제 컨텐츠와 간극을 줄여 체감 속도를 더욱 천천히 */
        transition: max-height 0.6s ease-in-out;
        /* 마우스 올릴 때 (내려가는 속도: 천천히 부드럽게 가속) */
    }

    .faq-grid-item:hover .faq-card-preview-q {
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: hidden;
        max-height: 600px;
        /* 질문 확장 간극을 줄여 체감 속도 낮춤 */
        transition: max-height 0.6s ease-in-out;
        /* 마우스 올릴 때 (내려가는 속도: 천천히 부드럽게 가속) */
    }
}

/* 모바일 모드: 기본적으로 제목과 질문 전체 보기 */
@media (max-width: 768px) {

    .faq-card-title,
    .faq-card-preview-q {
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
        max-height: none;
    }
}

/* 미리보기 텍스트 A */
.faq-card-preview-a {
    flex: 1;
    min-width: 0;
    word-break: break-all;
    margin: 0;
    font-size: 15px;
    color: var(--faq-text-body);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 카드 하단 (조회수+날짜) */
.faq-card-bottom {
    color: var(--faq-text-sub);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid #f5f5f5;
}

.faq-card-date {
    font-size: 14px;
    color: var(--faq-text-sub);
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 14px;
}


/* comm-pagination / comm-page-btn → page_banner.css로 이동 */

/* ── 메타 정보 라인 (총 N건) ───────────────────────────── */
.faq-meta-line {
    color: #888;
    font-size: 14px;
    margin: 8px 0 16px;
}

/* ── Empty State ─────────────────────────────────────────── */
.faq-empty-box {
    padding: 60px 24px;
    text-align: center;
    background: #fff;
    grid-column: 1 / -1;
    border-radius: 16px;
    border: 1px solid #eee;
}

.faq-empty-box svg {
    margin-bottom: 12px;
}

.faq-empty-text {
    color: #aaa;
    font-size: 15px;
}


/* ================================================================
   FAQ 상세 페이지
   ================================================================ */

/* 상세 본문 카드 */
.faq-detail-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 24px;
}

.faq-detail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px 28px;
    border-radius: var(--faq-radius-card);
    background: var(--faq-bg-card);
    box-shadow: var(--faq-shadow-card);
    position: relative;
}

.faq-detail-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.faq-detail-header-right {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 16px;
    color: var(--faq-text-sub);
}

.faq-detail-body-wrap {
    border-radius: var(--faq-radius-card);
    border: 1px solid var(--faq-border-card);
    background: var(--faq-bg-card);
    box-shadow: var(--faq-shadow-card);
    position: relative;
    z-index: 1;
    margin-top: -16px;
    padding: 32px 36px 44px;
    overflow: hidden;
}

/* Q/A 래퍼: 제목 아래 구분 */
.faq-detail-qa-wrap {
    margin-top: 24px;
}

/* Q. 질문 섹션 */
.faq-detail-question {
    display: flex;
    align-items: baseline;
    gap: 14px;
    margin-bottom: 40px;
}

/* A. 답변 섹션 */
.faq-detail-answer {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

/* Q 내용 영역 */
.faq-detail-q-content {
    flex: 1;
    min-width: 0;
    font-size: 19px;
    font-weight: 500;
    color: var(--faq-text-title);
    line-height: 1.5;
    word-break: break-word;
}

.faq-detail-q-content .q {
    margin: 0 !important;
    padding: 0 !important;
    font-size: inherit !important;
    font-weight: inherit !important;
    color: inherit !important;
    line-height: inherit !important;
}

/* A 내용 영역 */
.faq-detail-a-content {
    flex: 1;
    min-width: 0;
}

/* 상세 페이지 Q. 마크 */
.faq-detail-mark-q {
    display: inline-block;
    font-size: 26px;
    font-weight: 900;
    color: var(--faq-primary);
    line-height: 1.6;
    flex-shrink: 0;
}

/* 상세 페이지 A. 마크 */
.faq-detail-mark-a {
    display: inline-block;
    font-size: 26px;
    font-weight: 900;
    color: #252E82;
    line-height: 1.4;
    flex-shrink: 0;
    margin-top: 2px;
}

/* Q/A 라벨 강조 */
.faq-label-q {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--faq-primary);
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}

.faq-label-a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #252E82;
    color: #fff;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
}

.faq-detail-title {
    font-weight: 700;
    font-size: 23px;
    color: var(--faq-text-title);
    margin: 0;
    line-height: 1.45;
    word-break: break-word;
}

/* 질문 헤더 (Q 원형 + 타이틀) */
.faq-question-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--faq-bg-gray);
}

/* 답변 영역 */
.faq-answer-section {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 4px;
}

.faq-answer-body {
    flex: 1;
}

/* 본문 콘텐츠 (기존 faq-content 스타일 계승) */
.faq-content {
    font-size: 1.05rem;
    line-height: 2.2;
    color: #222;
}

.faq-content h2.q {
    font-size: 1.3rem;
    margin: 0 0 10px;
    line-height: 1.5;
}

.faq-content .lead {
    padding: 12px 14px;
    border-left: 4px solid #FF5D1A;
    background: #fff8f4;
    color: #333;
    border-radius: 6px;
}

.faq-content ol {
    margin: 6px 0 16px 22px;
}

.faq-content li {
    margin: 6px 0;
}

.faq-content .tip {
    margin: 16px 0;
    padding: 12px 14px;
    background: #f6fbff;
    border: 1px solid #e5f2ff;
    border-radius: 8px;
}

.faq-content blockquote {
    margin: 14px 0;
    padding: 10px 14px;
    border-left: 3px solid #e0e0e0;
    color: #555;
    background: #fafafa;
    border-radius: 4px;
}

.faq-content p {
    margin: 8px 0;
}

.faq-content code,
.faq-content pre {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.faq-content img {
    max-width: 100%;
    height: auto;
}

.faq-content table {
    border-collapse: collapse;
    width: 100%;
}

.faq-content table,
.faq-content th,
.faq-content td {
    border: 1px solid #e5e5e5;
}

.faq-content th,
.faq-content td {
    padding: 8px;
}

/* 기본 코드 버튼 (블루 톤) */
.btn-code {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 10px;
    border: 1px solid #e5f2ff;
    border-radius: 999px;
    background: #f6fbff;
    color: #0b5cab;
    font-size: .92rem;
    line-height: 1.9;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn-code:hover {
    background: #e9f5ff;
    border-color: #cfe8ff;
    color: #084a8d;
}

.btn-code:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(11, 92, 171, .15), 0 0 0 1px #0b5cab;
}

.btn-code:active {
    transform: translateY(1px);
}

/* 대안 버튼 (ALT) */
.btn-code-alt {
    display: inline-block;
    margin: 0 4px;
    padding: 2px 10px;
    border: 1px solid #ffe1cc;
    border-radius: 999px;
    background: #fff6f0;
    color: #9a3e00;
    font-size: .92rem;
    line-height: 1.9;
    text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}

.btn-code-alt:hover {
    background: #ffefe5;
    border-color: #ffd1b5;
    color: #7b3200;
}

.btn-code-alt:focus-visible {
    outline: 0;
    box-shadow: 0 0 0 3px rgba(255, 93, 26, .18), 0 0 0 1px #ff5d1a;
}

.btn-code-alt:active {
    transform: translateY(1px);
}

/* 코드 버튼 도트 아이콘 */
.btn-code::before,
.btn-code-alt::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.btn-code::before {
    background: #0b5cab;
}

.btn-code-alt::before {
    background: #ff7a2f;
}

/* ── 상세: 하단 네비 버튼 ────────────────────────────────── */
.faq-nav-actions {
    display: flex;
    justify-content: end;
    align-items: center;
    margin: 24px 0 8px;
    gap: 8px;
}

.faq-nav-actions-left,
.faq-nav-actions-right {
    display: flex;
    gap: 8px;
}

.faq-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border: 1.5px solid var(--faq-border-card);
    border-radius: 30px;
    background: #fff;
    color: var(--faq-text-body);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--faq-transition);
    text-decoration: none;
}

.faq-btn:hover {
    border-color: var(--faq-primary);
    color: var(--faq-primary);
}

.faq-btn.primary {
    background: var(--faq-primary);
    color: #fff;
    border-color: var(--faq-primary);
}

.faq-btn.primary:hover {
    background: var(--faq-primary-hover);
    border-color: var(--faq-primary-hover);
    color: #fff;
}

.faq-btn.danger {
    color: #d44;
    border-color: #fcc;
}

.faq-btn.danger:hover {
    background: #fef0f0;
    border-color: #d44;
}

/* ── 이전/다음 글 ─────────────────────────────────────────── */
.faq-adjacent {
    display: flex;
    flex-direction: column;
    margin: 40px 0 20px;
    border-top: 2px solid var(--faq-text-title);
    border-bottom: 1px solid var(--faq-border-card);
}

.faq-adjacent-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: var(--faq-text-title);
    transition: var(--faq-transition);
    cursor: pointer;
}

.faq-adjacent-item:last-child {
    border-bottom: none;
}

.faq-adjacent-item:hover {
    background: #fafafa;
}

.faq-adjacent-item:hover .faq-adjacent-title {
    color: var(--faq-primary);
}

.faq-adjacent-dir {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--faq-text-title);
    width: 100px;
    flex-shrink: 0;
}

.faq-adjacent-dir svg {
    width: 18px;
    height: 18px;
    stroke: var(--faq-text-light);
}

.faq-adjacent-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--faq-text-body);
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: var(--faq-transition);
}

.faq-adjacent-empty {
    color: #999;
    font-size: 15px;
    flex: 1;
}

.faq-btn-list-wrap {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 60px;
}

.faq-btn-list {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 11px 32px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 30px;
    font-size: 15px;
    font-weight: 400;
    color: #5b5b5b;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.15s, color 0.15s;
}

.faq-btn-list svg {
    display: none;
}

.faq-btn-list:hover {
    border-color: var(--faq-primary);
    color: var(--faq-primary);
    box-shadow: none;
}

/* ── 상세 타이틀 강조 ────────────────────────────── */
.faq-detail-title {
    font-weight: 500;
    font-size: 23px;
    color: var(--faq-text-title);
    margin: 0 0 24px 0;
    line-height: 1.4;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--faq-bg-gray);
}

/* Q/A 본문 내 h2.q 자동 강조 — htmlContent에서 Q. 로 시작하는 질문 강조 */
.faq-content h2.q {
    font-size: 1.25rem;
    margin: 24px 0 12px;
    line-height: 1.5;
    font-weight: 500;
    color: var(--faq-text-title);
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* ================================================================
   반응형
   ================================================================ */

@media (max-width: 1200px) {
    .faq-card-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .faq-main-container {
        gap: 20px;
    }

    .faq-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .wrapper {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
        box-sizing: border-box;
    }

    .faq-main-container {
        flex-direction: column;
        align-items: stretch;
    }

    .faq-card-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;
    }

    /*.faq-sidebar {*/
    /*    width: 100% !important;*/
    /*    margin-top: 24px;*/
    /*    display: block;*/
    /*    position: static;*/
    /*    max-height: none;*/
    /*}*/

    .faq-title-section {
        padding: 24px 0 0;
        margin-left: 0;
    }

    .faq-page-title {
        font-size: 32px;
    }

    .faq-page-subtitle {
        font-size: 16px;
    }

    .faq-filter-section {
        flex-wrap: wrap;
    }

    .faq-filter-right {
        flex-shrink: 1;
        flex-wrap: wrap;
        max-width: 100%;
    }

    .faq-container {
        padding: 0 16px;
    }

    .faq-detail-meta {
        padding: 14px 16px 24px;
        flex-wrap: wrap;
        gap: 8px;
    }

    .faq-detail-body-wrap {
        padding: 20px 16px 28px;
    }

    .faq-adjacent {
        flex-direction: column;
    }

    .faq-nav-actions {
        flex-direction: column;
        gap: 12px;
    }

    .faq-nav-actions-left,
    .faq-nav-actions-right {
        width: 100%;
        justify-content: center;
    }

}

@media (max-width: 500px) {
    .faq-filter-right {
        width: 100%;
        flex-wrap: wrap;
    }

    .faq-search-input {
        width: 100%;
        box-sizing: border-box;
    }
}

@media (max-width: 400px) {

    /* 초소형 모바일 기기 (iPhone SE, Galaxy Fold 등) */
    .faq-page-title {
        font-size: 26px;
    }

    .faq-page-subtitle {
        font-size: 14px;
    }


    .faq-container {
        padding: 0 12px;
    }

    .faq-card-body {
        padding: 10px 16px;
    }

    .faq-card-title {
        font-size: 16px;
        height: 60px;
    }

    .faq-card-preview {
        font-size: 14px;
        height: 80px;
        -webkit-line-clamp: 3;
        line-clamp: 3;
    }

    .faq-detail-meta {
        padding: 12px 14px 20px;
    }

    .faq-detail-body-wrap {
        padding: 16px 14px 24px;
    }

    .comm-nav-text {
        display: none;
    }

}

/* 다크 모드(선택) */
@media (prefers-color-scheme: dark) {
    .btn-code {
        background: #0d1b2a;
        border-color: #1f3b5a;
        color: #aac8ff;
    }

    .btn-code:hover {
        background: #0f2236;
        border-color: #2a4c73;
        color: #c5d9ff;
    }

    .btn-code-alt {
        background: #2a1b12;
        border-color: #5a3a26;
        color: #ffbd99;
    }

    .btn-code-alt:hover {
        background: #331f15;
        border-color: #6e462f;
        color: #ffd2b8;
    }
}
