/* ============================================================
   전대서한의원 — subpage-merge.css
   서브 페이지에 메인(index.html)의 헤더/푸터/사이드바를 이식.
   common.css, clinic.css 뒤에 로드되어 우선순위로 덮어씀.
   ============================================================ */

/* ─── 메인에서 가져온 CSS 변수 (서브 컬러 체계와 병행) ─────── */
:root {
  --m-navy:       #0F4A6E;
  --m-navy-deep:  #083350;
  --m-sky:        #38BDF8;
  --m-sky-light:  #E0F2FE;
  --m-text-dark:  #0F172A;
  --m-text-mid:   #334155;
  --m-text-soft:  #64748B;
  --m-r-full:     9999px;
  --m-r-md:       16px;
  --m-shadow-lg:  0 8px 40px rgba(15,74,110,0.16);
}

/* ══════════════════════════════════════════════════════════
   HEADER (메인과 동일)
══════════════════════════════════════════════════════════ */
#site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  box-shadow: 0 1px 0 rgba(15,74,110,.08);
  font-family: 'Pretendard Variable','Pretendard',-apple-system,sans-serif;
}
#site-header *,
#site-header *::before,
#site-header *::after { box-sizing: border-box; margin: 0; padding: 0; }

#site-header .header-wrap {
  border-bottom: 1px solid #E2EAF0;
  padding: 14px 0;
}
#site-header .hd-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px,5vw,64px);
}

/* 로고 */
#site-header .logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}
#site-header .logo-mark {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}
#site-header .logo-mark svg {
  width: 64px;
  height: 64px;
}
#site-header .logo-text-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
#site-header .logo-ko {
  font-size: 17px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: -.03em;
  line-height: 1;
}
#site-header .logo-ko em {
  color: #0F4A6E;
  font-style: normal;
}
#site-header .logo-en {
  font-size: 10px;
  color: #64748B;
  letter-spacing: .04em;
}

/* 검색창 */
#site-header .hd-search {
  flex: 0 0 300px;
  position: relative;
}
#site-header .hd-search input {
  width: 100%;
  padding: 10px 40px 10px 18px;
  border: 1.5px solid #CBD8E8;
  border-radius: var(--m-r-full);
  font-size: 14px;
  background: #F8FAFC;
  outline: none;
  transition: .2s;
  font-family: inherit;
}
#site-header .hd-search input:focus {
  border-color: var(--m-navy);
}
#site-header .hd-search button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--m-text-soft);
  background: none;
  border: none;
  cursor: pointer;
}
#site-header .hd-search button svg {
  width: 16px;
  height: 16px;
}

/* 우측 */
#site-header .hd-right {
  display: flex;
  align-items: center;
  gap: 20px;
}
#site-header .hd-utils {
  display: flex;
  gap: 14px;
}
#site-header .hd-utils a {
  font-size: 13px;
  color: var(--m-text-soft);
  font-weight: 500;
  transition: .2s;
  text-decoration: none;
}
#site-header .hd-utils a:hover {
  color: var(--m-navy);
}
#site-header .hd-phone {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 900;
  color: var(--m-navy);
  letter-spacing: -.02em;
  text-decoration: none;
}
#site-header .hd-phone svg {
  width: 18px;
  height: 18px;
}

/* GNB */
#site-header .gnb-wrap {
  background: #fff;
}
#site-header .gnb-inner {
  display: flex;
  align-items: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px,5vw,64px);
}
#site-header .gnb-ham {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--m-text-mid);
  padding: 14px 16px 14px 0;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}
