/* ============================================================
   하투스과외 — 교육상담노트 게시판 (board.css)
   메인페이지 enote 디자인 토큰 재사용
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1b2d4f;
  --navy-mid:    #243a5e;
  --navy-light:  #2d4a73;
  --accent:      #6b87b0;
  --warm-bg:     #f7f6f3;
  --white:       #ffffff;
  --gray-50:     #f9fafb;
  --gray-100:    #f3f4f6;
  --gray-200:    #e5e7eb;
  --gray-300:    #d1d5db;
  --gray-400:    #9ca3af;
  --gray-600:    #4b5563;
  --gray-800:    #1f2937;
  --text-main:   #1a1f2e;
  --text-sub:    #52596b;
  --text-light:  #8a919e;
  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   22px;
  --shadow-sm:   0 1px 3px rgba(0,0,0,.07);
  --shadow-md:   0 4px 16px rgba(0,0,0,.09);
  --transition:  0.18s ease;
}

body {
  font-family: 'Noto Sans KR', sans-serif;
  background: var(--warm-bg);
  color: var(--text-main);
  min-height: 100vh;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ─── 공통 레이아웃 ─────────────────────────────────────── */
.board-wrap {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ─── 사이트 헤더 ────────────────────────────────────────── */
.site-header {
  background: var(--navy);
  height: 56px;
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}
.site-header__inner {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-header__logo {
  font-size: 0.9rem;
  font-weight: 800;
  color: rgba(255,255,255,.92);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.site-header__home {
  font-size: 0.78rem;
  color: rgba(255,255,255,.6);
  text-decoration: none;
  padding: 5px 12px;
  border-radius: 6px;
  transition: background var(--transition), color var(--transition);
}
.site-header__home:hover {
  background: rgba(255,255,255,.12);
  color: #fff;
}

/* ─── 페이지 히어로 (타이틀 영역) ──────────────────────── */
.board-hero {
  padding: 56px 0 40px;
  text-align: center;
}
.board-hero__label {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}
.board-hero__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.03em;
  line-height: 1.25;
  margin-bottom: 14px;
}
.board-hero__desc {
  font-size: 0.95rem;
  color: var(--text-sub);
  line-height: 1.7;
}

/* ─── 목록 섹션 ─────────────────────────────────────────── */
.board-section {
  padding-bottom: 80px;
}

/* ─── 글 수 표시 ─────────────────────────────────────────── */
.board-count {
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--navy);
}
.board-count strong {
  color: var(--navy);
  font-weight: 800;
}

/* ─── 목록 (리스트형) ────────────────────────────────────── */
.board-list {
  list-style: none;
}

/* 목록 아이템 */
.board-item {
  border-bottom: 1px solid var(--gray-200);
}
.board-item:first-child {
  border-top: 1px solid var(--gray-200);
}

/* 목록 링크 */
.board-item__link {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 22px 12px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.board-item__link:hover {
  background: var(--gray-50);
}
.board-item__link:hover .board-item__arrow {
  transform: translateX(4px);
  color: var(--navy);
}

/* 썸네일 */
.board-item__thumb {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--gray-200);
  display: block;
}
.board-item__thumb-placeholder {
  width: 80px;
  height: 60px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: var(--gray-300);
}

/* 텍스트 영역 */
.board-item__body {
  flex: 1;
  min-width: 0; /* 말줄임 처리를 위해 필수 */
  display: flex;
  flex-direction: column;
  gap: 5px;
}

/* 제목 (말줄임) */
.board-item__title {
  font-size: clamp(0.95rem, 2.2vw, 1.08rem);
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
  /* 2줄 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

/* 부제 (말줄임) */
.board-item__sub {
  font-size: clamp(0.8rem, 1.8vw, 0.88rem);
  color: var(--text-sub);
  line-height: 1.5;
  /* 1줄 말줄임 */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 작성일 */
.board-item__date {
  font-size: 0.75rem;
  color: var(--text-light);
  white-space: nowrap;
}

/* 화살표 */
.board-item__arrow {
  font-size: 0.9rem;
  color: var(--text-light);
  flex-shrink: 0;
  transition: transform var(--transition), color var(--transition);
}

/* ─── 빈 목록 ───────────────────────────────────────────── */
.board-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-sub);
}
.board-empty__icon {
  font-size: 2.4rem;
  margin-bottom: 12px;
  display: block;
}
.board-empty p {
  font-size: 0.95rem;
  margin-bottom: 24px;
}
.board-empty a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.88rem;
  padding: 10px 24px;
  border: 2px solid var(--navy);
  border-radius: 40px;
  display: inline-block;
  transition: background var(--transition), color var(--transition);
}
.board-empty a:hover {
  background: var(--navy);
  color: #fff;
}

