/* 결자해지 — 공용 스타일 (board, notices, faq, admin) */

@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-4Regular.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-5Medium.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-6SemiBold.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-7Bold.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Paperlogy';
  src: url('https://cdn.jsdelivr.net/gh/projectnoonnu/2408-3@1.0/Paperlogy-9Black.woff2') format('woff2');
  font-weight: 900; font-style: normal; font-display: swap;
}

:root {
  --bg: #f5f5f4;
  --surface: #ffffff;
  --text: #1a1916;
  --muted: #6b6965;
  --border: #e4e3e1;
  --accent: #2AC1BC;
  --accent-strong: #22A8A3;
  --accent-light: #E4F7F6;
  --secondary: #FFC94A;
  --coral: #FF8E6B;
  --hover-bg: #ebebea;
  --tag-bg: #ecebe9;
  --tag-text: #545250;
  --deepred: #a52b1e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}

a { color: inherit; }

/* ── 공용 상단 네비 ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-nav-mount { min-height: 64px; }
.site-nav-inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 64px;
}
.site-nav, .site-nav-mount { height: 64px; }
.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--text);
}
.site-brand .brand-logo {
  height: 36px;
  width: auto;
  display: block;
}
.site-menu {
  margin-left: auto;
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.site-menu > li { position: relative; display: flex; }
.site-menu > li > a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 16px;
  height: 64px;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  letter-spacing: -0.3px;
}
.site-menu > li > a:hover {
  background: var(--hover-bg);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-menu > li.active > a {
  background: var(--surface);
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--accent);
}
.site-menu .home-ico { font-size: 16px; line-height: 1; }
.site-menu .caret {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  opacity: 0.7;
  transition: transform 0.15s;
}
.site-menu .dropdown:hover .caret,
.site-menu .dropdown.open .caret { transform: rotate(180deg); }
.site-menu .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0; left: auto;
  min-width: 190px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
  padding: 4px 0;
  list-style: none;
  z-index: 100;
  margin: 0;
}
.site-menu .dropdown:hover > .dropdown-menu,
.site-menu .dropdown.open > .dropdown-menu { display: block; }
.site-menu .dropdown-menu a {
  display: block;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.site-menu .dropdown-menu a:hover {
  background: var(--hover-bg);
  color: var(--text);
}
@media (max-width: 620px) {
  .site-nav-mount, .site-nav, .site-nav-inner { min-height: 60px; height: 60px; }
  .site-brand .brand-logo { height: 32px; }
  .site-menu > li > a { height: 60px; }
}
@media (max-width: 480px) {
  .site-nav-inner { padding: 0 12px; gap: 6px; }
  .site-brand .brand-logo { height: 28px; }
}

/* ── 페이지 컨테이너 ── */
.page {
  max-width: 780px;
  margin: 0 auto;
  padding: 30px 24px 60px;
}
.page-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 24px;
}
.page-title {
  font-family: 'Noto Serif KR', 'Paperlogy', serif;
  font-size: clamp(24px, 4.2vw, 34px);
  font-weight: 900;
  letter-spacing: -1px;
  line-height: 1.2;
}
.page-title em { color: var(--accent); font-style: normal; }
.page-sub {
  margin-top: 8px;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.crumb {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
}
.crumb a { color: var(--muted); text-decoration: none; }
.crumb a:hover { color: var(--text); text-decoration: underline; }

/* ── 버튼 ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  font-size: 13.5px;
  letter-spacing: -0.2px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  line-height: 1.2;
}
.btn:hover { background: var(--hover-bg); }
.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
.btn.primary:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
}
.btn.danger {
  color: var(--deepred);
  border-color: #e5c7c4;
}
.btn.danger:hover { background: #fbf1f0; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--hover-bg); color: var(--text); }
.btn.sm { padding: 6px 10px; font-size: 12px; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── 폼 ── */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field > label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.2px;
}
.field > label .req { color: var(--coral); margin-left: 3px; }
.field-hint { font-size: 11.5px; color: var(--muted); }

.input, .textarea, .select {
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}
.input:focus, .textarea:focus, .select:focus {
  border-color: var(--accent);
}
.textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none' stroke='%236b6965' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='1 1 6 6 11 1'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}
.form-actions.start { justify-content: flex-start; }

/* ── 토스트 / 알림 ── */
.toast-root {
  position: fixed;
  top: 70px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text);
  color: #fff;
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(0,0,0,0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: auto;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--accent-strong); }
.toast.error { background: var(--deepred); }

