/* 1. 전체 배경 및 초기화 */
body {
    background-color: #f4f4f4;
}

footer {
    background-color: #ffffff;
}  

.char-count {
    font-size: 11px;    /* 글자 크기를 확 줄임 */
    color: #999;        /* 흐릿한 회색으로 변경 */
    text-align: right;  /* 오른쪽 정렬 */
    margin-top: 4px;    /* textarea와의 간격 */
    margin-right:2px;
    font-weight: normal;
}

#charCount {
    font-size: 11px;    /* 글자 크기를 확 줄임 */
    color: #999;        /* 흐릿한 회색으로 변경 */
    text-align: right;  /* 오른쪽 정렬 */
    margin-top: 4px;    /* textarea와의 간격 */
    margin-right:2px;
    font-weight: normal;
}

.mookhon-board-container {
    max-width: 1200px;
    margin: 10px auto; 
    width: 100%;
}

.board-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 0 20px 0;
    background-color: transparent;
}

.board-title {
    font-size: 32px; 
    font-weight: 500; 
    color: #363853; /* 제공된 네이비 타이틀 색상 */
    margin: 0 0 0 10px; 
    letter-spacing: -1px;
}

.board-main-content {
    background-color: #ffffff;
    border-top: 2px solid #363853; /* 제공된 상단 네이비 포인트 테두리 */
    padding-bottom: 40px;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .06);
}

/* 제공된 버튼 스타일 활용 */
.btn-write { 
    background: #e74438; /* 제공된 빨간색 포인트 컬러 */
    color: #fff; border: none; padding: 12px 35px; 
    border-radius: 4px; font-size: 15px; font-weight: bold; cursor: pointer; 
}

/* =========================================
    2. 게시글 상세 페이지 전용 커스텀 스타일
    ========================================= */

/* 헤더 (제목, 날짜) */
.post-detail-header {
    padding: 30px 40px 20px 40px;
    border-bottom: 1px solid #dcdcdc; /* 목록 페이지의 검색바 테두리색 활용 */
}
.post-detail-header .title-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.post-detail-header h3 {
    margin: 0;
    font-size: 32px;
    letter-spacing: -1px;
    font-weight:700;
    color: #363853;
}
.link-copy-btn {
    background-color: #e74438; /* 빨간색 포인트 */
    color: white;
    border: none;
    border-radius: 4px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
}
.link-copy-btn svg { width: 24px; height: 24px; fill: currentColor; }

.post-detail-header .date {
    color: #bbb; /* 제공된 날짜 색상 */
    font-size: 14px;
}

/* 본문 영역 */
.post-detail-body {
    padding: 40px;
    min-height: 400px;
    color: #444; /* 제공된 기본 텍스트 색상 */
    font-size: 15px;
    /* line-height: 1.7; */ 
}

/* 본문 내 hr 태그 스타일 강제 지정 */
.post-detail-body hr {
    display: block !important;
    height: 1px !important;
    border: 0 !important;
    border-top: 1px solid #dcdcdc !important; /* 목록 구분선과 같은 색상 */
    margin: 20px 0 !important;
    clear: both !important;
}
        
/* 3. 위지윅 에디터 및 표(Table) 영역 설정 */
.post-detail-body table {
    width: 100% !important;
    table-layout: fixed !important; /* 표 칸 비율 고정 (매우 중요) */
    border-collapse: collapse !important;
    margin: 15px 0 !important;
    line-height: 0.8 !important;   /* 요청하신 1.5 적용 */
}

/* 4. 표 셀(td) 안의 내용 정렬 */
.post-detail-body td, 
.post-detail-body th {
    line-height: 1.2 !important;  /* 글자 겹침 방지 (약간 늘림) */
    padding: 6px 5px !important;   /* 상하 패딩을 10px에서 5px로 줄임 */
    vertical-align: middle !important;
    height: auto !important;
}

