/* ===== Base ===== */
body { margin: 0; background: #fbf8f3; overflow-wrap: anywhere; }
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .75; }
button { font-family: inherit; }
main { display: block; }

/* 콘텐츠 영역 1280px 중앙 정렬, 작은 화면에서는 좌우 여백 유지 */
:root { --page-gutter: max(24px, calc((100% - 1280px) / 2)); }
.site {
  background: #fbf8f3;
  color: #24201a;
  font-family: Pretendard, sans-serif;
  width: 100%;
  min-width: 0;
}
main :where(div, span, a) { min-width: 0; }

/* ===== Header (GNB) ===== */
:root { --header-height: 85px; --header-compact-height: 73px; }
.gnb-slot { height: var(--header-height); }
html { scroll-padding-top: 85px; }
.gnb {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  box-sizing: border-box;
  width: 100%;
  background: #fbf8f3;
  padding: 0 max(24px, calc(50% - 640px));
  height: var(--header-height);
  gap: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #ebe6dd;
  transition: height .2s ease, box-shadow .2s ease;
}
.gnb.is-scrolled, .nav-compact .gnb { height: var(--header-compact-height); box-shadow: 0 3px 12px rgba(36, 32, 26, .06); }
.gnb__logo { display: flex; align-items: baseline; gap: 10px; flex-shrink: 0; }
.gnb__logo img { display: block; height: 30px; transition: height .2s ease; }
.gnb.is-scrolled .gnb__logo img, .nav-compact .gnb__logo img { height: 27px; }
.nav-restoring .gnb, .nav-restoring .gnb__logo img { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .gnb, .gnb__logo img { transition: none; }
}
.gnb__menu { display: flex; gap: clamp(12px, 2.3vw, 44px); font-size: 16px; font-weight: 600; min-width: 0; overflow-x: auto; white-space: nowrap; }
.gnb__menu a { flex-shrink: 0; }
.gnb__menu a.is-active { color: #6e6a3b; }
.gnb__tel { font-size: 18px; font-weight: 700; color: #6e6a3b; flex-shrink: 0; white-space: nowrap; }
.gnb__phone-icon, .gnb__toggle { display: none; }
[hidden] { display: none !important; }
.gnb-backdrop { position: fixed; inset: 0; z-index: 1001; background: rgba(36, 32, 26, .28); }
.gnb__toggle:focus-visible, .gnb__tel:focus-visible, .gnb__menu a:focus-visible { outline: 2px solid #6e6a3b; outline-offset: 3px; }
/* ===== Footer ===== */
.footer {
  background: #24201a;
  color: #9a8f80;
  padding: 48px var(--page-gutter);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  line-height: 1.9;
}
.footer--bordered { border-top: 1px solid #33291f; }
.footer__logo { display: block; height: 26px; margin-bottom: 16px; }
.footer__links { display: flex; gap: 20px; align-items: flex-start; color: #ddd3c4; flex-shrink: 0; }
.footer { gap: 32px; }

/* Shared responsive hooks for all exported content states. */
.page-hero { padding: 48px var(--page-gutter); }
.subnav { overflow-x: auto; overscroll-behavior-x: contain; }
.subnav button { flex-shrink: 0; white-space: nowrap; min-height: 44px; }
.gnb__menu a { display: flex; align-items: center; min-height: 36px; }
.r-image img { object-fit: contain; }
.content-tabs { max-width: 100%; overflow-x: auto; justify-content: safe center !important; }
.content-tabs button { flex-shrink: 0; white-space: nowrap; min-height: 44px; }
@media (max-width: 1350px) {
  .r-columns { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
}
@media (max-width: 1100px) {
  .r-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .r-process { grid-template-columns: minmax(0, 1fr) !important; gap: 12px; }
  .r-process > span { transform: rotate(90deg); }
  .r-process > div { min-height: 0 !important; }
  .subnav:not(.is-pinned) { flex-direction: row !important; justify-content: safe center !important; gap: 10px !important; }
  .subnav:not(.is-pinned) > div { display: contents !important; }
  .subnav:not(.is-pinned) button { font-size: 15px !important; padding: 10px 18px !important; }
}
@media (max-width: 900px) {
  .r-spread { flex-wrap: wrap; gap: 16px; }
  main div[style*="white-space:nowrap"] { white-space: normal !important; }
  .r-columns { grid-template-columns: minmax(0, 1fr) !important; }
  .r-image { height: clamp(280px, 65vw, 500px) !important; }
  .page-hero { height: 460px !important; gap: 24px !important; }
  .home-hero { height: 640px !important; background-position: 65% center !important; }
  .home-hero__copy { top: 72px !important; right: var(--page-gutter); max-width: 520px !important; }
  .location-map { min-height: 360px !important; }
  .footer { flex-direction: column; }
}
@media (max-width: 600px) {
  :root { --page-gutter: 20px; }
  .r-cards { grid-template-columns: minmax(0, 1fr) !important; }
  .r-fact-row { grid-template-columns: minmax(0, 1fr) !important; gap: 10px; }
  .r-icon-row { grid-template-columns: 36px minmax(0, 1fr) !important; gap: 12px !important; }
  .r-comparison-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important; }
  .r-comparison-row > :first-child { grid-column: 1 / -1; }
  .r-comparison-row > * { padding: 16px 12px !important; }
  .r-cards > [style*="border-left"] { border-left: 0 !important; }
  .r-cards > [style*="padding:clamp(24px"] { padding: 24px !important; }
  .home-hero { height: 580px !important; background-position: 60% center !important; }
  .home-hero__copy { top: 52px !important; gap: 20px !important; max-width: 330px !important; }
  .home-hero__copy > :last-child { max-width: 290px; }
  .page-hero { height: auto !important; min-height: 380px; padding-top: 48px; padding-bottom: 48px; }
  .page-hero [style*="bottom:48px"] { display: none !important; }
  .location-map { min-height: 300px !important; }
  .footer__links { flex-wrap: wrap; gap: 16px; }
  .subnav.is-pinned { padding: 8px 16px !important; }
  [data-marquee] { padding-left: 20px !important; }
  [data-marquee] > a { width: 190px !important; margin-right: 16px !important; height: 64px !important; font-size: 18px !important; }
}

/* ===== Tabs / 질환 버튼 (data-nav) ===== */
.subnav.is-pinned {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 999;
  box-sizing: border-box;
  padding: 10px 24px !important;
  flex-direction: row !important;
  justify-content: safe center !important;
  gap: 10px !important;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  box-shadow: 0 4px 12px rgba(36, 32, 26, .06);
  scrollbar-width: thin;
  scrollbar-color: #c4bea4 #f6f3ec;
}
.subnav.is-pinned > div { display: contents !important; }
.subnav.is-pinned button {
  flex: 0 0 auto;
  white-space: nowrap;
  font-size: 15px !important;
  padding: 9px 18px !important;
}
.subnav button:focus-visible { outline: 2px solid #6e6a3b; outline-offset: 2px; }
.subnav__toggle { display: none; }
.subnav__options { display: contents; }
[data-nav] { cursor: pointer; }

/* Switch only when the full header no longer fits. */

.mobile-header { --header-height: 72px; --header-compact-height: 64px; }
.mobile-header .gnb {
    display: flex;
    gap: 8px;
    padding: 0 16px;
  }
.mobile-header .gnb__logo { margin-right: auto; min-width: 0; }
.mobile-header .gnb__logo img { height: 26px; }
.mobile-header .gnb.is-scrolled .gnb__logo img, .mobile-header.nav-compact .gnb__logo img { height: 24px; }
.mobile-header .gnb__tel, .mobile-header .gnb__toggle {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
.mobile-header .gnb__tel > span { display: none; }
.mobile-header .gnb__phone-icon { display: block; }
.mobile-header .gnb__toggle { border: 0; padding: 10px; background: transparent; color: #24201a; cursor: pointer; flex-direction: column; gap: 5px; }
.mobile-header .gnb__toggle span { display: block; width: 22px; height: 2px; background: currentColor; }
.mobile-header .gnb__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px 20px 20px;
    background: #fbf8f3;
    border-bottom: 1px solid #ebe6dd;
    box-shadow: 0 8px 16px rgba(36, 32, 26, .08);
    flex-direction: column;
    gap: 0;
    max-height: calc(100dvh - var(--header-height));
    overflow: auto;
    font-size: 17px;
  }
.mobile-header .gnb__menu a { min-height: 56px; padding: 12px; border-bottom: 1px solid #ebe6dd; }
.mobile-header .gnb__menu a:last-child { border-bottom: 0; }
.mobile-header .gnb__menu a.is-active { background: #f1efe3; border-radius: 8px; }
.mobile-header .gnb.is-menu-open { z-index: 1002; }
.mobile-header .gnb.is-menu-open .gnb__menu { display: flex; }
.mobile-header .gnb.is-menu-open .gnb__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-header .gnb.is-menu-open .gnb__toggle span:nth-child(2) { opacity: 0; }
.mobile-header .gnb.is-menu-open .gnb__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }



/* The item count determines when the submenu becomes a selector. */
  .subnav.subnav--compact, .subnav.subnav--compact.is-pinned {
    display: block !important;
    padding: 8px 16px !important;
    overflow: visible;
  }
  .subnav.subnav--compact:not(.is-pinned) { position: relative; z-index: 999; }
  .subnav.subnav--compact .subnav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px !important;
    border: 1px solid #ded9c9;
    border-radius: 8px;
    background: #f6f4ec;
    color: #6e6a3b;
    font-size: 16px !important;
    font-weight: 700;
    cursor: pointer;
  }
  .subnav__toggle::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); flex-shrink: 0; }
  .subnav__toggle[aria-expanded="true"]::after { transform: rotate(225deg) translate(-2px, -2px); }
  .subnav.subnav--compact:not(.is-pinned) > .subnav__options,
  .subnav.subnav--compact.is-pinned > .subnav__options { display: none !important; }
  .subnav.subnav--compact.is-subnav-open > .subnav__options {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 12px 16px 16px;
    max-height: calc(100dvh - var(--header-height) - 76px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
    background: #fff;
    border-bottom: 1px solid #ebe6dd;
    box-shadow: 0 8px 16px rgba(36, 32, 26, .12);
  }
  .subnav.subnav--compact .subnav__options > div { display: contents !important; }
  .subnav.subnav--compact .subnav__options button {
    width: 100%;
    min-width: 0;
    min-height: 50px;
    padding: 12px !important;
    border-radius: 8px !important;
    font-size: 14px !important;
    white-space: normal;
    word-break: keep-all;
  }
  .subnav.subnav--compact .subnav__options [aria-current="page"]::after { content: ' ✓'; }

@keyframes mq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