/* ── 카드/목록 ── */
.card-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.card-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
  transition: border-color 0.15s, box-shadow 0.15s;
  text-decoration: none;
  color: inherit;
  display: block;
}
.card-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.card-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  background: var(--tag-bg);
  color: var(--tag-text);
  border-radius: 12px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.chip.accent { background: var(--accent-light); color: var(--accent-strong); }
.chip.pin { background: var(--secondary); color: #6b4a00; }
.card-title {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.3px;
}
.card-meta {
  margin-top: 6px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}
.card-meta .dot { color: var(--border); }

/* ── 페이지네이션 ── */
.pagination {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 24px;
}
.pagination a, .pagination span {
  min-width: 32px;
  padding: 7px 10px;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.pagination a:hover { background: var(--hover-bg); color: var(--text); }
.pagination .current {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  font-weight: 700;
}
.pagination .disabled {
  opacity: 0.35;
  pointer-events: none;
}

/* ── 본문 뷰 ── */
.post-view {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px 28px;
}
.post-view-title {
  font-size: clamp(19px, 3vw, 24px);
  font-weight: 800;
  letter-spacing: -0.4px;
  line-height: 1.35;
  margin: 8px 0 10px;
}
.post-view-meta {
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.post-view-body {
  padding: 18px 0 10px;
  font-size: 15px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.post-view-actions {
  display: flex;
  gap: 8px;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.post-view-actions .right { display: flex; gap: 6px; }

.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 999px;
  background: var(--surface);
  border: 1.5px solid var(--border);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  transition: all 0.15s;
}
.like-btn:hover { border-color: var(--coral); color: var(--coral); }
.like-btn.liked {
  background: #fff3ef;
  border-color: var(--coral);
  color: var(--coral);
}
.like-btn .heart { font-size: 15px; }

/* ── 댓글 ── */
.comments {
  margin-top: 24px;
}
.comments h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 12px;
  letter-spacing: -0.3px;
}
.comment {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 8px;
}
.comment-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
}
.comment-head .nick { color: var(--text); font-weight: 700; }
.comment-body {
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment-actions {
  margin-top: 6px;
  display: flex;
  gap: 4px;
  justify-content: flex-end;
}

.comment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
}
.comment-form .row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
@media (max-width: 480px) {
  .comment-form .row { grid-template-columns: 1fr; }
}

/* ── 빈 상태 ── */
.empty {
  text-align: center;
  padding: 60px 24px;
  color: var(--muted);
  font-size: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
}
.empty strong { color: var(--text); display: block; margin-bottom: 4px; font-size: 16px; }

.loading {
  text-align: center;
  padding: 40px 24px;
  color: var(--muted);
  font-size: 13px;
}

/* ── 필터·검색 (목록) ── */
.list-controls {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.list-controls .search {
  position: relative;
  flex: 1 1 260px;
}
.list-controls .search input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 6px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  font: inherit;
  font-size: 14px;
}
.list-controls .search input:focus { border-color: var(--accent); outline: none; }
.list-controls .cat-select { flex: 0 0 auto; }

.cat-chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.cat-chip {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
}
.cat-chip:hover { background: var(--hover-bg); color: var(--text); }
.cat-chip.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ── FAQ 아코디언 ── */
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-item {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.faq-item:hover {
  border-color: #cfccc7;
}
.faq-item.open {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(42, 193, 188, 0.10);
}
.faq-q {
  width: 100%;
  text-align: left;
  background: transparent;
  border: none;
  padding: 16px 18px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  letter-spacing: -0.3px;
}
.faq-q .q-badge {
  flex: none;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--accent-light);
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, color 0.18s;
}
.faq-item.open .faq-q .q-badge {
  background: var(--accent);
  color: #fff;
}
.faq-q .q-text { flex: 1; line-height: 1.5; }
.faq-q .arrow {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  background: transparent;
  transition: transform 0.25s ease, color 0.18s;
}
.faq-item.open .faq-q .arrow {
  transform: rotate(180deg);
  color: var(--accent-strong);
}
.faq-a {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.25s ease;
}
.faq-a-inner {
  overflow: hidden;
  min-height: 0;
}
.faq-a-text {
  margin: 0 18px 16px 56px;
  padding: 14px 16px;
  background: var(--accent-light);
  border-radius: 10px;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}
.faq-item.open .faq-a { grid-template-rows: 1fr; }
@media (max-width: 560px) {
  .faq-a-text { margin-left: 18px; }
}

/* ── 모달 ── */
.modal-root {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.45);
  padding: 20px;
}
.modal-root.show { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  max-width: 420px;
  width: 100%;
  padding: 22px 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.modal h3 {
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 4px;
}
.modal p {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}
