/* Q&A 최종 디자인 최적화 */
.section-title { text-align: center; margin-top: 50px; font-size: 32px; font-weight: bold; }
.section-desc { text-align: center; color: #666; margin-bottom: 30px; }

.qna-write-btn { background: #ed5848; color: #fff; border: none; padding: 10px 22px; border-radius: 6px; cursor: pointer; font-weight: bold; }

/* 작성 폼 */
.write-area-minimal { display: none; padding: 10px 0 30px 0; border-bottom: 1px solid #eee; margin-bottom: 20px; }
.write-area-minimal textarea, .write-area-minimal input { width: 100%; padding: 14px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; font-size: 15px; background: #fff; }
.form-group { margin-bottom: 12px; }
.form-row-password { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.password-input-area { flex: 1; }
.private-check-area { flex-shrink: 0; font-size: 14px; display: flex; align-items: center; }
.private-check-area input { width: auto; margin-right: 6px; }
.form-actions { display: flex; gap: 10px; }
.btn-submit-main { flex: 2; background: #333; color: #fff; padding: 14px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-cancel-main { flex: 1; background: #f5f5f5; color: #666; padding: 14px; border: none; border-radius: 6px; cursor: pointer; }

/* 피드 아이템 */
.qna-feed { border-top: 2px solid #333; }
.qna-item { border-bottom: 1px solid #eee; transition: background 0.2s; }
.pending-bg { background: #f0f7ff; }

/* 헤더: 10칸 밀림 방지를 위해 padding 최적화 */
.qna-header { display: flex; align-items: flex-start; padding: 18px 12px; cursor: pointer; gap: 12px; }

/* Q 아이콘 상단 정렬 */
.q-icon { font-weight: bold; font-size: 18px; flex-shrink: 0; line-height: 1.5; align-self: flex-start; }
.q-icon.pending { color: #3498db; }
.q-icon.answered { color: #333; }

/* 본문 텍스트: 미리보기 2줄 제한 */
.qna-content-container { flex: 1; min-width: 0; }
.qna-main-text {
    font-size: 15px;
    line-height: 1.5;
    color: #444;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    /* [수정] 미리보기 시 불필요한 공백과 줄바꿈을 모두 무시하고 텍스트만 연결 */
    white-space: normal;
    word-break: break-all;
}

/* 질문을 클릭하여 펼쳤을 때(active) */
.qna-item.active .qna-main-text {
    -webkit-line-clamp: unset !important;
    display: block !important;
    /* [핵심 수정] pre-wrap 대신 pre-line 사용 */
    white-space: pre-line !important;
    /* pre-line은 HTML 소스의 탭(들여쓰기) 공백은 한 칸으로 합치고,
     *      사용자가 입력한 '엔터' 줄바꿈만 정상적으로 보여줍니다. */
}

.lock-text { color: #aaa; font-style: italic; }
.qna-meta { flex-shrink: 0; text-align: right; color: #bbb; font-size: 12px; margin-top: 5px; }

/* 바디 영역: [중요] 10칸 밀림의 원인인 padding-left 제거 */
.qna-body-area { display: none; padding: 0 12px 25px 12px; background: #fafafa; }
.qna-item.active .qna-body-area { display: block; }

/* 답변 영역 A 아이콘 정렬 */
.answer-container { display: flex; gap: 12px; background: #fff; padding: 18px; border-radius: 10px; border: 1px solid #eee; margin-top: 10px; align-items: flex-start; }
.a-icon { color: #ed5848; font-weight: bold; font-size: 18px; line-height: 1.5; flex-shrink: 0; }
.answer-text { flex: 1; line-height: 1.5; color: #444; font-size: 15px; word-break: break-all; }
.answer-date { margin-top: 10px; font-size: 11px; color: #aaa; }

/* 액션 바 */
.action-footer { text-align: right; margin-top: 20px; border-top: 1px solid #eee; padding-top: 12px; }
.btns button { background: none; border: none; color: #888; font-size: 13px; text-decoration: underline; cursor: pointer; margin-left: 10px; }
.btns .btn-del { color: #ed5848; }

/* 와이드 모달 */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); z-index: 9999; align-items: center; justify-content: center; }
.modal-box-wide { background: #fff; padding: 25px; border-radius: 12px; width: 95%; max-width: 700px; box-sizing: border-box; }
.modal-box-wide textarea { width: 100%; padding: 15px; border: 1px solid #ddd; border-radius: 8px; font-size: 15px; line-height: 1.5; box-sizing: border-box; resize: vertical; margin-bottom: 10px; }
.modal-box-wide input { width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; box-sizing: border-box; }
.modal-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.modal-btns button { padding: 10px 20px; border: none; border-radius: 6px; cursor: pointer; font-weight: bold; }
.btn-confirm { background: #ed5848; color: #fff; }

@media (max-width: 767px) {
    .qna-header { padding: 15px 10px; }
}
