/* ===========================================================
   늘푸른한의원 — 공통 스타일 시스템
   브랜드: brand_guide.md 준수 (Primary #1A7DB5 계열)
   타이포: Nanum Myeongjo(헤드라인) + Noto Sans KR(본문)
   모바일 우선. 침도 허브는 .senior 클래스로 큰글자 변형.
   =========================================================== */

:root {
  /* 브랜드 컬러 */
  --primary: #1A7DB5;
  --primary-light: #5BB5DB;
  --accent: #4A8EAE;
  --dark: #0C5A84;
  --dark-text: #A8D8EF;
  --surface: #F5FAFE;
  --surface-hover: #E8F4FB;

  /* 중립 */
  --ink: #14303f;        /* 본문 텍스트 */
  --ink-soft: #4a5f6b;   /* 보조 텍스트 */
  --line: #d8e6ef;       /* 구분선 */
  --white: #ffffff;
  --shadow: 0 2px 12px rgba(12, 90, 132, 0.08);
  --shadow-lg: 0 8px 30px rgba(12, 90, 132, 0.14);

  /* 타이포 */
  --serif: 'Nanum Myeongjo', serif;
  --sans: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
          'Noto Sans KR', system-ui, sans-serif;

  /* 레이아웃 */
  --wrap: 1080px;
  --radius: 18px;
  --radius-sm: 12px;
  --cta-bar-h: 66px;      /* 하단 고정 CTA 높이 (모바일) */
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
/* hallmark #7 — 페이지 가장자리 클리핑(가로 스크롤 방지). clip: sticky/fixed 자손 보존. */
html, body { overflow-x: clip; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--white);
  line-height: 1.75;
  font-size: 17px;
  /* 하단 고정 CTA에 콘텐츠가 가려지지 않도록 */
  padding-bottom: calc(var(--cta-bar-h) + env(safe-area-inset-bottom, 0px));
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { font-family: var(--serif); font-weight: 800; color: var(--dark); line-height: 1.35; }
h1 { font-size: 1.9rem; letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin-bottom: 0.6em; }
h3 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.4em; }
p { margin-bottom: 1em; }
strong { color: var(--dark); font-weight: 700; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--ink-soft); }
.center { text-align: center; }
.serif { font-family: var(--serif); }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.94);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { height: 34px; width: auto; }
.brand .name { font-family: var(--serif); font-weight: 800; font-size: 1.15rem; color: var(--dark); }
.brand:hover { text-decoration: none; }

.nav-toggle {
  display: inline-flex; flex-direction: column; gap: 5px;
  background: none; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle span { width: 24px; height: 2px; background: var(--dark); border-radius: 2px; transition: .2s; }

.site-nav { display: none; }
.site-nav.open { display: block; }
.site-nav ul { list-style: none; }

@media (max-width: 820px) {
  .site-nav {
    position: absolute; top: 62px; left: 0; right: 0;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .site-nav ul { padding: 8px 0; }
  .site-nav li a {
    display: block; padding: 14px 20px; color: var(--ink);
    font-weight: 500; border-bottom: 1px solid var(--surface-hover);
  }
  .site-nav li a:hover { background: var(--surface); text-decoration: none; }
}

@media (min-width: 821px) {
  .nav-toggle { display: none; }
  .site-nav { display: block !important; }
  .site-nav ul { display: flex; gap: 4px; align-items: center; }
  .site-nav ul { gap: 2px; }
  .site-nav li a {
    display: block; padding: 8px 11px; border-radius: var(--radius-sm);
    color: var(--ink); font-weight: 500; font-size: 0.94rem;
  }
  .site-nav li a:hover { background: var(--surface-hover); text-decoration: none; }
  .site-nav li a.active { color: var(--primary); font-weight: 700; }
}

/* ---------- 히어로 ---------- */
.hero {
  background: linear-gradient(160deg, var(--surface) 0%, var(--surface-hover) 100%);
  padding: 54px 0 48px;
  text-align: center;
}
.hero h1 { font-size: 2rem; margin-bottom: 0.5em; }
.hero .sub { font-size: 1.12rem; color: var(--ink-soft); max-width: 560px; margin: 0 auto 1.4em; }
.hero .eyebrow {
  display: inline-block; font-family: var(--sans); font-weight: 700;
  font-size: 0.85rem; letter-spacing: 0.04em; color: var(--primary);
  background: var(--white); padding: 5px 14px; border-radius: 999px;
  margin-bottom: 1.2em; box-shadow: var(--shadow);
}

/* ---------- 섹션 ---------- */
section { padding: 44px 0; }
section.tint { background: var(--surface); }
.section-title { text-align: center; margin-bottom: 1.6em; }
.section-title h2 { font-size: 1.6rem; }
.section-title p { color: var(--ink-soft); }
.lead { font-size: 1.15rem; color: var(--ink); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--sans); font-weight: 700; font-size: 1rem;
  padding: 14px 26px; border-radius: 999px; border: 2px solid transparent;
  cursor: pointer; transition: .18s; text-align: center;
}
.btn:hover { text-decoration: none; }   /* hallmark #6 — hover 효과 1개: 색 변화(하위 -primary/-outline)만. translateY 제거 */
.btn-primary { background: var(--primary); color: var(--white); }
.btn-primary:hover { background: var(--dark); }
.btn-outline { background: var(--white); color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--surface-hover); }
.btn-lg { padding: 17px 34px; font-size: 1.1rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }

