/* 게시판 기본 스타일 */
.board-container {
    max-width: 100%;
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.board-header {
    text-align: center;
    padding: 30px 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    margin: -20px -20px 30px -20px;
}

.board-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.board-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

/* 게시글 보기 */
.post-view-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 30px;
    overflow: hidden;
}

.post-view-header {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
}

.post-category-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.post-category-badge.notice {
    background: #fee2e2;
    color: #dc2626;
}

.post-category-badge.general {
    background: #e0f2fe;
    color: #0284c7;
}

.post-category-badge.question {
    background: #fef3c7;
    color: #92400e;
}

.post-category-badge.suggestion {
    background: #d1fae5;
    color: #065f46;
}

.post-title {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 12px;
}

.post-meta {
    display: flex;
    gap: 20px;
    font-size: 13px;
    color: #6b7280;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.post-content {
    padding: 30px 24px;
    line-height: 1.8;
    color: #374151;
    min-height: 200px;
}

.post-actions {
    padding: 20px 24px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* 댓글 섹션 */
.comments-section {
    padding: 24px;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.comments-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.comment-form {
    margin-bottom: 24px;
}

.comment-form textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    resize: vertical;
    min-height: 80px;
    margin-bottom: 10px;
}

.comment-item {
    background: #fff;
    padding: 16px;
    border-radius: 6px;
    margin-bottom: 12px;
    border: 1px solid #e5e7eb;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    align-items: center;
}

.comment-author {
    font-weight: 600;
    color: #111827;
}

.comment-date {
    font-size: 12px;
    color: #9ca3af;
}

.comment-delete-btn {
    background: none;
    border: none;
    color: #dc2626;
    font-size: 12px;
    cursor: pointer;
    padding: 2px 6px;
}

.comment-delete-btn:hover {
    text-decoration: underline;
}

.comment-content {
    color: #4b5563;
    line-height: 1.6;
}

/* 도구 모음 */
.board-tools {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 20px;
}

.board-search {
    display: flex;
    gap: 8px;
}

.board-search form {
    display: flex;
    gap: 8px;
}

.board-search select,
.board-search input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.board-search input {
    width: 240px;
}

/* 게시판 테이블 */
.board-table-wrapper {
    overflow-x: hidden; /* auto에서 hidden으로 변경 */
    margin-bottom: 30px;
}

.board-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    table-layout: fixed; /* 테이블 레이아웃 고정 */
}

.board-table thead {
    background: #f9fafb;
    border-top: 2px solid #374151;
    border-bottom: 1px solid #e5e7eb;
}

.board-table th {
    padding: 12px 8px;
    text-align: center;
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}

.board-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f3f4f6;
    font-size: 14px;
    color: #4b5563;
}

.board-table tbody tr:hover {
    background: #f9fafb;
}

.notice-row {
    background: #fef2f2 !important;
}

.notice-row:hover {
    background: #fee2e2 !important;
}

/* 컬럼 너비 */
.col-no { width: 60px; }
.col-category { width: 80px; }
.col-title { text-align: left !important; padding-left: 16px !important; }
.col-author { width: 100px; }
.col-date { width: 100px; }
.col-views { width: 60px; }
.col-likes { width: 60px; }

/* 게시글 링크 */
.post-link {
    color: #111827;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.post-link:hover {
    color: #2563eb;
}

