/* ═══════════════════════════════════════════════════════════════
   웹 게시판 스타일
   위치: public/web/board.css
   (main.css 의 CSS 변수 --brand, --text, --border 등을 사용)
   ═══════════════════════════════════════════════════════════════ */

.board-section { padding: 28px 0 60px; }

.board-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.board-h1 { font-size: 24px; font-weight: 800; color: var(--text); }
.board-write-btn {
  display: inline-block; font-size: 14px; font-weight: 700;
  padding: 9px 18px; border-radius: var(--radius-md);
  background: var(--brand); color: #fff; cursor: pointer;
}
.board-write-btn:hover { opacity: 0.9; }

.board-empty {
  padding: 60px 0; text-align: center; color: var(--text-soft);
  border-top: 2px solid var(--text); font-size: 15px;
}

/* ── 목록 ── */
.board-list { border-top: 2px solid var(--text); }
.board-row {
  display: block; padding: 16px 4px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.board-row:hover { background: var(--bg-soft); }
.board-row-main { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.board-row-title { font-size: 16px; font-weight: 600; color: var(--text); }
.board-row-cmt {
  font-size: 13px; font-weight: 700; color: var(--brand);
  background: var(--brand-light); padding: 1px 8px; border-radius: 10px;
}
.board-row-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); }
.board-dot { opacity: 0.5; }

/* ── 페이지네이션 ── */
.board-paging { display: flex; justify-content: center; gap: 6px; padding: 24px 0; flex-wrap: wrap; }
.board-page {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 6px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); font-size: 14px; color: var(--text); cursor: pointer;
}
.board-page:hover { border-color: var(--brand); color: var(--brand); }
.board-page.is-active { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; cursor: default; }

