/* The sidebar of spaces and shared pages. Moved out of the partial's inline
 * <style> so the sheet can be listed for a signed-in reader who does not get
 * the full `:app` set. */
.sidebar {
  width: 260px;
  height: 100vh;
  background: #1e1e1e;
  color: #eee;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  flex: 0.4;
}

@media (max-width: 768px) {
  .sidebar {
    width: 100%;
    position: absolute;
    z-index: 2;
  }

  .sidebar.open ~ .main-content .page-header .menu-toggle {
    position: absolute;
    color: #dddddd;
    z-index: 2;
    right: 0;
    right: -22px;
    transform: translateX(-12px);
  }
}

.sidebar-header {
  padding: 1rem;
  position: sticky;
  top: 0;
  z-index: 30;
  background: #1e1e1e;
}

.sidebar-header input {
  width: 100%;
  padding: 6px;
  border-radius: 4px;
  border: none;
  background: #333;
  color: #fff;
}

.sidebar-header input:disabled {
  cursor: not-allowed;
  background: #2a2a2a;
}

.page-list {
  overflow-y: auto;
  flex-grow: 1;
  margin: 0 0 1rem 1rem;
  margin-right: 0;
  scrollbar-color: #6c6c6c #1e1e1e;
  scrollbar-width: thin;
}

.scrollable-sections {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.section-title {
  font-size: 0.85rem;
  color: #aaa;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

.sticky-section {
  position: sticky;
  top: 0;
  background: #1e1e1e;
  z-index: 9000;
  padding-top: 1rem;
}

.page-link {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ddd;
  text-decoration: none;
  padding: 6px;
  border-radius: 4px;
  font-size: 0.95rem;
  transition: background 0.2s;
  background: #1e1e1e;
  z-index: inherit;
}

.page-link:hover {
  background: #2a2a2a !important;
}

.page-icon {
  flex-shrink: 0;
}

.page-link.active {
  background: #2a2a2a !important;
  color: #fff;
}

.page-link-wrapper {
  display: flex;
  flex-direction: column;
  margin-left: calc(var(--level, 0) * 1rem);
  position: relative;
  z-index: var(--z-index, auto);
}

.page-link-wrapper > .page-link {
  position: sticky;
  background: #1e1e1e;
  display: flex;
  align-items: center;
}

.page-children {
  display: none;
  margin-left: 0.6rem;
  border-left: 1px dashed #444;
  padding-left: 0.5rem;
}

.page-link-wrapper.open > .page-children {
  display: block;
}

.toggle-arrow {
  cursor: pointer;
  margin-right: 4px;
  font-size: 0.8rem;
  color: #888;
  user-select: none;
}
