@charset "utf-8";
/* 고산정담치과의원 — main.css
   Tokens derive from RESEARCH/design-tokens.json (authority: industry-research).
   No external font/CDN dependency. No reference-origin code. */

/* ------------------------------------------------------------------ tokens */
:root {
  /* color */
  --c-brand-900: #1F2A26;
  --c-brand-700: #2F4A3F;
  --c-brand-600: #3F5D52;
  --c-brand-500: #547C6D;
  --c-brand-100: #EDF3EF;
  --c-accent-600: #A8823C;
  --c-surface: #FBFBF9;
  --c-surface-raised: #FFFFFF;
  --c-border: #DDE4E0;
  --c-text: #1F2A26;
  --c-text-2: #55645D;
  --c-text-inverse: #FBFBF9;
  --c-focus: #1B6B4A;
  --c-scrim: rgba(31, 42, 38, 0.58);
  --c-accent-100: #FBF3E3;
  --c-table-head: var(--c-brand-600);
  --c-table-head-text: var(--c-text-inverse);
  --c-table-today: var(--c-accent-100);
  --c-table-today-bar: var(--c-accent-600);
  --c-code-bg: #F1F4F2;

  /* type */
  --f-base: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    'Apple SD Gothic Neo', 'Malgun Gothic', system-ui, sans-serif;
  --fs-display: 26px;
  --fs-h1: 26px;
  --fs-h2: 22px;
  --fs-h3: 20px;
  --fs-body: 16px;
  --fs-small: 15px;
  --fs-caption: 14px;
  --lh-tight: 1.45;
  --lh-base: 1.7;
  --lh-loose: 1.8;
  --ls-heading: -0.02em;
  --ls-body: -0.005em;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-bold: 700;

  /* space */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 28px;
  --s-8: 32px;
  --s-10: 40px;
  --s-12: 48px;
  --s-16: 64px;
  --s-20: 80px;
  --s-24: 96px;

  /* radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 14px;
  --r-xl: 16px;
  --r-pill: 999px;

  /* shadow */
  --sh-sm: 0 1px 2px rgba(31, 42, 38, 0.06);
  --sh-md: 0 4px 16px rgba(31, 42, 38, 0.08);
  --sh-drawer: 0 0 32px rgba(31, 42, 38, 0.18);

  /* layout */
  --container: 1200px;
  --container-narrow: 820px;
  --gutter: 16px;
  --header-h: 60px;
  --call-bar-h: 56px;
  --tap-min: 44px;
  --rhythm: 36px;

  /* motion */
  --d-fast: 180ms;
  --d-base: 240ms;
  --d-slow: 600ms;
  --ease: cubic-bezier(0.2, 0, 0.2, 1);
}

@media (min-width: 768px) {
  :root {
    --fs-display: 34px;
    --fs-h1: 36px;
    --fs-h2: 28px;
    --fs-body: 17px;
    --gutter: 24px;
    --header-h: 76px;
    --rhythm: 64px;
  }
}

@media (min-width: 1440px) {
  :root {
    --fs-display: 44px;
    --rhythm: 80px;
  }
}

/* ------------------------------------------------------------------- reset */
*,
*::before,
*::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--c-surface);
  color: var(--c-text);
  font-family: var(--f-base);
  font-size: var(--fs-body);
  font-weight: var(--fw-regular);
  line-height: var(--lh-base);
  letter-spacing: var(--ls-body);
  overflow-x: hidden;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

img { max-width: 100%; display: block; }
a { color: var(--c-brand-600); }
h1, h2, h3, h4 {
  margin: 0;
  color: var(--c-brand-900);
  font-weight: var(--fw-bold);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-heading);
}
p, ul, ol, dl, table { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--c-focus);
  outline-offset: 2px;
  border-radius: 2px;
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: var(--s-4);
  top: -100px;
  z-index: 200;
  padding: var(--s-3) var(--s-5);
  background: var(--c-brand-600);
  color: var(--c-text-inverse);
  border-radius: var(--r-sm);
  text-decoration: none;
  transition: top var(--d-fast) var(--ease);
}
.skip-link:focus { top: var(--s-3); }

