/* ============================================================
   style-classical.css — 천기코드 고전 공통 스타일
   「고전 서물 × 미니멀」테이스트
   작성: 2026-06-03
   ============================================================ */

/* ────────────────────────────────────────
   1. 리셋 & 기반
   ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ────────────────────────────────────────
   2. CSS 변수
   ──────────────────────────────────────── */
:root {
  --ink:        #1a1208;       /* 먹물색 */
  --ink-mid:    #3d2e15;       /* 중간 먹 */
  --ink-light:  #6b5740;       /* 연한 먹 */
  --ink-faint:  #a89070;       /* 극연 먹 */
  --hanji:      #f5f0e6;       /* 한지 기본 */
  --hanji-dark: #ede5d0;       /* 한지 어두운 면 */
  --hanji-fold: #e0d4b8;       /* 한지 접힘부 */
  --zhu:        #8b1a1a;       /* 주인(朱印) 붉음 */
  --zhu-light:  #c0392b;       /* 주인 하이라이트 */
  --gold-faint: rgba(139,90,26,0.15);
  --serif-ko:   'Gowun Batang', 'Nanum Myeongjo', 'Noto Serif KR', 'Batang', serif;
  --brush-ko:   'East Sea Dokdo', 'Yeon Sung', 'Gowun Batang', 'Batang', serif;
  --sans-ko:    'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

/* ────────────────────────────────────────
   3. 기반 body — 한지 SVG 노이즈 배경
   ──────────────────────────────────────── */
html { scroll-behavior: smooth; }

body {
  font-family: var(--serif-ko);
  background-color: var(--hanji);
  color: var(--ink);
  line-height: 1.85;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.72' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3CfeBlend in='SourceGraphic' mode='multiply'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)' opacity='0.038'/%3E%3C/svg%3E");
  background-size: 400px 400px;
  min-height: 100vh;
}

/* ────────────────────────────────────────
   4. 타이포그래피
   ──────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif-ko);
  font-weight: 700;
  color: var(--ink);
  line-height: 1.4;
  letter-spacing: -0.02em;
}

p { color: var(--ink-mid); }

a { color: inherit; text-decoration: none; }

/* ────────────────────────────────────────
   5. 세선 — 고전 괘선
   ──────────────────────────────────────── */
.rule-h {
  border: none;
  border-top: 1px solid var(--ink-faint);
  margin: 0;
}

.rule-double {
  border: none;
  border-top: 3px double var(--ink-faint);
}

/* ────────────────────────────────────────
   6. 헤더 — 먹선 상단
   ──────────────────────────────────────── */
header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--hanji);
  border-bottom: 2px solid var(--ink);
  padding: 14px 40px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.logo-text {
  font-family: var(--serif-ko);
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: 0.05em;
}

.logo-sub {
  font-size: 11px;
  color: var(--ink-faint);
  font-weight: 400;
  margin-left: 10px;
  font-family: var(--sans-ko);
  letter-spacing: 0.1em;
}

nav {
  display: flex;
  align-items: baseline;
  gap: 28px;
}

nav a {
  font-size: 13px;
  color: var(--ink-light);
  letter-spacing: 0.08em;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, color 0.2s;
  font-family: var(--serif-ko);
}

nav a:hover {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.nav-cta {
  font-size: 12px;
  color: var(--hanji) !important;
  background: var(--ink);
  padding: 6px 18px;
  letter-spacing: 0.1em;
  border-bottom: none !important;
}

.nav-cta:hover {
  background: var(--ink-mid);
  border-bottom: none !important;
}

/* ────────────────────────────────────────
   7. 朱印 SVG 씰 — 1점 배치용
   ──────────────────────────────────────── */
.seal {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
}

.seal-sm {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
}

/* ────────────────────────────────────────
   8. 창호지 사진 공통
   ──────────────────────────────────────── */
.changhoji-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  pointer-events: none;
  user-select: none;
}

.changhoji-band {
  width: 100%;
  height: 110px;
  overflow: hidden;
  position: relative;
  border-top: 1px solid var(--ink-faint);
  border-bottom: 1px solid var(--ink-faint);
}

.changhoji-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 40%;
  opacity: 0.28;
  display: block;
}

.changhoji-band-label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans-ko);
  font-size: 10px;
  letter-spacing: 0.6em;
  color: var(--ink-faint);
  pointer-events: none;
}

/* ────────────────────────────────────────
   9. 장 제목 & CHAPTER 구조
   ──────────────────────────────────────── */
.chapter-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 80px 40px;
}

