/* ═════════════════════════════════════════════════════════════
   따라오는 메뉴바, 퀵메뉴, 둥근 카드 (site.css 다음에 읽는다)
   둥근 정도는 크기에 따라 다르게: 큰 패널 24 > 카드 18 > 사진 12 > 작은 사진 10 > 버튼 완전 둥글게
   그림자는 회색 대신 자홍 기운이 도는 그림자로 바탕색과 어울리게
   ═════════════════════════════════════════════════════════════ */

:root {
  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 10px;
  --shadow-1: 0 1px 2px rgb(98 30 66 / 0.06), 0 8px 22px -8px rgb(98 30 66 / 0.16);
  --shadow-2: 0 2px 6px rgb(98 30 66 / 0.07), 0 20px 40px -14px rgb(98 30 66 / 0.26);
  --header-h: 82px;
}

html { scroll-padding-top: calc(var(--header-h) + 16px); }

/* ── 따라오는 메뉴바 ── */
.site-header { position: sticky; top: 0; z-index: 50; }
.site-header.is-scrolled { box-shadow: var(--shadow-1); border-bottom-color: transparent; }
@media (min-width: 1100px) {
  .site-header.is-scrolled .bar { min-height: 66px; }
  .site-header.is-scrolled .gnb-item > a { padding-block: 21px; }
}
@media (max-width: 1099px) { :root { --header-h: 64px; } }

.subnav { top: calc(var(--header-h) + 20px); }
.stop, .facility-floor { scroll-margin-top: calc(var(--header-h) + 16px); }

