/* ===== 게시판 ===== */
.board-wrap { max-width: 1100px; }

/* 정렬 + 검색 묶음 */
.board-search-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.board-sort { display:flex; gap:4px; flex-shrink:0; }
.sort-btn {
  padding: 6px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #fff;
  font-size: 12.5px;
  color: #666;
  transition: all .15s;
}
.sort-btn.active { background: #444; color:#fff; border-color:#444; font-weight:700; }
.sort-btn:hover:not(.active) { border-color:#666; color:#333; }

/* 레벨 뱃지 */
.lv-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  vertical-align: middle;
}

/* 게시글 행 썸네일 (호버 미리보기) */
.post-row-thumb {
  display: none;
  width: 32px; height: 32px;
  border-radius: 4px;
  background-size: cover;
  background-position: center;
  margin-top: 4px;
}
.board-row:hover .post-row-thumb { display: inline-block; }

/* 하단 버튼 */
.board-bottom-btns {
  display: flex;
  justify-content: space-between;
  margin-top: 14px;
}
.board-btn-gray {
  padding: 8px 18px;
  background: #f0f0f0;
  color: #555;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.board-btn-gray:hover { background: #e0e0e0; }

.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 10px;
}
.board-header h2 { font-size: 20px; font-weight: 700; color: #222; }
.board-header-right { display:flex; align-items:center; gap:12px; }
.post-count { font-size: 13px; color: #888; }
.post-count b { color: var(--primary); }

.write-btn {
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background .2s;
}
.write-btn:hover { background: var(--primary-dark); }

.board-search {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.board-search select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  color: #333;
  outline: none;
}
.board-search input {
  flex:1;
  min-width: 150px;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border .2s;
}
.board-search input:focus { border-color: var(--primary); }
.board-search button {
  padding: 8px 18px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  transition: background .2s;
}
.board-search button:hover { background: var(--primary-dark); }

.board-table-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  overflow-x: auto;
}
.board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
.board-table thead tr {
  background: #f8f9fa;
  border-bottom: 2px solid #e8eaed;
}
.board-table th {
  padding: 11px 14px;
  font-weight: 700;
  color: #555;
  text-align: center;
  white-space: nowrap;
}
.col-num { width: 60px; }
.col-title { text-align: left !important; }
.col-author { width: 90px; }
.col-date { width: 90px; }
.col-view { width: 60px; }
.col-like { width: 60px; }

.board-row {
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background .12s;
}
.board-row:hover { background: #f8faff; }
.board-row td {
  padding: 10px 14px;
  text-align: center;
  vertical-align: middle;
}
.board-row td.col-title { text-align: left; }

.notice-pinned { background: #fffbf0; }
.notice-pinned:hover { background: #fff8e0 !important; }
.notice-title { font-weight: 700; color: #b71c1c !important; }

.post-link-title {
  color: #333;
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
}
.post-link-title:hover { color: var(--primary); }
.img-icon { color: #3a7bd5; font-size: 12px; }
.tc { color: var(--primary); font-weight: 700; font-size: 12px; }
.new-badge {
  display: inline-block;
  padding: 0px 5px;
  background: #ea4335;
  color: #fff;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
}

.table-loading, .table-empty {
  text-align: center;
  padding: 40px !important;
  color: #aaa;
  font-size: 14px;
}

/* 페이지네이션 */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.pg-btn {
  min-width: 34px; height: 34px;
  padding: 0 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  color: #555;
  transition: all .15s;
}
.pg-btn:hover { border-color: var(--primary); color: var(--primary); }
.pg-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); font-weight: 700; }

/* ===== 글상세 ===== */
.post-wrap { max-width: 900px; }

.post-head {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 24px 18px;
  box-shadow: var(--card-shadow);
  margin-bottom: 4px;
}
.post-board-badge {
  display: inline-block;
  padding: 2px 10px;
  background: #e8f0fe;
  color: var(--primary);
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 10px;
}
.post-head h1 { font-size: 20px; font-weight: 700; color: #111; margin-bottom: 12px; line-height: 1.4; }
.post-meta-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: #888;
  flex-wrap: wrap;
}
.post-meta-row span { display:flex; align-items:center; gap:4px; }
.post-meta-row .author { font-weight: 600; color: #555; }

.post-body {
  background: #fff;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--card-shadow);
  margin-bottom: 4px;
  min-height: 200px;
  line-height: 1.8;
  font-size: 14.5px;
  color: #333;
}
.post-body img { max-width: 100%; border-radius: 6px; }

.post-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  margin-bottom: 4px;
}
.like-btn, .dislike-btn {
  display: flex; align-items:center; gap:6px;
  padding: 10px 28px;
  border: 2px solid #ddd;
  border-radius: 30px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  transition: all .2s;
}
.like-btn:hover { border-color: #ea4335; color: #ea4335; }
.dislike-btn:hover { border-color: #999; color: #666; }
.like-btn.active { background: #ea4335; color: #fff; border-color: #ea4335; }

.post-nav {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 4px;
}
.post-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13.5px;
  color: #444;
  transition: background .15s;
}
.post-nav a:hover { background: #f8faff; }
.post-nav a:last-child { border-bottom: none; }
.post-nav .nav-label { font-size: 12px; color: #aaa; min-width: 40px; }

/* ===== 댓글 ===== */
.comment-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
  margin-bottom: 4px;
}
.comment-header {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  font-size: 14px;
  font-weight: 700;
  color: #333;
}
.comment-form {
  padding: 14px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.comment-form textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 13.5px;
  resize: vertical;
  min-height: 80px;
  outline: none;
  font-family: inherit;
  transition: border .2s;
}
.comment-form textarea:focus { border-color: var(--primary); }
.comment-submit {
  align-self: flex-end;
  padding: 8px 22px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13.5px;
  font-weight: 600;
  transition: background .2s;
}
.comment-submit:hover { background: var(--primary-dark); }
.comment-list { }
.comment-item {
  padding: 14px 20px;
  border-bottom: 1px solid #f7f7f7;
}
.comment-item:last-child { border-bottom: none; }
.comment-top { display:flex; justify-content:space-between; align-items:center; margin-bottom:6px; }
.comment-author { font-size: 13px; font-weight: 600; color: #333; }
.comment-time { font-size: 12px; color: #bbb; }
.comment-text { font-size: 13.5px; color: #444; line-height: 1.6; }
.comment-del { background:none; border:none; color:#ccc; font-size:12px; cursor:pointer; }
.comment-del:hover { color: #e44; }

/* ===== 글쓰기 ===== */
.write-wrap { max-width: 900px; }
.write-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}
.write-card-header {
  padding: 16px 20px;
  background: #fafafa;
  border-bottom: 1px solid #f0f0f0;
  font-size: 16px;
  font-weight: 700;
  color: #222;
}
.write-form { padding: 20px; }
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #555;
  margin-bottom: 6px;
}
.form-group select,
.form-group input[type="text"] {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
  font-family: inherit;
}
.form-group select:focus,
.form-group input[type="text"]:focus { border-color: var(--primary); }
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1.5px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  min-height: 300px;
  resize: vertical;
  outline: none;
  font-family: inherit;
  line-height: 1.7;
  transition: border .2s;
}
.form-group textarea:focus { border-color: var(--primary); }
.img-preview { display:flex; flex-wrap:wrap; gap:8px; margin-top:8px; }
.img-preview-item {
  position: relative;
  width: 90px; height: 90px;
}
.img-preview-item img { width:100%; height:100%; object-fit:cover; border-radius:6px; }
.img-preview-item button {
  position: absolute; top:-6px; right:-6px;
  width:20px; height:20px;
  background:#e44; color:#fff;
  border:none; border-radius:50%;
  font-size:11px; line-height:1;
}
.write-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  background: #fafafa;
}
.btn-cancel {
  padding: 10px 24px;
  background: #f0f0f0;
  color: #555;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
}
.btn-cancel:hover { background: #e0e0e0; }
.btn-submit {
  padding: 10px 30px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  transition: background .2s;
}
.btn-submit:hover { background: var(--primary-dark); }

/* ===== 로그인/회원가입 ===== */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1e2130 0%, #2d3250 100%);
  padding: 20px;
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.25);
  overflow: hidden;
}
.auth-header {
  background: linear-gradient(135deg, #3a7bd5, #00d2ff);
  padding: 30px 24px;
  text-align: center;
  color: #fff;
}
.auth-header .logo { font-size: 32px; font-weight: 700; margin-bottom: 6px; }
.auth-header p { font-size: 13px; opacity: .85; }
.auth-body { padding: 28px 24px; }
.auth-group { margin-bottom: 18px; }
.auth-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #555;
  margin-bottom: 7px;
}
.auth-group input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  transition: border .2s;
  font-family: inherit;
}
.auth-group input:focus { border-color: var(--primary); }
.auth-submit {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, #3a7bd5, #2c5fb3);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  margin-top: 6px;
  transition: opacity .2s;
}
.auth-submit:hover { opacity: .9; }
.auth-footer {
  text-align: center;
  padding: 16px 24px 22px;
  font-size: 13px;
  color: #888;
  border-top: 1px solid #f0f0f0;
}
.auth-footer a { color: var(--primary); font-weight: 600; }
.auth-error {
  background: #fce8e6;
  color: #d93025;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 14px;
  display: none;
}

@media (max-width: 600px) {
  .board-table thead { display: none; }
  .board-row { display: flex; flex-wrap: wrap; padding: 12px; }
  .board-row td { border: none; padding: 2px 4px; }
  .col-num { display: none; }
  .col-title { flex: 1 1 100%; font-weight: 600; }
  .col-author, .col-date, .col-view, .col-like { font-size: 12px; color: #aaa; }
}

/* ===================================================
   무한 스크롤 게시글 목록 (새 레이아웃)
   =================================================== */

/* 계급 뱃지 */
.rank-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  vertical-align: middle;
}

/* 게시글 목록 래퍼 */
.post-list-wrap {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
  overflow: hidden;
}

/* 개별 게시글 아이템 */
.post-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f2f2f2;
  cursor: pointer;
  transition: background .12s;
  min-height: 60px;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: #f8faff; }
.post-item.pi-notice { background: #fffbf0; }
.post-item.pi-notice:hover { background: #fff8e0; }

.pi-main { flex: 1; min-width: 0; }

/* 제목 줄 */
.pi-title-row {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 5px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.pi-notice-tag {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  color: #c62828;
  background: #fdecea;
  border-radius: 3px;
  padding: 1px 6px;
}
.pi-img-icon { color: #5c85d6; font-size: 11px; flex-shrink: 0; }
.pi-title {
  font-size: 14px;
  font-weight: 500;
  color: #222;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.pi-title:hover { color: var(--primary); }
.pi-cmt { color: var(--primary); font-size: 12px; font-weight: 700; flex-shrink: 0; }
.pi-new {
  flex-shrink: 0;
  display: inline-block;
  padding: 0 4px;
  background: #ea4335;
  color: #fff;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
}

/* 메타 줄 (계급·닉네임·시간·조회수) */
.pi-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #999;
  flex-wrap: nowrap;
  overflow: hidden;
}
.pi-author { font-weight: 600; color: #555; max-width: 80px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pi-sep { color: #ddd; }
.pi-time { flex-shrink: 0; }
.pi-icon { font-size: 10px; }
.pi-views { flex-shrink: 0; }
.pi-pinned { border-left: 3px solid #ab47bc; }
.pi-highlighted { border-left: 3px solid #ffd700; background: linear-gradient(90deg, rgba(255,215,0,0.04), transparent); }
.pi-highlighted .pi-title { color: #b8860b; }
.pi-preview {
  font-size: 12px; color: #aaa; margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 썸네일 */
.pi-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 6px;
  overflow: hidden;
  background: #f0f0f0;
}
.pi-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 로딩/빈 상태 */
.pi-loading, .pi-empty {
  padding: 40px;
  text-align: center;
  color: #aaa;
  font-size: 14px;
}

/* ── 무한 스크롤 로더 ── */
.infinite-loader {
  padding: 20px;
  text-align: center;
  color: #aaa;
  font-size: 13px;
  min-height: 60px;
}
.loader-spinner i { color: var(--primary); }

/* ===================================================
   꽁가이 사진 게시판 포토카드 그리드
   =================================================== */
.gallery-board-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.gallery-card {
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--card-shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s, box-shadow .18s;
  cursor: pointer;
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.13); }

.gc-img-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f0f0f0;
  position: relative;
}
.gc-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .25s;
}
.gallery-card:hover .gc-img-wrap img { transform: scale(1.05); }
.gc-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  color: #ccc;
}

.gc-body {
  padding: 8px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.gc-title {
  font-size: 13px;
  font-weight: 600;
  color: #222;
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
}
.gc-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: #aaa;
  flex-wrap: wrap;
  margin-top: auto;
}
.gc-author { color: #666; font-weight: 600; max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-time { flex-shrink: 0; }
.gc-cmt { color: #e53935; font-weight: 700; margin-left: auto; flex-shrink: 0; }

/* ── 반응형 ── */
@media (max-width: 1024px) {
  .gallery-board-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .gallery-board-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .pi-thumb { width: 48px; height: 48px; }
  .post-item { padding: 10px 12px; }
  .pi-title { font-size: 13.5px; }
}
@media (max-width: 400px) {
  .gallery-board-grid { grid-template-columns: repeat(2, 1fr); gap: 6px; }
}
