/* 자료실 · 이슈 게시판 (screens/board.js)
   styles.css 의 .bd-* 기본 위에 얹는다. 색은 전부 테마 토큰이라 라이트·다크 둘 다 맞는다. */

/* ---------- 파일 첨부 버튼: 버튼처럼 보이게 ---------- */
.bd-pick {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  align-self: flex-start;
  min-height: 40px; padding: 0 16px; margin-top: 8px;
  border: 1px solid var(--border-strong); border-radius: 10px;
  background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 700; cursor: pointer; user-select: none;
  transition: background .15s, border-color .15s, color .15s;
}
.bd-pick:hover { background: var(--accent-softer); border-color: var(--accent); color: var(--accent-ink); }
.bd-pick:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.bd-pick svg { flex: none; }
.bd-cform .bd-pick { margin-top: 0; }

/* 작은 공용 버튼 (댓글 수정 저장/취소, 주소 열기) */
.bd-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 36px; padding: 0 14px; border-radius: 9px;
  font-size: 13px; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
}
.bd-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.bd-btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.bd-btn-primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); color: #fff; }
.bd-btn:disabled { opacity: .55; cursor: default; }
.bd-btn[hidden] { display: none; }

/* ---------- 목록 ---------- */
.bd-item-title { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.bd-item-text { min-width: 0; overflow-wrap: anywhere; }
.bd-item-place { font-size: 12.5px; font-weight: 700; color: var(--text-muted); overflow-wrap: anywhere; }

/* 이슈 상태 배지 */
.bd-status {
  display: inline-flex; align-items: center; flex: none;
  height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .2px; border: 1px solid transparent;
  vertical-align: middle;
}
.bd-post-title .bd-status { margin-right: 8px; position: relative; top: -2px; }
.bd-status-waiting     { background: var(--warn-bg); color: var(--warn-text); border-color: var(--warn-border, transparent); }
.bd-status-in_progress { background: var(--info-bg, var(--accent-soft)); color: var(--info-text, var(--accent-ink)); border-color: var(--info-border, transparent); }
.bd-status-done        { background: var(--ok-bg); color: var(--ok-text); border-color: var(--ok-border); }

/* 상태 걸러 보기 칩 */
.bd-filter { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 12px; }
.bd-chip {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 34px; padding: 0 13px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-muted);
  font-size: 13px; font-weight: 700; cursor: pointer;
}
.bd-chip b { font-weight: 800; color: var(--text-faint); }
.bd-chip:hover { border-color: var(--accent); color: var(--text); }
.bd-chip.on { background: var(--text); border-color: var(--text); color: var(--surface); }
.bd-chip.on b { color: inherit; opacity: .75; }