/* ── 상세 ── */
.board-post { border-top: 2px solid var(--text); padding: 22px 4px 24px; }
.board-post-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.4; margin-bottom: 12px; }
.board-post-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-soft); padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.board-post-actions { display: flex; gap: 8px; margin-top: 14px; }
.board-act {
  font-size: 13px; font-weight: 600; padding: 6px 14px; border-radius: var(--radius-sm);
  border: 1px solid var(--border); background: var(--bg); color: var(--text); cursor: pointer;
}
.board-act:hover { border-color: var(--brand); color: var(--brand); }
.board-act-del { color: #dc2626; }
.board-act-del:hover { border-color: #dc2626; color: #dc2626; }
.board-post-content { font-size: 16px; line-height: 1.8; color: var(--text); margin-top: 20px; white-space: pre-wrap; word-break: break-word; }

/* ── 댓글 ── */
.board-comments { margin-top: 36px; }
.board-cmt-head { font-size: 16px; font-weight: 700; color: var(--text); padding-bottom: 12px; border-bottom: 2px solid var(--text); }
.board-cmt-item { padding: 14px 4px; border-bottom: 1px solid var(--border); }
.board-cmt-top { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.board-cmt-name { font-size: 14px; font-weight: 600; color: var(--text); }
.board-cmt-date { font-size: 12px; color: var(--text-soft); }
.board-cmt-del { margin-left: auto; font-size: 12px; color: #dc2626; background: none; border: none; cursor: pointer; padding: 0; }
.board-cmt-body { font-size: 15px; line-height: 1.6; color: var(--text); white-space: pre-wrap; word-break: break-word; }

.board-cmt-input-row { display: flex; gap: 8px; margin-top: 18px; }
.board-cmt-input {
  flex: 1; height: 44px; padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); font-size: 15px; outline: none; color: var(--text);
}
.board-cmt-input:focus { border-color: var(--brand); }
.board-cmt-send {
  padding: 0 20px; height: 44px; border-radius: var(--radius-md); border: none;
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600; cursor: pointer;
}
.board-cmt-send:hover { opacity: 0.9; }
.board-cmt-send:disabled { opacity: 0.5; cursor: default; }

/* ── 글쓰기 ── */
.board-write { border-top: 2px solid var(--text); padding-top: 20px; }
.board-write-title {
  width: 100%; height: 52px; font-size: 18px; font-weight: 600;
  border: none; border-bottom: 1px solid var(--border); outline: none;
  color: var(--text); box-sizing: border-box;
}
.board-write-content {
  width: 100%; min-height: 340px; margin-top: 14px; font-size: 16px; line-height: 1.8;
  border: none; outline: none; resize: vertical; color: var(--text);
  box-sizing: border-box; font-family: inherit;
}
.board-write-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.board-write-counter { font-size: 13px; color: var(--text-soft); }
.board-write-btns { display: flex; gap: 8px; }
.board-btn-cancel {
  padding: 9px 18px; border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--bg); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer;
}
.board-btn-submit {
  padding: 9px 20px; border-radius: var(--radius-md); border: none;
  background: var(--brand); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer;
}
.board-btn-submit:disabled { opacity: 0.5; cursor: default; }

/* ── 로그인 모달 ── */
.board-login { position: fixed; inset: 0; z-index: 1000; display: none; }
.board-login.is-open { display: block; }
.board-login-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.board-login-box {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 90%; max-width: 360px; background: var(--bg); border-radius: 16px;
  padding: 28px 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.board-login-close { position: absolute; right: 14px; top: 12px; font-size: 24px; background: none; border: none; color: var(--text-soft); cursor: pointer; line-height: 1; }
.board-login-title { font-size: 20px; font-weight: 800; color: var(--text); margin-bottom: 8px; }
.board-login-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin-bottom: 20px; }
.board-login-input {
  width: 100%; height: 48px; padding: 0 14px; border-radius: var(--radius-md);
  border: 1px solid var(--border); font-size: 16px; outline: none; box-sizing: border-box;
  text-align: center; letter-spacing: 1px; color: var(--text);
}
.board-login-input:focus { border-color: var(--brand); }
.board-login-error { font-size: 13px; color: #dc2626; min-height: 18px; margin: 8px 2px; }
.board-login-btn {
  display: block; width: 100%; height: 48px; border-radius: var(--radius-md); border: none;
  background: var(--brand); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer;
  text-align: center; line-height: 48px; text-decoration: none;
}
.board-login-btn:hover { opacity: 0.9; }
.board-login-btn:disabled { opacity: 0.5; cursor: default; }
.board-login-link { display: block; width: 100%; margin-top: 12px; background: none; border: none; color: var(--text-soft); font-size: 13px; cursor: pointer; }
.board-login-noaccount-icon { font-size: 44px; text-align: center; margin-bottom: 10px; }

/* ── 모바일 헤더에서 게시판 메뉴 보이게 (기본은 nav-cta만 보임) ── */
@media (max-width: 640px) {
  .nav a[href="/board"] { display: inline !important; }
}

/* ── 공지 고정 ────────────────────────────────────────────────── */
.board-badge-notice {
  display: inline-block;
  flex: none;
  margin-right: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  background: #7c3aed;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: middle;
}
/* hidden 속성이 클래스 display 보다 우선하도록 */
.board-write-notice[hidden] { display: none !important; }
.board-write-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-size: 14px;
  color: #444;
  cursor: pointer;
  user-select: none;
}
.board-write-notice input {
  width: 16px;
  height: 16px;
  accent-color: #7c3aed;
  cursor: pointer;
}

/* ── 목록: 표 형식 ────────────────────────────────────────────── */
.board-count {
  margin: 0 0 10px;
  font-size: 13px;
  color: #777;
}
.board-count strong { color: #7c3aed; }

.board-table {
  border-top: 2px solid #333;
}
.board-thead,
.board-tr {
  display: grid;
  grid-template-columns: 70px 1fr 110px 100px 70px;
  align-items: center;
  gap: 8px;
  padding: 12px 8px;
  border-bottom: 1px solid #eee;
}
.board-thead {
  background: #fafafa;
  font-size: 13px;
  font-weight: 700;
  color: #555;
  text-align: center;
}
.board-thead .bt-title { justify-content: center; }

.board-tr {
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}
.board-tr:hover { background: #faf9ff; }

.bt-no, .bt-author, .bt-date, .bt-view {
  text-align: center;
  font-size: 13px;
  color: #888;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bt-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: #222;
}
.bt-title-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.board-tr-notice { background: #faf7ff; }
.board-tr-notice .bt-title-text { font-weight: 700; color: #111; }

/* ── 모바일: 표 → 카드형 전환 ─────────────────────────────────── */
@media (max-width: 640px) {
  .board-thead { display: none; }
  .board-tr {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 14px 4px;
  }
  .board-tr .bt-no {
    display: none;
  }
  .board-tr-notice .bt-no {
    display: block;
    text-align: left;
  }
  .bt-title { font-size: 15px; }
  .bt-author, .bt-date, .bt-view {
    display: inline;
    text-align: left;
    font-size: 12px;
    color: #999;
  }
  .bt-author::after,
  .bt-date::after { content: ' · '; }
  .bt-view::before { content: '조회 '; }
}