/* PC에서 제목 한 줄 처리 - 기본값 */
.post-title-text {
    display: inline-block;
    max-width: 400px; /* 500px에서 줄임 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

/* 태블릿에서 제목 너비 더 줄이기 */
@media screen and (min-width: 769px) and (max-width: 1200px) {
    .post-title-text {
        max-width: 250px !important;
    }
}

.comment-count {
    color: #dc2626;
    font-weight: 600;
    font-size: 12px;
    display: inline-block;
}

.has-image {
    font-size: 12px;
    display: inline-block;
}

/* 모바일 메타 정보 - 기본적으로 숨김 */
.mobile-meta {
    display: none;
}

/* 배지 스타일 */
.badge-notice {
    background: #dc2626;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
}

.category-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.category-badge.notice {
    background: #fee2e2;
    color: #dc2626;
}

.category-badge.general {
    background: #dbeafe;
    color: #1e40af;
}

.category-badge.question {
    background: #fef3c7;
    color: #92400e;
}

.category-badge.suggestion {
    background: #d1fae5;
    color: #065f46;
}

/* 버튼 스타일 - 파스텔 톤으로 변경 */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-icon {
    font-size: 16px;
}

.btn-primary {
    background: #2563eb;
    color: #fff;
}

.btn-primary:hover {
    background: #1d4ed8;
}

.btn-secondary {
    background: #6b7280;
    color: #fff;
}

.btn-secondary:hover {
    background: #4b5563;
}

/* 추천하기 버튼 - 연한 파스텔 퍼플 */
.btn-like {
    background: #e9d5ff;
    color: #6b21a8;
}

.btn-like:hover {
    background: #d8b4fe;
    color: #581c87;
}

/* 추천취소 버튼 - 연한 파스텔 핑크 */
.btn-liked {
    background: #fecaca;
    color: #991b1b;
}

.btn-liked:hover {
    background: #fca5a5;
    color: #7f1d1d;
}

/* 수정 버튼 - 연한 파스텔 블루 */
.btn-edit {
    background: #bfdbfe;
    color: #1e3a8a;
}

.btn-edit:hover {
    background: #93c5fd;
    color: #1e40af;
}

/* 삭제 버튼 - 연한 파스텔 레드 */
.btn-danger {
    background: #fca5a5;
    color: #7f1d1d;
}

.btn-danger:hover {
    background: #f87171;
    color: #991b1b;
}

.btn-search {
    background: #374151;
    color: #fff;
}

.btn-search:hover {
    background: #1f2937;
}

/* 페이지네이션 */
.pagination-container {
    text-align: center;
    padding: 20px 0;
}

.pagination-container .page-numbers {
    display: inline-block;
    padding: 6px 12px;
    margin: 0 4px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    color: #4b5563;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination-container .page-numbers:hover {
    background: #f3f4f6;
}

.pagination-container .page-numbers.current {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* 모달 */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: #fff;
    width: 90%;
    max-width: 900px;
    margin: 50px auto;
    padding: 40px;
    border-radius: 8px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #6b7280;
}

.modal-close:hover {
    color: #111827;
}

/* 폼 스타일 */
.form-group {
    margin-bottom: 25px; /* 간격 증가 */
}

.form-group label {
    display: block;
    margin-bottom: 8px; /* 간격 증가 */
    font-weight: 500;
    color: #374151;
    font-size: 15px; /* 라벨 크기 증가 */
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 15px;
}

.form-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1); /* 포커스 효과 추가 */
}

/* 카테고리 선택 박스 스타일 개선 */
select.form-input {
    cursor: pointer;
    background-color: #fff;
}

/* 제목 입력 필드 */
input[type="text"].form-input {
    font-size: 16px;
    font-weight: 500;
}

.char-counter {
    text-align: right;
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 24px;
}

.empty-message {
    padding: 40px !important;
    text-align: center !important;
    color: #9ca3af;
}

/* 게시글 아래 목록 (PC만) */
.post-bottom-list {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e5e7eb;
}

.list-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #111827;
}

.current-post-row {
    background: #fef3c7 !important;
}

.current-post-row:hover {
    background: #fde68a !important;
}

.current-link {
    font-weight: 700;
    color: #d97706 !important;
}

/* PC에서만 표시 */
.desktop-only {
    display: block;
}

/* 아이콘 스타일 */
.icon-user::before { content: "👤 "; }
.icon-calendar::before { content: "📅 "; }
.icon-eye::before { content: "👁 "; }
.icon-thumbs-up::before { content: "👍 "; }
.icon-comment::before { content: "💬 "; }

/* ============================================
   반응형 스타일 - 태블릿과 모바일 (768px 이하)
   ============================================ */