/* ---------- 두 입구 카드 (홈) ---------- */
.gates { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 700px) { .gates { grid-template-columns: 1fr 1fr; } }
.gate {
  display: block; background: var(--white); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 32px 28px; box-shadow: var(--shadow);
  transition: .2s; position: relative; overflow: hidden;
}
.gate:hover { box-shadow: var(--shadow-lg); text-decoration: none; }   /* hallmark #6 — hover 효과 1개: 그림자(elevation)만. translateY·border-color 제거 */
.gate .icon { font-size: 2.4rem; margin-bottom: 12px; }
.gate h2 { font-size: 1.4rem; margin-bottom: 0.3em; }
.gate .who { color: var(--primary); font-weight: 700; font-size: 0.95rem; margin-bottom: 0.7em; }
.gate p { color: var(--ink-soft); margin-bottom: 1em; }
.gate .go { color: var(--primary); font-weight: 700; }

/* ---------- 카드 그리드 (증상 등) ---------- */
.cards { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 620px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .cards.three { grid-template-columns: repeat(3, 1fr); } }
.card {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 22px 20px; box-shadow: var(--shadow);
}
.card h3 { color: var(--dark); }
.card p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.98rem; }
.card .icon { font-size: 1.6rem; margin-bottom: 8px; }

/* ---------- 정보 박스 / 강조 ---------- */
.callout {
  background: var(--surface); border-left: 4px solid var(--primary);
  border-radius: var(--radius-sm); padding: 20px 22px; margin: 22px 0;
}
.callout.strong { background: var(--dark); color: var(--dark-text); border-left-color: var(--primary-light); }
.callout.strong h3, .callout.strong strong { color: var(--white); }
.callout h3 { margin-bottom: 0.3em; }
.callout p:last-child { margin-bottom: 0; }

