.sidebar {
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  /* background: #25232a; */
  border-radius: 5px;
  top: 10px;
  max-height: calc(100vh - 16px);
  /* max-height: calc(100vh - 145px - 40px); */
  /* max-height: calc(100vh - 40px); */
  /* height: 100%; */
  gap: 10px;
  margin: 8px;
  transition: all 0.25s ease;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar_sect {
  background: #25232a;
  border-radius: 5px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  /* width: auto; */
  min-width: 300px;
  padding: 15px;
  overflow: hidden;
  flex-shrink: 0;
}

.sidebar_sect_top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.sidebar_row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar_sect_heading {
  font-size: 1.13rem;
  font-weight: bold;
}

.sidebar_note {
  background-color: var(--layers-theme-secondary, #19181b);
  border-radius: 5px;
  padding: 10px;
  width: 0;
  min-width: 100%;
  font-size: 0.9rem;
}

/* Link Buttons */

.link_button {
  color: #f0f0f0;
  text-decoration: none;
  background: transparent;
  border-radius: 5px;
  padding: 10px;
  cursor: pointer;
}

.link_button:hover {
  background: #2d2a33;
}

#link_button_active {
  background: #393140;
  font-weight: bold;
}

/*  */

.sidebar_switcher {
  background: #1E1D22;
  border-radius: 5px;
  justify-content: space-between;
  transition: all 0.25s ease;
}

.sidebar_switcher.expanded {
  filter: drop-shadow(0 0 5px rgb(19, 19, 19));
}

.switcher-links {
  gap: 5px;
}

.sidebar_header {
  display: flex;
  min-height: 50px;
  cursor: pointer;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 1.5rem;
  font-weight: bold;
  user-select: none;
  padding: 8px 16px;
}

/* The toggle arrow is a DIRECT child of the header; the current-selection block
   nests its own vortex-label[name="Icon"] (the project logo), so these rotation
   rules use the child combinator to spin only the arrow, not the logo. */
/* Aim arrow image right when collapsed (default) */
.sidebar_header > vortex-label[name="Icon"] {
  flex: none;
  transition: all 0.25s ease;
  transform: rotate(-90deg); /* Start with arrow pointing right (rotated from down) */
}

/* Aim arrow image down when expanded */
.sidebar_header.expanded > vortex-label[name="Icon"] {
  transform: rotate(0deg);
}

/* Current-selection block in the switcher header: icon + (title / tagline). */
.switcher-current {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0; /* let the texts ellipsize instead of pushing the arrow out */
}

.switcher-current-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switcher-current-title {
  font-size: 1rem;
  font-weight: bold;
}

.switcher-current-desc {
  font-size: 0.8rem;
  font-weight: normal;
  opacity: 0.6;
  margin-top: -5px;
}

/* Switcher option rows: icon + title in a line (the surface is display:flex
   inline; this just aligns + spaces its children). */
.sidebar_switcher .switcher-links .link_button {
  align-items: center;
  gap: 10px;
}

.switcher-option-texts {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.switcher-option-title {
  font-size: 1rem;
}

.switcher-option-desc {
  font-size: 0.8rem;
  font-weight: normal; /* keep the tagline light even on the bold active option */
  opacity: 0.6;
  margin-top: -5px;
}

/* Sub-project options are two lines (icon + title + tagline), so they need more
   room than the shared single-line option cap (.sidebar_switcher .link_button
   .visible, 50px). Scoped to this switcher so the version/topics switchers keep
   their tighter cap. */
#sect_subprojects .link_button.visible {
  max-height: 80px;
}

/* Switcher icons (current selection + each option) contain a tall or square
   logo within a fixed square slot — same technique as the family-index cards
   (.member-icon in index.css) — so different logo shapes share one footprint.
   Size differs per slot. */
vortex-label[name="Icon"].switcher-current-icon,
vortex-label[name="Icon"].switcher-option-icon {
  aspect-ratio: 1 / 1;
  flex: none;
  position: relative;
}

vortex-label[name="Icon"].switcher-current-icon {
  width: 36px;
  height: 36px;
}

vortex-label[name="Icon"].switcher-option-icon {
  width: 30px;
  height: 30px;
}

vortex-label[name="Icon"].switcher-current-icon svg,
vortex-label[name="Icon"].switcher-option-icon svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Original transitions on these elements */
.sidebar_switcher .link_button {
  /* Remove display: none */
  opacity: 0;
  max-height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.sidebar_switcher .link_button.visible {
  /* Remove display: flex */
  opacity: 1;
  max-height: 50px; /* Set an appropriate max height */
  margin: 0;
  padding: 8px 10px;
}

#sect_topics {
  /* Remove display: none */
  opacity: 0;
  max-height: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

#sect_topics.visible {
  /* Remove display: flex */
  opacity: 1;
  padding: 15px;
  max-height: 500px; /* Set this to an appropriate value larger than the expected height */
  margin: 0 5px 5px 5px !important;
}

/* .sidebar_switcher .link_button {
  display: none;
  opacity: 0.0;
  max-height: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

.sidebar_switcher .link_button.visible {
  display: flex;
  opacity: 1.0;
}

#sect_topics {
  display: none;
  opacity: 0.0;
}

#sect_topics.visible {
  display: flex;
  opacity: 1.0;
} */

/* Sub-project (family) switcher section — same collapse behavior as #sect_topics.
   Its .visible class is toggled by sidebar_switchers.js on the project page and by
   docs_sidebars.js (#subproject_switcher) on the docs index/doc pages. */
#sect_subprojects {
  opacity: 0;
  max-height: 0;
  padding: 0;
  overflow: hidden;
  transition: all 0.25s ease;
}

#sect_subprojects.visible {
  opacity: 1;
  padding: 15px;
  max-height: 500px;
  margin: 0 5px 5px 5px !important;
}

/* Docs-area breadcrumb (Project › Documentation) at the top of the docs sidebars
   — see __project__/includes/docs_breadcrumb.html. The container is the themed
   "Breadcrumb" surface (styles/breadcrumb.json); these rules drive layout + the
   crumb links/separator. The background/radius are non-vortex fallbacks (Layers
   themes the fill in the vortex shell, like .sidebar_switcher does). */
.docs_breadcrumb {
  gap: 8px;
  background: #1e1d22;
  border-radius: 5px;
  padding: 12px 16px;
}

.docs_crumb {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--layers-theme-foreground, #f0f0f0);
}

a.docs_crumb {
  text-decoration: none;
  cursor: pointer;
}

a.docs_crumb:hover {
  text-decoration: underline;
}

.docs_crumb_current {
  font-weight: bold;
  cursor: default;
}

.docs_crumb_sep {
  opacity: 0.5;
  user-select: none;
}

/*  */