/* 5. 에디터가 표 안에 넣는 p태그 간격 제거 (표가 뚱뚱해지는 주범) */
.post-detail-body td p {
    margin: 0 !important;
    line-height: 1.2 !important;
}
        
/* 이전글/다음글 네비게이션 */
.post-nav-list {
    list-style: none;
    margin: 0 40px;
    padding: 0;
    border-top: 1px solid #666;
    border-bottom: 1px solid #666;
}
.post-nav-list li {
    display: flex;
    align-items: center;
    padding: 15px 10px;
    border-bottom: 1px solid #f2f2f2; /* 목록 아이템 테두리색 활용 */
    font-size: 14px;
}
.post-nav-list li:last-child {
    border-bottom: none;
}
.post-nav-list .nav-label {
    width: 60px;
    color: #666;
    font-weight: bold;
}
.post-nav-list .nav-title {
    flex: 1;
    color: #444;
    cursor: pointer;
    text-decoration: none;
}
.post-nav-list .nav-title:hover {
    text-decoration: underline;
}
.post-nav-list .nav-author {
    width: 120px;
    text-align: center;
    color: #666;
    font-size: 13px;
}
.post-nav-list .nav-date {
    width: 100px;
    text-align: right;
    color: #bbb;
    font-size: 13px;
}

/* 하단 버튼 영역 */
.post-detail-footer {
    display: flex;
    justify-content: flex-end; /* 기본적으로 오른쪽 정렬 */
    align-items: center;      /* 세로 중앙 정렬 */
    gap: 10px;
    padding: 30px 40px 0 40px;
}

/* 신고 버튼을 왼쪽 끝으로 밀어내기 */
.post-detail-footer .user-actions {
    margin-right: auto;       /* 이 설정이 오른쪽 요소들을 끝으로 밀어냅니다 */
    list-style: none;
    padding: 0;
    margin-top: 0;
    margin-bottom: 0;
}

/* 신고 텍스트 스타일 (선택 사항) */
.action-report {
    color: #999;
    text-decoration: none;
    font-size: 14px;
}

.btn-list {
    background: #363853; /* 제공된 네이비 컬러 (활성 페이지 컬러) */
    color: #fff; border: none; padding: 12px 35px; 
    border-radius: 4px; font-size: 15px; font-weight: bold; cursor: pointer; 
}

/* 모바일 반응형 처리 */
@media (max-width: 768px) {
.board-title { font-size: 24px; }
.post-detail-header { padding: 20px 15px; }
.post-detail-header h3 { font-size: 18px; }
.post-detail-body { padding: 20px 15px; }
.post-nav-list { margin: 0 15px; }
.post-nav-list .nav-author, .post-nav-list .nav-date { display: none; } /* 모바일에서 작성자/날짜 숨김 */
.post-detail-footer { padding: 20px 15px 0 15px; justify-content: stretch; }
.btn-list, .btn-write { flex: 1; text-align: center; }
}