#site-header .gnb-ham svg {
  width: 20px;
  height: 20px;
}
#site-header .gnb-list {
  display: flex;
  flex: 1;
  list-style: none;
}
#site-header .gnb-list a {
  display: flex;
  align-items: center;
  padding: 15px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--m-text-dark);
  transition: .2s;
  white-space: nowrap;
  text-decoration: none;
}
#site-header .gnb-list a:hover,
#site-header .gnb-list a.active {
  color: var(--m-navy);
}
#site-header .gnb-highlight {
  color: var(--m-navy) !important;
  font-weight: 700 !important;
}
#site-header .gnb-divider {
  width: 1px;
  height: 16px;
  background: #CBD8E8;
  margin: auto 8px;
  align-self: center;
}
#site-header .gnb-sub a {
  font-size: 13px;
  color: var(--m-text-soft);
}
#site-header .has-drop {
  position: relative;
}
#site-header .drop {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border-radius: 0 0 var(--m-r-md) var(--m-r-md);
  box-shadow: var(--m-shadow-lg);
  padding: 12px 0;
  z-index: 999;
  border-top: 2px solid var(--m-navy);
}
#site-header .has-drop:hover .drop {
  display: block;
}
#site-header .drop a {
  display: block;
  padding: 9px 22px;
  font-size: 13px;
  font-weight: 500;
  color: var(--m-text-mid);
  transition: .15s;
  text-decoration: none;
}
#site-header .drop a:hover {
  color: var(--m-navy);
  background: #F0F8FF;
  padding-left: 28px;
}

/* ══════════════════════════════════════════════════════════
   FOOTER (메인과 동일)
══════════════════════════════════════════════════════════ */
#site-footer {
  background: #0A1628;
  color: rgba(255,255,255,.75);
  padding: 60px 0 0;
  font-family: 'Pretendard Variable','Pretendard',-apple-system,sans-serif;
}
#site-footer *,
#site-footer *::before,
#site-footer *::after { box-sizing: border-box; margin: 0; padding: 0; }

#site-footer .container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(20px,5vw,64px);
}

#site-footer .footer-top-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 64px;
  margin-bottom: 44px;
}
#site-footer .footer-logo-block {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  text-decoration: none;
}
#site-footer .footer-logo-mark {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}
#site-footer .footer-logo-mark svg {
  width: 52px;
  height: 52px;
}
#site-footer .footer-logo-ko {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: #fff;
  letter-spacing: -.03em;
  line-height: 1;
}
#site-footer .footer-logo-ko em {
  color: #38BDF8;
  font-style: normal;
}
#site-footer .footer-logo-en {
  display: block;
  font-size: 10px;
  color: rgba(255,255,255,.4);
  letter-spacing: .04em;
  margin-top: 4px;
}
#site-footer .footer-tagline {
  font-size: 13px;
  color: rgba(255,255,255,.45);
  margin-bottom: 16px;
}
#site-footer .footer-policy-links {
  display: flex;
  gap: 14px;
}
#site-footer .footer-policy-links a {
  font-size: 12px;
  color: rgba(255,255,255,.35);
  transition: .2s;
  text-decoration: none;
}
#site-footer .footer-policy-links a:hover {
  color: rgba(255,255,255,.75);
}
#site-footer .footer-nav-grid {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 32px;
}
#site-footer .footer-nav-grid h4 {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}
#site-footer .footer-nav-grid a {
  display: block;
  font-size: 12px;
  color: rgba(255,255,255,.45);
  margin-bottom: 8px;
  transition: .2s;
  text-decoration: none;
}
#site-footer .footer-nav-grid a:hover {
  color: rgba(255,255,255,.85);
}
#site-footer .footer-biz-info {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 20px 0;
  font-size: 12px;
  color: rgba(255,255,255,.28);
  line-height: 2;
}
#site-footer .footer-biz-info strong {
  color: rgba(255,255,255,.45);
  font-weight: 600;
  margin-right: 4px;
}
#site-footer .footer-bottom-bar {
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
#site-footer .footer-copy {
  font-size: 12px;
  color: rgba(255,255,255,.25);
}
#site-footer .footer-sns {
  display: flex;
  gap: 8px;
}
#site-footer .footer-sns a {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.5);
  transition: .2s;
  text-decoration: none;
}
#site-footer .footer-sns a:hover {
  background: var(--m-navy);
  color: #fff;
}
#site-footer .footer-sns svg {
  width: 16px;
  height: 16px;
}

/* ══════════════════════════════════════════════════════════
   SIDEBAR (메인과 동일)
══════════════════════════════════════════════════════════ */
#sidebar-fixed {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(8px);
  border-radius: 16px 0 0 16px;
  box-shadow: -4px 0 24px rgba(15,74,110,.15);
  min-width: 120px;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  font-family: 'Pretendard Variable','Pretendard',-apple-system,sans-serif;
}
#sidebar-fixed *,
#sidebar-fixed *::before,
#sidebar-fixed *::after { box-sizing: border-box; margin: 0; padding: 0; }

