/* 게시판 (clien 모두의공원 형태) */

.board-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; margin-bottom: .85rem; flex-wrap: wrap;
}
.board-title { font-size: 1.35rem; margin: 0; }

.cat-tabs { display: flex; gap: .35rem; flex-wrap: wrap; margin-bottom: .85rem; }
.cat-tab {
  padding: .25rem .8rem; border-radius: 999px; font-size: .82rem;
  border: 1px solid var(--line); color: var(--muted); text-decoration: none;
}
.cat-tab:hover { color: var(--text); }
.cat-tab.active { border-color: var(--brand); color: var(--brand); font-weight: 700; }

/* ---------- 목록 ---------- */
.board-table { width: 100%; border-collapse: collapse; font-size: .88rem; }
.board-table thead th {
  color: var(--muted); font-weight: 500; text-align: center;
  padding: .55rem .4rem; border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line); white-space: nowrap;
}
.board-table td {
  padding: .6rem .4rem; border-bottom: 1px solid rgba(63, 63, 70, .45);
  text-align: center; white-space: nowrap;
}
.board-table td.subject { text-align: left; white-space: normal; }
.board-table tbody tr:hover { background: rgba(255, 255, 255, .03); }
.board-table tr.notice { background: rgba(255, 187, 0, .06); }

.subject a { color: var(--text); text-decoration: none; }
.subject a:hover { text-decoration: underline; }
.subject .hot a { color: var(--brand); font-weight: 700; }
.subject .cat {
  color: var(--muted); font-size: .78rem; margin-right: .4rem;
}
.subject .cnt { color: var(--brand); font-size: .8rem; margin-left: .3rem; }
.subject .thumb-ico { color: var(--muted); font-size: .75rem; margin-left: .25rem; }
.blinded { color: var(--muted); font-style: italic; }

.col-num { width: 60px; }
.col-nick { width: 130px; }
.col-num-s { width: 60px; }
.col-time { width: 90px; }

.nick { color: var(--muted); }

/* ---------- 페이징 / 검색 ---------- */
.pager { display: flex; gap: .25rem; justify-content: center; margin: 1.25rem 0; flex-wrap: wrap; }
.pager a, .pager span {
  min-width: 32px; padding: .3rem .55rem; text-align: center;
  border: 1px solid var(--line); border-radius: 6px;
  color: var(--muted); text-decoration: none; font-size: .85rem;
}
.pager .current { border-color: var(--brand); color: var(--brand); font-weight: 700; }

.search-bar { display: flex; gap: .4rem; justify-content: center; margin-bottom: 1rem; flex-wrap: wrap; }
.search-bar select { width: auto; }
.search-bar input[type=text] { width: min(280px, 60vw); }

/* ---------- 본문 ---------- */
.post-head { border-bottom: 1px solid var(--line); padding-bottom: .85rem; margin-bottom: 1rem; }
.post-title { font-size: 1.3rem; margin: .3rem 0 .6rem; line-height: 1.4; }
.post-meta { color: var(--muted); font-size: .82rem; display: flex; gap: .8rem; flex-wrap: wrap; }
.post-meta .author { color: var(--text); font-weight: 600; }

.post-body {
  font-size: .95rem; line-height: 1.85; padding: .5rem 0 1.5rem;
  word-break: break-word;
  color: var(--text);
}
.post-body img { max-width: 100%; height: auto; border-radius: 6px; margin: .5rem 0; }
.post-body a { color: var(--brand); }

/* 공지처럼 긴 문서가 읽히도록. 살균기가 허용하는 태그만 다룬다
   (sanitize.ALLOWED_TAGS 참고). 여기 없는 태그는 애초에 저장되지 않는다. */
