/* ============================================================
   그누보드5 게시판 스킨 공통 스타일
   대상 파일: list.skin.php / view.skin.php / view_comment.skin.php / write.skin.php
   그누보드는 스킨 폴더에 style.css가 있으면 자동으로 <link> 태그를 추가하므로
   각 skin.php 파일에 별도로 <link>를 넣을 필요가 없습니다.
   ============================================================ */

/* ------------------------------------------------------------
   0. 기본 레이아웃 (공통)
   ------------------------------------------------------------ */
.nb-board-wrap {
    background-color: #ffffff;
    padding: 24px 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333333;
}

.nb-board-container {
    background-color: #ffffff;
    padding: 8px 0;
}

.nb-aside-wrap {
    background-color: #ffffff;
    border-left: 1px solid #f0f0f0;
    padding: 4px 0 4px 20px;
    height: 100%;
}

/* ------------------------------------------------------------
   1. 헤더 / 타이틀 (list, view, write 공통)
   ------------------------------------------------------------ */
.nb-board-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    border-bottom: 2px solid #111111;
    padding-bottom: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 14px;
}
.nb-board-title h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    letter-spacing: -0.5px;
    margin: 0;
}
.nb-board-title p {
    font-size: 13px;
    color: #666666;
    margin-top: 4px;
}

