/**
 * EOND Board — FAQ 스킨 스타일
 *
 * default/style.css를 상속하고, FAQ 전용 아코디언 스타일을 레이어링합니다.
 * CSS 변수는 테마 시스템에서 주입됩니다.
 */

/* === FAQ 전용 변수 === */
.eond-faq-list,
.eond-faq-view,
.eond-faq-write {
    --eb-faq-q-bg: #3b82f6;
    --eb-faq-a-bg: #10b981;
    --eb-faq-hover: rgba(59, 130, 246, 0.04);
    --eb-faq-open-border: var(--eb-accent);
}

/* Dark 테마 오버라이드 */
.eond-board[data-theme="dark"] {
    --eb-faq-q-bg: #60a5fa;
    --eb-faq-a-bg: #34d399;
    --eb-faq-hover: rgba(96, 165, 250, 0.08);
}

/* === 검색 === */
.eond-faq-search-wrap {
    margin-bottom: 1em;
}

.eond-faq-search-form {
    position: relative;
    max-width: 400px;
}

.eond-faq-search-input {
    width: 100%;
    padding: 10px 40px 10px 14px;
    border: 1px solid var(--eb-border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    background: var(--eb-bg);
    color: var(--eb-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.eond-faq-search-input:focus {
    outline: none;
    border-color: var(--eb-focus-border);
    box-shadow: 0 0 0 3px var(--eb-focus-ring);
}

.eond-faq-search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--eb-text-muted);
    cursor: pointer;
    padding: 6px;
    display: flex;
    align-items: center;
}

.eond-faq-search-btn:hover {
    color: var(--eb-text);
}

/* === 공지 === */
.eond-faq-notices {
    margin-bottom: 1em;
    border-top: 1px solid var(--eb-border);
}

.eond-faq-notice-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 8px;
    border-bottom: 1px solid var(--eb-border);
    text-decoration: none;
    color: inherit;
    background: var(--eb-bg-notice);
    transition: background 0.15s;
}

.eond-faq-notice-item:hover {
    background: var(--eb-bg-subtle);
    text-decoration: none;
    color: inherit;
}

.eond-faq-notice-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: var(--eb-text-link);
}

.eond-faq-notice-date {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--eb-text-muted);
}

/* === 아코디언 === */
.eond-faq-accordion {
    border-top: 2px solid var(--eb-border-strong);
}

.eond-faq-item {
    border-bottom: 1px solid var(--eb-border);
    transition: border-color 0.2s;
}

.eond-faq-item.is-open {
    border-bottom-color: var(--eb-border-strong);
}

/* 질문 버튼 */
.eond-faq-question {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 8px;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    font-size: 14px;
    color: var(--eb-text);
    transition: background 0.15s;
}

.eond-faq-question:hover {
    background: var(--eb-faq-hover);
}

.eond-faq-q-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--eb-faq-q-bg);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.eond-faq-q-text {
    flex: 1;
    min-width: 0;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
}

.eond-faq-chevron {
    flex-shrink: 0;
    color: var(--eb-text-muted);
    transition: transform 0.25s ease;
}

.eond-faq-item.is-open .eond-faq-chevron {
    transform: rotate(180deg);
}

/* 답변 영역 */
.eond-faq-answer {
    overflow: hidden;
}

.eond-faq-answer[hidden] {
    display: none;
}

.eond-faq-answer-inner {
    display: flex;
    gap: 12px;
    padding: 0 8px 16px 8px;
    animation: eond-faq-fadein 0.2s ease;
}

.eond-faq-a-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--eb-faq-a-bg);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
}

.eond-faq-a-content {
    flex: 1;
    min-width: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--eb-text);
    word-break: break-word;
}

.eond-faq-a-content p:first-child {
    margin-top: 0;
}

.eond-faq-a-content p:last-child {
    margin-bottom: 0;
}

.eond-faq-a-content img {
    max-width: 100%;
    height: auto;
}

/* 답변 하단 (고유링크, 조회수, 수정/삭제) */
.eond-faq-a-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-top: 8px;
    border-top: 1px solid var(--eb-border);
    font-size: 12px;
    color: var(--eb-text-muted);
}

.eond-faq-a-footer-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.eond-faq-a-footer-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.eond-faq-a-footer-actions .eond-btn {
    padding: 4px 12px;
    font-size: 12px;
}

.eond-faq-a-footer-actions .eond-delete-form {
    display: inline;
}

.eond-faq-permalink {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--eb-text-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.eond-faq-permalink:hover {
    color: var(--eb-focus-border);
    text-decoration: none;
}

.eond-faq-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--eb-text-muted);
    font-size: 14px;
}

@keyframes eond-faq-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === 개별 FAQ 보기 (view) === */
.eond-faq-view-card {
    border: 1px solid var(--eb-border);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 1.5em;
}

.eond-faq-view-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--eb-border);
}

.eond-faq-view-question {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 8px;
}

.eond-faq-view-title {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0;
    color: var(--eb-text-heading);
    line-height: 1.4;
}

.eond-faq-view .eond-view-meta {
    margin-top: 12px;
    padding-left: 40px;
}

.eond-faq-view-answer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    background: var(--eb-bg-subtle);
}

.eond-faq-view-answer .eond-faq-a-content {
    min-height: 100px;
}

/* === 글쓰기 폼 (write) === */
.eond-faq-field-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 4px;
    background: var(--eb-faq-q-bg);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-right: 4px;
    vertical-align: middle;
}

.eond-faq-field-icon-a {
    background: var(--eb-faq-a-bg);
}

/* === 반응형 === */
@media (max-width: 768px) {
    .eond-faq-question {
        padding: 12px 4px;
        gap: 8px;
    }

    .eond-faq-q-icon,
    .eond-faq-a-icon {
        width: 24px;
        height: 24px;
        font-size: 12px;
        border-radius: 4px;
    }

    .eond-faq-q-text {
        font-size: 13px;
    }

    .eond-faq-answer-inner {
        padding: 0 4px 14px 4px;
        gap: 8px;
    }

    .eond-faq-a-content {
        font-size: 13px;
    }

    .eond-faq-search-form {
        max-width: 100%;
    }

    .eond-faq-view-header,
    .eond-faq-view-answer {
        padding: 16px;
    }

    .eond-faq-view-title {
        font-size: 1.2em;
    }

    .eond-faq-view .eond-view-meta {
        padding-left: 36px;
    }
}
