/* ============================================================
   게시판 (board) — 좌·우 15% 여백 + 비밀글 스타일 v1
   ============================================================ */

/* 좌·우 15% 여백 — board-narrow 클래스를 적용한 .container */
.container.board-narrow {
  width: 70% !important;
  max-width: 70% !important;
  margin: 0 auto !important;
  padding: 40px 0 80px !important;
}

@media (max-width: 1280px) {
  .container.board-narrow { width: 78% !important; max-width: 78% !important; }
}
@media (max-width: 980px) {
  .container.board-narrow { width: 90% !important; max-width: 90% !important; padding: 28px 0 60px !important; }
}
@media (max-width: 640px) {
  .container.board-narrow { width: 94% !important; max-width: 94% !important; }
}

/* 게시판 헤더 */
.board-page .board-head {
  margin-bottom: 28px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--c-gold);
}
.board-page .board-title {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 800;
  color: var(--c-navy);
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.board-page .board-desc {
  color: var(--c-text-soft);
  font-size: 16px;
  margin: 0 0 16px;
}
.board-page .board-tools {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.board-page .search {
  display: flex; gap: 6px;
}
.board-page .search input[type="search"] {
  padding: 10px 14px;
  border: 1px solid rgba(15,23,42,.15);
  border-radius: 8px;
  font-size: 16px;
  min-width: 200px;
}
.board-page .search button {
  padding: 10px 18px;
  background: var(--c-navy);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}
.board-page .btn-primary {
  display: inline-block;
  padding: 10px 22px;
  background: linear-gradient(135deg, var(--c-gold), #d4a017);
  color: #0f172a !important;
  border-radius: 8px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(212,160,23,.30);
  transition: transform .2s;
}
.board-page .btn-primary:hover { transform: translateY(-2px); }

/* 게시판 테이블 */
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,23,42,.04);
}
.board-table thead {
  background: linear-gradient(180deg, #fdfbf7 0%, #fff 100%);
}
.board-table th {
  padding: 14px 12px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
  color: var(--c-navy);
  border-bottom: 2px solid var(--c-gold);
}
.board-table td {
  padding: 14px 12px;
  text-align: center;
  border-bottom: 1px solid rgba(15,23,42,.06);
  vertical-align: middle;
}
.board-table .num-col, .board-table .meta-col, .board-table .adm-col {
  width: 110px;
}
.board-table .num-col { width: 70px; }
.board-table .adm-col { width: 44px; }
.board-table td.subj { text-align: left; }
.board-table td.subj a {
  color: var(--c-navy);
  text-decoration: none;
  font-weight: 600;
}
.board-table td.subj a:hover { color: var(--c-gold); text-decoration: underline; }
.board-table tr:hover { background: #fdfbf7; }
.board-table .notice-row {
  background: linear-gradient(180deg, #fffbeb 0%, #fef9c3 100%);
}
.board-table .notice-row td { font-weight: 700; }
.board-table .badge {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 7px;
  background: rgba(212,160,23,.12);
  color: #8a6310;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
}
.board-table .empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--c-text-soft);
  font-size: 16px;
}
.board-table .secret-row td.subj { color: #94a3b8; }
.board-table .lock-ic {
  display: inline-block;
  margin-right: 4px;
  font-size: 16px;
  color: var(--c-gold);
}

/* 페이징 */
.pager {
  margin-top: 24px;
  display: flex; gap: 6px; justify-content: center;
}
.pager a {
  display: inline-block;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.10);
  border-radius: 8px;
  color: var(--c-navy);
  font-weight: 700;
  text-decoration: none;
  font-size: 16px;
}
.pager a.on, .pager a:hover {
  background: var(--c-navy);
  color: #fff;
  border-color: var(--c-navy);
}

/* 게시글 보기 */
.post-view .crumbs {
  font-size: 16px;
  color: var(--c-text-soft);
  margin-bottom: 18px;
}
.post-view .crumbs a {
  color: var(--c-text-soft);
  text-decoration: none;
}
.post-view .crumbs a:hover { color: var(--c-gold); }

.post-view .post-head {
  padding-bottom: 20px;
  margin-bottom: 28px;
  border-bottom: 2px solid var(--c-gold);
}
.post-view .post-head h1 {
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--c-navy);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
  line-height: 1.4;
}
.post-view .post-meta {
  color: var(--c-text-soft);
  font-size: 16px;
}
.post-view .post-body {
  font-size: 16.5px;
  line-height: 1.85;
  min-height: 200px;
  padding: 20px 4px 32px;
}
.post-view .post-actions {
  margin: 30px 0;
  display: flex; gap: 10px; flex-wrap: wrap;
}
.post-view .post-actions .btn,
.post-view .post-actions .btn-danger {
  padding: 10px 22px;
  background: #fff;
  border: 1px solid rgba(15,23,42,.15);
  border-radius: 8px;
  color: var(--c-navy);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  font-size: 16px;
}
.post-view .post-actions .btn:hover { background: #fdfbf7; }
.post-view .post-actions .btn-danger {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.post-view .prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(15,23,42,.06);
}
.post-view .prev-next a {
  padding: 16px 18px;
  background: #fdfbf7;
  border-radius: 8px;
  color: var(--c-navy);
  text-decoration: none;
  font-size: 16px;
  font-weight: 600;
}
.post-view .prev-next a:hover { background: var(--c-navy); color: #fff; }
.post-view .prev-next a:nth-child(2):only-child { grid-column: 2; }

/* 댓글 */
.post-view .comments {
  margin-top: 40px;
  padding-top: 32px;
  border-top: 2px solid rgba(212,160,23,.20);
}
.post-view .comments h3 {
  font-size: 18px;
  font-weight: 800;
  color: var(--c-navy);
  margin: 0 0 16px;
}
.post-view .comments ul {
  list-style: none; padding: 0; margin: 0 0 24px;
}
.post-view .comments li {
  padding: 14px 16px;
  background: #fdfbf7;
  border-radius: 8px;
  margin-bottom: 10px;
}
.post-view .comments li strong { color: var(--c-navy); }
.post-view .comments li time { font-size: 16px; margin-left: 8px; }
.post-view .comments li p { margin: 8px 0 0; font-size: 16px; line-height: 1.6; }
.post-view .comment-form {
  display: grid;
  gap: 10px;
}
.post-view .comment-form input[type="text"],
.post-view .comment-form textarea {
  padding: 12px 14px;
  border: 1px solid rgba(15,23,42,.12);
  border-radius: 8px;
  font-size: 16px;
  width: 100%;
  font-family: inherit;
}

/* 글쓰기 폼 */
.post-write .board-head { margin-bottom: 24px; }
.post-write .qna-notice {
  background: linear-gradient(135deg, #fffbeb, #fef3c7);
  border-left: 4px solid var(--c-gold);
  padding: 14px 18px;
  border-radius: 8px;
  color: #8a6310;
  font-size: 16px;
  font-weight: 600;
  margin-top: 12px;
}
.post-write .write-form {
  display: grid; gap: 16px;
}
.post-write .write-form > label {
  display: grid; gap: 6px;
  font-weight: 700;
  color: var(--c-navy);
  font-size: 16px;
}
.post-write .write-form input[type="text"],
.post-write .write-form input[type="password"],
.post-write .write-form input[type="datetime-local"] {
  padding: 12px 14px;
  border: 1px solid rgba(15,23,42,.15);
  border-radius: 8px;
  font-size: 16px;
  font-weight: 400;
  width: 100%;
}
.post-write .write-form input[type="password"] { letter-spacing: 4px; }
.post-write .pw-label input { border-color: var(--c-gold); background: #fffbeb; }
.post-write .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.post-write .attachments {
  border: 1px dashed rgba(15,23,42,.18);
  border-radius: 10px;
  padding: 16px 18px;
}
.post-write .attachments legend {
  font-weight: 700; color: var(--c-navy); padding: 0 8px; font-size: 16px;
}
.post-write .file-row { margin-bottom: 8px; }
.post-write .muted { color: var(--c-text-soft); font-size: 16px; }
.post-write .form-actions {
  display: flex; gap: 10px; margin-top: 12px;
}
.post-write .form-actions .btn-primary,
.post-write .form-actions .btn {
  padding: 13px 28px;
  border-radius: 8px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
}
.post-write .form-actions .btn-primary {
  background: linear-gradient(135deg, var(--c-gold), #d4a017);
  color: #0f172a;
  box-shadow: 0 6px 16px rgba(212,160,23,.30);
}
.post-write .form-actions .btn {
  background: #fff;
  border: 1px solid rgba(15,23,42,.15);
  color: var(--c-navy);
}

/* 첨부파일 / 이벤트바 */
.post-view .attachments-block {
  margin-top: 24px;
  padding: 18px 20px;
  background: #fdfbf7;
  border-radius: 10px;
}
.post-view .attachments-block h3 {
  font-size: 16px; font-weight: 800; color: var(--c-navy);
  margin: 0 0 10px;
}
.post-view .att-list { list-style: none; padding: 0; margin: 0; }
.post-view .att-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  font-size: 16px;
}
.post-view .att-list a { color: var(--c-navy); text-decoration: none; font-weight: 600; }
.post-view .att-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 4px; }
.post-view .event-bar {
  padding: 12px 18px;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-left: 4px solid var(--c-navy);
  border-radius: 8px;
  margin-bottom: 18px;
  font-weight: 700;
  color: var(--c-navy);
}

/* === 비밀번호 게이트 (비밀글 잠금 화면) === */
.secret-gate { display: flex; justify-content: center; padding-top: 60px !important; }
.sg-card {
  width: 100%; max-width: 480px;
  background: #fff;
  border-radius: 20px;
  padding: 48px 36px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(15,23,42,.10);
  border: 1px solid rgba(212,160,23,.18);
}
.sg-icon {
  width: 80px; height: 80px;
  margin: 0 auto 20px;
  background: linear-gradient(135deg, var(--c-gold), #d4a017);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px;
  box-shadow: 0 10px 30px rgba(212,160,23,.35);
}
.sg-card h1 {
  font-size: 24px;
  font-weight: 800;
  color: var(--c-navy);
  margin: 0 0 12px;
}
.sg-hint {
  font-size: 16px;
  color: var(--c-text-soft);
  line-height: 1.6;
  margin: 0 0 24px;
}
.sg-error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
}
.sg-form {
  display: grid; gap: 12px;
}
.sg-form input[type="password"] {
  padding: 14px 18px;
  border: 2px solid rgba(212,160,23,.30);
  border-radius: 10px;
  font-size: 16px;
  letter-spacing: 4px;
  background: #fffbeb;
  text-align: center;
}
.sg-form input[type="password"]:focus {
  outline: none;
  border-color: var(--c-gold);
}
.sg-form .btn-primary {
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--c-gold), #d4a017);
  color: #0f172a;
  border: 0;
  border-radius: 10px;
  font-weight: 800;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(212,160,23,.30);
}
.sg-back {
  margin-top: 18px;
  font-size: 16px;
}
.sg-back a {
  color: var(--c-text-soft);
  text-decoration: none;
}
.sg-back a:hover { color: var(--c-navy); }

@media (max-width: 640px) {
  .board-table .meta-col:nth-last-child(-n+2),
  .board-table th:nth-last-child(-n+2),
  .board-table td:nth-last-child(-n+2) { display: none; }
  .post-view .prev-next { grid-template-columns: 1fr; }
  .sg-card { padding: 36px 24px; }
}

/* ============================================================
   첨부 — 본문 상단 이미지 + 하단 다운로드 카드 v2
   ============================================================ */
.post-images {
  margin: 0 0 28px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.post-image-figure {
  margin: 0;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15,23,42,.10);
  background: #fafbfc;
}
.post-image-link { display: block; line-height: 0; }
.post-image-link img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform .35s ease;
}
.post-image-link:hover img { transform: scale(1.015); }

/* 다운로드 카드 */
.attachments-block { margin-top: 32px; }
.attachments-block h3 .att-count {
  color: var(--c-text-soft);
  font-weight: 600;
  margin-left: 4px;
}
.att-list-files {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.att-file-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: linear-gradient(180deg, #fdfbf7 0%, #fff 100%);
  border: 1px solid rgba(15,23,42,.08);
  border-radius: 12px;
  transition: all .25s ease;
}
.att-file-item:hover {
  border-color: var(--c-gold);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15,23,42,.08);
}
.att-file-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}
.att-file-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.att-file-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--c-navy);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.att-file-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  color: var(--c-text-soft);
}
.att-file-ext {
  display: inline-block;
  padding: 2px 9px;
  background: var(--c-navy);
  color: #fbbf24;
  border-radius: 6px;
  font-weight: 800;
  font-size: 16px;
  letter-spacing: 0.05em;
}
.att-file-size { color: var(--c-text-soft); }
.att-file-dl {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 20px;
  background: linear-gradient(135deg, #fbbf24, #d4a017);
  color: #0f172a !important;
  border-radius: 30px;
  font-weight: 800;
  font-size: 16px;
  text-decoration: none;
  box-shadow: 0 6px 14px rgba(212,160,23,.28);
  transition: transform .2s;
}
.att-file-dl:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(212,160,23,.40); }
.att-dl-icon { font-size: 16px; }

