/* Left-hand navigation drawer.
   Colors come exclusively from the site tokens in site.css, so all three
   themes (graphite, light, sepia) work without any theme-specific rules. */

/* The drawer is a Lantern sheet: translucent, blurred, rounded on its
   free edge — the same surface language as the reader sheet and the
   settings panel. */
.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  width: min(18rem, 85vw);
  background: var(--sheet-strong);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-right: 1px solid var(--sheet-border);
  border-radius: 0 16px 16px 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: 2.9rem 0 1.25rem;
  transform: translateX(-100%);
  transition: transform .22s ease;
  z-index: 60;
  overflow-y: auto;
}

.drawer[data-open="true"] { transform: translateX(0); }

/* Own compositor layer: keeps the slide smooth even when the backdrop
   blur has dense admin tables to resample behind it. */
.drawer { will-change: transform; }

@media (prefers-reduced-motion: reduce) {
  .drawer { transition: none; }
}

/* The scrim fades in step with the drawer's slide instead of popping —
   the pop was glaring over bright admin pages while invisible over
   dark site pages, which made one menu feel like two. */
.drawer-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: 55;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, visibility 0s linear .22s;
}
.drawer-scrim.on {
  opacity: 1;
  visibility: visible;
  transition: opacity .22s ease;
}
@media (prefers-reduced-motion: reduce) {
  .drawer-scrim, .drawer-scrim.on { transition: none; }
}

.drawer-close {
  position: absolute;
  top: .6rem;
  right: .6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  background: none;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  cursor: pointer;
}
.drawer-close:hover,
.drawer-close:focus-visible { color: var(--ink); background: var(--rule-soft); }
.drawer-close svg { width: 18px; height: 18px; }

.drawer-group { padding: 0 .6rem; }

.drawer-label {
  font-family: var(--font-mono);
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 .35rem;
  padding: 0 .5rem;
}

.drawer ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.drawer a {
  display: flex;
  align-items: center;
  gap: .65rem;
  width: 100%;
  text-align: left;
  padding: .5rem .55rem;
  border-radius: 4px;
  color: var(--ink);
  text-decoration: none;
  font-size: .95rem;
}

.drawer a svg {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--ink-faint);
}

.drawer a:hover,
.drawer a:focus-visible {
  background: var(--accent-soft);   /* purple highlight, per the owner */
}
.drawer a:hover svg,
.drawer a:focus-visible svg { color: var(--accent); }

.drawer a[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--ink);
}

.drawer-foot {
  margin-top: auto;
  padding-top: .9rem;
  border-top: 1px solid var(--rule-soft);
}

/* Hamburger button — speaks the site's .btn language: grape-soft fill,
   grape icon, solid grape on hover. Mirrors the avatar button so the
   header's two icon buttons read as a pair. */
.drawer-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: var(--accent-soft);
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--ink);   /* white icon on graphite, per the owner */
  padding: 0;
  font: inherit;
  cursor: pointer;
}
.drawer-toggle:hover,
.drawer-toggle:focus-visible { background: var(--accent-solid); color: #fff; }

.drawer-toggle svg { width: 20px; height: 20px; }

/* Avatar icon button + notification badge hook. The badge span ships
   hidden; when notifications land, unhide it (and set data-count) and
   it renders as a grape dot pinned to the avatar's corner. */
.avatar-btn { position: relative; }
.avatar-btn svg { width: 18px; height: 18px; }

.avatar-badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent-solid);
  border: 2px solid var(--paper);
}
