#sidebar {
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  background-color: var(--color-primary);
  padding: 5rem 2.5rem 1rem 2rem;
  z-index: 30;
  overflow-y: auto;
  width: var(--sidebar-width);
  border-right: 1px solid var(--color-text-primary);

  @media screen and (max-width:1024px){
    padding: 1rem;
  }

  .aside-logo {
    background-color: var(--color-light);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    width: fit-content;
    padding: 8px 12px;

    @media screen and (max-width: 1025px) {
      display: none;
    }
  }

  .sidebar-search {
    margin-block-start: 2.5rem;
  }

  .sidebar-navigation-menu > li:nth-child(1) {
    border-top: 1px solid var(--color-light);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
  }

  .sidebar-navigation-menu {
    list-style: none;
    padding: 0;
    margin-block-start: 1.5rem;
    line-height: 2.5rem;

    li {
      margin-bottom: 1rem;
      display: block;

      &:nth-child(7) {
        border-bottom: 1px solid var(--color-light);
        padding-bottom: 0.5rem;
        margin-bottom: 0.5rem;
      }

      &.menu-item-has-children {
        position: relative;
        display: block;

        > a {
          color: var(--color-light);
          text-decoration: none;
          min-width: 0;
        }

        .menu-item-wrapper {
          display: grid;
          grid-template-columns: 1fr auto;
          align-items: center;
          column-gap: 0.75rem;
          width: 100%;
        }

        .submenu-toggle {
          position: relative;
          display: inline-flex;
          align-items: center;
          justify-content: center;
          width: 20px;
          height: 20px;
          background: none;
          border: none;
          cursor: pointer;
          color: var(--color-light);
          flex-shrink: 0;

          &:hover,
          &:focus {
            opacity: 0.85;
          }

          .visually-hidden {
            position: absolute !important;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
          }

          .plusminus {
            position: relative;
            display: inline-flex;
            justify-content: center;
            align-items: center;
            width: 14px;
            height: 14px;
          }
          .plusminus::before,
          .plusminus::after {
            content: "";
            position: absolute;
            width: 10px;
            height: 2px;
            background: currentColor;
            border-radius: 1px;
            transition: opacity 200ms ease, transform 250ms ease;
            transform-origin: center;
          }

          .plusminus::before {
            transform: rotate(0deg);
          }

          .plusminus::after {
            transform: rotate(90deg);
          }
        }

        .sub-menu {
          padding-left: 1rem;
          margin-top: 0.5rem;
          line-height: 1.4rem;
          overflow: hidden;
          max-height: 0;
          opacity: 0;
          transition: max-height 250ms ease, opacity 200ms ease;
        }

        &.open {
          .sub-menu {
            opacity: 1;
          }
          .submenu-toggle .plusminus::after {
            opacity: 0;
            transform: rotate(90deg) scaleX(0.5);
          }
        }
      }

      a {
        color: var(--color-light);
        text-decoration: none;
        display: block;
      }
    }
  }

  .menu-item-wrapper {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    column-gap: 0.75rem;
    width: 100%;
  }
}

.site-content {
  margin-left: 250px;
  padding: 2rem;
}

.menu-item.current-menu-item > .menu-item-wrapper > a {
  font-weight: bold;
}

/* Mobile Nav */

.sidebar-mobile-content {
  display: none;
}
.mobile-burger {
  display: none;
}

@media screen and (max-width: 1024px) {
  #sidebar {
    width: 100%;
    height: auto;
    border: none;
    top: 0;
  }

  .sidebar-menu {
    height: 100vh;
  }

  .sidebar-mobile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0.5rem 1rem;
    background: var(--color-primary);
  }

  .sidebar-navigation-menu {
    height: 100vh;
  }

  .site-logo-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
  }

  .mobile-burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 35px;
    height: 24px;
    background: none;
    border: none;
    cursor: pointer;
  }

  .mobile-burger__line {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--color-light);
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.3s ease;
  }

  .mobile-burger.open .mobile-burger__line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .mobile-burger.open .mobile-burger__line:nth-child(2) {
    opacity: 0;
  }
  .mobile-burger.open .mobile-burger__line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  .site-logo img {
    width: 150px;
    height: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sidebar-navigation-menu li.menu-item-has-children .sub-menu,
  .submenu-toggle .plusminus::before,
  .submenu-toggle .plusminus::after {
    transition: none;
  }
}
