
/* ── EMD nav — uses the shadcn/Geist CSS variables from base.css ─────────── */

/* ── Nav tree shared by sidebar slot, standalone drawer, and mobile drawer ── */
#custom-nav {
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  font-size: var(--text-sm, 0.875rem);
  padding: 0.25rem 0;
}
#custom-nav a {
  display: flex;
  align-items: center;
  padding: 0.3rem 0.625rem;
  border-radius: var(--radius-md, 0.375rem);
  color: var(--sidebar-foreground, inherit);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s, color 0.15s;
  font-size: var(--text-sm, 0.875rem);
  line-height: 1.4;
}
#custom-nav a:hover {
  background: var(--sidebar-accent, rgba(0,0,0,0.06));
  color: var(--sidebar-accent-foreground, inherit);
}
#custom-nav a.active {
  background: var(--accent, rgba(0,0,0,0.09));
  color: var(--foreground, inherit);
  font-weight: var(--font-weight-medium, 500);
}

/* Group label row */
.nav-group-label {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.625rem;
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--font-weight-medium, 500);
  color: var(--muted-foreground, #888);
  cursor: pointer;
  border-radius: var(--radius-md, 0.375rem);
  user-select: none;
  transition: background 0.15s, color 0.15s;
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
}
.nav-group-label:hover {
  background: var(--sidebar-accent, rgba(0,0,0,0.06));
  color: var(--sidebar-accent-foreground, inherit);
}
.nav-group-label svg {
  flex-shrink: 0;
  width: 12px; height: 12px;
  transition: transform 0.2s var(--ease-in-out, ease);
}
.nav-group-label.collapsed svg { transform: rotate(-90deg); }

/* Indented child group */
.nav-group-children {
  padding-left: 0.5rem;
  margin-left: 1rem;
  margin-bottom: 0.125rem;
  border-left: 1px solid var(--sidebar-border, rgba(0,0,0,0.08));
}
.nav-group-children.collapsed { display: none; }

/* ── Standalone page: slide-in drawer ────────────────────────────────────── */
#emd-nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: var(--sidebar-width, 240px);
  max-width: min(85vw, 280px);
  background: var(--sidebar, #fafafa);
  color: var(--sidebar-foreground, #111);
  border-right: 1px solid var(--sidebar-border, rgba(0,0,0,0.08));
  box-shadow: 2px 0 20px rgba(0,0,0,0.12);
  padding: 0.75rem 0.5rem 1.5rem;
  overflow-y: auto;
  z-index: 200;
  transform: translateX(-100%);
  transition: transform 0.22s var(--ease-out, ease);
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  scrollbar-width: thin;
  scrollbar-color: var(--muted-foreground, #aaa) transparent;
}
#emd-nav-drawer.open { transform: translateX(0); }

/* Drawer header — mirrors the MkDocs site header height */
#emd-nav-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0.625rem 0.875rem;
  border-bottom: 1px solid var(--sidebar-border, rgba(0,0,0,0.08));
  margin-bottom: 0.5rem;
}
#emd-nav-drawer-title {
  font-size: var(--text-sm, 0.875rem);
  font-weight: var(--font-weight-semibold, 600);
  color: var(--sidebar-foreground, #111);
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
  letter-spacing: var(--tracking-tight, -0.015em);
}
#emd-nav-drawer-close {
  display: flex; align-items: center; justify-content: center;
  width: 1.75rem; height: 1.75rem;
  border: none; border-radius: var(--radius-md, 0.375rem);
  background: transparent; cursor: pointer;
  color: var(--muted-foreground, #888);
  transition: background 0.15s, color 0.15s;
}
#emd-nav-drawer-close:hover {
  background: var(--sidebar-accent, rgba(0,0,0,0.06));
  color: var(--sidebar-accent-foreground, #111);
}
#emd-nav-drawer-close svg { width: 14px; height: 14px; }

/* Scrim */
#emd-nav-scrim {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 199; backdrop-filter: blur(1px);
}
#emd-nav-scrim.open { display: block; }

/* Edge tab — hamburger handle */
#emd-nav-tab {
  position: fixed; top: 50%; left: 0;
  transform: translateY(-50%);
  z-index: 198;
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 10px 6px;
  background: var(--sidebar, #fafafa);
  border: 1px solid var(--sidebar-border, rgba(0,0,0,0.08));
  border-left: none;
  border-radius: 0 var(--radius-md, 0.375rem) var(--radius-md, 0.375rem) 0;
  box-shadow: 2px 0 8px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}
#emd-nav-tab:hover {
  background: var(--sidebar-accent, #f3f3f3);
  box-shadow: 2px 0 12px rgba(0,0,0,0.12);
}
#emd-nav-tab.hidden { display: none; }
#emd-nav-tab svg {
  width: 14px; height: 14px;
  color: var(--muted-foreground, #666);
  flex-shrink: 0;
}

/* ── Mobile drawer (MkDocs-themed pages) ─────────────────────────────────── */
#mobile-nav-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.4); display: none;
}
#mobile-nav-overlay.open { display: block; }
#mobile-nav-drawer {
  position: fixed; top: 0; left: 0; bottom: 0;
  width: min(85vw, 300px);
  background: var(--sidebar, #fafafa);
  color: var(--sidebar-foreground, #111);
  z-index: 101; overflow-y: auto;
  padding: 0.75rem 0.5rem;
  transform: translateX(-100%);
  transition: transform 0.22s var(--ease-out, ease);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
  font-family: var(--font-sans, ui-sans-serif, system-ui, sans-serif);
}
#mobile-nav-overlay.open #mobile-nav-drawer { transform: translateX(0); }
