/** ToC hidden setting disabled - ToC expand is active. */
.handbook[data-toc-hidden="0"] .handbook-toc-toggle {
  display: none;
}
.handbook[data-toc-hidden="0"] .handbook-toc-expand {
  display: block;
}

/** ToC hidden setting enabled - ToC toggle is active. */
.handbook[data-toc-hidden="1"] .handbook-toc-toggle {
  display: block;
}
.handbook[data-toc-hidden="1"] .handbook-toc-expand {
  display: none;
}

/** ToC label toggle based on state */
.handbook:not(.toc-open) .handbook-toc-toggle .open {
  display: none;
}
.handbook.toc-open .handbook-toc-toggle .closed {
  display: none;
}

/** ToC expand toggle based on state */
.handbook:not(.toc-expand) .handbook-toc-expand .open {
  display: none;
}
.handbook.toc-expand .handbook-toc-expand .closed {
  display: none;
}

/** Hide the handbook content when the ToC is open. */
.handbook.toc-open .handbook-content {
  display: none;
}

/** Show the ToC when the ToC is open. */
.handbook.toc-open .handbook-toc {
  display: block;
}

@media  screen and (min-width: 992px) {
  /** Hide the ToC when the ToC is hidden and the screen is big enough to show sidebar. */
  .handbook[data-toc-hidden="0"] .handbook-toc {
    display: none;
  }
  /** Show main content when the ToC is hidden and the screen is big enough to show sidebar. */
  .handbook[data-toc-hidden="0"] .handbook-content {
    display: flex;
  }
}

.handbook-toc-toggle, .handbook-toc-expand {
  background: none;
  padding: 0;
  border: none;
  color: var(--secondary);
}

/** ToC label disable pointer events */
.handbook .handbook-toc-expand .open,
.handbook .handbook-toc-expand .closed,
.handbook .handbook-toc-toggle .open,
.handbook .handbook-toc-toggle .closed {
  pointer-events: none;
}