/* --------------------------------------------------------------- container */
.container {
  width: 100%;
  max-width: calc(var(--container) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(var(--container-narrow) + var(--gutter) * 2); }

/* Keeps a phone/fax number from breaking after a hyphen; the label may still wrap. */
.nowrap { white-space: nowrap; }

.section { padding-block: var(--rhythm); }
.section--alt { background: var(--c-brand-100); }

.section__head { max-width: 720px; margin-bottom: var(--s-6); }
.section__eyebrow {
  display: block;
  margin-bottom: var(--s-2);
  color: var(--c-brand-600);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section__title { font-size: var(--fs-h2); }
.section__lead {
  margin-top: var(--s-3);
  color: var(--c-text-2);
  font-size: var(--fs-body);
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--tap-min);
  padding: var(--s-3) var(--s-6);
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  line-height: 1.4;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--d-fast) var(--ease),
              border-color var(--d-fast) var(--ease),
              color var(--d-fast) var(--ease);
}
.btn--primary { background: var(--c-brand-600); color: var(--c-text-inverse); }
.btn--primary:hover { background: var(--c-brand-500); }
.btn--ghost {
  background: transparent;
  border-color: var(--c-border);
  color: var(--c-brand-700);
}
.btn--ghost:hover { border-color: var(--c-brand-500); color: var(--c-brand-600); }
.btn--lg { min-height: 56px; padding-inline: var(--s-8); font-size: var(--fs-body); }
.btn--block { width: 100%; }

/* ----------------------------------------------------------------- header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: color-mix(in srgb, var(--c-surface) 94%, transparent);
  -webkit-backdrop-filter: saturate(1.4) blur(8px);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.site-header.is-scrolled { box-shadow: var(--sh-md); }
/* backdrop-filter 는 fixed 자손의 containing block 이 된다 (Safari·Chrome).
   드로어가 열린 동안만 해제해야 .primary-nav 가 뷰포트 기준으로 뜬다. */
body.nav-open .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; }

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-4);
  min-height: var(--header-h);
}
.header__logo { display: inline-flex; align-items: center; flex: 0 0 auto; }
.header__logo img { width: 132px; height: auto; }
@media (min-width: 768px) { .header__logo img { width: 160px; } }

.header__actions { display: flex; align-items: center; gap: var(--s-2); }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-width: var(--tap-min);
  min-height: var(--tap-min);
  padding: 0 var(--s-3);
  background: transparent;
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  cursor: pointer;
}
.nav-toggle__bars { position: relative; display: block; width: 18px; height: 2px; background: var(--c-brand-700); }
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute; left: 0;
  width: 18px; height: 2px;
  background: var(--c-brand-700);
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle__label { font-size: var(--fs-caption); font-weight: var(--fw-medium); }

/* no-JS: toggle hidden, nav lives in normal flow */
html:not(.js) .nav-toggle { display: none; }

.primary-nav__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-6);
}
.primary-nav__link {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap-min);
  color: var(--c-brand-900);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--d-fast) var(--ease), border-color var(--d-fast) var(--ease);
}
.primary-nav__link:hover { color: var(--c-brand-600); }
.primary-nav__link[aria-current="page"] {
  color: var(--c-brand-600);
  border-bottom-color: var(--c-brand-600);
}

.header__call { display: none; }

@media (min-width: 768px) {
  .nav-toggle { display: none; }
  .header__call { display: inline-flex; white-space: nowrap; }
  .primary-nav__list { gap: var(--s-7); flex-wrap: nowrap; }
  /* body sets overflow-wrap:anywhere for long Korean prose; header controls
     are fixed short labels and must never break at character level. */
  .primary-nav__link { white-space: nowrap; overflow-wrap: normal; word-break: keep-all; }
}

/* The phone glyph only renders in the 768-1023 compact-icon band; the
   desktop band keeps the label-and-number variant. */
.header__call-icon { display: none; flex: 0 0 auto; }

/* Tablet band 768-1023px (fidelity-contract band-tablet):
   logo 128px, nav 14px / gap 14px, and the call CTA collapses to a real
   44x44 icon-only button. Label AND number are visually hidden but stay
   in the accessible name "전화 예약 031-845-2875" with tel: href. */