.chapter-num {
  font-family: var(--brush-ko);
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  margin-bottom: 20px;
  display: block;
}

.chapter-h2 {
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 700;
  margin-bottom: 36px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--ink-faint);
  position: relative;
}

/* 장 제목 왼쪽 朱色 세로선 */
.chapter-h2::before,
.section-h-classic::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 4px;
  bottom: 4px;
  width: 2px;
  background: var(--zhu);
}

.section-h-classic {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--ink-faint);
  position: relative;
}

/* ────────────────────────────────────────
   10. 세로 조판 헬퍼
   ──────────────────────────────────────── */
.vertical-text {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--brush-ko);
  letter-spacing: 0.18em;
}

.vertical-guide {
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--serif-ko);
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.2em;
}

/* ────────────────────────────────────────
   11. 구분선 장식
   ──────────────────────────────────────── */
.divider-ornament {
  text-align: center;
  padding: 40px 0;
  color: var(--ink-faint);
  font-size: 16px;
  letter-spacing: 0.8em;
  font-family: var(--serif-ko);
  user-select: none;
}

/* ────────────────────────────────────────
   12. 인용 — blockquote 고전 방점
   ──────────────────────────────────────── */
.blockquote-classic {
  margin: 48px 0;
  padding: 28px 36px;
  border-left: 3px solid var(--zhu);
  background: var(--hanji-dark);
  position: relative;
}

.blockquote-classic p {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.9;
  color: var(--ink);
}

.blockquote-classic cite {
  display: block;
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 12px;
  font-style: normal;
  letter-spacing: 0.15em;
}

/* ────────────────────────────────────────
   13. CTA 버튼 — 인장(印章) 형식
   ──────────────────────────────────────── */
.cta-primary {
  display: inline-block;
  font-family: var(--serif-ko);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--hanji);
  background: var(--ink);
  padding: 16px 40px;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(245,240,230,0.25);
  transition: background 0.25s;
  cursor: pointer;
  border: none;
  text-align: center;
}

.cta-primary:hover { background: var(--ink-mid); }

.cta-primary::before {
  content: '─';
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.5;
}

.cta-primary::after {
  content: '─';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 10px;
  opacity: 0.5;
}

.cta-secondary {
  display: inline-block;
  font-family: var(--serif-ko);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--ink);
  padding: 12px 32px;
  transition: background 0.2s, color 0.2s;
  cursor: pointer;
  text-align: center;
}

.cta-secondary:hover {
  background: var(--ink);
  color: var(--hanji);
}

.cta-note {
  font-size: 11px;
  color: var(--ink-faint);
  margin-top: 14px;
  letter-spacing: 0.08em;
  font-family: var(--sans-ko);
}

/* ────────────────────────────────────────
   14. 폼 요소 — 한지 편지지 스타일
   ──────────────────────────────────────── */
.field-wrap {
  margin-bottom: 24px;
}

.field-label {
  display: block;
  font-family: var(--serif-ko);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.field-label .req {
  color: var(--zhu);
  margin-left: 4px;
  font-size: 12px;
}

.field-label .opt {
  color: var(--ink-faint);
  font-size: 11px;
  font-weight: 400;
  margin-left: 8px;
  letter-spacing: 0;
}

.field-input,
.field-select {
  width: 100%;
  padding: 12px 16px;
  background: var(--hanji);
  border: 1px solid var(--ink-faint);
  border-bottom: 2px solid var(--ink-light);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--serif-ko);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color 0.2s;
}

.field-input:focus,
.field-select:focus {
  outline: none;
  border-color: var(--ink);
  border-bottom-color: var(--ink);
}

.field-input::placeholder {
  color: var(--ink-faint);
  font-size: 13px;
}

.select-wrap {
  position: relative;
}

.select-wrap::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-faint);
  pointer-events: none;
  font-size: 12px;
}

/* ────────────────────────────────────────
   15. 선택 버튼 — 성별·시각 격자
   ──────────────────────────────────────── */
.choice-btn {
  padding: 12px 16px;
  background: var(--hanji);
  border: 1px solid var(--ink-faint);
  color: var(--ink-light);
  font-family: var(--serif-ko);
  font-size: 14px;
  cursor: pointer;
  text-align: center;
  transition: 0.15s;
}

.choice-btn:hover {
  border-color: var(--ink-light);
  color: var(--ink);
}

.choice-btn.selected {
  background: var(--ink);
  color: var(--hanji);
  border-color: var(--ink);
}

/* ────────────────────────────────────────
   16. 테이블 — 고전 괘선 스타일
   ──────────────────────────────────────── */
