/* BOK Layout */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; padding: 0; }

/* ── 테마 변수 ── */
.bok-theme-light {
  --bok-bg: #ffffff;
  --bok-text: #111111;
  --bok-text-sub: #888888;
  --bok-text-muted: #bbbbbb;
  --bok-nav: #111111;
  --bok-nav-hover: #b0b0b0;
  --bok-border: #eeeeee;
  --bok-border-mid: #dddddd;
  --bok-border-strong: #cccccc;
  --bok-card-bg: #f4f4f4;
  --bok-btn-bg: #111111;
  --bok-btn-text: #ffffff;
  --bok-btn-hover: #333333;
  --bok-input-bg: #ffffff;
  --bok-topbar-text: #333333;
  --bok-badge-bg: #111111;
  --bok-badge-text: #ffffff;
  --bok-panel-bg: #f8f8f8;
  --bok-logo-filter: none;
}
.bok-theme-gray {
  --bok-bg: #dcdad4;
  --bok-text: #1c1c1a;
  --bok-text-sub: #6b6a64;
  --bok-text-muted: #9b9a92;
  --bok-nav: #1c1c1a;
  --bok-nav-hover: #7a7a72;
  --bok-border: #c9c7c0;
  --bok-border-mid: #bbb9b1;
  --bok-border-strong: #a9a79f;
  --bok-card-bg: #cbc9c2;
  --bok-btn-bg: #1c1c1a;
  --bok-btn-text: #dcdad4;
  --bok-btn-hover: #35342f;
  --bok-input-bg: #e6e4de;
  --bok-topbar-text: #3a3a36;
  --bok-badge-bg: #1c1c1a;
  --bok-badge-text: #dcdad4;
  --bok-panel-bg: #d1cfc8;
  --bok-logo-filter: none;
}
.bok-theme-dark {
  --bok-bg: #0e0e0e;
  --bok-text: #f0f0f0;
  --bok-text-sub: #9a9a9a;
  --bok-text-muted: #666666;
  --bok-nav: #f0f0f0;
  --bok-nav-hover: #777777;
  --bok-border: #262626;
  --bok-border-mid: #333333;
  --bok-border-strong: #444444;
  --bok-card-bg: #1e1e1e;
  --bok-btn-bg: #f0f0f0;
  --bok-btn-text: #0e0e0e;
  --bok-btn-hover: #cccccc;
  --bok-input-bg: #1a1a1a;
  --bok-topbar-text: #cccccc;
  --bok-badge-bg: #f0f0f0;
  --bok-badge-text: #0e0e0e;
  --bok-panel-bg: #191919;
  --bok-logo-filter: brightness(0) invert(1);
}

/* 본문 배경이 뷰포트 전체를 덮도록 (오버스크롤 대비) */
body:has(.bok-theme-light) { background: #ffffff; }
body:has(.bok-theme-gray)  { background: #dcdad4; }
body:has(.bok-theme-dark)  { background: #0e0e0e; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  color: #111;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

#bok-wrap {
  min-height: 100vh;
  background: var(--bok-bg);
  color: var(--bok-text);
}

/* ── 상단 유틸바 ── */
#bok-topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 18px 40px;
  font-size: 14px;
  color: var(--bok-topbar-text);
  background: var(--bok-bg);
}
#bok-topbar a { color: var(--bok-topbar-text); }
#bok-topbar a:hover { color: var(--bok-text); text-decoration: underline; }

/* 햄버거 (모바일 전용) */
#bok-hamburger {
  display: none;
  margin-left: auto;
  width: 30px;
  height: 24px;
  border: none;
  background: none;
  cursor: pointer;
  padding: 0;
  flex-direction: column;
  justify-content: space-between;
}
#bok-hamburger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--bok-text);
  transition: transform 0.2s, opacity 0.2s;
}
#bok-hamburger.open span:nth-child(1) { transform: translateY(11px) rotate(45deg); }
#bok-hamburger.open span:nth-child(2) { opacity: 0; }
#bok-hamburger.open span:nth-child(3) { transform: translateY(-11px) rotate(-45deg); }