/* 3단 패턴 (문제→개입→결과) */
.steps { display: grid; grid-template-columns: 1fr; gap: 16px; counter-reset: step; }
@media (min-width: 780px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step {
  background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 24px 20px; position: relative;
}
.step .n {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 50%; background: var(--primary);
  color: var(--white); font-weight: 700; font-family: var(--serif); margin-bottom: 10px;
}
.step h3 { color: var(--dark); }
.step p { color: var(--ink-soft); margin-bottom: 0; font-size: 0.98rem; }

/* ---------- 진료시간 표 ---------- */
.hours { width: 100%; border-collapse: collapse; background: var(--white); border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow); }
.hours th, .hours td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--line); }
.hours th { background: var(--surface); font-weight: 700; color: var(--dark); width: 42%; }
.hours tr:last-child td, .hours tr:last-child th { border-bottom: 0; }
.hours .off { color: #b0463f; font-weight: 500; }
.hours .hi { color: var(--primary); font-weight: 700; }

/* ---------- 가격표 (비급여 고지) ---------- */
.price-table { width: 100%; border-collapse: collapse; background: var(--white); box-shadow: var(--shadow); border-radius: var(--radius-sm); overflow: hidden; font-size: 0.98rem; }
.price-table caption { text-align: left; font-family: var(--serif); font-weight: 800; color: var(--dark); font-size: 1.1rem; padding: 14px 4px; }
.price-table th, .price-table td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.price-table thead th { background: var(--dark); color: var(--white); font-weight: 700; }
.price-table tbody th { background: var(--surface); font-weight: 600; color: var(--ink); }
.price-table td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }
.price-table th.num { text-align: right; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 18px 0; }

/* ---------- FAQ (아코디언 + FAQPage 스키마 대응) ---------- */
.faq-list { max-width: 760px; margin: 0 auto; }
.faq-item { border: 1px solid var(--line); border-radius: var(--radius-sm); margin-bottom: 12px; overflow: hidden; background: var(--white); }
.faq-item summary {
  list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 700; color: var(--dark);
  display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 1.05rem;
}
/* 질문을 h3로 시맨틱화(헤드라인 스캔·AI 크롤러용). summary는 details의 첫 자식이어야 하므로
   heading을 summary '안'에 둔다 — 시각은 기존 summary 그대로 유지(폰트·마진 상속). */
.faq-item summary h3 { font: inherit; color: inherit; margin: 0; line-height: inherit; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; font-size: 1.5rem; color: var(--primary); font-weight: 400; line-height: 1; flex: none; }
.faq-item[open] summary::after { content: '\2212'; }
.faq-item summary:hover { background: var(--surface); }
.faq-item .answer { padding: 0 20px 18px; color: var(--ink-soft); }
.faq-item .answer p:last-child { margin-bottom: 0; }

/* ---------- 크로스링크 배너 (보호자 등) ---------- */
.crosslink {
  background: linear-gradient(135deg, var(--dark) 0%, var(--primary) 100%);
  color: var(--white); border-radius: var(--radius); padding: 28px 26px; text-align: center;
}
.crosslink h2, .crosslink h3 { color: var(--white); }
.crosslink p { color: var(--dark-text); }
.crosslink .btn-outline { background: transparent; color: var(--white); border-color: var(--white); }
.crosslink .btn-outline:hover { background: rgba(255,255,255,0.12); }

/* ---------- 목록 콘텐츠 (칼럼 링크 등) ---------- */
.link-list { list-style: none; }
.link-list li { border-bottom: 1px solid var(--line); }
.link-list li a { display: block; padding: 15px 4px; color: var(--ink); font-weight: 500; }
.link-list li a:hover { color: var(--primary); text-decoration: none; }
.tag { display:inline-block; background: var(--surface-hover); color: var(--accent); font-size: 0.78rem; font-weight:700; padding: 2px 9px; border-radius: 999px; margin-left:6px; }

/* ---------- 하단 고정 CTA 4종 ---------- */
.cta-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: grid; grid-template-columns: repeat(4, 1fr);
  background: var(--white); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 14px rgba(12,90,132,0.10);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.cta-bar a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 4px; height: var(--cta-bar-h); color: var(--ink-soft);
  font-size: 0.72rem; font-weight: 600; text-align: center; border-right: 1px solid var(--surface-hover);
}
.cta-bar a:last-child { border-right: 0; }
.cta-bar a:hover { text-decoration: none; background: var(--surface); color: var(--primary); }
.cta-bar a .ic { font-size: 1.35rem; line-height: 1; }
.cta-bar a.call { color: var(--primary); }
.cta-bar a.book { background: var(--primary); color: var(--white); }
.cta-bar a.book:hover { background: var(--dark); color: var(--white); }