.post-body p { margin: 0 0 .9rem; }
.post-body h3 {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  margin: 1.9rem 0 .7rem; padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.post-body h4 {
  font-size: .95rem; font-weight: 700; color: var(--text);
  margin: 1.3rem 0 .5rem;
}
.post-body > h3:first-child, .post-body > h4:first-child { margin-top: .3rem; }
.post-body ul, .post-body ol { margin: 0 0 1rem; padding-left: 1.35rem; }
.post-body li { margin-bottom: .4rem; }
.post-body li:last-child { margin-bottom: 0; }
.post-body strong { color: var(--text); font-weight: 700; }
.post-body em { color: var(--muted); font-style: normal; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 1.6rem 0 1rem; opacity: 1; }
.post-body code {
  background: rgb(31, 31, 34); border: 1px solid var(--line); border-radius: 4px;
  padding: .1rem .35rem; font-size: .88em; color: var(--brand);
}
.post-body pre code { background: none; border: 0; padding: 0; color: inherit; }

/* 표는 폰에서 넘칠 수 있으므로 감싸서 가로 스크롤시킨다.
   본문 HTML 에 래퍼를 넣을 수 없으니(살균기가 div 를 지운다) display 로 처리한다. */
.post-body table {
  display: block; width: 100%; overflow-x: auto;
  border-collapse: collapse; margin: 0 0 1.2rem; font-size: .9rem;
}
.post-body th, .post-body td {
  border: 1px solid var(--line); padding: .5rem .7rem;
  text-align: left; vertical-align: top; line-height: 1.65;
}
.post-body th { background: rgb(31, 31, 34); color: var(--muted); font-weight: 600; white-space: nowrap; }
.post-body tbody tr:nth-child(even) { background: rgba(255, 255, 255, .02); }
.post-body td:first-child { white-space: nowrap; }
@media (max-width: 767px) {
  .post-body td:first-child { white-space: normal; }
}
.post-body pre {
  background: rgb(31, 31, 34); padding: .8rem; border-radius: 6px;
  overflow-x: auto; border: 1px solid var(--line);
}
.post-body blockquote {
  border-left: 3px solid var(--line); margin: .8rem 0; padding: .2rem 0 .2rem .9rem;
  color: var(--muted);
}
.post-attachments img { max-width: 100%; border-radius: 6px; margin-bottom: .5rem; }

.post-tools { display: flex; gap: .5rem; align-items: center; margin: 1rem 0; flex-wrap: wrap; }
.vote-btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .55rem 1.4rem; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--text);
  cursor: pointer; font-weight: 700;
}
.vote-btn.voted { border-color: var(--brand); color: var(--brand); background: rgba(255,187,0,.1); }
.post-tools .spacer { margin-left: auto; }

/* ---------- 댓글 ---------- */
.comments { margin-top: 1.5rem; }
.comments h3 { font-size: 1rem; margin-bottom: .75rem; }
.comment {
  padding: .8rem 0; border-top: 1px solid rgba(63, 63, 70, .45);
}
.comment.reply { padding-left: 2rem; background: rgba(255,255,255,.015); }
.comment.reply::before { content: "↳"; color: var(--muted); margin-right: .35rem; }
.comment-meta { display: flex; gap: .6rem; align-items: baseline; font-size: .8rem; flex-wrap: wrap; }
.comment-meta .author { color: var(--text); font-weight: 600; }
.comment-meta .time { color: var(--muted); }
.comment-body { font-size: .9rem; line-height: 1.7; margin: .35rem 0; white-space: pre-wrap; word-break: break-word; }
.comment-actions { display: flex; gap: .7rem; font-size: .78rem; }
.comment-actions button {
  background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: .78rem;
}
.comment-actions button:hover { color: var(--text); }
.comment-actions .voted { color: var(--brand); }
.comment.deleted .comment-body { color: var(--muted); font-style: italic; }

.comment-form { margin-top: 1rem; }
.comment-form textarea { margin-bottom: .5rem; }
.reply-form { margin: .6rem 0 0 2rem; }

.login-hint {
  padding: .8rem 1rem; border: 1px dashed var(--line); border-radius: var(--radius);
  color: var(--muted); font-size: .88rem; text-align: center;
}
.login-hint a { color: var(--brand); }

/* ---------- 글쓰기: 이미지 삽입 ---------- */
.editor-toolbar {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .4rem; flex-wrap: wrap;
}
.editor-toolbar .btn-sm { padding: .28rem .7rem; font-size: .8rem; }
.img-status { font-size: .8rem; color: var(--brand); margin-left: auto; }
.img-status.err { color: var(--down); }

.editor-drop { position: relative; }
.editor-drop .drop-hint {
  position: absolute; inset: 0; display: none;
  align-items: center; justify-content: center;
  background: rgba(255, 187, 0, .12); border: 2px dashed var(--brand);
  border-radius: var(--radius); color: var(--brand); font-weight: 600;
  pointer-events: none;
}
.editor-drop.dragging .drop-hint { display: flex; }