/* 댓글 영역 커스텀 스타일 */
.comment-container { padding: 40px; margin-top:30px; border-top: 1px solid #eee; background: #fff; }

.comment-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.comment-count { font-size: 18px; color: #333; }
.comment-count strong { color: #880000; }

.sort-btn { background: #fff; border: 1px solid #ddd; padding: 5px 12px; font-size: 12px; color: #999; cursor: pointer; border-radius: 4px; }
.sort-btn.active { background: #880000; color: #fff; border-color: #880000; }

/* 입력창 */
.comment-write-box { display: flex; border: 1px solid #ddd; margin-bottom: 30px; height: 100px; }
.comment-write-box textarea { flex: 1; border: none; padding: 15px; resize: none; outline: none; font-size: 14px; }
.comment-write-box textarea::placeholder { color: #bbb; }
.btn-comment-submit { width: 100px; background: #000; color: #fff; border: none; cursor: pointer; font-size: 14px; }

/* 리스트 */
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-item { padding: 20px 0; border-bottom: 1px solid #f2f2f2; }
.comment-item.reply { padding-left: 30px; }

.comment-info { display: flex; align-items: center; margin-bottom: 10px; font-size: 13px; color: #666; position: relative; }
.comment-info .author { font-weight: bold; color: #333; }
.comment-info .divider { margin: 0 8px; color: #eee; }
.comment-info .date { color: #999; }

.comment-actions { margin-left: auto; color: #bbb; }
.comment-actions button { background: none; border: none; color: #999; cursor: pointer; font-size: 13px; padding: 0; }

.comment-text { font-size: 14px; color: #444; padding-left: 0; }
.reply .comment-text { padding-left: 20px; }
.reply-icon { margin-right: 8px; font-weight: bold; }

@media (max-width: 768px) {
    .comment-container { padding: 20px 15px; }
    .btn-comment-submit { width: 80px; }
}

        
/* 댓글 영역 신규 CSS */
/* 댓글 영역 컨테이너 */
.comments-wrap { 
    padding: 20px 0; 
}

/* 리스트 아이템 공통 */
.comment-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.comment-item { 
    padding: 15px 0; 
    border-bottom: 1px solid #f2f2f2; 
}

/* 대댓글(Reply) 스타일 */
.comment-list-reply { 
    background-color: #fcfcfc; /* 대댓글 배경에 미세한 차이 부여 */
}

/* 대댓글 화살표 ↳ */
.comment-list-reply .comment-writer::before {
    content: "ㄴ";
    display: inline-block;
    margin-right: 8px;
    color: #ccc;
    font-weight: bold;
    font-size: 14px;
}

/* 작성자 및 날짜 영역 (폰트 한단계 낮춤) */
.comment-header { 
    display: flex; 
    align-items: center; 
    margin-bottom: 6px; 
    font-size: 13px; /* 전체 정보 폰트 다운 */
}

.comment-writer { 
    font-weight: bold; 
    color: #333; 
    margin-right: 18px; /* 작성자와 날짜 사이 간격 확대 */
}

.comment-time { 
    color: #999; 
    font-size: 11px; /* 날짜는 한 단계 더 작게 */
}

/* 댓글 내용 (폰트 한단계 낮춤) */
.comment-content { 
    font-size: 14px; /* 기존 14px -> 13px로 조정 */
    color: #444; 
    line-height: 1.6; 
    word-break: break-all;
    padding-left: 0;
}

/* 대댓글일 경우 내용도 화살표만큼 들여쓰기 */
.comment-list-reply .comment-content {
    padding-left: 18px;
}

/* 액션 버튼 (답변, 삭제 등) */
.comment-actions { 
    margin-left: auto; 
    display: flex; 
    gap: 10px;
}

.comment-actions a { 
    font-size: 11px; 
    color: #999; 
    text-decoration: none; 
}

.comment-actions a:hover { 
    color: #880000; 
    text-decoration: underline; 
}

/* 삭제된 댓글 텍스트 */
.comment-content span[style*="color:#c5c5c5"] {
    font-size: 12px !important;
    font-style: italic;
}

/* 대댓글 전용 입력창 스타일 */
.comment-form-reply {
    margin-top: 10px;
    margin-left: 20px; /* 대댓글 들여쓰기 */
    display: flex;
    border: 1px solid #ddd;
    background-color: #fafafa; /* 일반 댓글창과 구분되는 연한 배경색 */
    height: 80px; /* 대댓글은 조금 더 슬림하게 조정 가능 */
}

.comment-form-reply textarea {
    flex: 1;
    border: none;
    padding: 12px;
    resize: none;
    outline: none;
    font-size: 13px;
    background: transparent;
}

.comment-form-reply .btn-submit {
    width: 90px;
    background: #363853; /* 게시판 포인트 네이비 컬러 활용 */
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    transition: background 0.2s;
}

.comment-form-reply .btn-submit:hover {
    background: #e74438; /* 호버 시 포인트 레드 컬러 */
}
       
/* 수정, 삭제, 글쓰기 목록 아이콘 */
.post-detail-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
        /*
    padding: 15px 0;

    margin-top: 20px;
    border-top: 1px solid #ddd;
    */
}

/* 왼쪽 버튼들 정렬 */
.user-actions-left {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 6px; /* 버튼 사이 간격 */
}

/* 수정/삭제 전용 버튼 스타일 (이미지 느낌) */
.btn-custom {
    display: inline-block;
    padding: 7px 16px;
    border-radius: 3px; /* 이미지처럼 살짝 각진 느낌 */
    font-size: 13px;
    font-weight: 500;
    color: #fff !important;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
}

/* 이미지와 유사한 색상값 */
.action-modify { background-color: #537ca1; } /* 수정: 차분한 파랑 */
.action-delete { background-color: #d66661; } /* 삭제: 톤 다운된 레드 */
.action-report { background-color: #fff; }    /* 신고: 회색 */

.btn-custom:hover {
    filter: brightness(90%);
}

/* 오른쪽 기존 버튼들의 간격 조절 */
.user-actions-right {
    display: flex;
    gap: 5px;
}

/* 1. 모든 p 태그에 최소 높이 부여 (내용이 없어도 줄바꿈 유지) */
.post-body p, 
.answer-text p {
    margin: 0;
    padding: 0;
    min-height: 1.5em; /* 내용이 없어도 한 줄만큼의 공간을 확보 */
    line-height: 1.6;  /* 가독성 좋은 줄 간격 */
}

/* 2. 내용이 완전히 비어있는 p 태그( <p></p> ) 내부에 가상 공백 삽입 */
.post-body p:empty::before,
.answer-text p:empty::before {
    content: "\00a0"; /* 투명한 공백(&nbsp;) 효과 */
    display: inline;
}

/* 3. 이미지 스타일 (글자와 너무 붙지 않게 하고 본문 폭을 넘지 않게 설정) */
.post-body img,
.answer-text img {
    display: block;      /* 이미지를 독립된 블록으로 처리 */
    max-width: 100%;    /* 본문 너비를 넘지 않도록 방어 */
    height: auto;
    margin: 15px 0;      /* 이미지 위아래로 15px 여백 */
}

/* 4. 연속된 빈 문단이 너무 넓어 보일 경우를 대비한 미세 조정 */
.post-body p + p, 
.answer-text p + p {
    margin-top: 2px;
}


/* --- 에디터 본문 및 답변 영역 통합 줄간격 보정 --- */

/* 1. 모든 p 태그에 최소 높이 부여 (내용이 없어도 줄바꿈 유지) */
.post-detail-body p {
    margin: 0;
    padding: 0;
    min-height: 1.5em; /* 내용이 없어도 한 줄만큼의 공간을 확보 */
    line-height: 1.6;  /* 가독성 좋은 줄 간격 */
}

/* 2. 내용이 완전히 비어있는 p 태그(<p></p>) 내부에 가상 공백 삽입 */
/* CKEditor 사용 시 비어있는 문단이 깨지는 것을 방지합니다. */
.post-detail-body p:empty::before {
    content: "\00a0"; /* 투명한 공백(&nbsp;) 효과 */
    display: inline;
}

/* 3. 이미지 스타일 (글자와 너무 붙지 않게 하고 본문 폭을 넘지 않게 설정) */
.post-detail-body img {
    display: block;      /* 이미지를 독립된 블록으로 처리 */
    max-width: 100%;    /* 본문 너비를 넘지 않도록 방어 */
    height: auto;
    margin: 15px 0;      /* 이미지 위아래로 15px 여백 */
}

/* 4. 연속된 빈 문단이 너무 넓어 보일 경우를 대비한 미세 조정 */
.post-detail-body p + p {
    margin-top: 2px;
}