/* ════════════════════════════════════════════════
   게시판 공통 스타일 — 후기(reviews.html) · 자료게시판/과제게시판(lecture.html)
   크기·간격·레이아웃은 이 파일 한 곳에서만 정한다.
   색은 대부분 dark.css(기존 클래스: btn-write/btn-submit/btn-cancel/btn-edit/btn-del/
   badge-notice/form-input 등)와 lecture-board.css(lb-*)가 이미 다크로 칠해두므로
   여기서 중복으로 넣지 않았다. 새로 생기는 클래스(board-view-*, board-back, bw-*)만
   var(--d-*) 다크 변수로 색을 직접 넣었다.
   [디자이너 1차 설계 + 2차 선택자 변경(id → 클래스) 반영본] */

/* ── 폭 ── */
.board-wrap { max-width:1200px; margin:0 auto; padding:0 clamp(14px,1.6vw,28px); }

/* ── 목록 상단 ── */
.board-top, .lb-top { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:12px; margin:0 0 20px; }
.board-top h2, .lb-top h2 { font-size:24px; font-weight:800; line-height:1.3; color:var(--d-text); }

/* ── 버튼 공통 ── */
.btn-write { padding:11px 20px; font-size:14px; font-weight:700; line-height:20px; border:none; border-radius:8px; color:#fff; cursor:pointer; }
.lb-btn { padding:10px 20px; font-size:14px; font-weight:700; line-height:20px; border:1px solid transparent; border-radius:8px; cursor:pointer; }
.lb-sm { padding:6px 12px; font-size:13px; }
.btn-edit, .btn-del { padding:6px 10px; font-size:12px; font-weight:600; line-height:16px; border:none; border-radius:6px; cursor:pointer; }
.btn-edit { margin-right:4px; }
.btn-submit, .btn-cancel { padding:14px 24px; min-width:120px; font-size:15px; font-weight:700; line-height:20px; border:none; border-radius:8px; cursor:pointer; }
.board-back { padding:10px 16px; font-size:14px; font-weight:600; line-height:20px; border:1px solid var(--d-border-s); border-radius:8px; background:transparent; color:var(--d-muted); cursor:pointer; }

/* ── 목록 표 ── */
.board-table, .lb-table { width:100%; border-collapse:collapse; table-layout:fixed; }
.board-table thead th, .lb-table th { padding:12px 12px; font-size:13px; font-weight:700; text-align:center; white-space:nowrap;
  color:var(--d-muted) !important; border-bottom:1px solid var(--d-border-s) !important; }
.board-table thead th.th-title, .lb-table th:nth-child(2) { text-align:left; }
.board-table tbody tr, .lb-table tbody tr { border-bottom:1px solid var(--d-border) !important; cursor:pointer; }
.board-table tbody tr:hover, .lb-table tbody tr:hover { background:rgba(255,255,255,.03) !important; }
.board-table td, .lb-table td { padding:15px 12px; font-size:15px; line-height:1.5; text-align:center; vertical-align:middle; border-bottom:0; }
.board-table td.td-title, .lb-table td.lb-title { text-align:left; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.td-title-inner { display:flex; align-items:center; gap:8px; min-width:0; }
.td-title-text { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.td-actions { white-space:nowrap; }
.badge-notice { display:inline-block; padding:2px 8px; font-size:11px; font-weight:700; line-height:16px; border-radius:4px; white-space:nowrap; }
.board-empty { text-align:center; padding:60px 0 !important; font-size:15px; color:var(--d-muted) !important; }

/* ── 페이지 번호 (후기) ── */
.board-pager { display:flex; justify-content:center; flex-wrap:wrap; gap:6px; margin-top:28px; }
.board-pager button { min-width:40px; height:40px; padding:0 12px; font-size:14px; font-weight:700; border-radius:8px; cursor:pointer;
  border:1px solid var(--d-border-s); background:transparent; color:var(--d-text); }
.board-pager button.on { background:#6366f1; border-color:#6366f1; color:#fff; }
.board-pager button:disabled { opacity:.35; cursor:default; }

/* ── 상세 ── */
.board-view { padding:clamp(28px,3.5vw,48px) 0 clamp(56px,6vw,96px); }
.board-view-title, .lb-view h3 { margin:24px 0 10px; font-size:26px; font-weight:800; line-height:1.4; color:var(--d-text); word-break:break-word; }
.board-view-meta, .lb-view h3 + .lb-muted { padding-bottom:16px; font-size:13px; color:var(--d-muted); border-bottom:1px solid var(--d-border); }
.board-view-content, .lb-content { padding:24px 0; font-size:16px; line-height:1.85; color:var(--d-text); white-space:pre-wrap; word-break:break-word; }
.board-view-content img { max-width:720px; }
.board-view-files { padding:0 0 24px; }
.lb-file { padding:14px 16px; margin-bottom:8px; font-size:14px; }
.board-view-foot, .lb-foot { display:flex; justify-content:flex-end; gap:8px; margin-top:0; padding:20px 0 0; border-top:1px solid var(--d-border); }
.board-view-foot:empty { display:none; }
.board-view-foot .btn-edit, .board-view-foot .btn-del { padding:11px 20px; font-size:14px; line-height:20px; border-radius:8px; margin-right:0; }

/* ── 글쓰기 ── */
.board-write { display:none; padding:clamp(28px,3.5vw,48px) 0 clamp(56px,6vw,96px); }
.board-write.open { display:block; }
.bw-head { padding-bottom:16px; margin-bottom:8px; border-bottom:1px solid var(--d-border); }
.bw-title, .lb-writepage h3 { margin:0; font-size:24px; font-weight:800; line-height:1.3; color:var(--d-text); }
.lb-writepage h3 { padding-bottom:16px; margin-bottom:8px; border-bottom:1px solid var(--d-border); }
.lb-writepage { max-width:none; }
.form-label, .lb-writepage label { display:block; margin:24px 0 8px; font-size:14px; font-weight:700; line-height:1.4; }
.form-input, .lb-writepage input, .lb-writepage select, .lb-writepage textarea {
  display:block; width:100%; font-family:inherit; font-size:15px; border:1px solid var(--d-border-s); border-radius:8px; box-sizing:border-box; }
input.form-input:not([type=file]), select.form-input,
.lb-writepage input:not([type=file]), .lb-writepage select { height:48px; padding:0 14px; }
textarea.form-input, .lb-writepage textarea { min-height:360px; padding:12px 14px; line-height:1.7; resize:vertical; }
input[type=file].form-input, .lb-writepage input[type=file] { height:auto; padding:10px 12px; font-size:14px; }
.form-input:focus, .lb-writepage input:focus, .lb-writepage select:focus, .lb-writepage textarea:focus { outline:none; }
.form-notice-row { display:flex; align-items:center; gap:8px; margin-top:24px; font-size:14px; }
.form-notice-row input[type=checkbox] { width:18px !important; height:18px; }
.form-msg, .lb-msg { min-height:20px; margin-top:12px; font-size:14px; }
.bw-foot, .lb-box-foot { display:flex; justify-content:flex-end; gap:8px; margin-top:28px; padding-top:20px; border-top:1px solid var(--d-border); }
.lb-box-foot .lb-btn { padding:13px 24px; min-width:120px; font-size:15px; }
.lb-frow { padding:10px 12px; margin-top:8px; }

/* ── 태블릿 ── */
@media (max-width:1023px) {
  .board-top h2, .lb-top h2 { font-size:22px; }
  .board-table thead th, .lb-table th { padding:11px 8px; }
  .board-table td, .lb-table td { padding:13px 8px; font-size:14px; }
  .board-table th:nth-child(5), .board-table td:nth-child(5),
  .lb-table th:nth-child(5), .lb-table td:nth-child(5) { display:none; }
  .board-view-title, .lb-view h3 { font-size:22px; }
  .bw-title, .lb-writepage h3 { font-size:22px; }
  textarea.form-input, .lb-writepage textarea { min-height:300px; }
}

/* ── 모바일: 목록은 카드형 ──
   주의: style.css 548~553행에 `.board-table td:nth-child(3/4/5) { display:none; }`(600px 이하) 이
   이미 있다. 그 선택자 명시도는 (0,2,1)인데, 아래 `.board-table tbody td:nth-child(3)` 처럼
   tbody 를 넣은 선택자는 (0,2,2)로 더 높아 이 파일이 이겨서 작성자·날짜 칸이 보인다.
   (검증 결과: 이겨서 나옴 — 별도 !important 불필요) */
@media (max-width:600px) {
  .board-top h2, .lb-top h2 { font-size:20px; }

  .board-table thead, .lb-table thead { display:none; }
  .board-table, .board-table tbody, .lb-table, .lb-table tbody { display:block; }
  .board-table tbody tr, .lb-table tbody tr { display:flex; flex-wrap:wrap; align-items:center; column-gap:12px; row-gap:0; padding:14px 2px; }
  .board-table tbody tr::before, .lb-table tbody tr::before { content:""; order:2; flex-basis:100%; height:0; }
  .board-table tbody td, .lb-table tbody td { display:block; order:3; margin-top:6px; padding:0; border:0; text-align:left;
    font-size:13px; line-height:1.5; color:var(--d-muted) !important; }
  .board-table tbody td:nth-child(1), .lb-table tbody td:nth-child(1) { order:1; margin-top:0; }
  .board-table tbody td:nth-child(1):not(.board-empty):not(:has(.badge-notice)), .lb-table tbody td:nth-child(1):not(:has(.badge-notice)) { display:none; }
  .board-table tbody td.td-title, .lb-table tbody td.lb-title { order:1; flex:1 1 0; min-width:0; margin-top:0;
    font-size:15px; font-weight:600; color:var(--d-text) !important; }
  .board-table tbody td:nth-child(3), .board-table tbody td:nth-child(4),
  .lb-table tbody td:nth-child(3), .lb-table tbody td:nth-child(4) { display:block; }
  .board-table tbody td:nth-child(5), .lb-table tbody td:nth-child(5) { display:none; }
  .board-table tbody td:nth-child(6) { margin-left:auto; }
  .board-table tbody td:nth-child(6):empty { display:none; }
  .board-table tbody .btn-edit, .board-table tbody .btn-del { padding:8px 12px; font-size:13px; line-height:20px; }
  .board-table tbody td.board-empty { flex-basis:100%; margin:0; text-align:center; font-size:14px; }

  .board-pager { gap:4px; }

  .board-view-title, .lb-view h3 { font-size:20px; margin-top:20px; }
  .board-view-content, .lb-content { padding:20px 0; font-size:15px; line-height:1.8; }
  .board-view-content img { max-width:100%; }

  .bw-title, .lb-writepage h3 { font-size:20px; }
  .form-label, .lb-writepage label { margin-top:20px; }
  .form-input, .lb-writepage input, .lb-writepage select, .lb-writepage textarea { font-size:16px; }
  textarea.form-input, .lb-writepage textarea { min-height:240px; }
  .bw-foot .btn-cancel, .bw-foot .btn-submit, .lb-box-foot .lb-btn { flex:1 1 0; min-width:0; }
  #img-preview button { width:28px !important; height:28px !important; top:-8px !important; right:-8px !important; }
}

/* 강의 페이지 탭 안의 과제게시판 — 탭 막대가 위 여백을 주므로 페이지용 여백을 뺀다 */
.taskboard [hidden] { display:none !important; }
.taskboard .board-view, .taskboard .board-write { padding:0; }

/* 보이는 등급 선택 (관리자 글쓰기) */
.lv-pick { display:flex; gap:8px; flex-wrap:wrap; }
.lv-opt { min-width:64px; height:40px; padding:0 14px; border-radius:8px; font-size:14px; font-weight:700; cursor:pointer;
  border:1px solid var(--d-border-s); background:transparent; color:var(--d-muted); font-family:inherit; }
.lv-opt.on { background:#6366f1; border-color:#6366f1; color:#fff; }
.lv-opt:focus-visible { outline:3px solid #a5b4fc; outline-offset:2px; }
.lv-hint { margin-top:8px; font-size:13px; color:var(--d-muted); }
@media (max-width:600px) { .lv-opt { flex:1 1 0; min-width:0; } }