@media screen and (max-width: 768px) {
    /* 도구 모음 */
    .board-tools {
        flex-direction: column;
    }
    
    .board-search {
        width: 100%;
    }
    
    .board-search form {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .board-search input {
        flex: 1;
    }
    
    /* 테이블 */
    .board-table {
        font-size: 12px;
    }
    
    /* PC 전용 컬럼 숨기기 */
    .col-category {
        display: none !important;
    }
    
    .col-author {
        display: none !important;
    }
    
    .col-date {
        display: none !important;
    }
    
    .col-views {
        display: none !important;
    }
    
    .col-likes {
        display: none !important;
    }
    
    /* 제목 컬럼 스타일 */
    .col-title {
        padding: 12px !important;
    }
    
    .post-link {
        display: block;
        margin-bottom: 8px;
    }
    
    /* 모바일에서 제목과 댓글 수 한 줄로 */
    .post-link {
        display: flex !important;
        align-items: flex-start !important;
        gap: 4px !important;
        margin-bottom: 8px;
    }
    
    /* 모바일에서 제목 2줄까지 표시 */
    .board-table .post-title-text {
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        font-size: 14px !important;
        line-height: 1.4 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        flex: 1 !important;
        min-width: 0 !important;
    }
    
    /* 댓글 수는 축소되지 않게 */
    .post-link .comment-count {
        flex-shrink: 0 !important;
        white-space: nowrap !important;
        font-size: 12px !important;
        color: #dc2626 !important;
        font-weight: 600 !important;
    }
    
    /* 이미지 아이콘도 축소되지 않게 */
    .post-link .has-image {
        flex-shrink: 0 !important;
    }
    
    /* 모바일 메타 정보 표시 */
    .mobile-meta {
        display: flex !important;
        gap: 8px !important;
        font-size: 11px !important;
        color: #9ca3af !important;
        margin-top: 4px !important;
        flex-wrap: wrap !important;
    }
    
    .mobile-meta span {
        white-space: nowrap;
    }
    
    /* 게시글 보기 메타 정보 */
    .post-meta {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    /* 모달 */
    .modal-content {
        margin: 20px auto;
        padding: 20px !important; /* 모바일에서는 작게 */
        max-width: 100% !important;
        width: 95% !important;
    }
    
    /* 모바일에서 폼 입력 필드 */
    .form-input {
        padding: 10px !important;
        font-size: 14px !important;
    }
    
    textarea.form-input {
        min-height: 200px !important; /* 모바일에서는 작게 */
    }
    
    /* PC 전용 요소 숨기기 */
    .desktop-only {
        display: none !important;
    }
    
    /* 모바일 버튼 2x2 그리드 */
    .post-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 6px !important;
        padding: 15px !important;
    }
    
    .post-actions .btn {
        padding: 8px 4px !important;
        font-size: 12px !important;
        justify-content: center !important;
        white-space: nowrap !important;
        width: 100% !important;
    }
    
    /* 모바일에서 버튼 아이콘 숨기기 */
    .btn-icon {
        display: none !important;
    }
    
    .btn-text {
        font-size: 12px !important;
    }
}

/* ============================================
   반응형 스타일 - 작은 모바일 (480px 이하)
   ============================================ */
@media screen and (max-width: 480px) {
    .board-header h1 {
        font-size: 24px;
    }
    
    .board-header {
        padding: 20px 10px;
    }
    
    .board-table th,
    .board-table td {
        padding: 8px 4px;
        font-size: 11px;
    }
    
    .col-no {
        width: 40px;
    }
    
    .post-view-header {
        padding: 16px;
    }
    
    .post-content {
        padding: 20px 16px;
    }
    
    /* 작은 화면 버튼 더 작게 */
    .post-actions .btn {
        padding: 6px 2px !important;
        font-size: 11px !important;
    }
    
    .btn-text {
        font-size: 11px !important;
    }
    
    .comment-form textarea {
        font-size: 14px;
    }
    
    .board-search input {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .board-search select {
        width: 100%;
        margin-bottom: 8px;
    }
    
    .board-search form {
        flex-direction: column;
    }
}
/* === Board Responsive Fix (unified) === */

/* 1) 사이드바 없는 페이지에서 게시판 폭 무한 확장 방지 */
.board-container{
  max-width: 1200px;     /* 사이트 레이아웃에 맞게 1100~1280 등으로 조정 가능 */
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

/* 2) 셀 경계 밖으로 내용 튀어나오는 것 전역 방지(안전망) */
.board-table th,
.board-table td{
  overflow: hidden;
}

/* 3) 제목 셀: 제목이 칸 안에서 '수축' + 1줄 말줄임(PC) */
.board-table .col-title{ width: auto; }   /* 남는 공간은 제목 칸이 먹도록 */
.board-table .col-title .post-link{
  display: flex;          /* inline-flex 말고 flex로 통일 */
  align-items: center;
  gap: 6px;
  min-width: 0;           /* 컨테이너도 수축 허용 (핵심) */
}
.board-table .col-title .post-title-text{
  flex: 1 1 auto;         /* 제목이 가변적으로 줄어듦 (핵심) */
  min-width: 0;           /* flex 자식 수축 허용 (핵심) */
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 4) 보조 칼럼(작성자/작성일/조회/추천)도 길면 말줄임 */
.board-table .col-author,
.board-table .col-date,
.board-table .col-views,
.board-table .col-likes{
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 5) 작은 데스크탑/태블릿에서 공간 확보(선택) */
@media (max-width: 1024px){
  .board-table .col-views,
  .board-table .col-likes{ display: none !important; }
}

/* 6) 모바일에서는 제목 2줄 클램프(PC는 1줄 유지) + 가로 스크롤 허용 */
@media (max-width: 768px){
  .board-table .col-title .post-title-text{
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    white-space: normal;
    line-height: 1.35;
  }
  .board-table-wrapper{ overflow-x: auto; }
}
/* 특이성 강화 + 반드시 적용 */
body .board-container{
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 16px;
  box-sizing: border-box;
}