/* 사주 공부 가이드 (SSR) — 만세력 본 style.css의 #top-nav · #side-menu · #mobile-nav-bar
 * 네비를 그대로 재사용. 가이드 전용 스타일은 본문(.guide-page-*) 영역만.
 * v=260427.1200
 */

/* ── 컨테이너 ── */
.guide-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}
@media (min-width: 720px) {
  .guide-container { max-width: 720px; padding: 0 24px; }
}

/* ── 본문 영역 (모바일 통합 네비바와 본문 카드 사이 간격은 메인 .view 패턴 따름) ── */
.guide-main { min-height: calc(100vh - 200px); padding: 0 0 40px; }
.guide-page { padding-top: 0; }

/* ── 페이지 헤더 (메인 #view-input header h1 패턴 재현) ── */
.guide-page-header {
  padding-top: 30px;
  padding-bottom: 6px;
  text-align: center;
}
.guide-page-header h1 {
  font-size: 2.6rem; font-weight: 500;
  margin: 0;
  color: #000;
  letter-spacing: 0;
  line-height: 1.35;
  font-family: var(--font-main);
}
/* 모바일에서 mobile-nav-bar 타이틀이 페이지 H1 역할 — 페이지 H1은 시각적으로 숨김 (SEO H1은 유지) */
@media (max-width: 719px) {
  /* mobile-nav-bar ↔ 첫 컨텐츠 박스 간격 20px (마이페이지 .container padding-top과 동일) */
  .guide-page { padding-top: 20px; }
  .guide-page-header { padding: 0; margin: 0; }
  .guide-page-header h1 {
    position: absolute; width: 1px; height: 1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* ── 브레드크럼 (헤더 아래 · 컨텐츠 박스 위 · 가운데 정렬) ── */
.guide-breadcrumb {
  font-size: 1.3rem; color: var(--text-muted);
  margin: 8px 0 14px; padding: 0;
  text-align: center;
  font-family: var(--font-main);
}
.guide-breadcrumb a { color: var(--text-muted); text-decoration: none; }
.guide-breadcrumb a:hover { color: var(--accent); }
.guide-breadcrumb .current { color: var(--text-primary); font-weight: 500; }
.guide-breadcrumb span[aria-hidden="true"] { margin: 0 6px; opacity: 0.5; }
/* 모바일: .guide-page padding-top 20px이 navbar↔breadcrumb 간격을 담당 → breadcrumb 자체 top margin 제거 */
@media (max-width: 719px) {
  .guide-breadcrumb { margin-top: 0; }
}

/* ── 카테고리 카드 그리드 (가이드 메인) ── */
.guide-cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
}
.guide-cat-card {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text-primary);
  transition: border-color .15s, background .15s;
  font-family: var(--font-main);
}
.guide-cat-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  text-decoration: none;
}
.guide-cat-card h3 {
  margin: 0; font-size: 1.55rem; font-weight: 500; color: var(--text-primary);
}
.guide-cat-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.guide-cat-arrow svg { display: block; }
@media (min-width: 720px) {
  .guide-cat-grid { grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
}

/* ── 게시글 목록 (제목만 + 우측 ">" SVG + 카드 풀 너비 가로선) ── */
/* 카드 padding 32px 음수 마진으로 상쇄 → 가로선이 카드 가장자리까지 풀 너비 */
.guide-post-list { margin: -32px; }
.guide-post-list ul { list-style: none; padding: 0; margin: 0; }
.guide-post-list li {
  border-bottom: 1px solid var(--border);
}
.guide-post-list li:last-child { border-bottom: 0; }
.guide-post-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  color: var(--text-primary); text-decoration: none;
  font-family: var(--font-main);
  transition: background .15s;
}
.guide-post-list a:hover { background: var(--accent-light); text-decoration: none; }
.guide-post-list .post-title {
  font-weight: 500; font-size: 1.6rem; line-height: 1.5;
  color: var(--text-primary);
}
.guide-post-list .post-arrow {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--text-muted); flex-shrink: 0;
}
.guide-post-list .post-arrow svg { display: block; }
.guide-post-list .post-desc { display: none; }
.guide-empty {
  padding: 28px; text-align: center; color: var(--text-muted);
  font-family: var(--font-main);
}

/* ── 게시글 상세 본문 (.card 안 — sub-section 사이 가로선) ── */
.guide-article { margin: 0 0 22px; }
.guide-article-body {
  font-size: 1.55rem; line-height: 1.85;
  color: var(--text-primary);
  font-family: var(--font-main);
}
/* sub-section 사이 명확한 솔리드 가로선 + 충분한 여백 */
.guide-article-body section.guide-subitem {
  margin: 0; padding: 24px 0;
  border-top: 1px solid var(--border);
  scroll-margin-top: 80px;
}
.guide-article-body section.guide-subitem:first-child {
  border-top: 0; padding-top: 4px;
}
.guide-article-body section.guide-subitem:last-child { padding-bottom: 0; }
.guide-article-body section.guide-subitem h2 {
  font-size: 1.8rem; font-weight: 500;
  margin: 0 0 10px; padding: 0;
  color: var(--text-primary);
  border-top: 0;
  letter-spacing: -0.01em;
}
.guide-article-body h2 {
  font-size: 1.8rem; font-weight: 500;
  margin: 24px 0 10px; padding: 0;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}
