/* RGraphSpace pkgdown site: layout and navigation */

/* Content width and columns ------------------------------------------- */
/* pkgdown caps the article column at 50rem; lift the cap and give the
   main column more room than the sidebar on large screens. */
body > .container > .row > main { max-width: none; }

@media (min-width: 62em) {
  body > .container > .row > main  { width: 80%; }
  body > .container > .row > aside { width: 20%; margin-left: 0; padding-left: 1rem; }
}

/* Vignette menu: one submenu per group (built by extra.js) ------------- */
/* Brighter menu items: the theme's grey has low contrast on the dark menu */
.navbar .dropdown-menu { --bs-dropdown-link-color: #dee2e6; }

.navbar [aria-labelledby="dropdown-vignettes"] {
  overflow: visible;
  max-height: none;
  width: max-content;
  max-width: calc(100vw - 2rem);
}

.vignette-submenu { position: relative; margin: 0; }

.vignette-submenu > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  list-style: none;
}

.vignette-submenu > summary::-webkit-details-marker { display: none; }

/* Arrow pointing to the submenu */
.vignette-submenu > summary::after {
  content: "";
  border-top: 0.25em solid transparent;
  border-bottom: 0.25em solid transparent;
  border-left: 0.25em solid currentColor;
}

.vignette-submenu[open] > summary {
  background: var(--bs-dropdown-link-hover-bg);
  color: var(--bs-dropdown-link-hover-color);
}

.vignette-submenu[open] > .dropdown-menu { display: block; }

.navbar.navbar-expand-lg .vignette-submenu > .dropdown-menu {
  position: absolute;
  inset: -0.25rem auto auto 100%;
  width: max-content;
  max-width: min(34rem, 45vw);
  max-height: 70vh;
  overflow: auto;
  margin: 0;
}

.vignette-submenu .dropdown-item { white-space: normal; }

/* Stack submenus on narrow screens and touch devices */
@media (width < 75em), (hover: none) {
  .navbar.navbar-expand-lg .vignette-submenu > .dropdown-menu {
    position: static;
    width: 100%;
    max-width: none;
    padding-left: 0.75rem;
    border: 0;
    box-shadow: none;
  }
  .vignette-submenu[open] > summary::after { transform: rotate(90deg); }
}
