@charset "utf-8";

/* ================================
   HEADER (2단 : 상단 정보 줄 + GNB 줄)
   ================================ */

/* 시안 실측(1920) : 상단 줄 160px(구분선 포함) + 메뉴 줄 96px.
   --hd-h 는 본문 상단 여백(.site-content)과 main.scss 에서도 쓰므로
   높이를 바꿀 때는 :root 의 값을 고친다 */
:root {
  --hd-top-h: 160px;
  --hd-nav-h: 96px;
  --hd-h: calc(var(--hd-top-h) + var(--hd-nav-h));
  --hd-h-mo: 64px;
  --hd-line: #e5e5e5;
}

.one-hd-con {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  background: var(--white-c);
  transition: box-shadow 0.3s ease;
}

/* 스크롤 시 JS(initHeaderScroll)가 부여. 여기서 바꾼 값은 헤더 안에서만 적용되고
   :root 의 --hd-h 는 그대로라 본문이 따라 움직이지 않는다 */
.one-hd-con.is_scrolled {
  --hd-top-h: 90px;
  --hd-nav-h: 64px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
}

/* 로그인 시 WP 관리자 바(32px, 782px 이하 46px)에 가리지 않도록 — 782px 은 WP 기준값 */
.admin-bar .one-hd-con {
  top: 32px;
}

@media screen and (max-width: 782px) {
  .admin-bar .one-hd-con {
    top: 46px;
  }
}

/* 고정 헤더 높이만큼 본문을 내린다 */
.site-content {
  padding-top: var(--hd-h);
}

/* ── 상단 줄 ── */
.one-hd-top {
  /* 모바일 메뉴 패널의 딤(box-shadow)이 상단 줄을 덮지 않도록 위로 올린다 */
  position: relative;
  z-index: 2;
  height: var(--hd-top-h);
  border-bottom: 1px solid var(--hd-line);
  background: var(--white-c);
  transition: height 0.4s ease;
}

.one-hd-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-areas: "tel logo time";
  align-items: center;
  max-width: var(--container-s-width);
  height: 100%;
  margin: 0 auto;
}

/* 전화 버튼 */
.one-hd-tel {
  grid-area: tel;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  height: 48px;
  padding: 0 24px 0 4px;
  border-radius: 24px;
  background: var(--main-c);
  color: var(--white-c);
  font-size: var(--p-title);
  font-weight: var(--font-w-m);
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.one-hd-tel:hover {
  background: var(--sub-c-04);
}

/* tel_icon.svg 는 그림이 가운데 45% 뿐이라 크게 잡고 오른쪽 여백만 당긴다 (보이는 아이콘 ≈ 27px) */
.one-hd-tel img {
  flex: none;
  width: 60px;
  height: 60px;
  margin-right: -9px;
}

/* 로고 */
.one-hd-logo {
  grid-area: logo;
  margin: 0;
  padding: 0;
  line-height: 0;
}

.one-hd-logo a {
  display: block;
}

.one-hd-logo img {
  width: 298px;
  transition: width 0.4s ease;
}

.one-hd-con.is_scrolled .one-hd-logo img {
  width: 194px;
}

/* 스크롤 시 로고와 함께 좌우(전화 · 진료시간)도 작아진다 */
.one-hd-tel,
.one-hd-tel img,
.one-hd-time img,
.one-hd-time dt,
.one-hd-time dd {
  transition: all 0.4s ease;
}

.one-hd-con.is_scrolled .one-hd-tel {
  height: 38px;
  padding-right: 18px;
  font-size: var(--p-body);
}

.one-hd-con.is_scrolled .one-hd-tel img {
  width: 48px;
  height: 48px;
  margin-right: -7px;
}

.one-hd-con.is_scrolled .one-hd-time {
  margin-right: -11px;
}

.one-hd-con.is_scrolled .one-hd-time dt {
  font-size: var(--p-caption);
}

.one-hd-con.is_scrolled .one-hd-time dd {
  font-size: var(--p-body);
}

.one-hd-con.is_scrolled .one-hd-time img {
  width: 44px;
  height: 44px;
}

/* 진료시간 */
.one-hd-time {
  grid-area: time;
  justify-self: end;
  display: flex;
  align-items: center;
  /* 시계 svg 의 오른쪽 여백만큼 당겨 아이콘을 컨테이너 끝선에 맞춘다 */
  margin-right: -14px;
}

.one-hd-time dl {
  text-align: right;
}

.one-hd-time dt {
  font-size: var(--p-body);
  line-height: 1.4;
  color: #666;
}

.one-hd-time dd {
  font-size: var(--p-title);
  font-weight: var(--font-w-bm);
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--sub-c-01);
}

.one-hd-time img {
  flex: none;
  width: 56px;
  height: 56px;
}

