/* Base wrapper */
.block-handbook-menu {
  margin-bottom: 2rem;
}

/* Desktop/mobile "card" styling for the nav */
.handbook-nav {
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.25rem;
  background: #fff;
}

/* Summary (the clickable header inside the card) – MOBILE FIRST */
.handbook-nav__summary {
  padding: 0.75rem 1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none; /* hide default triangle in some browsers */
}

/* Provide your own indicator (mobile only) */
.handbook-nav__summary::after {
  content: '▾';
  float: right;
  transition: transform 0.2s ease-in-out;
}

/* Rotate indicator when open */
.handbook-nav__details[open] .handbook-nav__summary::after {
  transform: rotate(-180deg);
}

/* Inner body (menu list) */
.handbook-nav__body {
  padding: 0 1rem 0.75rem 1rem;
}

/* Tweak the original ul.nav styles if needed */
.handbook-nav__body .nav {
  flex-direction: column;
}

/* Example: highlight active link */
.handbook-nav__body .nav-link.is-active,
.handbook-nav__body .nav-link.active {
  font-weight: 600;
  text-decoration: underline;
}

/* ============================
   Narrow viewport behavior
   Card on top, sticky
   ============================ */
@media (max-width: 991.98px) {
  /* Make the entire sidebar region sticky so content scrolls behind it */
  #sidebar-second {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #ffffff;
    padding-top: 20px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  }
}

/* ============================
   Wide viewport behavior
   Sidebar card, always open
   ============================ */
@media (min-width: 992px) {
  /* On desktop, make just the handbook block sticky in the sidebar */
  .block-handbook-menu {
    position: sticky;
    top: 1.5rem;          /* Clear any fixed header / add breathing room */
    align-self: flex-start;
  }

  /* On desktop, hide the summary entirely – no toggle UI */
  .handbook-nav__summary {
    display: none;
  }

  /* Optional: adjust padding now that summary is gone */
  .handbook-nav__body {
    padding-top: 0.75rem;
  }
}