@media (min-width: 768px) and (max-width: 1023px) {
  .header__logo img { width: 128px; }
  .header__inner { gap: var(--s-3); }
  .primary-nav__list { gap: 14px; }
  .primary-nav__link { font-size: 14px; }
  .header__call {
    position: relative;
    flex: 0 0 44px;
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    gap: 0;
    font-size: 0;
    line-height: 0;
  }
  .header__call .header__call-icon { display: block; }
  .header__call .btn__label,
  .header__call .nowrap {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
}

.btn__label { white-space: nowrap; }

/* mobile drawer (JS enhanced) */
@media (max-width: 767px) {
  html.js .primary-nav {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 90;
    width: 84%;
    max-width: 360px;
    padding: var(--s-6) var(--s-5) var(--s-12);
    background: var(--c-surface-raised);
    box-shadow: var(--sh-drawer);
    transform: translateX(100%);
    transition: transform var(--d-base) var(--ease);
    overflow-y: auto;
    visibility: hidden;
  }
  html.js .primary-nav.is-open { transform: translateX(0); visibility: visible; }
  html.js .primary-nav__list { flex-direction: column; gap: 0; }
  html.js .primary-nav__link {
    width: 100%;
    min-height: 52px;
    padding-block: var(--s-2);
    border-bottom: 1px solid var(--c-border);
  }
  html.js .primary-nav__link[aria-current="page"] { border-bottom-color: var(--c-brand-600); }
  html.js .drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: var(--tap-min);
    min-height: var(--tap-min);
    margin-bottom: var(--s-4);
    margin-left: auto;
    background: transparent;
    border: 1px solid var(--c-border);
    border-radius: var(--r-sm);
    cursor: pointer;
  }
  html.js .drawer-nav-call { margin-top: var(--s-6); }
  html.js .nav-backdrop {
    position: fixed;
    inset: 0;
    /* 헤더(z 60)보다 낮아야 한다. 드로어는 헤더 stacking context 안에 있어서
       backdrop 이 헤더보다 높으면 드로어 위를 덮어 링크 탭이 전부 backdrop 클릭(=닫힘)이 된다. */
    z-index: 55;
    background: var(--c-scrim);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--d-base) var(--ease), visibility var(--d-base) var(--ease);
  }
  html.js .nav-backdrop.is-open { opacity: 1; visibility: visible; }
}
.drawer-close { display: none; }
.drawer-nav-call { display: none; }
html.js .drawer-nav-call { display: block; }
@media (min-width: 768px) { html.js .drawer-nav-call { display: none; } }
.nav-backdrop { display: none; }
@media (max-width: 767px) { html.js .nav-backdrop { display: block; } }

body.nav-open { overflow: hidden; }

/* ------------------------------------------------------- mobile call bar */
.call-bar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  min-height: var(--call-bar-h);
  background: var(--c-border);
  border-top: 1px solid var(--c-border);
}
.call-bar__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  min-height: var(--call-bar-h);
  padding: var(--s-2) var(--s-3);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  text-decoration: none;
}
.call-bar__item--primary { background: var(--c-brand-600); color: var(--c-text-inverse); }
.call-bar__item--secondary { background: var(--c-surface-raised); color: var(--c-brand-700); }
body { padding-bottom: calc(var(--call-bar-h) + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 768px) {
  .call-bar { display: none; }
  body { padding-bottom: 0; }
}

/* ------------------------------------------------------------------- hero */
.hero { padding-block: var(--rhythm); background: var(--c-brand-100); }
.hero__viewport { position: relative; }
.hero__slide {
  display: grid;
  gap: var(--s-6);
  align-items: center;
}
html.js .hero__slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--d-slow) var(--ease), visibility var(--d-slow) var(--ease);
  pointer-events: none;
}
html.js .hero__slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
html:not(.js) .hero__slide + .hero__slide { margin-top: var(--s-10); }