.nb-view-header {
    border-bottom: 2px solid #111111;
    padding-bottom: 16px;
    margin-bottom: 20px;
}
.nb-view-title {
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    letter-spacing: -0.5px;
    margin: 10px 0 12px;
    line-height: 1.4;
    word-break: break-word;
}
.nb-view-meta {
    font-size: 13px;
    color: #9ca3af;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.nb-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   2. 버튼 (list, view, write, comment 공통)
   ------------------------------------------------------------ */
.nb-write-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 18px;
    background-color: #111827;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.nb-write-btn:hover { background-color: #1f2937; color: #fff; }

/* 아이콘 전용 정사각 버튼 (관리자/RSS) - list.skin.php */
.nb-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
    text-decoration: none;
    font-size: 14px;
}
.nb-icon-btn:hover { background-color: #f3f4f6; }

/* 텍스트 버튼 (목록/수정/삭제/답변/취소) - view.skin.php, write.skin.php */
.nb-icon-btn-lg {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    color: #4b5563;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    background-color: #ffffff;
}
.nb-icon-btn-lg:hover { background-color: #f3f4f6; }
.nb-icon-btn-lg.danger { color: #dc2626; border-color: #fecaca; }
.nb-icon-btn-lg.danger:hover { background-color: #fef2f2; }

.nb-view-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 4px;
    flex-wrap: wrap;
    gap: 10px;
}
.nb-view-actions-left,
.nb-view-actions-right {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ------------------------------------------------------------
   3. 검색 폼 - list.skin.php
   ------------------------------------------------------------ */
.nb-search-form {
    display: flex;
    gap: 4px;
    margin-left: 4px;
}
.nb-search-select {
    padding: 8px 6px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    max-width: 90px;
}
.nb-search-input {
    padding: 8px 12px;
    border: 1px solid #cccccc;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
    width: 160px;
}
.nb-search-input:focus { border-color: #111111; }
.nb-search-btn {
    padding: 8px 14px;
    background-color: #111827;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

/* ------------------------------------------------------------
   4. 카테고리 필터 - list.skin.php
   ------------------------------------------------------------ */
.nb-category-group {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.nb-category-btn {
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
}
.nb-category-btn.active {
    background-color: #111827;
    color: #ffffff;
    border-color: #111827;
}

/* ------------------------------------------------------------
   5. 관리자 툴바 - list.skin.php
   ------------------------------------------------------------ */
.nb-admin-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 4px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f3f4f6;
    flex-wrap: wrap;
    gap: 8px;
}
.nb-chkall-label {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
}
.nb-admin-btns { display: flex; gap: 6px; }
.nb-admin-action-btn {
    padding: 5px 10px;
    font-size: 12px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #4b5563;
    border-radius: 4px;
    cursor: pointer;
}
.nb-admin-action-btn.danger { color: #dc2626; border-color: #fecaca; }
.nb-admin-action-btn:hover { background-color: #f3f4f6; }

/* ------------------------------------------------------------
   6. 게시물 리스트 항목 - list.skin.php (기본값)
      view.skin.php의 이전글/다음글(.nb-prev-next)은 하단에서 축소 오버라이드
   ------------------------------------------------------------ */
.nb-notice-list { list-style: none; margin: 0; padding: 0; }

.nb-notice-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 8px;
    border-bottom: 1px solid #f3f4f6;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
    gap: 12px;
}
.nb-notice-item:hover { background-color: #f9fafb; }
.nb-notice-item.pinned { background-color: #fffdf5; }
.nb-notice-item.pinned:hover { background-color: #fff9e6; }

.nb-notice-main {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    flex-grow: 1;
    min-width: 0;
}
.nb-notice-title {
    font-size: 15px;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pinned .nb-notice-title { font-weight: 600; }

.nb-comment-cnt {
    color: #dc2626;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.nb-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    white-space: nowrap;
    display: inline-block;
    flex-shrink: 0;
}

.nb-pin-tag {
    color: #d97706;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.nb-notice-meta {
    font-size: 13px;
    color: #9ca3af;
    white-space: nowrap;
    display: flex;
    gap: 14px;
    flex-shrink: 0;
}

.nb-empty {
    text-align: center;
    padding: 60px 0;
    color: #9ca3af;
    font-size: 14px;
}

/* 이전글/다음글 (view.skin.php) - 위 리스트 스타일을 축소해서 재사용 */
.nb-prev-next {
    border-top: 1px solid #111111;
    margin-top: 4px;
}
.nb-prev-next .nb-notice-item { padding: 14px 8px; }
.nb-prev-next .nb-notice-title { font-size: 14px; }

/* ------------------------------------------------------------
   7. 페이지네이션 - list.skin.php (그누보드 기본 클래스 재정의)
   ------------------------------------------------------------ */
.nb-pagination { margin-top: 28px; text-align: center; }
.nb-pagination .pg_wrap { display: inline-flex; gap: 4px; }
.nb-pagination a,
.nb-pagination strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #e5e7eb;
    color: #4b5563;
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    margin: 0 2px;
}
.nb-pagination strong,
.nb-pagination .pg_current {
    background-color: #111827;
    color: #ffffff;
    border-color: #111827;
    font-weight: 600;
}

/* ------------------------------------------------------------
   8. 글 본문 - view.skin.php
   ------------------------------------------------------------ */
.nb-view-content {
    font-size: 15px;
    line-height: 1.8;
    color: #1f2937;
    padding: 24px 4px;
    min-height: 160px;
    word-break: break-word;
    border-bottom: 1px solid #f3f4f6;
}
.nb-view-content img { max-width: 100%; height: auto; }

.nb-view-links {
    padding: 12px 4px;
    border-bottom: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nb-view-links a {
    font-size: 13px;
    color: #0284c7;
    text-decoration: none;
}
.nb-view-links a:hover { text-decoration: underline; }

.nb-view-files {
    padding: 14px 4px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.nb-view-files-title {
    display: block;
    color: #4b5563;
    margin-bottom: 8px;
    font-size: 13px;
}
.nb-view-files ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.nb-view-files a { color: #111827; text-decoration: none; }
.nb-view-files a:hover { text-decoration: underline; }

.nb-comment-area {
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid #f3f4f6;
    font-size: 14px;
}

/* ------------------------------------------------------------
   9. 댓글 - view_comment.skin.php
   ------------------------------------------------------------ */
.nb-comment-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #333333;
}

.nb-comment-title {
    font-size: 15px;
    font-weight: 700;
    color: #111111;
    margin-bottom: 14px;
}
.nb-comment-title strong { color: #dc2626; }

.nb-comment-list {
    list-style: none;
    margin: 0 0 20px;
    padding: 0;
}

.nb-comment-item {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    padding: 14px 4px;
    border-bottom: 1px solid #f3f4f6;
}

.nb-comment-reply-mark {
    color: #9ca3af;
    font-size: 13px;
    margin-top: 2px;
    flex-shrink: 0;
}

.nb-comment-body { flex-grow: 1; min-width: 0; }

.nb-comment-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}
.nb-comment-name {
    font-size: 13px;
    font-weight: 700;
    color: #1f2937;
}
.nb-comment-date {
    font-size: 12px;
    color: #9ca3af;
}

.nb-comment-content {
    font-size: 14px;
    line-height: 1.6;
    color: #374151;
    word-break: break-word;
    margin-bottom: 8px;
}
.nb-comment-secret {
    color: #9ca3af;
    font-size: 13px;
}

.nb-comment-actions {
    display: flex;
    gap: 10px;
}
.nb-comment-action-btn {
    background: none;
    border: none;
    padding: 0;
    font-size: 12px;
    color: #9ca3af;
    cursor: pointer;
    text-decoration: none;
}
.nb-comment-action-btn:hover { color: #111827; text-decoration: underline; }
.nb-comment-action-btn.danger:hover { color: #dc2626; }

.nb-comment-empty {
    padding: 24px 4px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
    border-bottom: 1px solid #f3f4f6;
    margin-bottom: 20px;
}

.nb-comment-form {
    border-top: 2px solid #111111;
    padding-top: 16px;
}

.nb-reply-target {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #f9fafb;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #4b5563;
    margin-bottom: 8px;
}
.nb-reply-target button {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 12px;
    cursor: pointer;
    text-decoration: underline;
}

.nb-comment-guest-fields {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.nb-comment-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 13px;
    outline: none;
}
.nb-comment-input:focus { border-color: #111111; }

.nb-comment-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none;
    font-family: inherit;
}
.nb-comment-textarea:focus { border-color: #111111; }

.nb-comment-form-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 10px;
}
.nb-comment-secret-label {
    font-size: 12px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: auto;
}

/* ------------------------------------------------------------
   10. 글쓰기 폼 - write.skin.php
   ------------------------------------------------------------ */
.nb-form-row { margin-bottom: 18px; }
.nb-form-row-split {
    display: flex;
    gap: 12px;
}
.nb-form-col { flex: 1; min-width: 0; }

.nb-form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}
.nb-form-optional { font-weight: 400; color: #9ca3af; }

.nb-form-input,
.nb-form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background-color: #ffffff;
}
.nb-form-input:focus,
.nb-form-select:focus,
.nb-form-textarea:focus { border-color: #111111; }
.nb-form-input:disabled { background-color: #f9fafb; color: #9ca3af; }

.nb-form-textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    font-family: inherit;
}

.nb-form-file { display: block; font-size: 13px; margin-bottom: 6px; }
.nb-form-existing-file {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background-color: #f9fafb;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 6px;
}
.nb-form-file-del { font-size: 12px; color: #dc2626; display: flex; align-items: center; gap: 4px; white-space: nowrap; }

.nb-form-options {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 12px 0;
    border-top: 1px solid #f3f4f6;
    border-bottom: 1px solid #f3f4f6;
}
.nb-form-check {
    font-size: 13px;
    color: #4b5563;
    display: flex;
    align-items: center;
    gap: 6px;
}
/* 단축키 영역 전체 박스 정렬 */
.cke_sc_def {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px; /* 전체 간격 */
}

/* 정의 목록(dt, dd)을 감싸는 dl 태그 가로 정렬 */
.cke_sc_def dl {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px; /* 행 간격과 열 간격 */
    margin: 0;
    padding: 0;
    align-items: center;
}

/* 단축키와 설명 항목 하나씩을 묶어서 가로로 배치 (선택사항) */
.cke_sc_def dt, 
.cke_sc_def dd {
    display: inline-flex;
    margin: 0;
    padding: 0;
}

/* 단축키(dt) 스타일 꾸미기 (보기 좋게 강조) */
.cke_sc_def dt {
    font-weight: 700;
    background-color: #f3f4f6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

/* 설명(dd) 스타일 */
.cke_sc_def dd {
    font-size: 12px;
    color: #4b5563;
    margin-right: 8px; /* 다음 단축키와의 간격 */
}

/* 닫기 버튼 스타일 조정 */
.cke_sc_def .btn_cke_sc_close {
    margin-left: auto;
}
/* ============================================================
   반응형
   ============================================================ */
@media (max-width: 991px) {
    .nb-aside-wrap {
        border-left: none;
        border-top: 1px solid #f0f0f0;
        padding: 20px 0 0 0;
    }
    .nb-board-container { padding: 8px 0; }
    .nb-header-actions { width: 100%; }
    .nb-search-form { width: 100%; margin-left: 0; margin-top: 8px; }
    .nb-search-input { flex-grow: 1; width: auto; }
}

@media (max-width: 640px) {
    .nb-view-title { font-size: 19px; }

    .nb-notice-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .nb-notice-main { width: 100%; }
    .nb-notice-meta { font-size: 12px; gap: 10px; }

    .nb-view-actions { flex-direction: column; align-items: stretch; }
    .nb-view-actions-left,
    .nb-view-actions-right { justify-content: center; }
    .nb-write-btn { justify-content: center; }

    .nb-comment-guest-fields { flex-direction: column; }
    .nb-comment-form-footer { justify-content: flex-end; }

    .nb-form-row-split { flex-direction: column; gap: 18px; }
}