/* ==========================================================================
   광주베스트이비인후과 — 공통 스타일 / 디자인 토큰
   ========================================================================== */

@import url('https://cdnjs.cloudflare.com/ajax/libs/pretendard/1.3.9/static/pretendard.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  /* --- Primary: 신뢰감 있는 딥 네이비 --- */
  --navy:        #1d3557;
  --navy-deep:   #142640;
  --navy-soft:   #3f5878;
  --navy-mist:   #eef1f6;

  /* --- Accent: 청각/호흡을 은유하는 틸 --- */
  --teal:        #2f8f8a;
  --teal-deep:   #226b67;
  --teal-soft:   #d9ece9;

  /* --- Neutral / Paper --- */
  --paper:       #faf9f6;
  --paper-deep:  #f1efe9;
  --ink:         #1c2024;
  --ink-soft:    #4e5964;   /* 가독성 위해 명도 낮춤 (AA 대비 확보) */
  --line:        #e2e2df;
  --white:       #ffffff;

  /* --- Type: Pretendard(제목/본문/버튼) + Noto Sans KR(진료시간·공지 등 정보성 텍스트) --- */
  --font-heading: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-info:    'Noto Sans KR', 'Pretendard', sans-serif;
  --font-mono:    'Inter', sans-serif;

  /* --- Layout --- */
  --container-w: 1160px;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --shadow-card: 0 4px 24px rgba(29, 53, 87, 0.08);
  --shadow-hover: 0 10px 32px rgba(29, 53, 87, 0.14);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.65;
  letter-spacing: -0.01em;
  overflow-x: hidden;
  word-break: keep-all;       /* 한글 단어 단위 줄바꿈 — 어색한 개행 방지 */
  overflow-wrap: break-word;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
ul { list-style: none; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  word-break: keep-all;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal-deep);
  margin-bottom: 14px;
}
.eyebrow::before {
  content: '';
  width: 18px;
  height: 2px;
  background: var(--teal);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-family: var(--font-heading);
  font-weight: 500;
  font-size: 15px;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.btn-primary {
  background: var(--navy);
  color: var(--white);
}
.btn-primary:hover { background: var(--navy-deep); box-shadow: var(--shadow-hover); transform: translateY(-2px); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--navy);
}
.btn-outline:hover { background: var(--navy); color: var(--white); }

.section { padding: 96px 0; }
.section-alt { background: var(--white); }

@media (max-width: 768px) {
  .section { padding: 56px 0; }
  .container { padding: 0 40px; }
  body { font-size: 15.5px; }
}

/* Skip link / accessibility */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--navy);
  color: #fff;
  padding: 12px 20px;
  z-index: 999;
}
.skip-link:focus { left: 16px; top: 16px; }

.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;
}

