/* ========================================
   서브페이지 공통 스타일
   ======================================== */

/* ── 서브페이지 히어로 (페이지 헤더) ── */
.subpage-hero {
  background: linear-gradient(135deg, rgba(107,158,122,.10) 0%, rgba(232,168,124,.08) 100%);
  padding: 56px 0 44px;
  border-bottom: 1px solid var(--color-border);
}
.breadcrumb-nav {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--color-text-muted);
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.breadcrumb-nav a { color: var(--color-text-muted); text-decoration: none; transition: color var(--transition); }
.breadcrumb-nav a:hover { color: var(--color-primary); }
.breadcrumb-sep { color: #CCC; font-size: 12px; }
.breadcrumb-current { color: var(--color-primary); font-weight: 500; }
.subpage-title {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
  line-height: 1.3;
}
.subpage-subtitle {
  font-size: 16px;
  color: var(--color-text-muted);
  margin: 0;
}

/* ── 서브 네비 (좌측 메뉴) ── */
.sub-nav-card {
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 8px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: calc(var(--top-offset) + 20px);
}
.sub-nav-title {
  font-size: 13px; font-weight: 700;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 6px;
}
.sub-nav-list { list-style: none; padding: 0; margin: 0; }
.sub-nav-item a {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  font-size: 14px; color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  text-decoration: none;
}
.sub-nav-item a:hover { background: var(--color-primary-light); color: var(--color-primary); }
.sub-nav-item a.active {
  background: var(--color-primary);
  color: #fff;
  font-weight: 500;
}
.sub-nav-item a.active::before {
  content: '';
  width: 4px; height: 4px;
  background: #fff;
  border-radius: 50%;
}

/* ── 콘텐츠 영역 ── */
.subpage-content {
  padding: 48px 0 80px;
}
.content-card {
  background: #fff;
  border-radius: var(--radius-xl);
  padding: 40px 48px;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}
@media (max-width: 767px) {
  .content-card { padding: 24px 20px; border-radius: var(--radius-lg); }
}

/* HTML 콘텐츠 (관리자가 입력한 HTML) */
.html-content { line-height: 1.85; }
.html-content h1, .html-content h2, .html-content h3,
.html-content h4, .html-content h5, .html-content h6 {
  color: var(--color-text);
  font-weight: 700;
  margin-top: 1.8em;
  margin-bottom: .6em;
}
.html-content h2 {
  font-size: 22px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-primary-light);
}
.html-content p { margin-bottom: 1.2em; }
.html-content ul, .html-content ol { padding-left: 1.5rem; margin-bottom: 1.2em; }
.html-content li { margin-bottom: .4em; }
.html-content blockquote {
  border-left: 4px solid var(--color-primary);
  padding: 16px 20px;
  background: var(--color-primary-light);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.5em 0;
  font-style: italic;
  color: var(--color-text-muted);
}
.html-content img { border-radius: var(--radius-md); max-width: 100%; height: auto; display: block; margin: 8px 0; }
.html-content iframe { max-width: 100%; }
/* 본문 링크: 전역 CSS 덮어쓰기 */
.html-content a { color: #1E88E5; text-decoration: underline; }
.html-content a:hover { color: #1565C0; }
.html-content table {
  width: 100%; border-collapse: collapse;
  margin: 1.5em 0; font-size: 15px;
}
.html-content th {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 12px 16px;
  font-weight: 600;
  text-align: left;
}
.html-content td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--color-border);
}
.html-content tr:hover td { background: rgba(107,158,122,.03); }

