/* The admin pages: the sidebar on the left of a computer screen, and a
   slide-out menu on a phone opened from the navbar. */
.admin-drawer {
  display: grid;
  grid-template-columns: 16rem minmax(0, 1fr);
  flex: 1;
  min-height: calc(100dvh - var(--navbar-height));
}
.admin-drawer__content { min-width: 0; }
.admin-drawer__overlay { display: none; }

.admin-sidebar {
  position: sticky;
  top: var(--navbar-height);
  height: calc(100dvh - var(--navbar-height));
  overflow-y: auto;
  padding: 2rem 0.75rem 0.75rem;
  background: var(--color-page);
  color: #5b6b73;
  font-size: 0.875rem;
}
.admin-sidebar__list { display: flex; flex-direction: column; gap: 0.125rem; }
.admin-sidebar__title {
  margin: 1.75rem 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
}
.admin-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4375rem 0.75rem;
  border-radius: 0.5rem;
  line-height: 1.25rem;

  & svg { flex: none; width: 1.125rem; height: 1.125rem; }
  &:hover { background: var(--color-sunken); color: var(--color-ink); }
}
/* The page you are on: brand colour, no background. */
.admin-sidebar__link--current,
.admin-sidebar__link--current:hover { background: transparent; color: var(--color-primary); font-weight: 600; }

@media (max-width: 1023px) {
  .admin-drawer { display: block; }
  .admin-sidebar {
    position: fixed;
    inset: var(--navbar-height) auto 0 0;
    z-index: 61;
    width: 16rem;
    height: auto;
    box-shadow: var(--shadow-pop);
    transform: translateX(-100%);
    transition: transform 250ms cubic-bezier(0.32, 0.72, 0, 1);
  }
  .admin-drawer__toggle:checked ~ .admin-drawer .admin-sidebar { transform: none; }
  .admin-drawer__toggle:checked ~ .admin-drawer .admin-drawer__overlay {
    position: fixed;
    inset: var(--navbar-height) 0 0 0;
    z-index: 60;
    display: block;
    background: rgb(20 40 38 / 0.4);
  }
  @media (prefers-reduced-motion: reduce) { .admin-sidebar { transition: none; } }
}