.classic-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.classic-table th {
  background: var(--hanji-dark);
  color: var(--ink-light);
  padding: 10px 14px;
  text-align: center;
  border: 1px solid var(--ink-faint);
  font-family: var(--sans-ko);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.classic-table td {
  border: 1px solid var(--hanji-fold);
  padding: 10px 14px;
  text-align: center;
  color: var(--ink-mid);
}

.classic-table tr:hover td {
  background: var(--hanji-dark);
}

/* ────────────────────────────────────────
   17. 카드 대신 — 괘선 구획
   ──────────────────────────────────────── */
.ruled-block {
  background: var(--hanji-dark);
  border: 1px solid var(--ink-faint);
  border-top: 2px solid var(--ink-light);
  padding: 24px 28px;
  margin-bottom: 2px;
}

.ruled-block + .ruled-block {
  border-top: 1px solid var(--ink-faint);
}

/* ────────────────────────────────────────
   18. FAQ — 괘선 스타일
   ──────────────────────────────────────── */
.faq-item {
  border-top: 1px solid var(--ink-faint);
  padding: 28px 0;
}

.faq-item:last-child {
  border-bottom: 1px solid var(--ink-faint);
}

.faq-q {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 12px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.faq-q::before {
  content: '問';
  font-family: var(--serif-ko);
  font-size: 12px;
  color: var(--zhu);
  font-weight: 700;
  flex-shrink: 0;
}

.faq-a {
  font-size: 13px;
  line-height: 2.1;
  color: var(--ink-light);
  padding-left: 24px;
}

/* ────────────────────────────────────────
   19. 탭 — 목차 형식
   ──────────────────────────────────────── */
.tabs-classic {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  border-bottom: 2px solid var(--ink);
  background: var(--hanji-dark);
}

.tab-btn-classic {
  background: transparent;
  color: var(--ink-light);
  border: none;
  border-right: 1px solid var(--ink-faint);
  padding: 12px 20px;
  cursor: pointer;
  font-family: var(--serif-ko);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  transition: 0.15s;
  position: relative;
}

.tab-btn-classic:hover {
  background: var(--hanji-fold);
  color: var(--ink);
}

.tab-btn-classic.active {
  background: var(--hanji);
  color: var(--ink);
  border-bottom: 2px solid var(--hanji);
  margin-bottom: -2px;
}

.tab-btn-classic.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--zhu);
}

.tab-content-classic {
  display: none;
  background: var(--hanji);
  padding: 36px 32px;
  border: 1px solid var(--ink-faint);
  border-top: none;
  min-height: 400px;
}

.tab-content-classic.active {
  display: block;
}

/* ────────────────────────────────────────
   20. 자물쇠 프리뷰 오버레이 — 고전풍
   ──────────────────────────────────────── */
.lock-section-classic {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--ink-faint);
  padding: 24px;
  margin-top: 24px;
}

.lock-section-classic::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 0%, var(--hanji-dark) 65%);
  z-index: 1;
  pointer-events: none;
}

.lock-preview-classic {
  opacity: 0.22;
  filter: blur(1px);
}

.lock-overlay-classic {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 2;
  background: rgba(240,235,220,0.55);
}

.lock-overlay-classic .lock-text-classic {
  font-family: var(--serif-ko);
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  letter-spacing: 0.05em;
}

.lock-overlay-classic .lock-sub-classic {
  font-size: 12px;
  color: var(--ink-light);
  margin-bottom: 20px;
  letter-spacing: 0.05em;
}

/* ────────────────────────────────────────
   21. 오행 바 — 고전 괘선 스타일
   ──────────────────────────────────────── */
.gogyo-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gogyo-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gogyo-label {
  width: 24px;
  font-family: var(--serif-ko);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
}

.gogyo-bar-wrap {
  flex: 1;
  height: 16px;
  background: var(--hanji-fold);
  border: 1px solid var(--ink-faint);
  overflow: hidden;
}

.gogyo-bar {
  height: 100%;
}

/* ────────────────────────────────────────
   22. 명식 격자 셀 — 고전 괘선
   ──────────────────────────────────────── */
.chart-cell {
  width: 38px;
  height: 38px;
  border: 1px solid var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  background: var(--hanji);
  font-family: var(--serif-ko);
}

.chart-cell.top {
  font-size: 12px;
  color: var(--zhu);
  background: var(--hanji-dark);
}

/* ────────────────────────────────────────
   23. 안내 텍스트 영역
   ──────────────────────────────────────── */
