@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&family=Open+Sans:ital,wght@0,300..800;1,300..800&display=swap');

:root {
  --line-color: #696969;
  --hover-color: #75e688;
  --background-color: #1a1a1a;
  --accent-color: #647b17;
  --text-color: #dcdcdc;
  --panel-color: rgba(0, 0, 0, 0.718);
  --active-color: rgba(205, 204, 204, 0.718);
  --font-family: 'Open Sans', sans-serif;
  
}
* {
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  line-height: 1.5rem;
}
body {
  min-height: 100vh;
  width: 100%;
  background-color: var(--background-color);
  color: var(--text-color); 
  display: grid;
  grid-template-columns: auto 1fr;
}

#toggle-btn{
  rotate: 180deg;}

#sidebar{
 height: 100vh;
  width: 50px;
  padding: 0;
  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
   background-color: var(--panel-color);

}

#sidebar-trigger {
  display: none;
}

#sidebar.open{
  box-sizing: border-box;
  height: 100vh;
  width: 250px;
  padding: 0;
  background-color: var(--panel-color);

  position: sticky;
  top: 0;
  align-self: start;
  transition: 300ms ease-in-out;
  overflow: hidden;
  text-wrap: nowrap;
}


@media (min-width: 801px) {
  body {
    grid-template-columns: 1fr;
  }

  #sidebar-trigger {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    width: 12px;
    height: 100vh;
  }

  #sidebar,
  #sidebar.open {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1001;
    transition: width 300ms ease-in-out, opacity 300ms ease-in-out, transform 300ms ease-in-out;
  }

  #sidebar.auto-hide {
    transform: translateX(-100%);
    opacity: 0;
    pointer-events: none;
  }

  #sidebar-trigger:hover + #sidebar.auto-hide,
  #sidebar.auto-hide:hover,
  #sidebar.auto-hide:focus-within {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
}


#sidebar ul {
  list-style: none;
}

#sidebar ul li.active a {
  color: var(--accent-color);
}

#sidebar ul li.active svg {
  fill: var(--accent-color);
}


#sidebar > .navbar > ul > li:first-child {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 16px;
}
#sidebar .logo {
  font-weight: 600;
  font-size: 1.25em;
}
#sidebar .sub-menu li.active > a {
  color: var(--accent-color);
}
#sidebar a, #sidebar .dropdown-btn, #sidebar .logo{
  border-radius: .5em;
  padding: .85em;
  text-decoration: none;
  color: var(--text-color);
  display: flex;
  align-items: center;
  gap: 1em;
}
#sidebar a:hover, #sidebar .dropdown-btn:hover {
  background-color: var(--accent-color);
  fill: var(--background-color);
}
.dropdown-btn {
width: 100%;
text-align: left;
background: none;
border: none;
font: inherit;
cursor: pointer;
}

#sidebar svg {
  flex-shrink: 0;
  fill  : var(--text-color);

}
#sidebar a span, #sidebar .dropdown-btn span {
  flex-grow: 1;
}



#sidebar .sub-menu {
  display: grid;
  transition: all .3s ease-in-out;
  grid-template-rows: 0fr;

  > div {
  overflow: hidden;
}
}

 

#sidebar .sub-menu.show {
  grid-template-rows: 1fr;

}

.dropdown-btn.rotate svg{
  transition: 200ms ease;
}
.rotate svg:last-child {
  rotate: 180deg; 
   
} 

/* Aerygrim active state when submenu open */
#sidebar > .navbar > ul > li.aerygrim-menu.active > .dropdown-btn,
#sidebar > .navbar > ul > li.aerygrim-menu.active > .dropdown-btn span {
  color: var(--accent-color);
}
#sidebar > .navbar > ul > li.aerygrim-menu.active > .dropdown-btn svg {
  fill: var(--accent-color);
}
#sidebar > .navbar > ul > li.aerygrim-menu > .dropdown-btn.rotate,
#sidebar > .navbar > ul > li.aerygrim-menu > .dropdown-btn.rotate span.aerygrim {
  color: var(--accent-color);
}
#sidebar > .navbar > ul > li.aerygrim-menu > .dropdown-btn.rotate svg {
  fill: var(--accent-color);
}


#sidebar .sub-menu a{
  padding-left: 2em;
}