.hero__copy { min-width: 0; }
.hero__eyebrow {
  display: inline-block;
  margin-bottom: var(--s-3);
  padding: var(--s-1) var(--s-3);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-pill);
  color: var(--c-brand-600);
  font-size: var(--fs-caption);
  font-weight: var(--fw-medium);
}
.hero__title { font-size: var(--fs-display); }
.hero__text {
  margin-top: var(--s-4);
  color: var(--c-text-2);
  font-size: var(--fs-body);
}
.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-3);
  margin-top: var(--s-7);
}
.hero__media {
  position: relative;
  aspect-ratio: 1200 / 800;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--c-border);
}
.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, var(--c-scrim), rgba(31, 42, 38, 0) 55%);
  pointer-events: none;
}
.hero__dots {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-6);
}
.hero__dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tap-min);
  height: var(--tap-min);
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.hero__dot::before {
  content: "";
  width: 10px; height: 10px;
  border-radius: var(--r-pill);
  background: var(--c-border);
  border: 1px solid var(--c-brand-500);
  transition: background-color var(--d-fast) var(--ease), width var(--d-fast) var(--ease);
}
.hero__dot[aria-selected="true"]::before { width: 28px; background: var(--c-brand-600); }
html:not(.js) .hero__dots { display: none; }

@media (min-width: 768px) {
  .hero { min-height: 520px; display: flex; align-items: center; }
  .hero__slide { grid-template-columns: 1fr 1fr; gap: var(--s-10); }
}
@media (min-width: 1024px) {
  .hero { min-height: 620px; }
  .hero__slide { grid-template-columns: 1.05fr 1fr; }
}
@media (max-width: 767px) {
  .hero { min-height: 460px; }
}

/* -------------------------------------------------------------- page head */
.page-head { padding-block: var(--s-6) var(--s-6); background: var(--c-brand-100); }
.page-head__title { font-size: var(--fs-h1); }
.page-head__lead { margin-top: var(--s-3); color: var(--c-text-2); max-width: 62ch; }

.breadcrumb { margin-bottom: var(--s-3); font-size: var(--fs-caption); color: var(--c-text-2); }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.breadcrumb li + li::before { content: "›"; margin-right: var(--s-2); color: var(--c-text-2); }
.breadcrumb a { color: var(--c-text-2); }

/* ----------------------------------------------------------- feature grid */
.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 768px) { .feature-grid { grid-template-columns: repeat(3, 1fr); } }
.feature {
  padding: var(--s-6);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.feature__icon { width: 32px; height: 32px; color: var(--c-brand-600); }
.feature__title { margin-top: var(--s-4); font-size: var(--fs-h3); }
.feature__text { margin-top: var(--s-2); color: var(--c-text-2); font-size: var(--fs-small); }

/* --------------------------------------------------------- treatment grid */
.tx-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-5);
}
@media (min-width: 360px) { .tx-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .tx-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .tx-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1440px) { .tx-grid { grid-template-columns: repeat(5, 1fr); } }

.tx-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-5);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  transition: border-color var(--d-fast) var(--ease),
              transform var(--d-fast) var(--ease),
              box-shadow var(--d-fast) var(--ease);
}
.tx-card:hover,
.tx-card:focus-within {
  border-color: var(--c-brand-500);
  transform: translateY(-2px);
  box-shadow: var(--sh-sm);
}
.tx-card__media {
  aspect-ratio: 226 / 235;
  width: 100%;
  max-width: 168px;
  margin-inline: auto;
  background: var(--c-brand-100);
  border-radius: var(--r-md);
  overflow: hidden;
}
.tx-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.tx-card__title { margin-top: var(--s-4); font-size: 18px; }
.tx-card__text {
  margin-top: var(--s-2);
  color: var(--c-text-2);
  font-size: var(--fs-small);
  line-height: var(--lh-base);
}

/* ------------------------------------------------------------ doctor cards */
.doctor-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-6);
}
@media (min-width: 768px) { .doctor-grid { grid-template-columns: repeat(2, 1fr); } }

