:root {
  --board-gap: 24px;
}

/*
  기존 게시판(Google Sheets 연동) 임시 비활성화 스위치 (2026-09-07)
  - board.html의 .board-section에 .board-legacy-hidden 클래스를 추가해 이 규칙으로 화면 전체를 숨깁니다.
  - Google Sheets 연동, 검색/카테고리 필터, 페이지네이션, PDF 관련 코드는 전부 그대로 보존되어 있습니다.
  - 재활성화 방법: board.html에서 <section class="board-section board-legacy-hidden"> 중
    board-legacy-hidden 클래스만 제거하면 기존 게시판 UI가 그대로 복구됩니다.
*/
.board-legacy-hidden {
  display: none !important;
}

.board-main {
  padding-bottom: 96px;
}

.board-intro {
  padding: 80px 0 0;
}

.board-intro .section-sub {
  margin: 0;
}

.board-section {
  padding: 40px 0 96px;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
}

@media (max-width: 640px) {
  .board-intro { padding-top: 52px; }
}

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}

.board-summary {
  font-size: 0.95rem;
  color: var(--text-light);
}

/* ── Board filter bar (category tabs) + search (in toolbar) ──── */
.board-filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 24px;
}

.board-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.board-category-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  min-width: 0;
}

.board-category-tab {
  flex: 0 0 auto;
  padding: 9px 16px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--white);
  color: var(--text-body);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.board-category-tab:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.board-category-tab.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.board-search-form {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: 100%;
  max-width: 360px;
}

.board-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-body);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color var(--transition);
}

.board-search-input:focus {
  outline: none;
  border-color: var(--teal);
}

.board-search-input::-webkit-search-cancel-button {
  display: none;
}

.board-search-clear {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1;
  transition: border-color var(--transition), color var(--transition);
}

.board-search-clear:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.board-search-submit {
  flex: 0 0 auto;
  height: 42px;
  padding: 0 18px;
  border: 1px solid var(--navy);
  border-radius: var(--radius-sm);
  background: var(--navy);
  color: var(--white);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  transition: background var(--transition), border-color var(--transition);
}

.board-search-submit:hover {
  background: var(--navy-medium);
  border-color: var(--navy-medium);
}

@media (max-width: 640px) {
  .board-filter-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }

  .board-category-tabs {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    padding-bottom: 4px;
    margin: 0 -4px;
    padding-left: 4px;
    padding-right: 4px;
  }

  .board-category-tab {
    font-size: 0.82rem;
    padding: 8px 14px;
  }

  .board-search-form {
    max-width: none;
  }
}

/* ── Board table ──────────────────────────────────────────── */
.board-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.board-table tbody tr {
  opacity: 0;
  transition: opacity 0.5s cubic-bezier(.22, 1, .36, 1);
}

.board-table tbody tr.is-visible {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .board-table tbody tr {
    transition: none;
    opacity: 1;
  }
}

.board-table thead th {
  padding: 14px 12px;
  border-top: 2px solid var(--navy);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  color: var(--navy);
  font-weight: 700;
  font-size: 0.88rem;
  white-space: nowrap;
}

.board-table tbody td {
  padding: 17px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--border);
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-body);
}

.board-table th:first-child,
.board-table td:first-child {
  width: 72px;
  text-align: center;
  color: var(--text-light);
  font-variant-numeric: tabular-nums;
}

.board-table th:nth-child(3),
.board-table td:nth-child(3) {
  width: 150px;
  text-align: center;
  white-space: nowrap;
}

.board-table th:last-child,
.board-table td:last-child {
  width: 120px;
  text-align: center;
  color: var(--text-light);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.board-keyword-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--blue-gray);
  color: var(--navy);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.board-table tbody tr:hover td {
  background: var(--gray-50);
}

.board-table tbody tr.board-row-filler:hover td {
  background: none;
}

.board-title-link {
  color: var(--navy);
  font-weight: 600;
  word-break: keep-all;
}

.board-title-link:hover,
.board-title-link:focus-visible {
  color: var(--teal);
}

.board-table-message td {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-body);
}

.board-table-message strong {
  display: block;
  font-size: 1.125rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.board-table-message p {
  margin-bottom: 16px;
}

.board-skeleton-line {
  height: calc(var(--text-body) * 1.5);
  width: 55%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: board-shimmer 1.2s linear infinite;
}

@keyframes board-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

.board-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 40px;
  min-height: 42px;
}

.board-page-btn,
.board-page-nav {
  min-width: 42px;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--navy);
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.board-page-btn:hover,
.board-page-nav:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.board-page-btn[aria-current="page"] {
  background: var(--yellow);
  border-color: var(--yellow);
  color: var(--navy);
}

.board-page-nav.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}

.board-state {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-body);
}

.board-state strong {
  display: block;
  font-size: 1.125rem;
  color: var(--navy);
  margin-bottom: 8px;
}

.board-state p {
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  .board-section {
    padding: 56px 0 72px;
  }

  .board-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .board-table {
    min-width: 0;
  }

  .board-table th,
  .board-table td {
    padding: 14px 12px;
    font-size: 0.88rem;
  }

  .board-table th:first-child,
  .board-table td:first-child {
    width: 46px;
  }

  .board-table th:nth-child(3),
  .board-table td:nth-child(3) {
    width: 96px;
    white-space: normal;
  }

  .board-keyword-tag {
    padding: 3px 8px;
    font-size: 0.72rem;
    white-space: normal;
    word-break: keep-all;
  }

  .board-table th:last-child,
  .board-table td:last-child {
    width: 92px;
    font-size: 0.8rem;
  }

  .board-page-btn,
  .board-page-nav {
    min-width: 38px;
    min-height: 38px;
    padding: 0 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .board-skeleton-line {
    animation: none;
  }
}
