/* =========================================================
   문정경희한의원 — 공통 스타일 (디자인 기준 v1)
   색·글꼴·간격은 :root 값만 바꾸면 사이트 전체에 반영됩니다.
   ========================================================= */

:root {
  /* 색 */
  --ink: #2e2f30;         /* 본문 글자 (간판 차콜) */
  --graphite: #4d4d4d;    /* 로고 회색, 어두운 구역 배경 */
  --orange: #fe9f29;      /* 로고 오렌지. 어두운 배경 위 강조 글자 전용 */
  /* 원칙: 오렌지는 어두운 배경(graphite·ink) 위의 강조 글자에만 씁니다. 흰 배경 위에는 쓰지 않습니다 */
  --naver: #03c75a;       /* 네이버 예약·지도·블로그 버튼 전용 */
  --stone: #efebe5;       /* 내부 벽 톤, 구역 배경 */
  --line: #dcd5cb;        /* 구분선 */
  --paper: #ffffff;
  --muted: #62605c;       /* 보조 글자 */

  /* 글꼴 */
  --font: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont,
    "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;

  /* 크기 (모바일 기준, 넓은 화면에서 아래 미디어쿼리로 확대) */
  --fs-body: 1rem;        /* 16px */
  --fs-small: 0.875rem;   /* 14px */
  --fs-lead: 1.125rem;    /* 18px */
  --fs-h3: 1.1875rem;     /* 19px */
  --fs-h2: 1.5rem;        /* 24px */
  --fs-h1: 1.9375rem;     /* 31px */

  --gap: 20px;            /* 화면 좌우 여백 */
  --section: 64px;        /* 구역 위아래 여백 */
  --wide: 1080px;         /* 최대 폭 */
  --text: 680px;          /* 글 읽는 폭 */
  --radius: 10px;
  --bar-h: 64px;          /* 하단 고정 바 높이 */
}

@media (min-width: 960px) {
  :root {
    --fs-body: 1.0625rem;
    --fs-lead: 1.25rem;
    --fs-h3: 1.25rem;
    --fs-h2: 1.875rem;
    --fs-h1: 3rem;
    --gap: 40px;
    --section: 96px;
  }
}

/* ---------- 기본 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  word-break: keep-all;
  overflow-wrap: break-word;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
}
@media (min-width: 960px) { body { padding-bottom: 0; } }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3 { line-height: 1.3; margin: 0; letter-spacing: -0.02em; }
h1 { font-size: var(--fs-h1); font-weight: 800; }
h2 { font-size: var(--fs-h2); font-weight: 750; }
h3 { font-size: var(--fs-h3); font-weight: 700; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gap); }
.section { padding: var(--section) 0; }
.section--stone { background: var(--stone); }
.section--dark { background: var(--graphite); color: #fff; }
.section-head { max-width: var(--text); margin-bottom: 32px; }
.section-head p { color: var(--muted); margin: 10px 0 0; }
.section--dark .section-head p { color: #e2e0dc; }
.prose { max-width: var(--text); }
.small { font-size: var(--fs-small); color: var(--muted); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; padding: 0 16px; white-space: nowrap;
  border-radius: var(--radius);
  font-weight: 700; font-size: 1rem; text-decoration: none;
  border: 2px solid transparent;
}
.btn svg { width: 20px; height: 20px; flex: none; }
/* 진료 예약: 첫 화면과 상단·하단 고정 바 전용 (2안: 진회색 바탕 + 오렌지 글자)
   1안(stone 바탕)으로 바꾸려면 아래 두 줄을 background: var(--stone); color: var(--ink); border-color: var(--line); 로 */