/* ---------- 글쓰기 ---------- */
.write-form .field { margin-bottom: 1rem; }
.write-form .row { display: flex; gap: .75rem; flex-wrap: wrap; }
.write-form .row .field.cat { flex: 0 0 140px; }
.write-form .row .field.title { flex: 1 1 300px; }
.write-actions { display: flex; gap: .5rem; justify-content: flex-end; }

@media (max-width: 767px) {
  /* 번호·글쓴이·조회는 접고 제목/공감/날짜만 남긴다 */
  .board-table .col-num,
  .board-table thead th.col-num,
  .board-table .col-nick,
  .board-table thead th.col-nick { display: none; }
  .board-table td, .board-table thead th { padding: .55rem .3rem; font-size: .84rem; }
  .board-table .col-num-s, .board-table thead th.col-num-s { width: 42px; }
  .board-table .col-time, .board-table thead th.col-time { width: 62px; font-size: .76rem; }
  .subject .cat { display: none; }

  /* 말머리 탭이 많아졌다. 줄바꿈 대신 가로 스크롤로 */
  .cat-tabs {
    flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding-bottom: .2rem;
  }
  .cat-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { flex: 0 0 auto; }

  .board-head { gap: .5rem; }
  .board-title { font-size: 1.15rem; }

  .post-title { font-size: 1.1rem; }
  .post-meta { gap: .5rem; font-size: .76rem; }
  .post-body { font-size: .92rem; }
  .comment.reply { padding-left: 1rem; }
  .reply-form { margin-left: 1rem; }

  .post-tools { gap: .35rem; }
  .post-tools .btn { padding: .45rem .7rem; font-size: .82rem; }
  .vote-btn { padding: .5rem 1rem; }

  .search-bar { gap: .3rem; }
  .search-bar input[type=text] { width: min(190px, 45vw); }

  .write-form .row .field.cat { flex: 1 1 100%; }
  .write-form .row .field.title { flex: 1 1 100%; }
  .editor-toolbar { gap: .4rem; }
  .img-status { margin-left: 0; width: 100%; }
}

/* ── 공지 고정줄 / 검색 결과 바 ───────────────────────────── */
.board-table tr.notice td { border-bottom-color: rgba(255, 187, 0, .25); }

.notice-badge {
  display: inline-block;
  padding: .1rem .4rem;
  border-radius: 3px;
  background: var(--brand, #ffbb00);
  color: #1a1a1a;
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.5;
  letter-spacing: .02em;
}

.board-table tr.notice .subject a { font-weight: 600; }

.search-result-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  margin: 0 0 .6rem;
  padding: .55rem .75rem;
  border-radius: 4px;
  background: rgba(127, 127, 127, .08);
  font-size: .88rem;
}
.search-result-bar .cnt-total { color: var(--brand, #ffbb00); }
.search-result-bar .btn-sm {
  margin-left: auto;
  padding: .2rem .55rem;
  font-size: .8rem;
}

/* ---------- 해시태그 ---------- */
.tag-strip {
  display: flex; align-items: center; gap: .4rem; flex-wrap: wrap;
  margin: 0 0 .9rem; padding: .6rem .75rem;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
}
.tag-strip-label {
  color: var(--muted); font-size: .78rem; font-weight: 600;
  margin-right: .2rem; flex: 0 0 auto;
}

.tag-list { display: flex; gap: .4rem; flex-wrap: wrap; margin: 0 0 1rem; }

/* a 태그라서 style.css 의 .dark a:link 가 색을 덮어쓴다. (0,3,1) 로 되받는다. */
.tag-chip,
.dark a.tag-chip:link, .dark a.tag-chip:visited {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .18rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: rgb(31, 31, 34);
  color: var(--muted); font-size: .78rem; text-decoration: none; white-space: nowrap;
}
.dark a.tag-chip:hover { border-color: var(--brand); color: var(--brand); }
.tag-chip b { color: var(--muted); font-weight: 600; font-size: .72rem; opacity: .8; }
.dark a.tag-chip.active:link, .dark a.tag-chip.active:visited {
  border-color: var(--brand); background: rgba(255, 187, 0, .12); color: var(--brand);
}
.tag-chip.active b { color: var(--brand); }