@media (min-width: 821px) {
  :root { --cta-bar-h: 60px; }
  .cta-bar { grid-template-columns: repeat(4, minmax(0, 200px)); justify-content: center; gap: 0; }
  .cta-bar a { flex-direction: row; gap: 8px; font-size: 0.92rem; }
}

/* ---------- 푸터 ---------- */
.site-footer { background: var(--dark); color: var(--dark-text); padding: 40px 0 30px; margin-top: 20px; }
.site-footer a { color: var(--dark-text); }
.site-footer a:hover { color: var(--white); }
.site-footer .cols { display: grid; grid-template-columns: 1fr; gap: 26px; }
@media (min-width: 700px) { .site-footer .cols { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h4 { font-family: var(--serif); color: var(--white); font-size: 1.05rem; margin-bottom: 10px; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 7px; font-size: 0.94rem; }
.site-footer .legal { border-top: 1px solid rgba(168,216,239,0.2); margin-top: 26px; padding-top: 18px; font-size: 0.82rem; color: rgba(168,216,239,0.7); }

/* ---------- 유틸 여백 ---------- */
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 12px; } .mt-2 { margin-top: 24px; } .mt-3 { margin-top: 36px; }
.mb-2 { margin-bottom: 24px; }
.note { font-size: 0.85rem; color: var(--ink-soft); }
.pill-note { background: #fff8e6; border: 1px solid #f0dca0; color: #7a5c12; border-radius: var(--radius-sm); padding: 12px 16px; font-size: 0.9rem; margin: 16px 0; }

/* ===========================================================
   침도 허브 = 어르신 가독 변형 (.senior)
   큰 글자·큰 버튼·넉넉한 여백. VAS 폼과 동일 철학.
   =========================================================== */
body.senior { font-size: 20px; line-height: 1.85; }
body.senior h1 { font-size: 2.2rem; }
body.senior h2 { font-size: 1.8rem; }
body.senior h3 { font-size: 1.35rem; }
body.senior .hero h1 { font-size: 2.3rem; }
body.senior .hero .sub { font-size: 1.3rem; }
body.senior .lead { font-size: 1.3rem; }
body.senior .btn { font-size: 1.2rem; padding: 18px 34px; }
body.senior .btn-lg { font-size: 1.35rem; padding: 22px 40px; }
body.senior .card p, body.senior .step p { font-size: 1.1rem; }
body.senior section { padding: 52px 0; }
body.senior .cta-bar a { font-size: 0.8rem; }
@media (min-width: 821px) { body.senior .cta-bar a { font-size: 1rem; } }

/* ---------- 히어로 영상 ---------- */
.hero-media { max-width: 860px; margin: 26px auto 0; }
.hero-media video, .hero-media img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius); box-shadow: var(--shadow-lg); background: var(--surface-hover);
}

/* ---------- 원장 크레딧 라인 ---------- */
.credit-bar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 0; }
.credit-bar .wrap { text-align: center; }
.doctor-credit { font-size: 0.95rem; font-weight: 600; color: var(--primary); }
.doctor-credit:hover { color: var(--dark); }
body.senior .doctor-credit { font-size: 1.1rem; }