@media (max-width: 640px) {
  .att-file-item { padding: 14px 16px; gap: 12px; }
  .att-file-icon { font-size: 26px; }
  .att-file-name { font-size: 16px; }
  .att-file-dl { padding: 10px 14px; }
  .att-dl-text { display: none; }
  .att-dl-icon { font-size: 18px; }
}
/* ============================================================
   본문 안 이미지/요소 — 화면 폭 초과 방지 v3
   ============================================================ */
.post-body img,
.post-body iframe,
.post-body video,
.post-body table {
  max-width: 100% !important;
  height: auto;
}
.post-body figure { margin: 1em 0; max-width: 100%; }
/* 빈 영역 숨김 */
.post-images:empty { display: none; }
.attachments-block:empty { display: none; }
/* 본문 전체 가로 스크롤 차단 */
.post-body { overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; }
.post-body * { max-width: 100%; }
/* date-nowrap-fix — 작성자/작성일/조회 줄바꿈 방지 + 폭 조정 (모든 게시판) */
.board-table th:nth-last-child(-n+3),
.board-table td:nth-last-child(-n+3) {
  white-space: nowrap;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.board-table .meta-col,
.board-table th:nth-last-child(-n+3) { min-width: 110px; }
/* 날짜 컬럼은 좀 더 넉넉히 (한국 날짜 포맷 안전) */
.board-table th:nth-last-child(2),
.board-table td:nth-last-child(2) { min-width: 120px; padding-left: 14px; padding-right: 14px; }
/* 제목 컬럼은 줄바꿈 허용 (긴 제목 다중행) */
.board-table td.subj { white-space: normal; }
/* 모바일 — 작성자만 숨기고 작성일/조회는 한 줄로 유지 */
@media (max-width: 600px) {
  .board-table td:nth-last-child(-n+3),
  .board-table th:nth-last-child(-n+3) { font-size: 13px; min-width: 0; padding-left: 6px; padding-right: 6px; }
}
