/* ===============================
   기본 설정
=============================== */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

body {
  margin: 0;
  padding: 0;
  font-family: 'Open Sans', '맑은 고딕', sans-serif;
  background-color: #f5f6fa;
  color: #333;
}

a {
  text-decoration: none;
  color: inherit;
}

a:hover {
  color: #4c4cff;
}

/* ===============================
   컨테이너 레이아웃
=============================== */
.container {
  display: grid;
  grid-template-columns: 3fr 1fr;  /* 본문 + 오른쪽 */
  gap: 20px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

.main-area {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 60px;
}

.rightAside {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ===============================
   제목
=============================== */
.headerB {
  font-family: 'Oswald', sans-serif;
  font-size: 48px;
  font-weight: 700;
  color: #4c4cff;
  text-align: center;
  margin: 30px 0;
}

/* ===============================
   게시글 카드 (table.a)
=============================== */
table.a {
  width: 100%;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  border-collapse: collapse;
}

table.a th {
  width: 120px;
  text-align: center;
  padding: 12px;
  background: #f8f9fa;
  border-right: 1px solid #eee;
  font-weight: 600;
  color: #444;
}

table.a td {
  padding: 12px 16px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  word-break: break-word;
}
table.a td.content {
  min-height: 200px;     /* 기본 높이 확보 */
  height: auto;          /* 내용 많으면 늘어남 */
  line-height: 1.6;      /* 줄간격 조금 넓혀줌 */
  padding: 16px;
  vertical-align: top;
  word-break: break-word; /* 긴 단어 줄바꿈 */
  white-space: pre-line; /* 줄바꿈(\n) 유지, 여러 공백은 1칸 처리 */
}

/* ===============================
   댓글 리스트 (table.b)
=============================== */
table.b {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  margin: 15px 0;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

/* 댓글 한 줄 구분 */
table.b tr {
  border-bottom: 1px solid #eee;
}

table.b tr:last-child {
  border-bottom: none;
}

/* 댓글 본문 */
table.b td.cont {
  padding: 10px;
  font-size: 14px;
  color: #333;
  vertical-align: top;
}

/* 댓글 작성자 */
table.b td.cont strong {
  display: block;
  font-size: 14px;
  color: #222;
  margin-bottom: 4px;
}

/* 댓글 날짜 */
.comment-date {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
  display: block;
}

/* ===============================
   댓글 프로필 이미지
=============================== */
.profile {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ddd;
  margin-top: 5px;
  margin-left: 5px;
}
table.b td.img-box {
  width: 50px;       /* 프로필 셀 고정 */
  padding: 0;        /* 내부 여백 제거 */
  vertical-align: top;
  white-space: nowrap;
}

/* ===============================
   댓글 입력 박스
=============================== */
.replyin_box {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 16px;
  box-shadow: 0 2px 6px rgba(0,0,0,.05);
  display: none;
}

.replyin_box textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  font-size: 14px;
  resize: vertical;
}

.replyin_box button {
  margin-top: 10px;
  background: #ff6f00;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  color: white;
  font-size: 14px;
  cursor: pointer;
  transition: background .2s;
}

.replyin_box button:hover {
  background: #e65c00;
}

/* ===============================
   버튼 (본문/댓글 공통)
=============================== */
table.a button,
table.b button {
  background: #4c4cff;
  border: none;
  border-radius: 4px;
  padding: 5px 10px;
  margin-left: 4px;
  color: white;
  font-size: 12px;
  cursor: pointer;
  transition: background .2s;
}

table.a button:hover,
table.b button:hover {
  background: #3a3ac9;
}
table.b td.updateForm {
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center;  /* 세로 가운데 정렬 */
  gap: 6px;
  padding: 6px 10px;
}

/* ===============================
   드롭다운 (신고하기)
=============================== */
.dropdown {
  position: relative;
  display: inline-block;
}

.dropbtn {
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  color: #333;
}

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #fff;
  border: 1px solid #ddd;
  min-width: 120px;
  box-shadow: 0px 4px 10px rgba(0,0,0,0.15);
  z-index: 10;
  border-radius: 6px;
}

.dropdown-content a {
  color: #333;
  padding: 10px 14px;
  text-decoration: none;
  display: block;
  font-size: 14px;
}

.dropdown-content a:hover {
  background-color: #f5f5f5;
}

.show {
  display: block;
}

/* ===============================
   페이징
=============================== */
.pagination {
  text-align: center;
  margin: 20px 0;
}

.pagination a,
.pagination span {
  margin: 0 5px;
  padding: 6px 10px;
  border-radius: 4px;
  text-decoration: none;
  font-size: 14px;
}

.pagination a {
  color: #4c4cff;
  border: 1px solid #4c4cff;
  transition: all 0.2s;
}

.pagination a:hover {
  background: #4c4cff;
  color: white;
}

.active-page {
  font-weight: bold;
  color: white;
  background: #ff6f00;
  border: 1px solid #ff6f00;
}

/* ===============================
   반응형
=============================== */
@media screen and (max-width: 1200px) {
  .headerB { font-size: 40px; }
  .container { grid-template-columns: 2fr 1fr; }
}

@media screen and (max-width: 768px) {
  .headerB { font-size: 32px; }
  .container { grid-template-columns: 1fr; }
  .rightAside { order: 2; }
}

@media screen and (max-width: 480px) {
  .headerB { font-size: 26px; }
}