/* 펼침 메뉴 */
.gnb-sub {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 8px;
}
.gnb-sub a { border-radius: var(--r-sm); padding: 8px 14px; }
.m-nav summary { border-radius: 999px; }
.m-nav-panel { border-radius: 0 0 var(--r-xl) var(--r-xl); box-shadow: var(--shadow-2); }
.m-nav-en {
  grid-column: 1 / -1; justify-self: start;
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 14px; padding: 8px 16px 8px 8px; border-radius: 999px;
  background: #1f2a4d; color: #fff; font-size: 14px; font-weight: 700; text-decoration: none;
}
.m-nav-en:hover { color: #fff; background: #2b3a69; }

/* ── 첫 화면 ── */
.intro-emergency {
  border-left: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding: 22px 28px;
}
.em-title { color: var(--magenta-deep); }

/* 오늘 진료: 진료과마다 카드 */
.today-list { background: none; border: 0; gap: 12px; }
.today-list li + li { border-left: 0; }
.today-list li { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.today-list a { border-radius: inherit; }
@media (max-width: 899px) {
  .today-list li:nth-child(n+3) { border-top: 0; }
  .today-list { gap: 10px; }
}

/* 층 목록: 한 장의 카드 (위아래 여백을 두지 않아 건물 그림과 높이가 맞는다) */
.floors {
  background: var(--paper);
  border-top: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding-inline: 12px;
  overflow: hidden;
}
.floors > li { border-bottom-color: var(--line); }
.floors > li:last-child { border-bottom: 0; }

/* 층 안내 패널 */
.stop {
  border: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.stop-hero figcaption { border-radius: 999px; left: 16px; bottom: 16px; padding: 4px 12px; }
.dept-note { border-radius: var(--r-md); }
.stop-thumbs img { border-radius: var(--r-sm); }

/* ── 아이를 만나기까지: 단계마다 카드 ── */
.journey { background: var(--blush); border-top: 1px solid var(--line); }
.journey-steps a {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  height: 100%;
  padding-bottom: 20px;
}
.journey-steps h3, .journey-steps p { padding-inline: 18px; }
.step-floor { border-radius: 999px; margin-left: 16px; }
.journey-steps a:hover { box-shadow: var(--shadow-2); }
@media (max-width: 599px) {
  .journey-steps { gap: 12px; }
  .journey-steps li { border-bottom: 0; padding-block: 0; }
  .journey-steps a { padding: 12px; column-gap: 14px; }
  .journey-steps img { border-radius: var(--r-md); }
  .journey-steps h3, .journey-steps p { padding-inline: 0; }
  .step-floor { margin-left: 0; }
}

/* ── 의료진 카드 ── */
.doctors { background: var(--paper); }
.doctor-grid a {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  height: 100%;
  padding-bottom: 18px;
}
.doc-photo { border-bottom: 0; }
.doc-dept, .doc-name, .doc-focus { padding-inline: 16px; }
.doctor-grid a:hover { box-shadow: var(--shadow-2); }
.doctor-grid a:hover .doc-name { text-decoration: none; }

/* ── 소식, 강좌 ── */
.home-lower { border-top: 0; }
.post-list {
  border-top: 0;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding: 4px 24px;
}
.post-list li:last-child { border-bottom: 0; }
.class-list li { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 10px 16px 10px 10px; }
.class-list time { background: var(--blush); border-radius: var(--r-md); }

/* ── 바로가기 ── */
.shortcuts a {
  border-left: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
}
.shortcuts a:hover { box-shadow: var(--shadow-2); }

/* ── 하위 페이지 ── */
.subnav {
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding: 20px 22px 12px;
}
.subnav > ul > li:last-child { border-bottom: 0; }
.subnav > ul > li > a[aria-current="page"] { box-shadow: none; padding-left: 12px; background: var(--tint); border-radius: var(--r-sm); }
@media (max-width: 899px) {
  .subnav { border-radius: 0; box-shadow: none; padding: 10px var(--gutter); }
  .subnav > ul > li > a[aria-current="page"] { background: none; padding-left: 0; }
}

.legacy table, .legacy .c_table {
  border-top: 0;
  border-collapse: separate; border-spacing: 0;
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  background: var(--paper);
}
.legacy tr:last-child > th, .legacy tr:last-child > td { border-bottom: 0; }
.legacy img, .legacy iframe, .legacy .root_daum_roughmap { border-radius: var(--r-lg); overflow: hidden; }

.facility-grid img { border-radius: var(--r-md); }
.facility-floor h2 { border-bottom: 0; padding-bottom: 0; }

.cal {
  border-top: 0;
  border-collapse: separate; border-spacing: 0;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  background: var(--paper);
}
.cal td { border: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.cal td:first-child { border-left: 0; }
.cal-list { border-top: 0; background: var(--paper); border-radius: var(--r-xl); box-shadow: var(--shadow-1); padding: 4px 20px; }
.cal-list li:last-child { border-bottom: 0; }

.board-search input, .board-search button, .post-back a { border-radius: 999px; }
.board-search input { padding-inline: 18px; }
.board-list {
  border-top: 0;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-1);
  padding: 4px 24px;
}
.board-list li:last-child { border-bottom: 0; }
.pager a, .pager span { border-radius: 999px; }
.post-image, .post-body img { border-radius: var(--r-lg); }
.post-files { background: var(--blush); border: 0; border-radius: var(--r-lg); padding: 14px 20px; }

.popups { border-radius: var(--r-xl); overflow: hidden; }
.popups-bar button { border-radius: 999px; }
.skip { border-radius: 999px; }

/* ── 퀵메뉴 ── */
.quick { position: fixed; z-index: 40; }
.quick ul {
  list-style: none; margin: 0; padding: 8px;
  background: var(--paper);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-2);
  display: grid; gap: 2px;
}
.quick a, .quick button {
  display: grid; justify-items: center; gap: 3px;
  width: 74px; padding: 10px 4px;
  border: 0; border-radius: var(--r-lg);
  background: none; color: var(--ink);
  font: inherit; font-size: 12px; font-weight: 700; line-height: 1.2;
  text-decoration: none; cursor: pointer;
}
.quick svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.quick a:hover, .quick button:hover { background: var(--tint); color: var(--magenta-deep); }
.quick .q-call a { background: var(--magenta); color: #fff; }
.quick .q-call a:hover { background: var(--magenta-deep); color: #fff; }
html:not(.is-scrolled) .quick .q-top { display: none; }

/* 인스타그램: 로고 색(그라데이션) */
.quick .q-insta svg { stroke: url(#q-insta-grad); stroke-width: 1.9; }
.quick .q-insta .q-insta-dot { fill: #962fbf; stroke: none; }
.q-en-badge {
  display: grid; place-items: center;
  width: 26px; height: 22px; border-radius: 6px;
  background: rgb(255 255 255 / 0.16);
  font-size: 11px; font-weight: 800; letter-spacing: 0.04em; color: #e8c88a;
}

/* 넓은 화면: 오른쪽 세로 (본문 바깥 여백에 놓인다) */
@media (min-width: 1440px) {
  .quick { right: 16px; top: 50%; translate: 0 -50%; }
}

/* 그보다 좁은 화면: 아래 가운데에 떠 있는 가로 줄 */
@media (max-width: 1439px) {
  .quick { left: 50%; bottom: 16px; translate: -50% 0; }
  .quick ul { grid-auto-flow: column; padding: 6px; border-radius: 999px; }
  .quick a, .quick button {
    width: auto; min-width: 76px; padding: 8px 14px; border-radius: 999px;
    grid-auto-flow: column; gap: 6px; align-items: center; font-size: 13px;
  }
  .quick svg { width: 20px; height: 20px; }
  body { padding-bottom: 84px; }
}

/* 태블릿·휴대폰: 가로 줄이 넘치지 않도록 진료시간 대신 진료스케줄을 두고, 인스타그램은 로고만 */
.quick a span, .quick button span { white-space: nowrap; }
@media (max-width: 899px) {
  .quick .q-hours { display: none; }
  .quick a, .quick button { min-width: 0; padding: 8px 12px; }
  .quick .q-insta span { display: none; }
}

/* 휴대폰: 화면 아래 꽉 찬 버튼 줄 */
@media (max-width: 599px) {
  .quick { left: 0; right: 0; bottom: 0; translate: none; }
  .quick ul {
    grid-auto-flow: row; grid-template-columns: repeat(4, 1fr);
    border-radius: var(--r-xl) var(--r-xl) 0 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .quick .q-hours, .quick .q-top, .quick .q-insta { display: none !important; }
  .quick a { min-width: 0; grid-auto-flow: row; gap: 2px; padding: 8px 2px; border-radius: var(--r-md); font-size: 12px; }
  body { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: no-preference) {
  .bar, .gnb-item > a { transition: min-height .2s ease, padding .2s ease; }
  .site-header, .journey-steps a, .doctor-grid a, .shortcuts a { transition: box-shadow .2s ease; }
}
