/* ================================================
   WORFLOGY — Layout & Core Structures (eduContextOn)
   ================================================ */

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--text);
  background: var(--bg);
  line-height: var(--lh-body);
  display: flex;
  min-height: 100vh;
  max-width: 1240px;
  margin: 0 auto;
  position: relative;
  box-shadow: 0 0 60px rgba(26,31,54,0.04);
  word-break: keep-all;
  overflow-wrap: break-word;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }

/* 제목 태그 기본 폰트 – Noto Serif KR */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif-ko);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.5px;
}

/* ── Sidebar ── */
.sidebar {
  width: var(--sidebar-w);
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  flex-shrink: 0;
}
.sidebar-logo {
  padding: 24px 20px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}
.sidebar-logo img { height: 28px; width: auto; flex-shrink: 0; }
.sidebar-logo a {
  display: flex;
  flex-shrink: 0;
  line-height: 0;
}
.sidebar-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.brand-ko {
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  line-height: 1.35;
  white-space: nowrap;
}
.brand-en {
  font-family: var(--font-serif-en);
  font-style: italic;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.2px;
  line-height: 1.35;
  white-space: nowrap;
}

.sidebar-nav {
  flex: 1;
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font-body);
  transition: background var(--t), color var(--t), border-color var(--t);
  border-left: 2px solid transparent;
  position: relative;
}
.nav-item:hover {
  background: var(--sand);
  color: var(--text);
  border-left-color: var(--border-sand);
}
.nav-item.active {
  background: rgba(26,31,54,0.07);
  color: var(--ink);
  font-weight: 600;
  border-left-color: var(--ink);
}
.nav-item svg { width: 16px; height: 16px; flex-shrink: 0; }

.sidebar-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  font-family: var(--font-body);
  color: var(--text-light);
  line-height: 1.6;
}

/* ── Main Content ── */
.main {
  flex: 1;
  min-height: 100vh;
  width: calc(100% - var(--sidebar-w));
}

/* ── Section Wrapper ── */
.section {
  padding: 40px 64px;
}
.section + .section {
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
.hamburger {
  display: none;
  position: fixed;
  top: 16px; left: 16px;
  z-index: 200;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 8px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}
.hamburger svg { width: 20px; height: 20px; display: block; }
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(26,31,54,0.25);
  z-index: 99;
}

@media (max-width: 768px) {
  :root {
    --sidebar-w: 0px;
  }
  .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform var(--t);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main { margin-left: 0; }
  .hamburger { display: block; }

  /* 모바일 추가 보정 (가로 스크롤 방지 및 타이틀/간격 최적화) */
  html, body {
    max-width: 100%;
    overflow-x: hidden;
  }
  .main {
    width: 100%;
    overflow: hidden;
  }
}