/* 쪽 이동 */
.bd-pager-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin: 14px 0;
}
.bd-total { font-size: 12.5px; font-weight: 700; color: var(--text-faint); }
.bd-pages { display: flex; align-items: center; gap: 4px; margin: 0; }
.bd-page {
  min-width: 34px; height: 34px; padding: 0 8px; border-radius: 9px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font-size: 13px; font-weight: 700; cursor: pointer; font-variant-numeric: tabular-nums;
}
.bd-page:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.bd-page.on { background: var(--accent); border-color: var(--accent); color: #fff; }
.bd-page:disabled { opacity: .4; cursor: default; }
.bd-page-arrow { font-size: 16px; }
.bd-page-gap { padding: 0 2px; color: var(--text-faint); }

/* ---------- 글 보기: 이슈 정보 ---------- */
.bd-issue-info {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0;
  margin: 14px 0 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
}
.bd-issue-info > div { display: flex; flex-direction: column; gap: 4px; padding: 10px 14px; border-top: 1px solid var(--border-subtle); min-width: 0; }
.bd-issue-info > div:nth-child(-n+2) { border-top: none; }
.bd-issue-info > div:nth-child(even) { border-left: 1px solid var(--border-subtle); }
.bd-issue-info dt { font-size: 11.5px; font-weight: 800; color: var(--text-faint); }
.bd-issue-info dd { margin: 0; font-size: 14px; font-weight: 700; overflow-wrap: anywhere; }
.bd-url { color: var(--accent-ink); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.bd-muted { color: var(--text-faint); font-weight: 600; }

/* 상태 바꾸기 (대기 · 진행 · 완료) */
.bd-seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: 10px; overflow: hidden; }
.bd-seg-btn {
  min-height: 34px; padding: 0 14px; border: 0; background: var(--surface); color: var(--text-muted);
  font-size: 13px; font-weight: 800; cursor: pointer;
}
.bd-seg-btn + .bd-seg-btn { border-left: 1px solid var(--border-strong); }
.bd-seg-btn:hover:not(.on):not(:disabled) { background: var(--surface-sunken); color: var(--text); }
.bd-seg-btn:disabled { cursor: default; opacity: .6; }
.bd-seg-btn.on.bd-seg-waiting     { background: var(--warn-bg); color: var(--warn-text); }
.bd-seg-btn.on.bd-seg-in_progress { background: var(--info-bg, var(--accent-soft)); color: var(--info-text, var(--accent-ink)); }
.bd-seg-btn.on.bd-seg-done        { background: var(--ok-bg); color: var(--ok-text); }

/* 글 수정/삭제 버튼도 테두리 있는 버튼으로 */
.bd-post-actions .btn-inline {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); text-decoration: none;
}
.bd-post-actions .btn-inline:hover { border-color: var(--accent); color: var(--accent-ink); }
.bd-post-actions .btn-inline.danger { color: var(--err-text); }
.bd-post-actions .btn-inline.danger:hover { border-color: var(--err-text); background: var(--err-bg); }
.bd-dl { border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); }
.bd-dl:hover { border-color: var(--accent); color: var(--accent-ink); }

/* 댓글 수정 */
.bd-comment-tools { margin-left: auto; display: inline-flex; gap: 2px; }
.bd-comment-tools .bd-cdel { margin-left: 0; }
.bd-cedit:hover { color: var(--accent-ink); }
.bd-cedit-form { margin-top: 6px; display: flex; flex-direction: column; gap: 6px; }
.bd-cedit-form textarea {
  width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); color: var(--text); font: inherit; font-size: 14px; resize: vertical;
}
.bd-cform-row-end { justify-content: flex-end; }

/* ---------- 글쓰기 ---------- */
/* .form-hint 는 전역 규칙이 없어 본문 크기(16px)로 나오던 것을 맞춘다 */
.bd-editor .form-hint, .bd-bar .form-hint { margin: 2px 0 6px; font-size: 12.5px; line-height: 1.55; color: var(--text-faint); }
.bd-editor .field { margin-bottom: 10px; }

/* ---------- 글쓰기: 이슈 위치 ---------- */
.bd-place {
  margin: 0 0 6px; padding: 12px 14px 4px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface-sunken); min-width: 0;
}
.bd-place legend { padding: 0 6px; font-size: 13px; font-weight: 800; color: var(--text); }
.bd-place-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 12px; }
.bd-place select, .bd-url-row input { width: 100%; min-width: 0; box-sizing: border-box; }
.bd-url-row { display: flex; gap: 8px; align-items: center; }
.bd-url-row input { flex: 1; }
.bd-req, .bd-opt { font-size: 11px; font-weight: 800; margin-left: 4px; }
.bd-req { color: var(--err-text); }
.bd-opt { color: var(--text-faint); font-weight: 600; }

/* ---------- 모바일 ---------- */
@media (max-width: 640px) {
  .bd-pager-row { justify-content: center; }
  .bd-total { width: 100%; text-align: center; }
  .bd-page { min-width: 38px; height: 38px; }
  .bd-filter { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-left: -2px; padding-bottom: 2px; }
  .bd-filter::-webkit-scrollbar { display: none; }
  .bd-chip { flex: none; }
  .bd-issue-info { grid-template-columns: minmax(0, 1fr); }
  .bd-issue-info > div:nth-child(2) { border-top: 1px solid var(--border-subtle); }
  .bd-issue-info > div:nth-child(even) { border-left: none; }
  .bd-seg { display: flex; width: 100%; }
  .bd-seg-btn { flex: 1; min-height: 40px; }
  .bd-place-grid { grid-template-columns: minmax(0, 1fr); }
  .bd-pick { align-self: stretch; min-height: 44px; }
  .bd-cform .bd-pick { align-self: auto; }
}