.btn--book { background: var(--graphite); color: var(--orange); }
.btn--book:hover { background: var(--ink); }
/* 네이버 버튼: 첫 화면·고정 바를 제외한 곳 */
.btn--naver { background: var(--naver); color: #fff; }
.btn--naver:hover { background: #02b351; }
.btn--naver .n { width: 16px; height: 16px; }
.btn--call { background: var(--paper); color: var(--ink); border-color: var(--ink); }
.btn--call:hover { background: var(--stone); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; min-height: 44px; font-weight: 600; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-row .btn { flex: 1 1 150px; }

.text-link { font-weight: 700; color: var(--ink); text-underline-offset: 4px; }
.section--dark .text-link { color: var(--orange); }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand img { height: 34px; width: auto; }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav-links { display: none; }
.nav-menu { position: relative; }
.nav-menu summary {
  list-style: none; cursor: pointer; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius);
}
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary svg { width: 24px; height: 24px; }
.nav-menu[open] summary { background: var(--stone); }
.nav-menu ul {
  position: absolute; right: 0; top: 52px; width: 230px; list-style: none;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 8px; box-shadow: 0 12px 30px rgba(46,47,48,.12);
}
.nav-menu a { display: block; padding: 12px 14px; text-decoration: none; font-weight: 600; border-radius: 8px; }
.nav-menu a:hover { background: var(--stone); }
.header-call { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius); }
.header-call svg { width: 22px; height: 22px; }
.header-book { display: none; }

@media (min-width: 960px) {
  .site-header .wrap { height: 72px; }
  .brand img { height: 40px; }
  .nav-menu, .header-call { display: none; }
  .nav-links { display: flex; list-style: none; gap: 2px; }
  .nav-links a { display: block; padding: 10px 12px; text-decoration: none; font-weight: 600; font-size: .9375rem; border-radius: 8px; }
  .nav-links a:hover, .nav-links a[aria-current="page"] { background: var(--stone); }
  .header-book { display: inline-flex; min-height: 44px; margin-left: 8px; }
}

/* ---------- 공지 띠 (블로그 [공지] 글이 있을 때만 표시) ---------- */
.notice-bar { background: var(--ink); color: #fff; font-size: var(--fs-small); }
.notice-bar[hidden] { display: none; }
.notice-bar a { display: flex; gap: 10px; align-items: baseline; padding: 11px 0; text-decoration: none; }
.notice-bar strong { color: var(--orange); flex: none; }
.notice-bar span { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- 하단 고정 예약·전화 바 (모바일) ---------- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: grid; grid-template-columns: 1.35fr 1fr; gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  background: rgba(255,255,255,.97); border-top: 1px solid var(--line);
}
.cta-bar .btn { min-height: 48px; padding: 0 12px; }
@media (min-width: 960px) { .cta-bar { display: none; } }

/* ---------- 첫 화면 (메인) ----------
   외부 간판 사진이 배경. 사진 파일 자체에 흰색으로 옅어지는 처리가 들어 있어
   글자 쪽은 흰 바탕처럼 보입니다. 모바일: 글 위·사진 아래 / PC: 사진 왼쪽·글 오른쪽 */
.hero { position: relative; overflow: hidden; background: var(--paper); padding: 28px 0 calc(100vw * 0.66); }
.hero .wrap { position: relative; z-index: 1; }
.hero-copy { max-width: 560px; }
.hero-bg { position: absolute; left: 0; right: 0; bottom: 0; z-index: 0; margin: 0; }
.hero-bg img { width: 100%; height: auto; }
.hero h1 { font-size: clamp(1.9rem, 8.2vw, 3.4rem); line-height: 1.22; letter-spacing: -0.035em; }
.hero h1 .line { display: block; }
.hero .btn-row .btn { flex: 1 1 0; padding: 0 10px; }
.hero-sub { font-size: var(--fs-lead); color: var(--graphite); margin: 14px 0 16px; font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; list-style: none; margin-bottom: 22px; }
.chips li {
  font-size: .75rem; font-weight: 600; line-height: 1.3; color: var(--graphite);
  padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.9);
}
.chips li::before { content: "#"; margin-right: 1px; color: var(--muted); font-weight: 500; }

.arch {
  position: relative; border-radius: 999px 999px var(--radius) var(--radius);
  overflow: hidden; background: #e9e8e6; aspect-ratio: 3 / 4;
}
.arch img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%; }