.doctor-card {
  display: flex;
  flex-direction: column;
  padding: var(--s-7);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xl);
}
.doctor-card__head { display: flex; align-items: center; gap: var(--s-5); }
.doctor-card__portrait {
  flex: 0 0 auto;
  width: 120px;
  aspect-ratio: 860 / 826;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-brand-100);
}
.doctor-card__portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.doctor-card__monogram {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--c-brand-100);
  color: var(--c-brand-600);
  font-size: 32px;
  font-weight: var(--fw-bold);
  letter-spacing: 0;
}
.doctor-card__role { color: var(--c-brand-600); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.doctor-card__name { margin-top: var(--s-1); font-size: 22px; }
.doctor-card__bio { margin-top: var(--s-6); }
.doctor-card__bio > summary {
  display: flex;
  align-items: center;
  gap: var(--s-2);
  min-height: var(--tap-min);
  color: var(--c-brand-700);
  font-size: var(--fs-small);
  font-weight: var(--fw-medium);
  cursor: pointer;
  list-style: none;
  border-top: 1px solid var(--c-border);
  padding-top: var(--s-3);
}
.doctor-card__bio > summary::-webkit-details-marker { display: none; }
.doctor-card__bio > summary::after { content: "＋"; margin-left: auto; color: var(--c-text-2); }
.doctor-card__bio[open] > summary::after { content: "－"; }
.doctor-card__bio ul { margin-top: var(--s-3); }
.doctor-card__bio li {
  position: relative;
  padding-left: var(--s-4);
  color: var(--c-text-2);
  font-size: var(--fs-small);
  line-height: var(--lh-base);
}
.doctor-card__bio li::before {
  content: "·";
  position: absolute;
  left: var(--s-1);
  color: var(--c-brand-500);
}

/* ------------------------------------------------------------ hours table */
.hours-wrap { max-width: 720px; }
.hours-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
@media (min-width: 390px) { .hours-table { font-size: 16px; } }
.hours-table caption {
  padding-bottom: var(--s-3);
  color: var(--c-text-2);
  font-size: var(--fs-small);
  text-align: left;
}
.hours-table th,
.hours-table td {
  padding: var(--s-3);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  line-height: var(--lh-base);
}
@media (min-width: 390px) {
  .hours-table th,
  .hours-table td { padding: 14px 16px; }
  .hours-table tbody tr { min-height: 56px; }
}
.hours-table thead th { background: var(--c-table-head); color: var(--c-table-head-text); font-weight: var(--fw-medium); }
.hours-table tbody th { font-weight: var(--fw-medium); white-space: nowrap; }
.hours-table tbody tr:last-child th,
.hours-table tbody tr:last-child td { border-bottom: 0; }
.hours-table tbody tr[data-today] {
  background: var(--c-table-today);
  box-shadow: inset 3px 0 0 0 var(--c-table-today-bar);
}
.hours-table tbody tr[data-today] th { color: var(--c-brand-700); }
.hours-note {
  margin-top: var(--s-4);
  color: var(--c-text-2);
  font-size: var(--fs-small);
}
.hours-note li { position: relative; padding-left: var(--s-4); }
.hours-note li::before { content: "※"; position: absolute; left: 0; }

/* --------------------------------------------------------------- info list */
.info-list { display: grid; gap: var(--s-4); }
.info-list__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-1);
  padding-bottom: var(--s-4);
  border-bottom: 1px solid var(--c-border);
}
@media (min-width: 768px) {
  .info-list__row { grid-template-columns: 140px 1fr; gap: var(--s-5); align-items: baseline; }
}
.info-list__key { color: var(--c-brand-600); font-size: var(--fs-small); font-weight: var(--fw-medium); }
.info-list__val { color: var(--c-text); font-size: 17px; line-height: var(--lh-base); }
.info-list__val a { text-decoration: none; }
.info-list__val a:hover { text-decoration: underline; }

/* ----------------------------------------------------------------- gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s-4);
}
@media (min-width: 768px) { .gallery { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
.gallery__item {
  aspect-ratio: 1200 / 800;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--c-brand-100);
}
.gallery__item img { width: 100%; height: 100%; object-fit: cover; }

/* -------------------------------------------------------------- link cards */
.link-grid { display: grid; grid-template-columns: 1fr; gap: var(--s-4); }
@media (min-width: 768px) { .link-grid { grid-template-columns: repeat(3, 1fr); } }
.link-card {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  min-height: var(--tap-min);
  padding: var(--s-5);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: var(--c-brand-900);
  transition: border-color var(--d-fast) var(--ease), transform var(--d-fast) var(--ease);
}
.link-card:hover { border-color: var(--c-brand-500); transform: translateY(-2px); }
.link-card__title { font-size: var(--fs-h3); font-weight: var(--fw-medium); }
.link-card__text { color: var(--c-text-2); font-size: var(--fs-small); }