/* 로딩 스피너 */
.content-loading {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 200px; gap: 16px;
  color: var(--color-text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--color-primary-light);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 빈 콘텐츠 */
.content-empty {
  text-align: center; padding: 60px 20px;
  color: var(--color-text-muted);
}
.content-empty-icon { font-size: 48px; margin-bottom: 16px; }
.content-empty-title { font-size: 18px; font-weight: 600; color: var(--color-text); margin-bottom: 8px; }
.content-empty-text { font-size: 14px; }

/* ══════════════════════════════════════
   게시판 공통
══════════════════════════════════════ */

/* ── 게시판 툴바 ── */
.board-toolbar {
  display: flex; align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.board-count {
  font-size: 14px; color: var(--color-text-muted);
}
.board-count strong { color: var(--color-primary); font-weight: 700; }
.board-search-wrap {
  position: relative;
  flex-shrink: 0;
}
.board-search-icon {
  position: absolute; left: 12px; top: 50%;
  transform: translateY(-50%);
  color: #AAA; pointer-events: none;
}
.board-search {
  height: 40px;
  width: 220px;
  padding: 0 16px 0 38px;
  border: 1.5px solid #E0E0E0;
  border-radius: 50px;
  font-size: 14px;
  font-family: var(--font-main);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  background: #fff;
}
.board-search:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(107,158,122,.12);
}
@media (max-width: 575px) { .board-search { width: 100%; } }

/* ── 공지사항 목록 테이블 ── */
.notice-table {
  width: 100%;
  border-collapse: collapse;
}
.notice-table thead th {
  font-size: 13px; font-weight: 600;
  color: var(--color-text-muted);
  padding: 12px 16px;
  border-bottom: 2px solid var(--color-border);
  background: #FAFAFA;
  white-space: nowrap;
}
.notice-table thead th:first-child { border-radius: var(--radius-sm) 0 0 0; }
.notice-table thead th:last-child  { border-radius: 0 var(--radius-sm) 0 0; }
.notice-table tbody tr {
  border-bottom: 1px solid #F5F5F5;
  transition: background var(--transition);
  cursor: pointer;
}
.notice-table tbody tr:hover { background: var(--color-primary-light); }
.notice-table td {
  padding: 14px 16px;
  font-size: 14px;
  vertical-align: middle;
}
.notice-num {
  width: 60px; text-align: center;
  color: var(--color-text-muted);
}
.notice-title-cell { max-width: 0; } /* flex 트릭으로 말줄임 */
.notice-title-link {
  display: flex; align-items: center; gap: 8px;
  color: var(--color-text);
  text-decoration: none;
  font-size: 15px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.notice-title-link:hover { color: var(--color-primary); }
.notice-pin-badge {
  flex-shrink: 0;
  display: inline-block;
  padding: 2px 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 11px; font-weight: 600;
  border-radius: 50px;
}
.notice-author, .notice-date, .notice-views {
  white-space: nowrap;
  text-align: center;
  color: var(--color-text-muted);
  font-size: 13px;
}
@media (max-width: 767px) {
  .notice-author, .notice-views { display: none; }
}

/* ── 페이지네이션 ── */
.board-pagination {
  display: flex; align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 28px;
}
.page-btn {
  width: 36px; height: 36px;
  border: 1.5px solid #E0E0E0;
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 13px; font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  font-family: var(--font-main);
}
.page-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.page-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.page-btn:disabled { opacity: .35; cursor: default; }

/* ── 게시글 상세 ── */
.detail-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 28px;
}
.detail-category-badge {
  display: inline-block;
  padding: 4px 12px;
  background: var(--color-primary-light);
  color: var(--color-primary);
  font-size: 13px; font-weight: 600;
  border-radius: 50px;
  margin-bottom: 12px;
}
.detail-title {
  font-size: clamp(20px, 3vw, 28px);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.4;
  margin-bottom: 12px;
}
.detail-meta {
  display: flex; align-items: center; gap: 16px;
  font-size: 13px; color: var(--color-text-muted);
  flex-wrap: wrap;
}
.detail-meta-item { display: flex; align-items: center; gap: 5px; }
.detail-body {
  font-size: 16px; line-height: 1.9;
  color: var(--color-text);
  padding: 4px 0 32px;
}
.detail-body p { margin-bottom: 1.2em; }
.detail-body img { border-radius: var(--radius-md); margin: 1em 0; }

/* 게시글 네비게이션 */
.detail-nav {
  border-top: 1px solid var(--color-border);
  padding-top: 20px;
  margin-top: 12px;
}
.detail-nav-item {
  display: flex; align-items: baseline; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #F5F5F5;
  font-size: 14px;
}
.detail-nav-label {
  flex-shrink: 0; width: 40px;
  font-size: 12px; font-weight: 600;
  color: var(--color-text-muted);
}
.detail-nav-link {
  color: var(--color-text);
  text-decoration: none;
  transition: color var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.detail-nav-link:hover { color: var(--color-primary); }
.detail-nav-empty { color: #CCC; }

/* 목록 돌아가기 버튼 */
.btn-back-list {
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 20px;
  border: 1.5px solid #E0E0E0;
  border-radius: 50px;
  background: #fff;
  font-size: 14px; color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font-main);
  text-decoration: none;
}
.btn-back-list:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* ── 반응형 ── */
@media (max-width: 991px) {
  .sub-nav-card { position: static; margin-bottom: 24px; }
}
@media (max-width: 575px) {
  .subpage-hero { padding: 40px 0 32px; }
  .subpage-content { padding: 32px 0 60px; }
}
