/* public/css/community.css */

/* ===== 전역 CSS 충돌 방지: community 영역만 강제 ===== */
#community.tab-content.panel.community-page{
  padding:0 !important;           /* 전역 .panel padding 덮어쓰기 */
  background:#fff !important;
  color:#111 !important;
  border:1px solid #e9e9e9;
  overflow:hidden;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif;
}
#community.community-page *{ box-sizing:border-box; }

/* 상세보기일 때 하단/글쓰기 숨김 */
#community.community-page.is-detail .community-footerbar{ display:none; }
#community.community-page.is-detail .community-toolbar .write-btn{ display:none; }

.community-header{
  padding:22px 24px 14px 24px;
  border-bottom:1px solid #ededed;
  display:flex;
  align-items:flex-end;
  gap:16px;
}
.community-header h2{
  margin:0;
  font-size:34px;
  letter-spacing:-1px;
  font-weight:800;
  color:#000;
}
.community-header p{
  margin:0 0 4px 0;
  color:#666;
  font-size:14px;
}

.community-tabs{
  display:flex;
  gap:0;
  border-bottom:2px solid #2b2b2b;
  padding:0 12px;
  background:#fafafa;
}
.community-tabs button{
  appearance:none;
  border:0;
  background:transparent;
  padding:14px 16px;
  font-size:14px;
  color:#444;
  cursor:pointer;
  border-right:1px solid #e8e8e8;
  white-space:nowrap;
}
.community-tabs button:hover{ background:#f2f2f2; }
.community-tabs button.active{
  background:#c44a2f;
  color:#fff;
  font-weight:700;
}

.community-toolbar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:14px 18px;
  border-bottom:1px solid #ededed;
  background:#fff;
}
.community-toolbar .scope{
  font-size:14px;
  font-weight:700;
  color:#111;
}
.community-toolbar .write-btn{
  border:0;
  background:#4b3f3b;
  color:#fff;
  padding:10px 18px;
  font-weight:700;
  cursor:pointer;
}
.community-toolbar .write-btn:hover{ filter:brightness(0.95); }