@media (min-width: 600px) and (max-width: 959px) {
  .hero { padding-bottom: 420px; }
  .hero-bg { left: 50%; transform: translateX(-50%); width: 640px; }
}
@media (min-width: 960px) {
  .hero { padding: 96px 0; min-height: 600px; display: flex; align-items: center; }
  .hero .wrap { width: 100%; }
  .hero h1 .line { white-space: nowrap; }
  .hero { min-height: 640px; }
  /* PC: 간판이 사진 왼쪽에 있어 사진은 왼쪽, 글은 오른쪽 */
  .hero-bg { top: 0; bottom: 0; left: 0; right: auto; width: min(60vw, 1100px); }
  .hero-bg img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 50%; }
  .hero-copy { margin-left: auto; width: 44%; max-width: 520px; }
  .hero h1 { font-size: clamp(2.4rem, 3.4vw, 3rem); }
  .hero .btn-row { max-width: 460px; }
}

/* ---------- 어디가 불편하세요? (증상 타일) ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; list-style: none; border-top: 2px solid var(--ink); }
.tiles a {
  display: flex; flex-direction: column; justify-content: center; min-height: 88px;
  padding: 14px 12px 14px 0; text-decoration: none; border-bottom: 1px solid var(--line);
}
.tiles li:nth-child(odd) a { padding-right: 14px; border-right: 1px solid var(--line); }
.tiles li:nth-child(even) a { padding-left: 14px; }
.tiles b { font-size: 1.0625rem; }
.tiles small { color: var(--muted); font-size: .8125rem; line-height: 1.45; margin-top: 3px; }
.tiles a:hover b { text-decoration: underline; text-underline-offset: 4px; }
@media (min-width: 960px) {
  .tiles { grid-template-columns: repeat(4, 1fr); }
  .tiles li a { padding: 22px 18px !important; border-right: 1px solid var(--line); }
  .tiles li:nth-child(4n) a { border-right: 0; }
}

/* ---------- 진료 원칙 (어두운 구역) ---------- */
.principles { display: grid; gap: 28px; list-style: none; }
.principles li { border-top: 1px solid rgba(255,255,255,.28); padding-top: 18px; }
.principles h3 { color: var(--orange); margin-bottom: 8px; }
.principles p { color: #eceae6; margin: 0; }
@media (min-width: 960px) { .principles { grid-template-columns: repeat(3, 1fr); gap: 40px; } }

/* ---------- 대표원장 ---------- */
.director { display: grid; gap: 28px; }
.director .arch { max-width: 300px; width: 70%; }
.creds { list-style: none; margin: 16px 0 22px; }
.creds li { padding: 9px 0; border-bottom: 1px solid var(--line); }
.creds li:first-child { border-top: 1px solid var(--line); }
@media (min-width: 960px) {
  .director { grid-template-columns: 300px 1fr; gap: 64px; align-items: center; }
  .director .arch { width: 100%; }
}

/* ---------- 치료 목록 (주황 세로선) ---------- */
.treat-list { display: grid; gap: 4px; }
.treat-list > div { border-left: 4px solid var(--graphite); padding: 12px 0 12px 16px; }
.treat-list dt { font-weight: 700; font-size: var(--fs-h3); }
.treat-list dt .tag { font-size: .75rem; font-weight: 700; margin-left: 6px; padding: 2px 7px; border-radius: 5px; background: var(--stone); vertical-align: 2px; white-space: nowrap; }
.treat-list dd { margin: 4px 0 0; color: var(--graphite); }
.treat-list dd p:last-child { margin-bottom: 0; }
@media (min-width: 960px) { .treat-list.two { grid-template-columns: 1fr 1fr; gap: 12px 40px; } }

/* ---------- 공간 사진 (가로 스크롤) ---------- */
.gallery {
  display: grid; grid-auto-flow: column; grid-auto-columns: 78%; gap: 12px;
  overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 8px; list-style: none;
}
.gallery li { scroll-snap-align: start; }
.gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); }
.gallery p { margin: 8px 0 0; font-size: var(--fs-small); color: var(--muted); }
@media (min-width: 960px) { .gallery { grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); overflow: visible; } }