/* ─── 페이지네이션 ───────────────────────────────────────── */
.board-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 44px;
  flex-wrap: wrap;
}
.board-pagination__btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--gray-200);
  border-radius: 8px;
  background: var(--white);
  font-size: 0.85rem;
  font-family: inherit;
  font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all var(--transition);
  white-space: nowrap;
}
.board-pagination__btn:hover:not(:disabled):not(.active) {
  border-color: var(--navy);
  color: var(--navy);
}
.board-pagination__btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 800;
}
.board-pagination__btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* ─── 사이트 푸터 ────────────────────────────────────────── */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,.55);
  text-align: center;
  padding: 28px 24px;
  font-size: 0.78rem;
  line-height: 1.8;
}
.site-footer a {
  color: rgba(255,255,255,.7);
  text-decoration: none;
}
.site-footer a:hover { color: #fff; }

/* ═══════════════════════════════════════════════════════════
   상세페이지 전용
   ═══════════════════════════════════════════════════════════ */

/* ─── 뒤로 가기 브레드크럼 ─────────────────────────────── */
.post-breadcrumb {
  padding: 24px 0 0;
  font-size: 0.8rem;
  color: var(--text-light);
}
.post-breadcrumb a {
  color: var(--text-sub);
  text-decoration: none;
  transition: color var(--transition);
}
.post-breadcrumb a:hover { color: var(--navy); }
.post-breadcrumb span { margin: 0 6px; }

/* ─── 상세 헤더 ─────────────────────────────────────────── */
.post-header {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--gray-200);
  margin-bottom: 40px;
}
.post-header__date {
  font-size: 0.78rem;
  color: var(--text-light);
  font-weight: 500;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
}
.post-header__title {
  font-size: clamp(1.5rem, 4vw, 2.1rem);
  font-weight: 800;
  color: var(--navy);
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  /* 말줄임 없이 전체 표시 */
  word-break: keep-all;
  overflow-wrap: break-word;
}
.post-header__sub {
  font-size: clamp(0.92rem, 2vw, 1.05rem);
  color: var(--text-sub);
  line-height: 1.65;
  font-weight: 400;
  /* 말줄임 없이 전체 표시 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* ─── 대표이미지 ─────────────────────────────────────────── */
.post-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  margin-bottom: 40px;
}

/* ─── 본문 ──────────────────────────────────────────────── */
.post-body {
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.9;
  color: var(--text-main);
  word-break: keep-all;
  overflow-wrap: break-word;
}

/* 본문 서식 */
.post-body h2 {
  font-size: clamp(1.15rem, 3vw, 1.4rem);
  font-weight: 800;
  color: var(--navy);
  margin: 40px 0 16px;
  letter-spacing: -0.02em;
  line-height: 1.35;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--gray-200);
}
.post-body h3 {
  font-size: clamp(1.02rem, 2.5vw, 1.18rem);
  font-weight: 700;
  color: var(--navy-mid);
  margin: 30px 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.4;
}
.post-body p {
  margin-bottom: 20px;
}
.post-body strong, .post-body b {
  font-weight: 700;
  color: var(--text-main);
}
.post-body ul, .post-body ol {
  padding-left: 24px;
  margin-bottom: 20px;
}
.post-body li {
  margin-bottom: 8px;
  line-height: 1.75;
}
.post-body hr {
  border: none;
  border-top: 1px solid var(--gray-200);
  margin: 36px 0;
}
.post-body a {
  color: var(--navy);
  text-decoration: underline;
}
.post-body a:hover { color: var(--navy-light); }

/* ─── 상세 하단 네비게이션 ──────────────────────────────── */
.post-nav {
  margin-top: 64px;
  padding-top: 32px;
  border-top: 1px solid var(--gray-200);
}
.post-nav__list-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--navy);
  text-decoration: none;
  padding: 10px 22px;
  border: 2px solid var(--navy);
  border-radius: 40px;
  margin-bottom: 24px;
  transition: background var(--transition), color var(--transition);
}
.post-nav__list-btn:hover {
  background: var(--navy);
  color: #fff;
}
.post-nav__siblings {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.post-nav__item {
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
  transition: border-color var(--transition), background var(--transition);
}
.post-nav__item:hover {
  border-color: var(--navy);
  background: var(--gray-50);
}
.post-nav__item.next {
  text-align: right;
}
.post-nav__label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.post-nav__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-main);
  /* 2줄 말줄임 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.45;
}
.post-nav__empty {
  background: var(--gray-50);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.82rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════════════════════
   Task 07-3-1: 상세페이지 CTA 블록
   위치: 본문 아래 / 이전·다음 글 내비게이션 위
   디자인: 메인페이지 btn-primary / btn-secondary 토큰 재사용
   ═══════════════════════════════════════════════════════════ */