/* ------------------------------------------------------------- steps / faq */
.steps { counter-reset: step; display: grid; gap: var(--s-5); }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .steps--3 { grid-template-columns: repeat(3, 1fr); } }
.steps__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.step {
  position: relative;
  padding: var(--s-6) var(--s-6) var(--s-6) var(--s-12);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: var(--s-5);
  top: var(--s-6);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-brand-100);
  color: var(--c-brand-600);
  font-size: var(--fs-caption);
  font-weight: var(--fw-bold);
}
.step__title { font-size: var(--fs-h3); }
.step__text { margin-top: var(--s-2); color: var(--c-text-2); font-size: var(--fs-small); }

.faq { display: grid; gap: var(--s-3); }
.faq__item {
  padding: var(--s-5);
  background: var(--c-surface-raised);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
}
.faq__item > summary {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-height: var(--tap-min);
  font-weight: var(--fw-medium);
  cursor: pointer;
  list-style: none;
}
.faq__item > summary::-webkit-details-marker { display: none; }
.faq__item > summary::after { content: "＋"; margin-left: auto; color: var(--c-text-2); }
.faq__item[open] > summary::after { content: "－"; }
.faq__body { margin-top: var(--s-3); color: var(--c-text-2); font-size: var(--fs-small); }

/* ----------------------------------------------------------- price tables */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--c-border);
  border-radius: var(--r-md);
  background: var(--c-surface-raised);
}
.price-table {
  width: 100%;
  min-width: 420px;
  border-collapse: collapse;
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}
.price-table caption {
  padding: var(--s-4) var(--s-4) 0;
  color: var(--c-text-2);
  font-size: var(--fs-small);
  text-align: left;
}
.price-table th,
.price-table td {
  padding: var(--s-3) var(--s-4);
  border-bottom: 1px solid var(--c-border);
  text-align: left;
  line-height: var(--lh-base);
}
.price-table thead th { background: var(--c-brand-100); color: var(--c-brand-700); font-weight: var(--fw-medium); }
.price-table tbody th { font-weight: var(--fw-medium); white-space: nowrap; }
.price-table td:last-child { text-align: right; white-space: nowrap; }
.price-table tbody tr:last-child th,
.price-table tbody tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------ cta */
.cta {
  display: grid;
  gap: var(--s-6);
  padding: var(--s-10) var(--s-6);
  background: var(--c-brand-900);
  border-radius: var(--r-xl);
  color: var(--c-text-inverse);
}
@media (min-width: 768px) {
  .cta { grid-template-columns: 1fr auto; align-items: center; padding: var(--s-12); }
}
.cta__title { color: var(--c-text-inverse); font-size: var(--fs-h2); }
.cta__text { margin-top: var(--s-3); color: #C9D4CE; font-size: var(--fs-small); }
.cta__actions { display: flex; flex-wrap: wrap; gap: var(--s-3); }
.cta .btn--ghost { border-color: rgba(251, 251, 249, 0.4); color: var(--c-text-inverse); }
.cta .btn--ghost:hover { border-color: var(--c-text-inverse); color: var(--c-text-inverse); }
.cta .btn--primary { background: var(--c-surface); color: var(--c-brand-900); }
.cta .btn--primary:hover { background: var(--c-brand-100); }

/* ---------------------------------------------------------------- footer */
.site-footer {
  padding-block: var(--s-12);
  background: var(--c-brand-900);
  color: #C9D4CE;
  font-size: var(--fs-caption);
  line-height: var(--lh-loose);
}
.site-footer__inner { display: grid; gap: var(--s-8); }
@media (min-width: 768px) {
  .site-footer__inner { grid-template-columns: minmax(0, 240px) 1fr; gap: var(--s-12); }
}
.site-footer__logo img { width: 140px; height: auto; }
.site-footer a { color: var(--c-surface); text-decoration: none; }
/* WCAG 2.2 AA 2.5.8: inline footer links need a >=24px tap/pointer target. */
.site-footer p a { display: inline-block; min-height: 24px; padding-block: 4px; }
.site-footer a:hover { text-decoration: underline; }
.site-footer :focus-visible { outline-color: var(--c-surface); }
.footer__biz p { margin: 0; }
.footer__links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin-bottom: var(--s-4); }
.footer__links a { display: inline-flex; align-items: center; min-height: var(--tap-min); font-weight: var(--fw-medium); }
.footer__copy { margin-top: var(--s-5); color: #8FA098; }

/* ------------------------------------------------------- reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .tx-card:hover,
  .tx-card:focus-within,
  .link-card:hover { transform: none; }
}

/* ================================================================ additions
   Django 전환 시 추가. 토큰은 :root 것만 사용. */

/* 메인 의료진 2열 */
.link-grid--doctors { grid-template-columns: 1fr; }
@media (min-width: 768px) { .link-grid--doctors { grid-template-columns: repeat(2, 1fr); } }

/* tx-card 가 <a> 로 바뀜 */
a.tx-card { display: block; color: inherit; text-decoration: none; }
a.tx-card:hover .tx-card__title { color: var(--c-brand-600); }
.tx-grid--related { grid-template-columns: 1fr; }
@media (min-width: 640px) { .tx-grid--related { grid-template-columns: repeat(3, 1fr); } }

/* ------------------------------------------------------------ prose (TinyMCE / Markdown 본문) */
.prose { font-size: var(--fs-body); line-height: var(--lh-loose); color: var(--c-text); word-break: keep-all; overflow-wrap: anywhere; }
.prose > * + * { margin-top: var(--s-4); }
.prose h2 { margin-top: var(--s-10); font-size: var(--fs-h2); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); color: var(--c-brand-900); padding-bottom: var(--s-2); border-bottom: 1px solid var(--c-border); }
.prose h3 { margin-top: var(--s-8); font-size: var(--fs-h3); line-height: var(--lh-tight); color: var(--c-brand-700); }
.prose h4 { margin-top: var(--s-6); font-size: var(--fs-body); font-weight: var(--fw-bold); }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose p { margin-top: var(--s-4); }
.prose a { color: var(--c-brand-600); text-decoration: underline; text-underline-offset: 3px; }
.prose a:hover { color: var(--c-brand-700); }
.prose strong { font-weight: var(--fw-bold); color: var(--c-brand-900); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--s-2); }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose blockquote { margin: var(--s-6) 0; padding: var(--s-4) var(--s-5); border-left: 3px solid var(--c-accent-600); background: var(--c-accent-100); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--c-text-2); }
.prose img { display: block; max-width: 100%; height: auto; margin: var(--s-6) auto; border-radius: var(--r-md); }
.prose figure { margin: var(--s-6) 0; }
.prose figcaption { margin-top: var(--s-2); font-size: var(--fs-caption); color: var(--c-text-2); text-align: center; }
.prose hr { border: 0; border-top: 1px solid var(--c-border); margin: var(--s-8) 0; }
.prose code { font-size: 0.92em; padding: 0.1em 0.4em; background: var(--c-code-bg); border-radius: 4px; }
.prose pre { overflow-x: auto; padding: var(--s-4); background: var(--c-code-bg); border-radius: var(--r-sm); }
.prose table { width: 100%; border-collapse: collapse; margin: var(--s-6) 0; font-size: var(--fs-small); font-variant-numeric: tabular-nums; display: block; overflow-x: auto; }
.prose thead th { background: var(--c-table-head); color: var(--c-table-head-text); font-weight: var(--fw-medium); text-align: left; }
.prose th, .prose td { padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--c-border); vertical-align: top; }
.prose tbody th { font-weight: var(--fw-medium); background: var(--c-brand-100); white-space: nowrap; }
.prose .toc { display: none; }
.prose__disclaimer { margin-top: var(--s-8); padding: var(--s-4) var(--s-5); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface-raised); font-size: var(--fs-caption); color: var(--c-text-2); line-height: var(--lh-base); }