.note-box {
  background: var(--hanji-dark);
  border-left: 2px solid var(--ink-faint);
  padding: 14px 18px;
  font-size: 13px;
  color: var(--ink-light);
  line-height: 1.9;
}

.note-box strong {
  color: var(--ink);
}

/* ────────────────────────────────────────
   24. 동의 행 — 체크박스
   ──────────────────────────────────────── */
.agree-row-classic {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px;
  background: var(--hanji-dark);
  border: 1px solid var(--ink-faint);
}

.agree-row-classic input[type="checkbox"] {
  margin-top: 3px;
  accent-color: var(--ink);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.agree-row-classic label {
  font-size: 12px;
  color: var(--ink-light);
  line-height: 1.8;
  cursor: pointer;
}

.agree-row-classic a {
  color: var(--zhu);
  text-decoration: underline;
}

/* ────────────────────────────────────────
   25. 푸터
   ──────────────────────────────────────── */
footer {
  background: var(--ink);
  color: var(--ink-faint);
  padding: 40px;
  text-align: center;
  border-top: 3px double var(--ink-faint);
}

footer p {
  font-family: var(--sans-ko);
  font-size: 11px;
  color: var(--hanji-fold);
  line-height: 2.2;
  opacity: 0.7;
}

footer p a {
  color: inherit;
  opacity: 0.8;
}

footer .footer-seal {
  margin-bottom: 20px;
  opacity: 0.35;
}

/* ────────────────────────────────────────
   26. 반응형 — 공통
   ──────────────────────────────────────── */

/* ── 768px: 태블릿 ── */
@media (max-width: 768px) {
  header {
    padding: 12px 20px;
    align-items: center;
  }
  .logo-sub { display: none; }
  nav { gap: 16px; }

  /* nav 링크 탭 영역 44px 확보 */
  nav a {
    padding: 13px 6px;
    font-size: 14px;
  }
  .nav-cta {
    padding: 13px 16px;
    font-size: 13px;
  }

  .chapter-wrap {
    padding-left: 24px;
    padding-right: 24px;
    padding-top: 60px;
    padding-bottom: 60px;
  }

  /* 세로선 좌우 overflow 방지 */
  .chapter-h2::before,
  .section-h-classic::before {
    left: -16px;
  }

  /* 탭 horizontal scroll — 목차 형식 유지 */
  .tabs-classic {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    /* scroll indicator 힌트 */
    background: linear-gradient(to right, var(--hanji-dark) 90%, transparent 100%);
  }

  .tab-btn-classic {
    padding: 12px 14px;
    min-height: 44px;       /* Apple HIG 최소 탭 터치 영역 */
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .tab-content-classic {
    padding: 24px 20px;
  }

  /* choice-btn 44px 확보 */
  .choice-btn {
    padding: 13px 12px;
    min-height: 44px;
  }

  /* CTA 버튼 모바일 전폭 */
  .cta-primary,
  .cta-secondary {
    width: 100%;
    display: block;
    text-align: center;
    padding: 16px 20px;
    font-size: 15px;
  }

  /* field-input / field-select 48px 확보 */
  .field-input,
  .field-select {
    padding: 14px 16px;
    font-size: 16px;       /* iOS 자동 줌 방지: 16px 이상 필수 */
    min-height: 48px;
  }

  /* blockquote 패딩 축소 */
  .blockquote-classic {
    padding: 20px 20px;
    margin: 32px 0;
  }

  /* 창호지 띠 — 負 마진 폭 제한 방지 */
  .changhoji-band {
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* ── 480px: 소형 모바일 ── */
@media (max-width: 480px) {
  header {
    padding: 10px 16px;
  }

  .cta-primary {
    padding: 16px 20px;
    font-size: 15px;
    letter-spacing: 0.12em;
  }

  /* agree 체크박스 터치 영역 확대 */
  .agree-row-classic input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-top: 2px;
  }

  /* FAQ 질문 줄바꿈 허용 */
  .faq-q {
    font-size: 14px;
    align-items: flex-start;
  }

  /* footer 여백 축소 */
  footer {
    padding: 28px 16px;
  }
  footer p {
    font-size: 10px;
    line-height: 2.0;
  }
}

/* ── 375px: iPhone SE / 최소 기준 ── */
@media (max-width: 375px) {
  .logo-text {
    font-size: 17px;
  }

  .chapter-wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  .tab-btn-classic {
    padding: 12px 10px;
    font-size: 11px;
  }

  .field-input,
  .field-select {
    font-size: 16px;
    padding: 13px 12px;
  }
}
