/* ===== 레이아웃 ===== */
.board-layout {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  gap: 24px;
}

.board-page {
  width: 100%;
  background-color: white;
}

.board-ads {
  width: 100%;
  min-width: 300px; /* 최소 너비 확보 */
  text-align: center;
  padding: 16px;
  box-sizing: border-box;
}

/* ===== 게시판 헤더 ===== */
.board-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding: 0 16px;
}

.board-title {
  font-size: 22px;
  font-weight: bold;
  color: var(--primary-color);
}

.write-button {
  background-color: var(--primary-color);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

/* ===== 게시판 테이블 공통 ===== */
.board-table {
  border-top: 2px solid var(--primary-color);
}

.board-header-row,
.vote-board-header-row {
  display: grid;
  background-color: #f8f8f8;
  font-weight: bold;
  align-items: center;
  padding: 10px 16px;
  gap: 10px;
}

.board-row,
.post-row,
.vote-board-row,
.vote-row {
  display: grid;
  align-items: center;
  padding: 10px 16px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  background-color: white;
  gap: 10px;
}

.board-row:hover,
.post-row:hover,
.vote-board-row:hover,
.vote-row:hover {
  background-color: #f9f9f9;
}

/* ===== PC 레이아웃 ===== */
@media (min-width: 1024px) {
  .board-layout {
    flex-direction: row;
    align-items: flex-start;
  }

  .board-page {
    width: calc(100% - 160px);
  }

  .board-ads {
    width: 150px;
    padding: 0 12px;
  }

  .board-header-row,
  .board-row {
    grid-template-columns: 60px 100px 1fr 120px 80px;
  }

  .vote-board-header-row,
  .vote-board-row,
  .vote-row {
    grid-template-columns: 60px 100px 1fr 80px 120px;
  }

  .post-row {
    grid-template-columns: 60px 100px 1fr 120px 80px;
  }
}

/* ===== 모바일 레이아웃 ===== */
@media (max-width: 767px) {
  .board-layout {
    flex-direction: column;
    gap: 16px;
  }

  .board-header-row,
  .board-row {
    grid-template-columns: 60px 1fr 100px;
  }

  .vote-board-header-row,
  .vote-board-row,
  .vote-row {
    grid-template-columns: 100px 1fr 60px;
  }

  .post-row {
    grid-template-columns: 60px 1fr 100px;
  }

  .vote-status,
  .vote-title,
  .vote-count {
    font-size: 13px;
  }

  .post-time,
  .vote-number,
  .post-category {
    display: none;
  }
}

/* ===== 공통 요소 스타일 ===== */
.vote-status {
  display: inline-block;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
  min-width: 60px;
}

.vote-status-label {
  display: inline-block;
  padding: 2px 8px;
  background-color: #e8f8f5;
  color: var(--primary-color);
  font-size: 12px;
  border-radius: 12px;
}

.vote-title,
.post-title {
  color: #222;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 4px;
}

.vote-title a,
.post-title a {
  color: inherit;
  text-decoration: none;
}

.vote-title a:hover,
.post-title a:hover {
  text-decoration: underline;
  color: var(--primary-color);
}

.vote-count,
.post-meta {
  font-size: 13px;
  text-align: center;
  color: #666;
  white-space: nowrap;
  line-height: 1.4;
}

.comment-count {
  font-size: 13px;
  color: var(--primary-color);
  margin-left: 4px;
}

/* ===== 공지글 ===== */
.notice-row {
  background-color: #fff9db;
  font-weight: bold;
  border-left: 4px solid #f1c40f;
}

.notice-row .post-title a {
  color: #333;
}

.notice-row .post-title a:hover {
  text-decoration: underline;
}

/* ===== 페이지네이션 ===== */
.pagination {
  padding: 20px 0;
  text-align: center;
}

.pagination a {
  margin: 0 4px;
  padding: 6px 10px;
  text-decoration: none;
  color: #555;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.pagination a.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

/* ===== 번호 정렬 ===== */
.post-number,
.vote-number {
  text-align: center;
}

/* ===== 투표 상태 마감 시간 스타일 ===== */
.vote-status-label.vote-status-normal {
  background-color: #e8f8f5;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.vote-status-label.vote-status-soon {
  background-color: #fff3cd;
  color: #856404;
  border-color: #ffc107;
}

.vote-status-label.vote-status-urgent {
  background-color: #ffe5e5;
  color: #c92a2a;
  border-color: #ff6b6b;
  animation: pulse 2s ease-in-out infinite;
}

.vote-status-label.vote-status-expired {
  background-color: #f1f3f5;
  color: #868e96;
  border-color: #ced4da;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}