/* ------------------------------------------------------------ 진료 상세 */
.tx-detail__layout { display: grid; gap: var(--s-8); }
@media (min-width: 900px) { .tx-detail__layout { grid-template-columns: 300px minmax(0, 1fr); align-items: start; } .tx-detail__side { position: sticky; top: calc(var(--header-h) + var(--s-4)); } }
.tx-detail__media { background: var(--c-brand-100); border-radius: var(--r-lg); padding: var(--s-6); display: flex; justify-content: center; }
.tx-detail__media img { width: 60%; max-width: 226px; height: auto; object-fit: contain; }
@media (min-width: 900px) { .tx-detail__media img { width: 100%; } }
.tx-detail__contact { margin-top: var(--s-4); display: grid; gap: var(--s-3); padding: var(--s-5); background: var(--c-surface-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg); }
.tx-detail__contact-label { font-size: var(--fs-caption); color: var(--c-text-2); font-weight: var(--fw-medium); }
.tx-detail__body { min-width: 0; }

/* ------------------------------------------------------------ 글 (블로그·매거진) */
.article__meta { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--c-text-2); }
.article__reviewer { margin-top: var(--s-2); font-size: var(--fs-caption); color: var(--c-brand-600); font-weight: var(--fw-medium); }
.article__hero { margin: 0 0 var(--s-8); border-radius: var(--r-lg); overflow: hidden; background: var(--c-brand-100); }
.article__hero img { display: block; width: 100%; height: auto; }
.article__tags { margin-top: var(--s-6); display: flex; flex-wrap: wrap; gap: var(--s-2); }

