/* 사이드 메뉴 — 홈과 모든 정적 페이지 공통. static-navigation.js가 마크업을 단다. */
.site-sidebar,
.site-drawer {
  --sm-ink: #172033;
  --sm-muted: #687386;
  --sm-line: rgba(23, 32, 51, 0.12);
  --sm-blue: #315f9f;
  color: var(--sm-ink);
  font-family: Inter, "Avenir Next", "Pretendard", "Apple SD Gothic Neo", sans-serif;
}

.site-sidebar { display: none; }

.sm-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 8px 18px;
  color: var(--sm-ink);
  font-weight: 900;
  text-decoration: none;
}

.site-sidebar .brand-mark,
.site-drawer .brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--sm-blue), #8eb3df);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 950;
}

.sm-start {
  margin: 0 4px 18px;
  padding: 14px 14px 12px;
  border-radius: 16px;
  background: rgba(49, 95, 159, 0.08);
}

.sm-start strong { display: block; font-size: 0.86rem; }

.sm-start ol {
  margin: 8px 0 0;
  padding-left: 20px;
  color: var(--sm-muted);
  font-size: 0.8rem;
  line-height: 1.55;
}

.sm-group { margin: 0 0 14px; }

.sm-group h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  padding: 0 10px;
  color: var(--sm-muted);
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.sm-group h3 span {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(23, 32, 51, 0.06);
  font-size: 0.7rem;
}

.sm-group ul { margin: 0; padding: 0; list-style: none; }

.sm-group a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 11px;
  color: var(--sm-ink);
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}

.sm-group a:hover { background: rgba(49, 95, 159, 0.08); text-decoration: none; }

.sm-group a[aria-current="page"] {
  background: var(--sm-blue);
  color: #fff;
}

.sm-group em {
  flex: 0 0 auto;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(49, 95, 159, 0.12);
  color: var(--sm-blue);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 850;
}

.sm-group a[aria-current="page"] em { background: rgba(255, 255, 255, 0.22); color: #fff; }

.sm-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 18px 10px 0;
  padding-top: 14px;
  border-top: 1px solid var(--sm-line);
}

.sm-footer a { color: var(--sm-muted); font-size: 0.78rem; font-weight: 650; text-decoration: none; }

/* 상단 '메뉴' 버튼 — 좁은 화면에서만 */
.topbar .site-menu-button {
  flex: 0 0 auto;
  white-space: nowrap;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid rgba(49, 95, 159, 0.25);
  border-radius: 999px;
  background: #fff;
  color: #153d73;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  cursor: pointer;
}

.topbar .site-menu-button:hover { background: rgba(49, 95, 159, 0.08); }

/* 모바일 서랍 */
.site-drawer {
  width: min(340px, calc(100% - 40px));
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 16px 12px 28px;
  border: 0;
  background: #fffdf8;
  box-shadow: 18px 0 50px rgba(23, 32, 51, 0.18);
  overflow-y: auto;
}

.site-drawer::backdrop { background: rgba(23, 32, 51, 0.38); }

.sm-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 6px 14px;
}

.sm-drawer-head button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sm-line);
  border-radius: 999px;
  background: #fff;
  color: var(--sm-ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 750;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .site-drawer[open] { animation: sm-slide 0.22s ease-out; }
  @keyframes sm-slide { from { transform: translateX(-24px); opacity: 0; } }
}

/* 넓은 화면: 왼쪽 고정 사이드바, 메뉴 버튼은 숨김 */
@media (min-width: 1200px) {
  html.has-site-menu body { padding-left: 272px; }

  .site-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 20;
    display: block;
    width: 272px;
    padding: 22px 14px 28px;
    border-right: 1px solid var(--sm-line);
    background: rgba(255, 253, 248, 0.94);
    overflow-y: auto;
  }

  .topbar .site-menu-button { display: none; }
  /* 정적 페이지 상단 바는 로고+메뉴 버튼뿐이라 사이드바가 있으면 필요 없다 */
  .topbar.has-global-nav { display: none; }
}