/* 모바일 메뉴 버튼 (PC 숨김) */
.one-hd-menu-btn {
  grid-area: menu;
  display: none;
  position: relative;
  width: 40px;
  height: 40px;
  padding: 0;
  cursor: pointer;
}

.one-hd-menu-bar,
.one-hd-menu-bar::before,
.one-hd-menu-bar::after {
  position: absolute;
  width: 22px;
  height: 2px;
  background: var(--sub-c-01);
  transition: transform 0.3s ease, top 0.3s ease, background-color 0.3s ease;
}

.one-hd-menu-bar {
  left: 9px;
  top: 50%;
  margin-top: -1px;
}

.one-hd-menu-bar::before,
.one-hd-menu-bar::after {
  content: '';
  left: 0;
}

.one-hd-menu-bar::before {
  top: -7px;
}

.one-hd-menu-bar::after {
  top: 7px;
}

.one-hd-con.is_menu_open .one-hd-menu-bar {
  background: transparent;
}

.one-hd-con.is_menu_open .one-hd-menu-bar::before {
  top: 0;
  transform: rotate(45deg);
}

.one-hd-con.is_menu_open .one-hd-menu-bar::after {
  top: 0;
  transform: rotate(-45deg);
}

/* ── GNB 줄 ── */
.one-hd-nav {
  position: relative;
  z-index: 1;
  background: var(--white-c);
}

.one-hd-gnb {
  display: flex;
  justify-content: space-between;
  max-width: var(--container-s-width);
  height: var(--hd-nav-h);
  margin: 0 auto;
  transition: height 0.4s ease;
}

.one-hd-gnb > li {
  position: relative;
}