.post-grid { display: grid; gap: var(--s-5); grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { background: var(--c-surface-raised); border: 1px solid var(--c-border); border-radius: var(--r-lg); overflow: hidden; transition: border-color var(--d-fast) var(--ease), box-shadow var(--d-fast) var(--ease); }
.post-card:hover { border-color: var(--c-brand-500); box-shadow: var(--sh-md); }
.post-card__link { display: block; color: inherit; text-decoration: none; height: 100%; }
.post-card__media { aspect-ratio: 1200 / 630; background: var(--c-brand-100); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.post-card__media--4x3 { aspect-ratio: 4 / 3; }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__placeholder { font-size: var(--fs-display); font-weight: var(--fw-bold); color: var(--c-brand-500); }
.post-card__body { padding: var(--s-5); }
.post-card__category { font-size: var(--fs-caption); color: var(--c-brand-600); font-weight: var(--fw-medium); }
.post-card__title { margin-top: var(--s-2); font-size: var(--fs-h3); line-height: var(--lh-tight); letter-spacing: var(--ls-heading); color: var(--c-brand-900); }
.post-card__text { margin-top: var(--s-3); font-size: var(--fs-small); color: var(--c-text-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post-card__meta { margin-top: var(--s-4); font-size: var(--fs-caption); color: var(--c-text-2); }

.chip-nav { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-6); }
.chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 var(--s-4); border: 1px solid var(--c-border); border-radius: var(--r-pill); background: var(--c-surface-raised); color: var(--c-brand-700); font-size: var(--fs-small); text-decoration: none; }
a.chip:hover { border-color: var(--c-brand-500); color: var(--c-brand-600); }
.chip.is-active { background: var(--c-brand-600); border-color: var(--c-brand-600); color: var(--c-text-inverse); }
.chip--static { color: var(--c-text-2); }
.chip-note { margin: calc(-1 * var(--s-3)) 0 var(--s-6); font-size: var(--fs-small); color: var(--c-text-2); }
.chip-note a { margin-left: var(--s-2); }

.pagination { display: flex; align-items: center; justify-content: center; gap: var(--s-2); margin-top: var(--s-8); flex-wrap: wrap; }
.pagination__list { display: flex; align-items: center; gap: var(--s-1); list-style: none; margin: 0; padding: 0; }
.pagination__page, .pagination__arrow {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: var(--tap-min); min-height: var(--tap-min); padding: 0 var(--s-2);
  border-radius: var(--r-sm); font-size: var(--fs-small); font-variant-numeric: tabular-nums;
  color: var(--c-brand-700); text-decoration: none;
}
.pagination__page:hover, .pagination__arrow:hover { background: var(--c-brand-100); color: var(--c-brand-600); }
.pagination__page.is-current { background: var(--c-brand-600); color: var(--c-text-inverse); font-weight: var(--fw-medium); }
.pagination__arrow { border: 1px solid var(--c-border); background: var(--c-surface-raised); font-size: var(--fs-h3); }
.pagination__arrow.is-disabled { opacity: 0.35; pointer-events: none; }
.empty-state { padding: var(--s-12) 0; text-align: center; color: var(--c-text-2); }

.error-page { text-align: center; padding-block: var(--s-12); }
.error-page .cta__actions { justify-content: center; }