/* ---------- 진료시간·오시는 길 ---------- */
.visit { display: grid; gap: 36px; }
@media (min-width: 960px) { .visit { grid-template-columns: 1fr 1fr; gap: 64px; } }
.hours { width: 100%; border-collapse: collapse; }
.hours th, .hours td { text-align: left; padding: 12px 0; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.hours th { font-weight: 700; width: 38%; }
.hours tr.off td { color: var(--muted); }
.hours-note { margin-top: 12px; font-size: var(--fs-small); color: var(--muted); }
.info-list { display: grid; gap: 18px; margin-bottom: 22px; }
.info-list dt { font-weight: 700; }
.info-list dd { margin: 2px 0 0; color: var(--graphite); }

/* ---------- 블로그 글 목록 ---------- */
.posts { list-style: none; border-top: 2px solid var(--ink); margin-bottom: 20px; }
.posts li { border-bottom: 1px solid var(--line); }
.posts a { display: block; padding: 16px 0; text-decoration: none; }
.posts b { display: block; font-size: 1.0625rem; }
.posts a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.posts time { font-size: var(--fs-small); color: var(--muted); }
.posts .empty { padding: 16px 0; color: var(--muted); }

/* ---------- 자주 묻는 질문 / 펼침 목록 ---------- */
.faq { border-top: 2px solid var(--ink); max-width: var(--text); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; font-weight: 700;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after, .acc summary::after {
  content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); transition: transform .2s;
}
.faq details[open] summary::after, .acc details[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq details > div { padding: 0 0 18px; color: var(--graphite); }
.faq details > div p:last-child { margin-bottom: 0; }

/* ---------- 마무리 예약 구역 ---------- */
.closing { text-align: left; }
.closing h2 { margin-bottom: 10px; }
.closing .btn-row { max-width: 460px; margin-top: 20px; }

/* ---------- 푸터 ---------- */
.site-footer { background: var(--ink); color: #d8d6d2; font-size: var(--fs-small); padding: 44px 0 36px; }
.site-footer img { height: 32px; width: auto; margin-bottom: 18px; }
.site-footer p { margin: 0 0 6px; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 18px; }
.site-footer a { color: #fff; }

/* =========================================================
   하위 페이지 공통 (통증 페이지가 본보기)
   ========================================================= */
.page-hero { padding: 32px 0 40px; border-bottom: 1px solid var(--line); }
.breadcrumb { font-size: var(--fs-small); color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { text-underline-offset: 3px; }
.page-hero h1 { margin-bottom: 14px; }
.aka { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin-bottom: 18px; }
.aka li { font-size: .8125rem; font-weight: 600; padding: 5px 10px; background: var(--stone); border-radius: 6px; }
.page-hero .lead { font-size: var(--fs-lead); color: var(--graphite); max-width: var(--text); }
.page-hero .btn-row { max-width: 460px; margin-top: 22px; }
@media (min-width: 960px) { .page-hero { padding: 56px 0 64px; } }

/* 진료실에서 자주 듣는 말 */
.voices { list-style: none; display: grid; gap: 10px; max-width: var(--text); }
.voices li {
  background: var(--paper); border-radius: 4px 16px 16px 16px; padding: 14px 18px;
  font-size: 1.0625rem; font-weight: 600; border: 1px solid var(--line);
}
.voices li:nth-child(even) { margin-left: 24px; }

/* 원장의 진료 관점 */
.doctor-voice { display: grid; gap: 20px; max-width: 820px; }
.doctor-voice blockquote { margin: 0; font-size: 1.0625rem; line-height: 1.85; }
.doctor-voice blockquote p { margin-bottom: 1em; }
.doctor-voice .who { display: flex; align-items: center; gap: 14px; }
.doctor-voice .who .arch { width: 64px; flex: none; }
.doctor-voice .who b { display: block; }
.doctor-voice .who span { font-size: var(--fs-small); color: var(--muted); }

/* 부위별 펼침 카드 */
.acc { display: grid; gap: 12px; }
.acc details { border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }
.acc details[open] { border-color: var(--ink); }
.acc summary { list-style: none; cursor: pointer; position: relative; padding: 18px 48px 18px 18px; }
.acc summary::-webkit-details-marker { display: none; }
.acc summary::after { right: 22px; }
.acc summary b { display: block; font-size: var(--fs-h3); }
.acc summary span { display: block; color: var(--muted); font-size: var(--fs-small); margin-top: 2px; }
.acc .acc-body { padding: 0 18px 18px; }
.acc dl { margin: 0; display: grid; gap: 14px; }
.acc dl > div { border-top: 1px solid var(--line); padding-top: 12px; }
.acc dt { font-weight: 700; font-size: var(--fs-small); color: var(--graphite); margin-bottom: 2px; }
.acc dd { margin: 0; }
@media (min-width: 960px) {
  .acc dl { grid-template-columns: 1fr 1fr; gap: 16px 32px; }
}

/* 병원 진료가 먼저인 신호 */
.redflag { border: 2px solid var(--ink); border-radius: var(--radius); padding: 22px 20px; max-width: var(--text); background: var(--paper); }
.redflag h2 { font-size: var(--fs-h3); display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.redflag h2 svg { width: 24px; height: 24px; flex: none; color: var(--ink); }
.redflag ul { padding-left: 1.2em; margin: 12px 0; }
.redflag li { margin-bottom: 6px; }
.redflag p:last-child { margin-bottom: 0; }

/* 진료 과정 (실제 순서가 있으므로 번호 사용) */
.steps { list-style: none; counter-reset: step; max-width: var(--text); }
.steps > li { counter-increment: step; position: relative; padding: 0 0 26px 52px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: -2px;
  width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: .9375rem;
}
.steps > li::after { content: ""; position: absolute; left: 16px; top: 36px; bottom: 4px; width: 2px; background: var(--line); }
.steps > li:last-child::after { display: none; }
.steps h3 { margin-bottom: 4px; }
.steps p { color: var(--graphite); margin: 0; }
.asklist { margin-top: 12px; background: var(--paper); border-radius: var(--radius); padding: 16px 18px 16px 34px; }
.asklist li { margin-bottom: 4px; }

/* 회복 단계 */
.phases { list-style: none; display: grid; gap: 0; max-width: 900px; }
.phases li { padding: 18px 0 18px 18px; border-left: 4px solid var(--line); }
.phases li:nth-child(1) { border-left-color: #d6d1ca; }
.phases li:nth-child(2) { border-left-color: #9c978f; }
.phases li:nth-child(3) { border-left-color: var(--graphite); }
.phases b { display: block; font-size: var(--fs-h3); }
.phases p { margin: 4px 0 0; color: var(--graphite); }
@media (min-width: 960px) {
  .phases { grid-template-columns: repeat(3, 1fr); }
  .phases li { border-left: 0; border-top: 6px solid var(--line); padding: 18px 24px 0 0; }
  .phases li:nth-child(1) { border-top-color: #d6d1ca; }
  .phases li:nth-child(2) { border-top-color: #9c978f; }
  .phases li:nth-child(3) { border-top-color: var(--graphite); }
}

/* 체크 목록 */
.checks { list-style: none; max-width: var(--text); }
.checks li { position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--line); }
.checks li::before {
  content: ""; position: absolute; left: 4px; top: 17px; width: 12px; height: 7px;
  border-left: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(-45deg);
}

/* 근거와 검토 */
.evidence { font-size: var(--fs-small); color: var(--muted); max-width: var(--text); }
.evidence h2 { font-size: 1.0625rem; color: var(--ink); margin-bottom: 10px; }
.evidence ol { padding-left: 1.3em; margin: 10px 0 14px; }
.evidence li { margin-bottom: 6px; }
.evidence .reviewed { color: var(--ink); font-weight: 600; }

.split { display: grid; gap: 28px; }
@media (min-width: 960px) { .split { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; } }
.figure-round img { border-radius: var(--radius); }
.figure-round figcaption { font-size: var(--fs-small); color: var(--muted); margin-top: 8px; }
