/* Hallmark · genre: editorial (luxury) · macrostructure: split-studio (home) / narrative-workflow (treatments) / conversational-faq / catalogue (cases)
 * theme: custom (tuned) · vibe: "porcelain calm, quiet gold, doctor's hand"
 * paper: oklch(97% 0.006 245) · accent: oklch(47% 0.125 245) · gold: oklch(78% 0.115 80)
 * display: Noto Serif KR (roman, 600/900) · body: Pretendard · axes: light / roman-serif / cool-245
 * nav: N9 edge-aligned minimal · footer: Ft4 dense colophon · enrichment: none (typography carries)
 * Hallmark · pre-emit critique: P4 H5 E4 S5 R5 V4
 */

:root {
  --color-paper:      oklch(97% 0.006 245);
  --color-paper-2:    oklch(94.5% 0.009 245);
  --color-ink:        oklch(24% 0.03 250);
  --color-ink-2:      oklch(34% 0.028 250);
  --color-muted:      oklch(48% 0.02 250);
  --color-rule:       oklch(85% 0.012 245);
  --color-rule-2:     oklch(90% 0.008 245);
  --color-accent:     oklch(47% 0.125 245);
  --color-accent-soft:oklch(93% 0.02 245);
  --color-gold:       oklch(78% 0.115 80);
  --color-gold-deep:  oklch(66% 0.12 75);
  --color-focus:      oklch(52% 0.19 245);
  --color-naver:      oklch(69% 0.19 150);
  --color-paper-on-ink: oklch(93% 0.008 245);
  --color-muted-on-ink: oklch(72% 0.015 245);
  --color-rule-on-ink:  oklch(38% 0.025 250);

  --font-display: "Noto Serif KR", "Nanum Myeongjo", serif;
  --font-body: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", sans-serif;

  --text-display: clamp(2rem, 5.2vw, 3.4rem);
  --text-title: clamp(1.5rem, 3.2vw, 2.1rem);

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-short: 200ms;
}

html, body { overflow-x: clip; }
html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--color-paper);
  color: var(--color-ink);
  font-feature-settings: 'ss05';
}

::selection { background: var(--color-accent); color: var(--color-paper-on-ink); }

:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 2px;
}

/* ─ Typography discipline ─ */
h1, h2, h3, .serif {
  font-family: var(--font-display);
  font-style: normal; /* 이탤릭 헤더 전역 금지 */
  overflow-wrap: anywhere;
  min-width: 0;
}

.display { font-size: var(--text-display); line-height: 1.28; letter-spacing: -0.01em; font-weight: 900; }
.title   { font-size: var(--text-title); line-height: 1.35; font-weight: 700; }

/* 섹션 헤딩 리듬: 골드 세리프 번호 + 오버라인 */
.sec-no {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-gold-deep);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
}
.overline {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--color-muted);
  font-weight: 600;
}

/* ─ Hairline discipline: 그림자 대신 헤어라인 ─ */
.hairline-t { border-top: 1px solid var(--color-rule); }
.hairline-b { border-bottom: 1px solid var(--color-rule); }
.hairline   { border: 1px solid var(--color-rule); }
.rule-double { border-top: 3px double var(--color-rule); }

/* ─ CTA voice: 사각(2px) 버튼, 세 가지 목소리 ─ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border-radius: 2px;
  padding: 0.9rem 1.9rem;
  font-weight: 600; font-size: 0.95rem;
  white-space: nowrap;
  transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out);
}
.btn-ink   { background: var(--color-ink); color: var(--color-paper-on-ink); }
.btn-ink:hover { background: var(--color-ink-2); }
.btn-gold  { background: var(--color-gold); color: var(--color-ink); }
.btn-gold:hover { background: var(--color-gold-deep); }
.btn-ghost { border: 1px solid var(--color-rule); color: var(--color-ink); background: transparent; }
.btn-ghost:hover { border-color: var(--color-ink); }
.btn-ghost-on-ink { border: 1px solid var(--color-rule-on-ink); color: var(--color-paper-on-ink); background: transparent; }
.btn-ghost-on-ink:hover { border-color: var(--color-paper-on-ink); }

/* 텍스트 링크 */
.link-quiet { color: var(--color-accent); font-weight: 600; }
.link-quiet:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ─ FAQ: 헤어라인 행 ─ */
.faq-item { border-top: 1px solid var(--color-rule); }
.faq-item:last-child { border-bottom: 1px solid var(--color-rule); }
.faq-item summary { list-style: none; cursor: pointer; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary .faq-mark {
  font-family: var(--font-display);
  color: var(--color-gold-deep);
  transition: transform var(--dur-short) var(--ease-out);
}
.faq-item[open] summary .faq-mark { transform: rotate(45deg); }

/* ─ 인라인 강조: x-height 골드 밴드 ─ */
mark.em-band {
  background: linear-gradient(transparent 62%, oklch(88% 0.09 82) 62%);
  color: inherit; font-weight: 700; padding: 0 0.1em;
}

/* ─ 플로팅 빠른 상담 버튼 (기능 유지, 시스템 보이스로) ─ */
.float-btn {
  display: flex; align-items: center; gap: 0.5rem;
  text-decoration: none; border: none; background: transparent; cursor: pointer;
}
.float-label {
  opacity: 0; transform: translateX(6px);
  transition: opacity var(--dur-short) var(--ease-out), transform var(--dur-short) var(--ease-out);
  background: var(--color-ink); color: var(--color-paper-on-ink);
  font-size: 0.75rem; font-weight: 600;
  padding: 0.35rem 0.7rem; border-radius: 2px;
  white-space: nowrap; pointer-events: none;
}
.float-btn:hover .float-label, .float-btn:focus-visible .float-label { opacity: 1; transform: translateX(0); }
.float-icon {
  width: 3rem; height: 3rem; border-radius: 2px;
  display: flex; align-items: center; justify-content: center;
  color: var(--color-paper-on-ink); font-size: 1.05rem;
  border: 1px solid var(--color-rule-on-ink);
  transition: transform var(--dur-short) var(--ease-out);
}
.float-btn:hover .float-icon { transform: translateY(-2px); }
.bg-float-ink   { background: var(--color-ink); }
.bg-float-naver { background: var(--color-naver); }
.bg-float-gold  { background: var(--color-gold); color: var(--color-ink); border-color: var(--color-gold-deep); }
.bg-float-accent{ background: var(--color-accent); }
@media (max-width: 640px) {
  .float-icon { width: 2.7rem; height: 2.7rem; font-size: 0.95rem; }
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* ─ 비급여 진료비용 고지: 푸터 트리거 버튼 + 팝업(모달) ─ */
.fee-open-btn {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--color-rule-on-ink); border-radius: 2px;
  background: transparent; color: var(--color-paper-on-ink);
  font-size: 0.82rem; font-weight: 600; letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out);
}
.fee-open-btn:hover { border-color: var(--color-paper-on-ink); background: oklch(100% 0 0 / 0.05); }

