html, body {
  margin: 0;
  height: 100vh;
}

body {
  overflow: hidden;
}

main {
  height: 93vh;
  background : linear-gradient(#2441B4, #31128B) fixed;
  background: #99B9D0;
  background-repeat: repeat-x;
  display: grid;
  grid-template-columns: 20vw 60vw 20vw;
}

li a {
  font-family: sans-serif;
}

a:hover {
  text-decoration: underline !important;
}

.title {
  font-family: 'Righteous', cursive;
  font-size: 3.5vh;
  color: black;
}

ul ul {
  padding-left: 2.5vh !important;
}

/*
  Needed to resize searchbar correctly
*/

.search {
  width: 80%;
  margin: 0 auto;
}

/*
  Courses
*/

.courses {
  margin: 0;
  margin-left: 3vh;
  height: 100%;
  margin-top: 30%;
  grid-column: 1;
  display: inline-block;
  font-size: 1.7vh;
}

.courses .unavailable {
  text-decoration: line-through !important;
}

.dropdown {
  display: inline-block;
  width: 1.5vh;
  height: 1.5vh;
  background-image: url(/imgs/dropdown.png);
  background-repeat: no-repeat;
  background-size: contain;
  position: relative;
  top: 0.2vh;
  left: 0.3vw;
}

.coursesListContainer {
  margin-left: 1vh;
}

.coursesList {
  padding: 0;
  width: 18vw;
  height: auto;
  max-height: 72vh;
  width: 18.5vw;
  overflow: auto;
}

.coursesListWrapper {
  height: auto;
  overflow-x: visible;
}

.coursesList > li > ul li > ul {
  transition: max-height 2s 1s;
  max-height: 0;
  overflow: hidden;
}

.coursesList > li > ul li:hover > ul {
  transition: max-height 1s;
  max-height: 30vh;
}

.coursesList li ul li:before {
  display: inline-block;
  width: 1.5vh;
  height: 1.5vh;
  content: '';
  background-image: url(/imgs/dropdown.png);
  transform: rotate(-90deg);
  background-repeat: no-repeat;
  background-size: contain;
  padding-left: 1%;
}

.coursesList > li > ul > li::before {
  display: none;
}

.coursesList li:first-child {
  padding-top: 0;
}

.coursesList ul {
  padding-left: 6%;
}

.courses ul {
  margin: 0;
  list-style: none;
}

.courses li {
  white-space: nowrap;
  margin-top: 1%;
}

.courses > ul > li {
  padding-top: 3%;
}

.courses a {
  color: black;
  text-decoration: none;
}

/*
  Middle Part
*/

.middle {
  grid-column: 2;
  display: block;
  padding: 0 2vh;
}

/*
  Domainname
*/

.domainname {
  display: flex;
  height: 50vh;
  width: 100%;
  color: black;
  font-family: 'Press Start 2P', cursive;
  text-align: center;
  justify-content: center;
  align-content: center;
  flex-direction: column;
  font-size: 6vw;
}

.domainname span {
  text-shadow: 0 0 8vh white;
  box-sizing: border-box;
  background-image: url(/imgs/circuit.png);
  padding: 4%;
  border-radius: 5vh;
  background-size: 10%;
}

/*
  Most Popular courses
*/

.right {
  grid-column: 3;
  margin: 0;
  padding: 0;
  height: 50vh;
  margin-top: 30%;
  margin-right: 1vh;
  margin-left: 4vh;
}

.mostPopular, .newestCourses {
  overflow: auto;
  height: auto;
  max-height: 50%;
  width: 100%;
  padding: 0;
  margin: 0;
  color: black;
  display: block;
  padding-bottom: 1%;
}

.newestCourses {
  box-sizing: border-box;
  border-top: 1vh solid transparent;
}

.mostPopular .title, .newestCourses .title {
  display: block;
}

.mostPopular ul, .newestCourses ul {
  display: block;
  list-style: none;
  padding: 0;
  margin: 0;
  margin-left: 1vh;
}

.mostPopular li, .newestCourses li {
  display: block;
  height: 2vh;
  margin-top: 1vh;
}

.mostPopular a, .newestCourses a {
  white-space: nowrap;
  display: block;
  color: black;
  text-decoration: none;
  font-size: 1.7vh;
}

footer {
  box-sizing: border-box;
  font-size: 1.5vh;
}

/*
  Media Queries
*/

/*
  Portrait-mode
*/

@media only screen and (max-aspect-ratio : 13 / 9) {

  main {
    height: 100vh;
    grid-gap: 0;
    grid-template: 48vh 48vh / 50vw 50vw;
  }

  .coursesList {
    width: auto;
    max-height: 40vh;
    overflow: auto;
  }

  .coursesListContainer li, .coursesListContainer ul {
    display: block;
    width: 100%;
  }

  .coursesListContainer a {
    display: inline-block;
    width: 100%;
  }

  .coursesList > li > ul li > ul {
    max-height: 100vh;
  }

  .coursesList > li > ul li:hover > ul {
    transition: none;
    max-height: inherit;
  }

  .dropdown {
    display: none;
  }

  .middle {
    padding: 0;
    grid-column: 1 / 3;
    grid-row: 1 / 2;
  }

  .domainname {
    width: 100vw;
    height: 35vh;
    font-size: 2em;
  }

  #searchBar {
    height: 3vh;
    padding-left: 2vw !important;
    font-size: 0.8em !important;
  }

  .domainname span {
    margin: 0 auto;
    width: 95vw;
  }

  .courses {
    width: auto;
    margin: 0 5vw;
    margin-right: 0;
    grid-column: 1 / 2;
    grid-row: 2 / 3;
  }

  .coursesListContainer {
    height: 90%;
    overflow: auto;
    margin-left: 3vw;
  }

  .right {
    height: 100%;
    width: 40vw;
    margin: 0 auto;
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding-left: 2vw;
  }

  .right, .courses {
    box-sizing: border-box;
  }

  .newestCourses li:nth-child(5) {
    display: none;
  }

}
