/* ── board.css ── */
*, *::before, *::after { box-sizing: border-box; }
body { display: flex; flex-direction: column; min-height: 100vh; }
footer { margin-top: auto; }

/* ── Hero (notice .hero 와 동일) ── */
#brd-hero {
  background: linear-gradient(135deg, #F0F8FF 0%, #E3F1FA 100%);
  padding: 60px 32px 50px;
  text-align: center;
}
#brd-hero h1 { font-size: 32px; font-weight: 700; color: var(--primary-dark); margin-bottom: 10px; }
#brd-hero p  { font-size: 15px; color: #546E7A; }

/* ── 본문 컨테이너 ── */
/* board.php(목록): hero 있음 → padding-top 48px */
/* board_back.php: hero 없음 → no-hero 클래스로 padding-top 56px */
.board-wrap { width: 100%; max-width: 900px; margin: 0 auto; padding: 48px 24px 80px; flex: 1; }
.board-wrap.no-hero { padding-top: 56px; }

/* ── 게시판 선택 목록 (notice .post-grid / .post-card 와 동일) ── */
.board-list-grid { display: grid; gap: 24px; }
.board-card {
  background: #fff; border: 1px solid #E0E7ED; border-radius: 12px;
  padding: 28px 32px; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
  text-decoration: none; display: flex; align-items: center; justify-content: space-between; gap: 20px;
  color: inherit;
}
.board-card:hover { box-shadow: 0 6px 24px rgba(43,122,158,0.12); transform: translateY(-2px); }
.board-card-left  { flex: 1; min-width: 0; }
.board-card-name  { font-size: 19px; font-weight: 700; color: #1A2332; margin-bottom: 8px; }
.board-card-desc  { font-size: 14px; color: #546E7A; line-height: 1.75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.board-card-right { display: flex; gap: 24px; flex-shrink: 0; }
.board-card-stat  { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.stat-val { font-size: 15px; font-weight: 700; color: var(--primary); }
.stat-lbl { font-size: 11px; color: #90A4AE; white-space: nowrap; }

/* ── 게시판 헤더 (board_back) ── */
.brd-header    { margin-bottom: 20px; }
.brd-header h1 { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.brd-header p  { font-size: 14px; color: var(--text-secondary); margin-top: 4px; }

/* ── 툴바 ── */
.brd-toolbar  { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; flex-wrap: wrap; gap: 8px; }
.brd-cats     { display: flex; gap: 6px; flex-wrap: wrap; }
.brd-cat      { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 500; border: 1.5px solid var(--border-color); background: #fff; color: var(--text-secondary); cursor: pointer; transition: all .15s; }
.brd-cat.on   { background: var(--primary); border-color: var(--primary); color: #fff; }
.brd-actions  { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.brd-search   { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; }
.brd-search input { width: min(240px, 48vw); height: 36px; border: 1px solid var(--border-color); border-radius: 8px; padding: 0 10px; font-size: 13px; color: var(--text-primary); background: #fff; }
.brd-search button { height: 36px; border: 1px solid var(--primary); border-radius: 8px; padding: 0 12px; background: var(--primary); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.brd-search button.muted { border-color: var(--border-color); background: #fff; color: var(--text-secondary); }
.brd-write-btn { padding: 8px 18px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.brd-write-btn:hover { background: var(--primary-dark); }

/* ── 글 목록 카드 (notice .post-grid / .post-card 와 동일) ── */
.brd-post-grid { display: grid; gap: 24px; }
.brd-post-card {
  background: #fff; border: 1px solid #E0E7ED; border-radius: 12px;
  padding: 28px 32px; cursor: pointer; transition: box-shadow 0.2s, transform 0.2s;
}
.brd-post-card:hover { box-shadow: 0 6px 24px rgba(43,122,158,0.12); transform: translateY(-2px); }
.brd-post-tags  { margin-bottom: 10px; }
.brd-pin-tag    { display: inline-block; background: #fff3cd; color: #856404; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-right: 6px; }
.brd-cat-tag    { display: inline-block; background: #e8f4f8; color: var(--primary); font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; margin-right: 6px; }
.brd-post-title { font-size: 17px; font-weight: 700; color: var(--text-primary); line-height: 1.5; margin-bottom: 6px; }
.brd-post-meta  { margin-top: 14px; font-size: 12px; color: #90A4AE; display: flex; gap: 16px; flex-wrap: wrap; }
.brd-empty      { text-align: center; padding: 60px 0; color: var(--text-tertiary); font-size: 14px; }

/* ── 글 목록 테이블 (board_back) ── */
.brd-table-wrap { border: 1px solid #E0E7ED; border-radius: 12px; overflow: hidden; background: #fff; }
.brd-table { width: 100%; border-collapse: collapse; }
.brd-table th { padding: 12px 20px; font-size: 12px; font-weight: 600; color: var(--text-secondary); background: #f8fafb; text-align: left; border-bottom: 1px solid #E0E7ED; }
.brd-table td { padding: 14px 20px; font-size: 14px; color: var(--text-primary); border-bottom: 1px solid #f0f2f5; vertical-align: middle; }
.brd-table tr:last-child td { border-bottom: none; }
.brd-table tr.post-row { cursor: pointer; transition: background .1s; }
.brd-table tr.post-row:hover { background: #f8fbfd; }
.brd-meta { font-size: 12px; color: var(--text-tertiary); white-space: nowrap; }

/* ── 페이지네이션 ── */
.brd-pagi        { display: flex; justify-content: center; gap: 4px; margin-top: 28px; flex-wrap: wrap; }
.brd-pagi button { padding: 6px 12px; border: 1px solid var(--border-color); background: #fff; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text-secondary); }
.brd-pagi button.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.brd-pagi button:hover:not(.on) { background: #f0f7fb; }

/* ── 글 상세 (board_back) ── */
.brd-detail-title   { font-size: 22px; font-weight: 700; color: var(--text-primary); line-height: 1.4; }
.brd-detail-meta    { display: flex; gap: 16px; flex-wrap: wrap; margin: 10px 0 0; font-size: 13px; color: var(--text-secondary); padding-bottom: 14px; border-bottom: 1px solid var(--border-color); }
.brd-detail-body    { font-size: 15px; line-height: 1.9; color: var(--text-primary); min-height: 120px; white-space: pre-wrap; word-break: break-word; padding: 20px 0; border-bottom: 1px solid var(--border-color); }
.brd-detail-actions { display: flex; gap: 8px; padding-top: 14px; }

/* ── 글 상세 (board - 아티클) ── */
.brd-breadcrumb { font-size: 13px; color: #90A4AE; margin-bottom: 24px; }
.brd-breadcrumb a { color: var(--primary); text-decoration: none; }
.brd-breadcrumb a:hover { text-decoration: underline; }
.brd-article-title { font-size: 28px; font-weight: 700; line-height: 1.4; margin-bottom: 12px; color: var(--text-primary); }
.brd-article-meta  { font-size: 13px; color: #90A4AE; display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--border-color); }
.brd-article-body  { font-size: 15px; line-height: 1.9; color: #374151; min-height: 120px; white-space: pre-wrap; word-break: break-word; padding-bottom: 28px; border-bottom: 1px solid var(--border-color); }
.brd-article-actions { display: flex; justify-content: space-between; align-items: center; padding-top: 16px; }
.brd-back-btn  { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--primary); cursor: pointer; background: none; border: none; padding: 0; font-weight: 600; }
.brd-btn       { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1.5px solid var(--border-color); background: #fff; color: var(--text-secondary); transition: all .15s; }
.brd-btn:hover { background: #f0f2f5; }
.brd-btn.danger { border-color: #dc3545; color: #dc3545; }
.brd-btn.danger:hover { background: #dc3545; color: #fff; }

/* ── 댓글 ── */
.brd-comments-section { margin-top: 40px; }
.brd-comments-title   { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.brd-comment-item     { padding: 14px 0; border-bottom: 1px solid #f0f2f5; }
.brd-comment-meta     { font-size: 12px; color: var(--text-secondary); margin-bottom: 5px; display: flex; justify-content: space-between; }
.brd-comment-body     { font-size: 14px; color: var(--text-primary); white-space: pre-wrap; }
.brd-comment-form     { margin-top: 20px; }
.brd-comment-form textarea { width: 100%; border: 1px solid var(--border-color); border-radius: 8px; padding: 10px 14px; font-size: 14px; resize: vertical; min-height: 80px; font-family: inherit; }
.brd-comment-form textarea:focus { outline: none; border-color: var(--primary); }
.brd-comment-submit   { margin-top: 8px; padding: 8px 20px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }

/* ── 글쓰기 ── */
.brd-write-form       { background: #fff; border: 1px solid var(--border-color); border-radius: 12px; padding: 28px; }
.brd-write-form h2    { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.brd-form-group       { margin-bottom: 16px; }
.brd-form-group label { display: block; font-size: 13px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.brd-form-group input, .brd-form-group select, .brd-form-group textarea {
  width: 100%; border: 1px solid var(--border-color); border-radius: 8px;
  padding: 10px 14px; font-size: 14px; font-family: inherit; color: var(--text-primary);
}
.brd-form-group textarea { min-height: 200px; resize: vertical; }
.brd-form-group input:focus, .brd-form-group select:focus, .brd-form-group textarea:focus { outline: none; border-color: var(--primary); }
.brd-form-actions  { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }
.brd-submit-btn    { padding: 10px 24px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.brd-cancel-btn    { padding: 10px 18px; background: #fff; color: var(--text-secondary); border: 1.5px solid var(--border-color); border-radius: 8px; font-size: 14px; cursor: pointer; }

.brd-loading { text-align: center; padding: 60px 0; color: var(--text-tertiary); }
.brd-error   { background: #fff3f3; border: 1px solid #fcc; border-radius: 8px; padding: 16px 20px; color: #c00; font-size: 14px; margin-top: 20px; }

@media (max-width: 600px) {
  #brd-hero { padding: 48px 20px 40px; }
  #brd-hero h1 { font-size: 26px; }
  .board-wrap { padding: 32px 16px 60px; }
  .board-card { flex-direction: column; align-items: flex-start; gap: 14px; padding: 20px 20px; }
  .board-card-right { flex-direction: row; }
  .brd-post-card { padding: 20px 20px; }
  .brd-article-title { font-size: 22px; }
  .brd-detail-title  { font-size: 18px; }
  .brd-table th:nth-child(3), .brd-table td:nth-child(3),
  .brd-table th:nth-child(4), .brd-table td:nth-child(4) { display: none; }
  .brd-write-form { padding: 20px 16px; }
}