.fee-modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  padding: 1.25rem;
}
.fee-modal.hidden { display: none; }
.fee-modal-backdrop {
  position: absolute; inset: 0;
  background: oklch(15% 0.02 250 / 0.72);
  backdrop-filter: blur(2px);
}
.fee-modal-panel {
  position: relative;
  width: 100%; max-width: 52rem; max-height: calc(100vh - 2.5rem);
  display: flex; flex-direction: column;
  background: var(--color-ink); color: var(--color-muted-on-ink);
  border: 1px solid var(--color-rule-on-ink); border-radius: 2px;
  box-shadow: 0 30px 80px oklch(10% 0.02 250 / 0.5);
  animation: fee-modal-in 260ms var(--ease-out);
  outline: none;
}
@keyframes fee-modal-in {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fee-modal-header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  border-bottom: 1px solid var(--color-rule-on-ink);
}
.fee-modal-close {
  flex-shrink: 0; width: 2.25rem; height: 2.25rem;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--color-rule-on-ink); border-radius: 2px;
  background: transparent; color: var(--color-paper-on-ink); cursor: pointer;
  transition: border-color var(--dur-short) var(--ease-out);
}
.fee-modal-close:hover { border-color: var(--color-paper-on-ink); }
.fee-modal-body {
  padding: 1.25rem 1.5rem;
  overflow-y: auto; flex: 1 1 auto; min-height: 0;
  font-size: 0.9rem;
}
.fee-modal-footer {
  display: flex; justify-content: flex-end;
  padding: 1rem 1.5rem 1.25rem;
  border-top: 1px solid var(--color-rule-on-ink);
}
@media (max-width: 640px) {
  .fee-modal { padding: 0.75rem; }
  .fee-modal-panel { max-height: calc(100vh - 1.5rem); }
  .fee-modal-header, .fee-modal-body, .fee-modal-footer { padding-left: 1rem; padding-right: 1rem; }
}

/* ─ 개인정보처리방침 (privacy.html) 본문 타이포 ─ */
.privacy section { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--color-rule); }
.privacy section h2 { font-size: 1.15rem; font-weight: 700; color: var(--color-ink); }
.privacy section p, .privacy section li { font-size: 0.95rem; line-height: 1.85; color: var(--color-ink-2); }
.privacy section p { margin-top: 1rem; }
.privacy section ol, .privacy section ul { margin-top: 1rem; padding-left: 1.4rem; }
.privacy section ol { list-style: decimal; }
.privacy section ul { list-style: disc; }
.privacy section li + li { margin-top: 0.5rem; }
.privacy section strong { color: var(--color-ink); font-weight: 600; }
.privacy section table { width: 100%; margin-top: 1rem; border-collapse: collapse; font-size: 0.9rem; min-width: 30rem; }
.privacy section th, .privacy section td { text-align: left; padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--color-rule); vertical-align: top; }
.privacy section th { font-weight: 600; color: var(--color-ink); background: var(--color-paper-2); font-size: 0.8rem; letter-spacing: 0.04em; }
.privacy section .hairline { margin-top: 1rem; }
.privacy section .hairline ul { list-style: none; padding-left: 0; margin-top: 0.5rem; }
.privacy section .hairline li + li { margin-top: 0.25rem; }

/* ─ 의료진 소개: 원장 프로필 블록 간 세로 간격 (여백만 사용, PC 96px / 모바일 64px) ─
   · 모바일: 1열 배치. 제목→프로필 간격(2.5rem)은 유지하고, 두 번째 프로필에만 추가 여백을 더해 합계 4rem(64px)
   · PC(md↑): 12열 그리드의 행 간격 6rem(96px) = 윤경원 블록 끝 → 현진의 블록 시작
   · 모바일에서는 빈 제목용 요소(.doctor-spacer)를 숨겨 여백 중복 방지 */
#doctor-section .doctor-grid {
  --doctor-gap: 4rem;
  --doctor-title-gap: 2.5rem;
  row-gap: var(--doctor-title-gap);
}
#doctor-section .doctor-spacer { display: none; }
#doctor-section .doctor-profile-next { margin-top: calc(var(--doctor-gap) - var(--doctor-title-gap)); }
@media (min-width: 768px) {
  #doctor-section .doctor-grid { --doctor-gap: 6rem; row-gap: var(--doctor-gap); }
  #doctor-section .doctor-spacer { display: block; }
  #doctor-section .doctor-profile-next { margin-top: 0; }
}