.board-wrap{ padding:18px; background:#fff; }

table.community-table{
  width:100%;
  border-collapse:collapse;
  table-layout:fixed;
}
.community-table thead th{
  background:#4b3f3b;
  color:#fff;
  font-weight:700;
  padding:14px 10px;
  font-size:13px;
}
.community-table tbody td{
  border-bottom:1px solid #eaeaea;
  padding:12px 10px;
  font-size:13px;
  color:#222;
  vertical-align:middle;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}

.col-type{ width:120px; }
.col-title{ width:auto; }
.col-author{ width:170px; }
.col-date{ width:120px; text-align:center; color:#666; }
.col-views{ width:70px; text-align:center; color:#666; }

.type-badge{
  display:inline-block;
  padding:4px 8px;
  border:1px solid #ddd;
  color:#333;
  background:#fff;
  font-size:12px;
}
.new-badge{
  display:inline-block;
  margin-left:8px;
  padding:2px 6px;
  font-size:11px;
  font-weight:800;
  color:#fff;
  background:#2f62c4;
  border-radius:2px;
  vertical-align:middle;
}
.title-link{
  cursor:pointer;
  color:#111;
  font-weight:600;
  text-decoration:none;
}
.title-link:hover{ text-decoration:underline; }

/* ✅ 칩(신용인/공지) 스타일 */
.title-chips{
  display:inline-flex;
  gap:6px;
  margin-left:10px;
  vertical-align:middle;
}
.chip{
  display:inline-block;
  padding:3px 7px;
  font-size:11px;
  font-weight:800;
  border-radius:999px;
  border:1px solid #ddd;
  background:#fff;
  color:#333;
}
.chip.credit{
  border-color:#c44a2f;
  color:#c44a2f;
  background:#fff7f4;
}
.chip.notice{
  border-color:#b3261e;
  color:#b3261e;
  background:#fff1f0;
}

/* ===== 상세 ===== */
.detail-wrap{ padding:18px; background:#fff; }
.detail-head{
  display:flex;
  gap:10px;
  align-items:center;
  justify-content:space-between;
  margin-bottom:10px;
}
.detail-head .left{
  display:flex;
  gap:10px;
  align-items:center;
}
.detail-head .back-btn{
  border:1px solid #ddd;
  background:#fff;
  padding:8px 12px;
  cursor:pointer;
}
.detail-head .danger{
  border:0;
  background:#b3261e;
  color:#fff;
  padding:8px 12px;
  cursor:pointer;
  font-weight:800;
}
.detail-title{
  font-size:20px;
  font-weight:900;
  margin:10px 0 6px 0;
  color:#111;
}
.detail-meta{
  font-size:12px;
  color:#666;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-bottom:12px;
}
.detail-content{
  border-top:1px solid #eee;
  padding-top:12px;
  font-size:14px;
  line-height:1.7;
  color:#222;
  white-space:pre-wrap;
}

/* ===== 댓글 ===== */
.comments{ margin-top:18px; border-top:1px solid #eee; padding-top:12px; }
.comments h4{ margin:0 0 10px 0; font-size:14px; font-weight:900; color:#111; }
.comment-item{
  border:1px solid #eee;
  padding:10px;
  margin-bottom:8px;
  display:flex;
  justify-content:space-between;
  gap:10px;
}
.comment-item .meta{ font-size:12px; color:#666; margin-bottom:6px; }
.comment-item .text{ font-size:13px; color:#222; white-space:pre-wrap; }
.comment-item .del{
  border:0;
  background:#111;
  color:#fff;
  padding:8px 10px;
  cursor:pointer;
  font-size:12px;
  height:34px;
  align-self:flex-start;
  white-space:nowrap;
}
.comment-form{
  margin-top:10px;
  display:flex;
  gap:10px;
  align-items:flex-start;
  flex-wrap:wrap;
}
.comment-form textarea{
  border:1px solid #ddd;
  padding:10px;
  width:min(720px, 100%);
  min-height:80px;
  font-size:13px;
  outline:none;
  resize:vertical;
}
.comment-form button{
  border:0;
  background:#4b3f3b;
  color:#fff;
  padding:10px 16px;
  font-weight:900;
  cursor:pointer;
  height:44px;
}

/* ===== 글쓰기 모달 ===== */
.modal-bg{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.45);
  display:none;
  align-items:center;
  justify-content:center;
  z-index:9999;
  padding:20px;
}
.modal{
  width:min(720px, 96vw);
  background:#fff;
  border-radius:6px;
  overflow:hidden;
  border:1px solid #eaeaea;
  box-shadow:0 20px 50px rgba(0,0,0,.25);
}
.modal-header{
  background:#4b3f3b;
  color:#fff;
  padding:14px 16px;
  display:flex;
  justify-content:space-between;
  align-items:center;
}
.modal-header b{ font-size:14px; }
.modal-header button{
  border:0;
  background:transparent;
  color:#fff;
  font-size:22px;
  cursor:pointer;
  line-height:1;
}
.modal-body{
  padding:14px 16px 16px 16px;
  display:flex;
  flex-direction:column;
  gap:10px;
}
.modal-body input,
.modal-body textarea,
.modal-body select{
  border:1px solid #ddd;
  padding:10px 10px;
  font-size:13px;
  outline:none;
  background:#fff;
}
.modal-body textarea{ min-height:180px; resize:vertical; }
.modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  padding:0 16px 16px 16px;
}
.modal-actions .cancel{
  border:1px solid #ddd;
  background:#fff;
  padding:10px 14px;
  cursor:pointer;
  font-weight:800;
}
.modal-actions .submit{
  border:0;
  background:#c44a2f;
  color:#fff;
  padding:10px 14px;
  cursor:pointer;
  font-weight:900;
}

/* ===== 하단 ===== */
.community-footerbar{
  padding:14px 18px 22px 18px;
  border-top:1px solid #ededed;
  background:#fff;
}
.pagination{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  margin:6px 0 16px 0;
  flex-wrap:wrap;
}
.page-btn{
  border:1px solid #ddd;
  background:#fff;
  padding:6px 10px;
  cursor:pointer;
  color:#333;
  min-width:34px;
  text-align:center;
}
.page-btn.active{
  border-color:#c44a2f;
  color:#c44a2f;
  font-weight:800;
}
.page-btn:disabled{ opacity:.45; cursor:not-allowed; }

.searchbar{
  display:flex;
  justify-content:center;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
}
.searchbar select,
.searchbar input{
  border:1px solid #ddd;
  padding:10px 10px;
  font-size:13px;
  outline:none;
  background:#fff;
  min-width:110px;
}
.searchbar input{ min-width:min(520px, 90vw); }
.searchbar button{
  border:0;
  background:#c44a2f;
  color:#fff;
  padding:10px 18px;
  font-weight:800;
  cursor:pointer;
}
.searchbar button:hover{ filter:brightness(0.95); }

/* ===== 토스트 ===== */
.toast{
  position:fixed;
  right:18px;
  bottom:18px;
  background:#111;
  color:#fff;
  padding:10px 12px;
  border-radius:6px;
  font-size:13px;
  opacity:0;
  transform:translateY(8px);
  transition:.18s;
  z-index:10000;
  pointer-events:none;
  max-width:min(520px, 92vw);
  white-space:pre-wrap;
}
.toast.show{ opacity:1; transform:translateY(0); }