.guide-article-body h2:first-child { margin-top: 0; }
.guide-article-body h3 { font-size: 1.55rem; font-weight: 500; margin: 16px 0 8px; }
.guide-article-body p { margin: 0 0 12px; }
.guide-article-body p:last-child { margin-bottom: 0; }
.guide-article-body ul, .guide-article-body ol { padding-left: 22px; margin: 0 0 12px; }
.guide-article-body li { margin-bottom: 4px; }
.guide-article-body strong { color: var(--accent); font-weight: 600; }

/* ── 본문 안 표 ── */
.guide-article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 1.35rem;
  line-height: 1.55;
  table-layout: fixed;
  word-break: keep-all;
  overflow-wrap: break-word;
}
.guide-article-body th,
.guide-article-body td {
  border: 1px solid var(--border);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.guide-article-body th {
  background: var(--accent-light);
  color: var(--text-primary);
  font-weight: 600;
  text-align: center;
}
.guide-article-body tr:nth-child(even) td { background: #fafaf9; }
/* 표가 가로 폭을 넘어가면 가로 스크롤 가능하도록 wrap */
.guide-article-body .table-wrap {
  width: 100%;
  overflow-x: auto;
}

/* ── 관련글 (별도 카드) ── */
.guide-related {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.guide-related h2 { font-size: 1.7rem; font-weight: 500; margin: 0 0 12px; color: var(--text-primary); }
.guide-related-list { list-style: none; padding: 0; margin: 0; }
.guide-related-list li { border-bottom: 1px solid var(--border); }
.guide-related-list li:last-child { border-bottom: 0; }
.guide-related-list a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px;
  color: var(--text-primary); text-decoration: none;
}
.guide-related-list a:hover { background: var(--accent-light); text-decoration: none; }
.guide-related-list .related-title {
  font-weight: 500; font-size: 1.5rem; color: var(--text-primary);
}
.guide-related-list .related-arrow {
  display: inline-flex; color: var(--text-muted); flex-shrink: 0;
}
.guide-related-list .related-desc { display: none; }

/* ── FAQ (별도 카드) ── */
.guide-faq {
  margin-top: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}
.guide-faq h2 { font-size: 1.7rem; font-weight: 500; margin: 0 0 12px; color: var(--text-primary); }
.guide-faq dl { margin: 0; }
.guide-faq dt {
  font-weight: 600; color: var(--text-primary);
  padding: 12px 0 6px;
  border-top: 1px dashed var(--border);
  font-size: 1.5rem;
}
.guide-faq dl > dt:first-of-type { border-top: 0; padding-top: 0; }
.guide-faq dd {
  margin: 0 0 12px;
  color: var(--text-primary); font-size: 1.45rem; line-height: 1.7;
}
.faq-list dt {
  font-weight: 600; padding: 14px 0 6px;
  border-top: 1px dashed var(--border); font-size: 1.55rem;
}
.faq-list dl > dt:first-of-type { border-top: 0; padding-top: 0; }
.faq-list dd { margin: 0 0 14px; line-height: 1.75; font-size: 1.45rem; }

/* ── 페이지 네비 (목록·이전·다음) ── */
.guide-page-nav {
  display: flex; align-items: stretch;
  margin: 24px 0 32px;
  gap: 8px;
  font-family: var(--font-main);
}
.guide-page-nav.single { justify-content: center; }
.guide-page-nav.group {
  /* < 이전 / 목록 / 다음 > 동일 너비 3등분 */
}
.guide-page-nav.group > * {
  flex: 1;
  text-align: center;
}
.guide-back, .guide-prev, .guide-next {
  display: inline-block;
  padding: 11px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1.45rem; color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  text-align: center;
}
.guide-page-nav.single .guide-back { padding: 11px 32px; }
.guide-back:hover, .guide-prev:not(.disabled):hover, .guide-next:not(.disabled):hover {
  border-color: var(--accent); color: var(--accent); text-decoration: none;
}
.guide-page-nav .guide-back {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.guide-page-nav .guide-back:hover {
  filter: brightness(0.92);
  color: #fff;
  border-color: var(--accent);
}
.guide-prev.disabled, .guide-next.disabled {
  opacity: 0.4; cursor: default; pointer-events: none;
  background: transparent;
}

/* ── /about, /how-to-use, /faq 본문 (.card 안 단독 article) ── */
.guide-article-header {
  margin-bottom: 16px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.guide-article-header h1 {
  font-size: 2.0rem; font-weight: 500;
  margin: 0 0 8px; color: #000;
  letter-spacing: -0.01em; line-height: 1.4;
}
.guide-article-lead {
  font-size: 1.45rem; color: var(--text-secondary);
  margin: 0; line-height: 1.65;
}
.guide-article-footer {
  margin-top: 18px; padding-top: 14px;
  border-top: 1px solid var(--border);
}
.guide-article-meta { font-size: 1.3rem; color: var(--text-muted); margin: 0; }
.guide-article-meta a { color: var(--accent); text-decoration: none; }

/* ── 미사용 호환 안전 ── */
.guide-cat-intro, .guide-cat-meta { display: none; }
.guide-topbar, .guide-footer { display: none !important; }

/* ── 접근성 유틸 ── */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