/* ── 사이드바 ── */
#bok-sidebar {
  position: fixed;
  top: 0; left: 0;
  width: 320px;
  height: 100vh;
  padding: 110px 48px 48px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  background: var(--bok-bg);
  z-index: 200;
}

#bok-logo {
  display: block;
  width: 130px;
  margin-bottom: 48px;
  flex-shrink: 0;
}
#bok-logo img { display: block; width: 100%; height: auto; filter: var(--bok-logo-filter); }

#bok-nav {
  display: flex;
  flex-direction: column;
  margin-bottom: auto;
}
#bok-nav a {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.9;
  color: var(--bok-nav);
  letter-spacing: -0.3px;
  transition: color 0.15s;
}
#bok-nav a:hover,
#bok-nav a.active { color: var(--bok-nav-hover); }

#bok-contact { margin-top: 48px; }
#bok-contact p {
  font-size: 13px;
  color: var(--bok-text-muted);
  line-height: 1.7;
  margin: 0;
}

#bok-sns {
  display: flex;
  gap: 16px;
  margin-top: 24px;
}
#bok-sns a { color: var(--bok-text); }
#bok-sns a:hover { color: var(--bok-text-sub); }

/* ── 모바일 오버레이 ── */
#bok-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 150;
}
#bok-overlay.open { display: block; }

/* ── 메인 콘텐츠 ── */
#bok-main {
  margin-left: 320px;
  padding: 110px 48px 80px;
  min-width: 0;
}

/* ── 로그인 모달 ── */
#bok-login-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 500;
  align-items: center;
  justify-content: center;
}
#bok-login-modal.open { display: flex; }
.bok-modal-dim {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}
.bok-modal-box {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 20px;
  padding: 44px 40px 32px;
  background: var(--bok-bg);
  color: var(--bok-text);
  border: 1px solid var(--bok-border);
}
.bok-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: var(--bok-text-muted);
  cursor: pointer;
  padding: 4px;
}
.bok-modal-close:hover { color: var(--bok-text); }
.bok-modal-title {
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  margin: 0 0 28px;
  color: var(--bok-text);
}
.bok-modal-msg {
  font-size: 13px;
  padding: 10px 12px;
  margin-bottom: 16px;
  border: 1px solid var(--bok-border-mid);
  color: var(--bok-text-sub);
}
.bok-modal-input {
  width: 100%;
  padding: 13px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--bok-border-mid);
  background: var(--bok-input-bg);
  color: var(--bok-text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
.bok-modal-input:focus { border-color: var(--bok-text); }
.bok-modal-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--bok-text-sub);
  margin: 6px 0 20px;
  cursor: pointer;
}
.bok-modal-submit {
  width: 100%;
  padding: 14px;
  border: none;
  background: var(--bok-btn-bg);
  color: var(--bok-btn-text);
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.bok-modal-submit:hover { background: var(--bok-btn-hover); }
.bok-modal-links {
  display: flex;
  justify-content: space-between;
  margin-top: 18px;
  font-size: 13px;
}
.bok-modal-links a { color: var(--bok-text-sub); }
.bok-modal-links a:hover { color: var(--bok-text); text-decoration: underline; }

/* ── 반응형 ── */
@media (max-width: 1000px) {
  #bok-sidebar { width: 260px; padding: 100px 32px 40px; }
  #bok-main { margin-left: 260px; padding: 100px 32px 60px; }
  #bok-nav a { font-size: 20px; }
}

@media (max-width: 680px) {
  #bok-topbar { padding: 14px 20px; }
  #bok-hamburger { display: flex; }

  #bok-sidebar {
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    width: 280px;
    padding: 90px 32px 40px;
    box-shadow: none;
  }
  #bok-sidebar.open {
    transform: translateX(0);
    box-shadow: 0 0 40px rgba(0,0,0,0.25);
  }

  #bok-main {
    margin-left: 0;
    padding: 70px 20px 50px;
  }
}
