body {
  display: flex;
  height: 100vh;
  flex-direction: column;
}

aside {
  flex: 0 0 4rem;
  display: grid;
  grid-template-areas: "head menubtn";
  grid-template-columns: auto 3rem;
}

main {
  flex: 1;
  padding: 2rem 0;
  overflow: auto;
}

.menu-head-wrapper {
  grid-area: head;
}

#filter,
#group-add,
aside {
  transition: all 0.2s;
}

#menubtn {
  grid-area: menubtn;
  height: 38px;
}

aside > ul {
  grid-area: handouts;
  overflow: auto;
  gap: 0.5rem;
  max-height: 100%;
  flex-wrap: nowrap !important;
}

#title {
  grid-area: title;
}

#group {
  grid-area: group;
}

#groupselect {
  grid-area: groupselect;
}

aside > hr {
  grid-area: hr;
}

.menu-head-wrapper {
  position: relative;
}

#group-add {
  width: 100%;
}

#filter-wrapper::after {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.5rem;
  padding-right: 0.25rem;
  padding-left: 0.25rem;
  font-size: 0.75rem;
  color: #6c757d;
  content: "Ctrl + k";
  border: 1px solid #dee2e6;
  border-radius: 0.125rem;
}

@media only screen and (max-width: 768px) {
  aside {
    grid-gap: 1rem;
    overflow: hidden;
  }

  aside > hr {
    display: none;
  }

  aside #title,
  aside #group,
  aside #groupselect {
    align-self: center;
    min-width: 0;
    overflow: visible;
  }

  aside #group {
    text-align: center;
  }

  aside:not(.open) #title,
  aside:not(.open) #group,
  aside:not(.open) #groupselect,
  aside:not(.open) > ul {
    display: none;
  }

  aside .menu-head-wrapper > * {
    float: right;
    max-width: 15rem !important;
  }

  aside.open {
    flex-basis: 90vh;
    grid-template-areas:
      "head head head menubtn"
      "handouts handouts handouts handouts"
      "title group groupselect groupselect";
    grid-template-columns: auto auto 4rem 3rem;
    grid-template-rows: auto 1fr 3rem;
  }

  aside.open #filter-wrapper::after {
    content: "Ctrl + k / Esc";
  }

  aside.open #filter-wrapper:focus-within::after {
    content: "Esc";
  }

  aside.open .menu-head-wrapper > * {
    max-width: 100% !important;
  }

  aside.open > #groupselect {
    width: 100%;
  }

  #filter:not(:focus) {
    background-color: rgb(180, 180, 180);
    border-color: rgb(30, 30, 30);
  }

  #filter-wrapper::after {
    color: #6c757d;
    border: 1px solid #6c757d;
  }
}

@media only screen and (min-width: 768px) {
  body {
    flex-direction: row;
  }

  #filter-wrapper:focus-within::after {
    content: "Esc";
  }

  aside {
    flex-basis: 300px;
    grid-template-areas:
      "title"
      "group"
      "groupselect"
      "hr"
      "head"
      "handouts";
    grid-template-columns: auto;
    grid-template-rows: repeat(5, min-content) auto;
  }

  aside > a,
  aside > span {
    text-align: center;
  }

  aside > #groupselect {
    width: 50%;
  }

  aside > #menubtn {
    display: none;
  }

  main > .container {
    max-width: 55rem;
  }
}

img {
  max-width: 100%;
  display: block;
  padding: 0.5rem 0rem;
  margin: 0 auto;
}

@media print {
  body {
    display: unset;
  }

  aside {
    display: none;
  }

  main > .container {
    padding: unset;
    max-width: unset;
  }
}


/* custom scrollbar */
::-webkit-scrollbar {
  width: 20px;
}

::-webkit-scrollbar-track {
  background-color: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: #d6dee180;
  border-radius: 20px;
  border: 6px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background-color: #a8bbbf;
}
