/* 게시판 전용 스타일 — Unite 테마. styles.css 뒤에 로드 */

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- 게시판 히어로 (핑크 밴드) ------------------------------------------- */

.board-hero {
  background: var(--pink);
  padding: 76px 0 64px;
}

.board-hero h1 {
  color: var(--navy);
  font-size: clamp(32px, 4.2vw, 48px);
  margin-bottom: 8px;
}

.board-hero-lead {
  color: #4a2733;
  font-size: 18px;
  margin: 0;
}

.board-section {
  padding-top: 56px;
}

/* --- 툴바 (알약 탭 + 검색) ------------------------------------------------ */

.board-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 28px;
}

.board-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.board-tabs a {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 24px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  color: var(--navy);
  transition: background 0.15s ease, color 0.15s ease;
}

.board-tabs a:hover {
  background: var(--cream);
}

.board-tabs a.is-active {
  background: var(--navy);
  color: #fff;
}

#board-search {
  display: flex;
  gap: 8px;
}

#board-search input {
  font-family: var(--font-body);
  font-size: 15px;
  padding: 10px 20px;
  min-width: 220px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}

#board-search input:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

#board-search button {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 26px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

#board-search button:hover {
  background: var(--green-deep);
}

.board-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.board-write {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  padding: 10px 22px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.board-write:hover,
.board-write:focus-visible {
  background: #fff;
  color: var(--navy);
}

/* --- 목록 (카드형 행) ------------------------------------------------------ */

.board-count {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}

.board-table {
  list-style: none;
  margin: 0 0 36px;
  padding: 0;
  display: grid;
  gap: 12px;
}

.board-row a {
  display: grid;
  grid-template-columns: 56px 100px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 18px 26px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.board-row a:hover {
  border-color: var(--navy);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(1, 34, 65, 0.08);
}

.board-row.is-pinned a {
  background: var(--cream);
  border-color: var(--cream);
}

.row-no {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

.is-pinned .row-no {
  color: var(--green);
}

.row-cat {
  justify-self: start;
  background: var(--pink);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.row-title {
  color: var(--navy);
  font-weight: 700;
}

.row-date {
  font-size: 14px;
  color: var(--muted);
}

.row-arrow {
  color: var(--green);
  font-weight: 700;
}

.board-empty {
  padding: 48px;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1.5px dashed var(--line);
  border-radius: var(--radius-card);
}

/* --- 페이지네이션 ------------------------------------------------------------ */

.board-pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
}

.board-pagination button {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  width: 42px;
  height: 42px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.board-pagination button:hover {
  border-color: var(--navy);
}

.board-pagination button[aria-current="page"] {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* --- 상세 -------------------------------------------------------------------- */

.board-detail {
  max-width: 820px;
}

.post-header {
  border-bottom: 2px solid var(--navy);
  padding-bottom: 24px;
  margin-bottom: 32px;
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 16px;
}

.post-cat {
  background: var(--pink);
  color: var(--navy);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.post-header h1 {
  font-size: clamp(26px, 3.4vw, 36px);
  margin: 0;
}

.post-body {
  font-size: 17px;
  color: var(--body);
}

.post-body p {
  margin-bottom: 1.2em;
}

.post-body ul {
  padding-left: 22px;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-attachments {
  margin-top: 40px;
  background: var(--cream);
  border-radius: var(--radius-card);
  padding: 24px 28px;
}

.post-attachments p {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 10px;
}

.post-attachments ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-attachments a {
  font-weight: 700;
  color: var(--green);
  text-decoration: underline;
}

/* --- 이전/다음, 목록으로 -------------------------------------------------------- */

.post-nav {
  display: grid;
  gap: 10px;
  margin-top: 48px;
}

.post-nav a {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  align-items: center;
  padding: 16px 24px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  transition: border-color 0.15s ease;
}

.post-nav a:hover {
  border-color: var(--navy);
}

.post-nav span {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--green);
}

.post-nav strong {
  color: var(--navy);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.post-back {
  margin-top: 40px;
  text-align: center;
}

/* --- 관리자 (admin.html) ------------------------------------------------------- */

/* display를 지정한 요소가 hidden 속성을 무시하지 않도록 강제 */
[hidden] {
  display: none !important;
}

.admin-login {
  max-width: 420px;
  margin: 24px auto;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.admin-login h2 {
  font-size: 22px;
  margin-bottom: 8px;
}

.admin-login label {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
}

.admin-login input {
  font-family: var(--font-body);
  font-size: 15.5px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}

.admin-login input:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.admin-login button {
  margin-top: 10px;
  cursor: pointer;
}

.admin-error {
  color: #c02537;
  font-weight: 600;
  font-size: 14px;
  margin: 4px 0 0;
}

.admin-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.admin-toolbar .board-count {
  margin: 0;
}

.admin-toolbar button {
  cursor: pointer;
}

/* 관리자 목록 행: a 없이 li 바로 아래 셀이 온다 */
.board-row.admin-row {
  display: grid;
  grid-template-columns: 56px 100px 1fr auto auto;
  align-items: center;
  gap: 20px;
  padding: 14px 26px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
}

.board-row.admin-row.is-pinned {
  background: var(--cream);
  border-color: var(--cream);
}

.admin-row-actions {
  display: flex;
  gap: 8px;
}

.admin-row-actions button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13.5px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1.5px solid var(--navy);
  background: #fff;
  color: var(--navy);
  cursor: pointer;
}

.admin-row-actions button:hover {
  background: var(--navy);
  color: #fff;
}

.admin-row-actions button.is-danger {
  border-color: #c02537;
  color: #c02537;
}

.admin-row-actions button.is-danger:hover {
  background: #c02537;
  color: #fff;
}

.admin-form {
  max-width: 820px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-card);
  padding: 36px 34px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-form h2 {
  font-size: 24px;
}

.admin-form label {
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-top: 10px;
}

.admin-form input[type="text"],
.admin-form input[type="date"],
.admin-form select,
.admin-form textarea {
  font-family: var(--font-body);
  font-size: 15.5px;
  padding: 11px 16px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
}

.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  outline: 2px solid var(--green);
  outline-offset: 1px;
}

.admin-form textarea {
  resize: vertical;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 14px;
  line-height: 1.6;
}

.admin-form-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: end;
}

.admin-form-row > div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  cursor: pointer;
  grid-column: 1 / -1;
}

.admin-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--green);
}

.admin-attachments {
  margin-top: 14px;
  background: var(--bg-soft, #f4f6fb);
  border-radius: 14px;
  padding: 16px 20px;
}

.admin-attachments p {
  font-weight: 700;
  color: var(--navy);
  font-size: 14px;
  margin: 0 0 8px;
}

.admin-attachments ul {
  list-style: none;
  margin: 0 0 10px;
  padding: 0;
  display: grid;
  gap: 6px;
}

.admin-attachments a {
  color: var(--green);
  font-weight: 600;
  text-decoration: underline;
}

.admin-attachments ul button {
  margin-left: 8px;
  font-size: 12.5px;
  padding: 3px 12px;
  border-radius: 999px;
  border: 1px solid #c02537;
  color: #c02537;
  background: #fff;
  cursor: pointer;
}

.admin-form-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.admin-form-actions button {
  cursor: pointer;
}

.site-nav .admin-logout {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  border: 0;
  cursor: pointer;
}

@media (max-width: 720px) {
  .board-row.admin-row {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "cat actions"
      "title actions"
      "date actions";
    gap: 4px 14px;
  }

  .admin-row .row-no {
    display: none;
  }

  .admin-row .row-cat {
    grid-area: cat;
  }

  .admin-row .row-title {
    grid-area: title;
    white-space: normal;
  }

  .admin-row .row-date {
    grid-area: date;
  }

  .admin-row .admin-row-actions {
    grid-area: actions;
    flex-direction: column;
  }

  .admin-form-row {
    grid-template-columns: 1fr;
  }
}

/* --- 반응형 ---------------------------------------------------------------------- */

@media (max-width: 720px) {
  .board-hero {
    padding: 56px 0 48px;
  }

  .board-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .board-tabs a {
    flex: 1;
    text-align: center;
    padding: 10px 14px;
  }

  #board-search input {
    flex: 1;
    min-width: 0;
  }

  .board-row a {
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "cat arrow"
      "title arrow"
      "date arrow";
    gap: 6px 16px;
    padding: 18px 22px;
  }

  .row-no {
    display: none;
  }

  .row-cat {
    grid-area: cat;
  }

  .row-title {
    grid-area: title;
    white-space: normal;
  }

  .row-date {
    grid-area: date;
  }

  .board-row .row-arrow {
    grid-area: arrow;
  }
}

@media (max-width: 720px) {
  .board-actions {
    flex-direction: column;
    align-items: stretch;
  }

  #board-search {
    width: 100%;
  }

  .board-write {
    justify-content: center;
  }
}