/* ---------- 정지 이미지 히어로 (배경 + 오버레이 + Ken Burns) ---------- */
.hero-photo { position: relative; overflow: hidden; color: #fff; }
.hero-photo::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background-image: var(--hero-img); background-size: cover; background-position: center 35%;
  transform-origin: center; transform: scale(1.04);
  animation: kenburns 22s ease-out infinite alternate;
}
.hero-photo::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, rgba(12,90,132,0.55) 0%, rgba(12,90,132,0.78) 100%);
}
.hero-photo .wrap { position: relative; z-index: 2; }
.hero-photo h1 { color: #fff; }
.hero-photo .sub { color: rgba(255,255,255,0.92); }
@keyframes kenburns { from { transform: scale(1.04); } to { transform: scale(1.16); } }
@media (prefers-reduced-motion: reduce) {
  .hero-photo::before { animation: none; transform: scale(1.04); }
}

/* ---------- 사진 (치료 스틸) ---------- */
.photo-row { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 760px) { .photo-row.three { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 560px) { .photo-row.four { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .photo-row.four { grid-template-columns: repeat(4, 1fr); } }
.figure { margin: 0; }
.figure img {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-radius: var(--radius-sm); box-shadow: var(--shadow); background: var(--surface-hover);
}
.figure figcaption { font-size: 0.9rem; color: var(--ink-soft); margin-top: 8px; text-align: center; }
body.senior .figure figcaption { font-size: 1.05rem; }
.list { margin: 0.4em 0 1.2em 1.25em; }
.list li { margin-bottom: 6px; }
.media-single { max-width: 620px; margin: 8px auto 0; }
.map-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 160px; text-align: center; padding: 24px;
  border: 2px dashed var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--ink-soft);
}
.map-placeholder .ic { font-size: 1.8rem; }
.map-placeholder .label { font-weight: 700; color: var(--accent); }
.media-single img { width: 100%; border-radius: var(--radius); box-shadow: var(--shadow); object-fit: cover; }

/* ---------- 칼럼 (아티클 + 허브) ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); margin-bottom: 8px; }
.breadcrumb a { color: var(--ink-soft); }
.article { max-width: 760px; }
.article h1 { margin-bottom: 12px; }
.article-meta { color: var(--ink-soft); font-size: 0.9rem; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 24px; }
.article h2 { font-size: 1.4rem; margin-top: 1.6em; }
.article ul { margin: 0 0 1.1em 1.25em; }
.article li { margin-bottom: 6px; }
.article .faq-list { margin-top: 8px; }
.cta-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px 24px; margin-top: 32px; text-align: center; }
.cta-box p { font-size: 1.08rem; color: var(--dark); font-weight: 500; margin-bottom: 14px; }
body.senior .article-meta { font-size: 1rem; }
body.senior .cta-box p { font-size: 1.25rem; }

.column-list { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 700px) { .column-list { grid-template-columns: 1fr 1fr; } }
.column-card { display: block; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 22px 20px; box-shadow: var(--shadow); transition: .2s; }
.column-card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); text-decoration: none; border-color: var(--primary-light); }
.column-card .hub-tag { display: inline-block; font-size: 0.75rem; font-weight: 700; color: var(--primary); background: var(--surface-hover); padding: 3px 10px; border-radius: 999px; margin-bottom: 10px; }
.column-card h2 { font-size: 1.18rem; margin-bottom: 6px; color: var(--dark); }
.column-card p { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0; }

/* 접근성: 포커스 표시 */
a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid var(--primary-light); outline-offset: 2px; border-radius: 4px;
}

/* 모션 최소화 선호 */
@media (prefers-reduced-motion: reduce) {
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ── hallmark 외과 수정 (2026-07-20): #5 인터랙션 상태 · 아이콘 SVG 사이징 ── */
/* #5 — :focus-visible(즉시 링, transition 없음)·:active·:disabled. 키보드 접근성. */
a:focus-visible,
.btn:focus-visible,
.gate:focus-visible,
.site-nav li a:focus-visible,
.cta-bar a:focus-visible,
.nav-toggle:focus-visible,
.faq-item summary:focus-visible,
.link-list li a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
.btn:active { transform: translateY(1px); }        /* 눌림 피드백(active 한정) */
.gate:active { box-shadow: var(--shadow); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.5; cursor: not-allowed; pointer-events: none;
}

/* 아이콘 = Lucide 라인 SVG(currentColor). 이모지 대체 — 의료 톤·절제. */
.card .icon svg { width: 1.75rem; height: 1.75rem; stroke: var(--primary); }
.gate .icon svg { width: 2.2rem;  height: 2.2rem;  stroke: var(--primary); }
.cta-bar a .ic svg { width: 22px; height: 22px; }   /* currentColor: 기본 ink-soft, hover primary */
.eyebrow svg, .btn svg { width: 1.05em; height: 1.05em; vertical-align: -0.16em; }
.btn svg { margin-right: 0.4em; }