.one-hd-gnb > li > a {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 8px;
  font-size: 20px;
  color: var(--sub-c-01);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.one-hd-gnb > li > a::after {
  content: '';
  position: absolute;
  left: 8px;
  right: 8px;
  /* 메뉴 칸 맨 아래가 아니라 글씨 바로 아래에 밑줄 (글씨는 칸 세로 가운데) */
  top: calc(50% + 0.85em);
  height: 2px;
  background: var(--main-c);
  transform: scaleX(0);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.one-hd-gnb > li:hover > a,
.one-hd-gnb > li:focus-within > a,
.one-hd-gnb > .current-menu-item > a,
.one-hd-gnb > .current-menu-ancestor > a {
  color: var(--main-c);
}

.one-hd-gnb > li:hover > a::after,
.one-hd-gnb > li:focus-within > a::after,
.one-hd-gnb > .current-menu-item > a::after,
.one-hd-gnb > .current-menu-ancestor > a::after {
  transform: scaleX(1);
}

/* 2차 메뉴 (드롭다운) */
.one-hd-gnb .sub-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  min-width: 180px;
  padding: 12px 0;
  border-top: 2px solid var(--main-c);
  background: var(--white-c);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  text-align: center;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.one-hd-gnb .sub-menu a {
  display: block;
  padding: 10px 20px;
  font-size: 16px;
  color: var(--bagic-color);
  white-space: nowrap;
  transition: color 0.3s ease;
}

.one-hd-gnb .sub-menu a:hover,
.one-hd-gnb .sub-menu .current-menu-item > a {
  color: var(--main-c);
}

/* 하위 메뉴 펼침 버튼 : JS(initGnb)가 생성, 모바일에서만 보인다 */
.one-hd-sub-btn {
  display: none;
}

/* 드롭다운 열림은 PC 에서만. 모바일에서는 탭(hover)으로 위치가 틀어지지 않도록 900px 기준을 뒤집어 쓴다 */
@media (min-width: 901px) {
  .one-hd-gnb > li:hover > .sub-menu,
  .one-hd-gnb > li:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }
}

/* 모바일 메뉴가 열려 있는 동안 뒤 페이지 스크롤을 막는다 */
html.is_menu_lock {
  overflow: hidden;
}


/* ================================
   반응형
   ================================ */

/* 랩탑 */
@media (max-width: 1279px) {
  .one-hd-inner,
  .one-hd-gnb {
    padding: 0 var(--space-sm);
  }
}

/* 태블릿 */
@media (max-width: 1023px) {
  :root {
    --hd-top-h: 120px;
    --hd-nav-h: 72px;
  }

  .one-hd-logo img {
    width: 227px;
  }

  .one-hd-con.is_scrolled .one-hd-logo img {
    width: 178px;
  }

  .one-hd-tel {
    height: 42px;
    padding-right: 18px;
  }

  .one-hd-tel img {
    width: 52px;
    height: 52px;
    margin-right: -8px;
  }

  .one-hd-time img {
    width: 48px;
    height: 48px;
  }

  .one-hd-gnb > li > a {
    font-size: 17px;
  }
}

/* 모바일 : 로고 + 전화 + 메뉴 버튼, GNB 는 우측 슬라이드 패널 */
@media (max-width: 900px) {
  :root {
    --hd-h: var(--hd-h-mo);
  }

  .one-hd-con,
  .one-hd-con.is_scrolled {
    --hd-top-h: var(--hd-h-mo);
  }

  .one-hd-inner {
    grid-template-columns: 1fr auto auto;
    grid-template-areas: "logo tel menu";
    gap: 10px;
    padding: 0 var(--space-xs);
  }

  .one-hd-logo {
    justify-self: start;
  }

  .one-hd-logo img,
  .one-hd-con.is_scrolled .one-hd-logo img {
    width: 140px;
  }

  .one-hd-time {
    display: none;
  }

  /* 번호 글자는 숨기고 원형 아이콘 버튼으로 (이름은 aria-label 이 전달) */
  .one-hd-tel,
  .one-hd-con.is_scrolled .one-hd-tel {
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 50%;
  }

  .one-hd-tel span {
    display: none;
  }

  .one-hd-tel img,
  .one-hd-con.is_scrolled .one-hd-tel img {
    width: 42px;
    height: 42px;
    margin: 0;
  }

  /* 메뉴 버튼도 한 단계 작게 (선 18px) */
  .one-hd-menu-btn {
    width: 34px;
    height: 34px;
  }

  .one-hd-menu-bar,
  .one-hd-menu-bar::before,
  .one-hd-menu-bar::after {
    width: 18px;
  }

  .one-hd-menu-bar {
    left: 8px;
  }

  .one-hd-menu-bar::before {
    top: -6px;
  }

  .one-hd-menu-bar::after {
    top: 6px;
  }

  .one-hd-menu-btn {
    display: block;
  }

  /* 메뉴 패널 : 헤더(fixed) 기준으로 상단 줄 바로 아래에 붙는다 */
  .one-hd-nav {
    position: absolute;
    top: 100%;
    right: 0;
    width: min(320px, 86%);
    height: calc(100vh - var(--hd-h-mo));
    height: calc(100dvh - var(--hd-h-mo));
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.4s, box-shadow 0.4s;
  }

  /* 패널 바깥 딤. 별도 요소 없이 그림자로 덮고, 바깥 클릭 닫기는 JS 가 처리한다 */
  .one-hd-con.is_menu_open .one-hd-nav {
    visibility: visible;
    transform: none;
    box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.45);
  }

  .one-hd-gnb {
    display: block;
    height: auto;
    padding: 0 0 var(--space-lg);
  }

  .one-hd-gnb > li {
    border-bottom: 1px solid var(--hd-line);
  }

  /* 높이를 고정해 하위 메뉴 버튼(.one-hd-sub-btn)과 맞춘다 */
  .one-hd-gnb > li > a {
    height: 60px;
    padding: 0 56px 0 var(--space-xs);
    font-size: var(--p-body);
  }

  .one-hd-gnb > li > a::after {
    display: none;
  }

  .one-hd-gnb .sub-menu {
    position: static;
    display: none;
    min-width: 0;
    padding: 8px 0;
    border-top: 0;
    background: #f5f8f8;
    box-shadow: none;
    text-align: left;
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: none;
  }

  .one-hd-gnb > li.is_sub_open > .sub-menu {
    display: block;
  }

  .one-hd-gnb .sub-menu a {
    padding: 10px var(--space-xs) 10px calc(var(--space-xs) + 12px);
    font-size: calc(var(--p-body) - 2px);
  }

  .one-hd-sub-btn {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 56px;
    height: 60px;
    padding: 0;
    cursor: pointer;
  }

  .one-hd-sub-btn::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    margin: -6px 0 0 -4px;
    border-right: 1.5px solid var(--sub-c-02);
    border-bottom: 1.5px solid var(--sub-c-02);
    transform: rotate(45deg);
    transition: transform 0.3s ease, margin 0.3s ease;
  }

  .one-hd-gnb > li.is_sub_open > .one-hd-sub-btn::before {
    margin-top: -2px;
    transform: rotate(-135deg);
  }
}

/* 소형 모바일 */
@media (max-width: 480px) {
  .one-hd-logo img,
  .one-hd-con.is_scrolled .one-hd-logo img {
    width: 124px;
  }

  .one-hd-inner {
    gap: 8px;
  }

  .one-hd-tel,
  .one-hd-con.is_scrolled .one-hd-tel,
  .one-hd-menu-btn {
    width: 32px;
    height: 32px;
  }

  .one-hd-tel img,
  .one-hd-con.is_scrolled .one-hd-tel img {
    width: 40px;
    height: 40px;
  }

  .one-hd-menu-bar {
    left: 7px;
  }
}