#toggle-btn{
  margin-left: auto;
  padding: 1em;
  border: none;
  border-radius: .5em;
  background: none;
  cursor: pointer;

  svg {
    transition: rotate 150ms ease;
  }
}
#toggle-btn:hover svg {
  fill: var(--accent-color);
}

/* this where the contents starts */

main {
    display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
  background-image:  linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.763)), url("/images/whimsical\ journey\ of\ the\ spacemage.jpg");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

}

.hero {
  display: flex;
  height: 100vh;
  width: 100%;
  margin: 0;
  box-sizing: border-box;
  
  align-items: center;
  justify-content: start;
  gap: 2em;
  overflow: hidden;
  overflow-y: scroll;
  overflow-x: auto;
  scrollbar-width: none;
}


.hero{
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    flex-direction: column;
    justify-items: center;
    align-items: center;
}
.header{
  box-sizing: border-box;
    padding: 6em;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-items: center;
    align-items: center;
}

.divider{
    display: block;
    background-color: var(--line-color);
    height: 5px;
    width: 100%;
}

.ribbon {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  height: 50px;}


.nav {
   position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
   justify-self: center;
  gap: 2em;
  height: 50px;
}

.nav .next-chapter {
  display: block;
    color: var(--accent-color);

  
}

.next-chapter img {
  display: block;
  width: 24px;
  height: 24px;

}
.gap-size{
  display: flex;
  margin-left: auto;
  gap: 1em;
  display: flex;
  position: relative;
  align-content: center;
  list-style: none;
}
.add {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.minus {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;}

/* this is where the contents starts */

.content {
  display: flex;
  flex-direction: column;
  width: 800px;
  height: auto;
  flex-shrink: 0;
  justify-content: center;
  align-items: center;
 }

.content ul {
  display: flex;
  flex-direction: column;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.content ul li {
  list-style: none;
  text-align: center;
  
}

.content img {
  display: block;
  height: 900px;
  width: auto;
  margin: 0 auto;
}

/*mobile format*/

@media (max-width: 800px) {
  body {
    grid-template-columns: 1fr;
    overflow-x: hidden;
  }

  .hero, .knight {
    text-wrap: auto;
    border: none;
    padding: 0;
  }

  #sidebar{
    height: 60px;
    width: 100%;
    border-right: none;
    border-top: 1px solid var(--line-color);
    padding: 0;
    position: fixed;
    top: unset;
    bottom: 0;
    z-index: 1001;
    transition: transform 300ms ease-in-out;

    .navbar { 
      
    ul li span, ul li:first-child, .dropdown-btn svg:last-child {
    display: none;}
    
   
    > ul{
      padding: 0;
      display: grid;
      grid-auto-columns: 60px;
      grid-auto-flow: column;
      align-items: center;
      overflow-x: scroll;
      justify-content: center;
    }

    ul li {
      height: 100%;}
      
    
    ul a, ul .dropdown-btn {
      width: 60px;
      height: 60px;
      padding: 0;
      border-radius: 0;
      justify-content: center;
    }
    ul li .sub-menu.show {
      position: fixed;
      bottom: 60px;
      left: 0;
      box-sizing: border-box;
      height: 60px;
      width: 100%;
      background-color: var(--panel-color);
      border-top: 1px solid var(--accent-color);
      display: flex;
      justify-content: center;

      >div {overflow-x: auto}

      li{
        display: inline-flex;
      }
      a{box-sizing: border-box;
      padding: 1em;
    width: auto;
  justify-content: center;}

    }
  }
  }

  #sidebar.open {
    box-sizing: border-box;
    position: fixed;
    top: auto;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
  }

  #sidebar.mobile-hidden {
  transform: translateY(100%);
  }


  /* content starts here */
.hero {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100vw;
}
.header{
  display: flex;
  justify-content: center;
  align-items: center;
  justify-items: center;
  align-content: center;
}
.ribbon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: auto;
  gap: 1em;
}

.ribbon .nav {
  position: static;
  left: auto;
  transform: none;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.ribbon .gap-size {
  margin: 0;
  justify-content: center;
  padding: 0;
}


.pad-size {
display: none;
}



  .content {
    box-sizing: border-box;
    width: 100vw;
    min-width: 0;
    flex-shrink: 1;
  }

  .content ul,
  .content ul li {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 0;
  }

 .content img {
    display: block;
    width: 100%;
    max-width: 100vw;
    height: auto;
    margin: 0;
  }
}