#sidebar-fixed > .sb-logo-block:first-of-type {
  border-radius: 16px 0 0 0;
}
#sidebar-fixed > .sb-btn:last-of-type {
  border-radius: 0 0 0 16px;
}

#sidebar-fixed .sb-logo-block {
  padding: 16px 12px 12px;
  border-bottom: 1px solid #E2EAF0;
  background: #F8FAFC;
}
#sidebar-fixed .sb-logo-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}
#sidebar-fixed .sb-logo-link svg {
  width: 52px;
  height: 52px;
}
#sidebar-fixed .sb-logo-text {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
#sidebar-fixed .sb-logo-ko {
  font-size: 13px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: -.02em;
}
#sidebar-fixed .sb-logo-ko em {
  color: #0F4A6E;
  font-style: normal;
}
#sidebar-fixed .sb-logo-en {
  font-size: 9px;
  color: #64748B;
  letter-spacing: .04em;
}

#sidebar-fixed .sb-btn {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 10px 14px;
  border-left: 3px solid var(--c,#0F4A6E);
  border-top: none;
  border-right: none;
  border-bottom: none;
  font-size: 12px;
  font-weight: 600;
  color: var(--m-text-dark);
  white-space: nowrap;
  transition: .18s;
  cursor: pointer;
  text-decoration: none;
  background: transparent;
  font-family: inherit;
}
#sidebar-fixed .sb-btn:hover {
  transform: translateX(-3px);
  background: #F0F8FF;
  color: var(--c,#0F4A6E);
}
#sidebar-fixed .sb-ic {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  flex-shrink: 0;
}
#sidebar-fixed .sb-ic svg {
  width: 15px;
  height: 15px;
}
#sidebar-fixed .sb-phone-btn {
  background: #0F4A6E;
  color: #fff;
  border-left-color: #083350;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
}
#sidebar-fixed .sb-phone-btn:hover {
  background: #083350;
  transform: none;
  color: #fff;
}
#sidebar-fixed .sb-phone-btn svg {
  width: 15px;
  height: 15px;
}

/* 접기/펴기 */
#sidebar-fixed.sb-collapsed {
  transform: translateY(-50%) translateX(100%);
}
#sidebar-fixed.sb-collapsed .sb-toggle {
  left: -30px;
  background: #38BDF8;
  box-shadow: -3px 3px 14px rgba(56,189,248,.3);
  animation: sb-toggle-pulse 2s ease-in-out infinite;
}
@keyframes sb-toggle-pulse {
  0%,100% { box-shadow: -3px 3px 14px rgba(56,189,248,.3); }
  50% { box-shadow: -3px 3px 20px rgba(56,189,248,.6), 0 0 0 4px rgba(56,189,248,.15); }
}
#sidebar-fixed .sb-toggle {
  position: absolute;
  left: -30px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 64px;
  background: #0F4A6E;
  color: #fff;
  border: none;
  border-radius: 10px 0 0 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: -3px 3px 10px rgba(15,74,110,.2);
  transition: background .2s;
  padding: 0;
  z-index: 901;
}
#sidebar-fixed .sb-toggle:hover {
  background: #083350;
}
#sidebar-fixed .sb-toggle-icon {
  width: 18px;
  height: 18px;
  transition: transform .35s cubic-bezier(.4,0,.2,1);
}
#sidebar-fixed.sb-collapsed .sb-toggle-icon {
  transform: rotate(180deg);
}

/* ══════════════════════════════════════════════════════════
   반응형
══════════════════════════════════════════════════════════ */
@media(max-width:1024px) {
  #site-header .hd-search { display: none; }
}
@media(max-width:768px) {
  #site-header .hd-utils { display: none; }
  #site-header .gnb-list,
  #site-header .gnb-divider,
  #site-header .gnb-sub { display: none; }
  #site-header .logo-mark { width: 52px; height: 52px; }
  #site-header .logo-mark svg { width: 52px; height: 52px; }
  #sidebar-fixed { display: none; }
  #site-footer .footer-top-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  #site-footer .footer-nav-grid {
    grid-template-columns: repeat(2,1fr);
    gap: 24px;
  }
}