.post-cta {
  margin-top: 64px;
  margin-bottom: 0;
  border-top: 2px solid var(--navy);
  border-bottom: 1px solid var(--gray-200);
  padding: 52px 0 48px;
}

/* ── Primary 영역 ── */
.post-cta__primary-wrap {
  text-align: center;
}

.post-cta__eyebrow {
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 800;
  color: var(--navy);
  letter-spacing: -0.025em;
  margin-bottom: 18px;
  line-height: 1.3;
}

.post-cta__body {
  font-size: clamp(0.88rem, 2vw, 0.97rem);
  color: var(--text-sub);
  line-height: 1.85;
  margin-bottom: 10px;
  word-break: keep-all;
}
.post-cta__body:last-of-type {
  margin-bottom: 20px;
}

/* 뱃지 행 (11년 상담 경험 · 내신 전문 · 방향 설계) */
.post-cta__badges {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 6px;
  margin-bottom: 32px;
}
.post-cta__badge {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--navy);
  opacity: 0.6;
  letter-spacing: 0.01em;
}
.post-cta__badge-dot {
  font-size: 0.78rem;
  color: var(--gray-300);
}

/* 액션 그룹 (버튼 + 전화번호) */
.post-cta__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Primary Button — 메인페이지 .btn-primary 토큰 동일 적용 */
.post-cta__btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 36px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(27,45,79,.26);
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.post-cta__btn-primary:hover {
  background: var(--navy-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(27,45,79,.32);
}
.post-cta__btn-primary:active {
  transform: translateY(0);
}

/* 전화번호 텍스트 */
.post-cta__tel {
  font-size: 0.82rem;
  color: var(--text-light);
  line-height: 1;
  margin: 0;
}
.post-cta__tel-link {
  color: var(--text-sub);
  font-weight: 700;
  text-decoration: none;
  transition: color var(--transition);
}
.post-cta__tel-link:hover {
  color: var(--navy);
}

/* ── 구분선 ── */
.post-cta__divider {
  width: 48px;
  height: 1px;
  background: var(--gray-200);
  margin: 36px auto;
}

/* ── Secondary 영역 ── */
.post-cta__secondary-wrap {
  text-align: center;
}

.post-cta__secondary-label {
  font-size: 0.82rem;
  color: var(--text-light);
  margin-bottom: 16px;
  font-weight: 500;
}

/* Secondary Button — 메인페이지 .btn-secondary 토큰 동일 적용 */
.post-cta__btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 13px 28px;
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  text-decoration: none;
  transition: background var(--transition), color var(--transition), transform var(--transition);
  word-break: keep-all;
  text-align: center;
  line-height: 1.5;
}
.post-cta__btn-secondary:hover {
  background: var(--navy);
  color: var(--white);
  transform: translateY(-1px);
}

/* ── 반응형 ── */
@media (max-width: 600px) {
  .post-cta {
    padding: 40px 0 36px;
    margin-top: 48px;
  }
  .post-cta__btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 0.97rem;
  }
  .post-cta__btn-secondary {
    width: 100%;
    padding: 13px 20px;
    font-size: 0.88rem;
  }
  .post-cta__eyebrow {
    font-size: 1.08rem;
  }
}

/* ─── 404 페이지 ─────────────────────────────────────────── */
.not-found-page {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}
.not-found-box {
  text-align: center;
  max-width: 420px;
}
.not-found-box__icon {
  font-size: 3rem;
  margin-bottom: 20px;
  display: block;
}
.not-found-box h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.not-found-box p {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.7;
  margin-bottom: 28px;
}
.not-found-box a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 12px 28px;
  background: var(--navy);
  color: #fff;
  border-radius: 40px;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: background var(--transition);
}
.not-found-box a:hover { background: var(--navy-light); }

/* ─── 로딩 스피너 ────────────────────────────────────────── */
.board-loading {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-sub);
  font-size: 0.92rem;
}
.spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── 반응형 ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .board-wrap { padding: 0 16px; }
  .board-hero { padding: 36px 0 28px; }

  /* 목록: 썸네일 축소 */
  .board-item__thumb,
  .board-item__thumb-placeholder {
    width: 64px;
    height: 48px;
  }
  .board-item__link { gap: 14px; padding: 18px 8px; }
  .board-item__arrow { display: none; }

  /* 상세: 여백 조정 */
  .post-header { padding: 20px 0 28px; margin-bottom: 28px; }
  .post-cover { max-height: 220px; margin-bottom: 28px; }
  .post-nav__siblings { grid-template-columns: 1fr; }
  .post-nav__item.next { text-align: left; }
  .post-body h2 { margin: 28px 0 12px; }
  .post-body h3 { margin: 22px 0 10px; }

  /* 페이지네이션 */
  .board-pagination__btn { min-width: 34px; height: 34px; font-size: 0.8rem; }
}
