body:has(> .site-sidebar) {
  display: grid;
  grid:
    "header" auto
    "sidebar" auto
    "content" 1fr
    "footer" auto
    / minmax(0, 1fr);

  @media screen and (min-width: 1024px) {
    grid:
      "header header  header  header" auto
      ".      sidebar content .     " 1fr
      "footer footer  footer  footer" auto
      / minmax(0, 1fr) 300px minmax(0, 860px) minmax(0, 1fr);
  }

  .site-header {
    grid-area: header;

    @media screen and (min-width: 1024px) {
      display: grid;
      grid-template-columns: subgrid;

      > .wrapper {
        grid-column: 2 / 4;
        max-width: none;
        margin: 0;
      }
    }
  }

  .site-sidebar {
    grid-area: sidebar;
  }

  .page-content {
    grid-area: content;
  }

  .site-footer {
    grid-area: footer;
  }
}

.site-sidebar {
  font-size: 0.9375rem;

  nav {
    padding-top: 30px;
  }

  summary {
    cursor: pointer;
    font-weight: 600;
  }

  details[open] > summary {
    margin-bottom: 15px;
  }

  @media screen and (min-width: 1024px) {
    nav {
      position: sticky;
      top: 0;
      box-sizing: border-box;
      max-height: 100vh;
      padding: 30px;
      overflow-y: auto;
    }

    summary {
      display: none;
    }

    details::details-content {
      content-visibility: visible;
    }
  }

  h4 {
    font-size: 1rem;
    margin-bottom: 8px;
  }

  ul {
    margin-left: 0;
    list-style: none;
  }

  li {
    margin-bottom: 4px;
  }

  a {
    color: var(--minima-text-color);

    &:visited {
      color: var(--minima-text-color);
    }

    &:hover {
      color: var(--minima-link-hover-color);
    }
  }

  li.current-page > a {
    color: var(--minima-link-base-color);
    font-weight: bold;
  }
}