:focus-visible {
  outline: 2.5px solid var(--teal);
  outline-offset: 3px;
}

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

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(250,249,246,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 78px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-img { height: 42px; width: auto; }
.logo-text { display: flex; flex-direction: column; line-height: 1.2; }
.logo-kr { font-family: var(--font-heading); font-size: 19px; font-weight: 700; color: var(--navy); }
.logo-en { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em; color: var(--ink-soft); }

.main-nav > ul { display: flex; gap: 24px; }
.nav-item > a {
  position: relative;
  font-size: 17px; font-weight: 600; color: var(--ink); padding: 10px 2px;
  white-space: nowrap; letter-spacing: -0.005em;
}
.nav-item > a::after {
  content: '';
  position: absolute; left: 2px; right: 2px; bottom: 4px;
  height: 2px; background: var(--teal);
  transform: scaleX(0); transform-origin: left;
  transition: transform .25s cubic-bezier(.22,.61,.36,1);
}
.nav-item > a:hover { color: var(--navy); }
.nav-item > a:hover::after { transform: scaleX(1); }
.nav-item.has-children { position: relative; }

.dropdown {
  padding: 10px 8px;
}
.dropdown li a {
  display: block; padding: 11px 16px; font-size: 14.5px; font-family: var(--font-info);
  color: var(--ink-soft); white-space: nowrap; border-radius: var(--radius-sm);
}
.dropdown li a:hover { background: var(--navy-mist); color: var(--navy); }

@media (min-width: 1281px) {
  .dropdown {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    box-shadow: 0 20px 48px rgba(15,25,40,0.14);
    min-width: 200px;
    opacity: 0; visibility: hidden; translate: 0 10px;
    transition: opacity .22s ease, translate .22s ease;
    overflow: hidden;
  }
  .dropdown::before {
    content: '';
    position: absolute; top: 0; left: 14px; right: 14px; height: 2px;
    background: linear-gradient(90deg, var(--teal), var(--navy));
  }
  .nav-item.has-children:hover .dropdown,
  .nav-item.has-children.touch-open .dropdown { opacity: 1; visibility: visible; translate: 0 0; }
  .dropdown li a {
    opacity: 0; transform: translateY(4px);
    transition: background .15s ease, color .15s ease, opacity .3s ease, transform .3s ease;
  }
  .nav-item.has-children:hover .dropdown li a,
  .nav-item.has-children.touch-open .dropdown li a { opacity: 1; transform: translateY(0); }
  .dropdown li:nth-child(1) a { transition-delay: .03s; }
  .dropdown li:nth-child(2) a { transition-delay: .07s; }
  .dropdown li:nth-child(3) a { transition-delay: .11s; }
  .dropdown li:nth-child(4) a { transition-delay: .15s; }
  .dropdown li:nth-child(5) a { transition-delay: .19s; }
}

.header-actions { display: flex; align-items: center; gap: 16px; }
.tel-btn {
  font-family: var(--font-mono); font-weight: 700; font-size: 14.5px;
  color: var(--navy); border: 1.5px solid var(--navy); padding: 9px 16px; border-radius: 999px;
}
.tel-btn:hover { background: var(--navy); color: #fff; }

.hamburger { display: none; flex-direction: column; gap: 5px; width: 26px; }
.hamburger span { display: block; height: 2px; background: var(--navy); border-radius: 2px; }

.mobile-nav {
  display: none;
  max-height: 0; overflow: hidden;
  transition: max-height .25s ease;
  background: #fff; border-bottom: 1px solid var(--line);
}
.mobile-nav.open { max-height: calc(100vh - 78px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.mobile-nav ul { padding: 4px 24px 24px; }

/* 카테고리 라벨 (병원소개, 귀클리닉 등) — 클릭 시 첫 하위페이지로 이동하되, 시각적으로는 작은 라벨 */
.mobile-nav .nav-item { border-bottom: none; }
.mobile-nav .nav-item > a {
  display: block;
  padding: 22px 0 6px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--teal-deep);
}
.mobile-nav .nav-item:first-child > a { padding-top: 8px; }
.mobile-nav .nav-item > a::after { display: none; }

/* 하위 항목 — 박스 없이 구분선으로만 구분되는 플랫 리스트 */
.mobile-nav .dropdown {
  position: static; opacity: 1; visibility: visible; box-shadow: none;
  background: transparent; padding: 0; margin: 0;
}
.mobile-nav .dropdown::before { display: none; }
.mobile-nav .dropdown li { border-bottom: 1px solid var(--line); }
.mobile-nav .dropdown li:last-child { border-bottom: none; }
.mobile-nav .dropdown li a {
  display: block;
  padding: 15px 2px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  opacity: 1; transform: none;
}
.mobile-nav .dropdown li a:active { background: var(--paper-deep); }

@media (max-width: 1280px) {
  .main-nav { display: none; }
  .tel-btn { display: none; }
  .hamburger { display: flex; }
  .mobile-nav { display: block; }
}

/* ==========================================================================
   Footer / Quick menu / Mobile tabbar / Hours modal
   ========================================================================== */
.site-footer { background: var(--navy-deep); color: rgba(255,255,255,0.75); padding: 56px 0 28px; }
.footer-inner { display: grid; gap: 10px; }
.footer-inner.has-map {
  grid-template-columns: 1fr 380px;
  gap: 48px;
  align-items: center;
}
.footer-map { align-self: stretch; }
.footer-map #footerMap {
  width: 100%; height: 100%; min-height: 220px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(255,255,255,0.06);
}
@media (max-width: 900px) {
  .footer-inner.has-map { grid-template-columns: 1fr; }
  .footer-map #footerMap { height: 220px; margin-top: 24px; }
}
.footer-brand strong { font-family: var(--font-heading); color: #fff; font-size: 18px; margin-right: 10px; }
.footer-brand span { font-family: var(--font-mono); font-size: 12px; color: rgba(255,255,255,0.5); }
.footer-info { margin-top: 12px; font-size: 13.5px; font-family: var(--font-info); display: grid; gap: 4px; }
.footer-links { display: flex; gap: 18px; margin-top: 18px; font-size: 13px; }
.footer-links a:hover { color: #8fd6cf; }
.footer-refs { margin-top: 10px; opacity: 0.6; font-size: 12px; }
.footer-copyright { margin-top: 28px; font-size: 12px; color: rgba(255,255,255,0.4); }

.quick-menu {
  position: fixed; right: 22px; top: 50%; transform: translateY(-50%);
  display: flex; flex-direction: column; gap: 8px; z-index: 90;
}
.quick-btn {
  width: 60px; height: 60px; border-radius: 16px;
  background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  font-family: var(--font-info);
  font-size: 10.5px; color: var(--navy); font-weight: 500; text-align: center;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.quick-btn svg { width: 20px; height: 20px; }
.quick-btn:hover { background: var(--navy); color: #fff; transform: translateX(-2px); }
.quick-top { background: var(--teal); color: #fff; }
.quick-top:hover { background: var(--teal-deep); color: #fff; }

.mobile-tabbar {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: #fff; border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  grid-template-columns: repeat(4, 1fr);
}
.mobile-tabbar a, .mobile-tabbar button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  font-family: var(--font-info);
  font-size: 11px; font-weight: 500; color: var(--navy-soft); padding: 7px 0;
}
.mobile-tabbar svg { width: 21px; height: 21px; }
@media (max-width: 900px) {
  .quick-menu { display: none; }
  .mobile-tabbar { display: grid; }
  body { padding-bottom: 64px; }
}

.hours-modal-overlay {
  position: fixed; inset: 0; background: rgba(20,38,64,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 200; opacity: 0; visibility: hidden; transition: opacity .2s ease;
}
.hours-modal-overlay.open { opacity: 1; visibility: visible; }
.hours-modal {
  background: #fff; border-radius: var(--radius-md); padding: 32px 28px;
  width: 90%; max-width: 340px; position: relative;
}
.hours-modal h3 { margin-bottom: 16px; font-size: 19px; }
.hours-modal-close {
  position: absolute; top: 14px; right: 16px; font-size: 22px; color: var(--ink-soft);
}
.hours-break-note { font-size: 12px; color: var(--ink-soft); }

/* ==========================================================================
   Scroll reveal (공통) — js/scroll-reveal.js 와 함께 사용
   ========================================================================== */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s cubic-bezier(.22,.61,.36,1), transform .7s cubic-bezier(.22,.61,.36,1);
  transition-delay: var(--reveal-delay, 0s);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-reveal-delay="1"] { --reveal-delay: .08s; }
.reveal[data-reveal-delay="2"] { --reveal-delay: .16s; }
.reveal[data-reveal-delay="3"] { --reveal-delay: .24s; }
.reveal[data-reveal-delay="4"] { --reveal-delay: .32s; }
.reveal[data-reveal-delay="5"] { --reveal-delay: .4s; }
.reveal[data-reveal-delay="6"] { --reveal-delay: .48s; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
