@import url('https://fonts.googleapis.com/css2?family=Istok+Web:ital,wght@0,400;0,700;1,400;1,700&display=swap');

body {
  font-family: 'Istok Web', sans-serif;
  height: 100%;
  margin: 0;
}

.container {
  height: 100%;
  display: grid;
  grid-template-columns: 18% 1fr 18%;
  grid-template-rows: auto 1fr;
  margin: 0;
}

#navbar {
  background-color: white;
  grid-column-start: 2;
  grid-column-end: 3;
  grid-row-start: 1;
  grid-row-end: 2;
  padding-top: 1rem;
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  transition: top 0.3s; /* Transition effect when sliding down (and up) */
}

.navhome {
  grid-column-start: 1;
  grid-column-end: 2;
  font-weight: bold;
  padding: 0.5rem;
  margin: 0.25rem;
  font-size: 2em;
  justify-items: start;
}

.navhome a {
  color: #7F4FD8;
}

.navitems {
  grid-column-start: 2;
  grid-column-end: 3;
  justify-items: end;
}

.navitems a {
  color: #7F4FD8;
  align-items: center;
  padding: 0.5rem;
  font-size: 1.2rem;
}

.main {
  padding: 0 1rem 1rem;
  grid-column-start: 2;
  grid-column-end: 3;
  grid-row-start: 2;
  grid-row-end: 3;
  overflow: auto;
}

.intro {
  width: 50%;
  min-width: 50vw;
  margin-left: auto;
  margin-right: auto;
}

.content {
    width: 100%;
    min-width: 50vw;
}

p {
  font-weight: 400;
}

h1 {
  font-weight: 700;
}

h2 {
  font-weight: 700;
}

h3 {
  font-weight: 700;
}

h4 {
  font-weight: 700;
}

h5 {
  font-weight: 700;
  font-style: italic;
}

.mono {
  color: #7F4FD8;
  font-family: monospace;
}

.code {
  font-family: monospace;
  color: #7F4FD8;
  background-color: #FDFDFE;
  max-width: 100%;
  white-space: pre-wrap;
  padding: 0 1rem;
}

img {
  max-width: 100%;
  width: 100%;
  height: auto;
  image-orientation: from-image;
}

a {
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img.centre { 
    display: block; 
    margin-left: auto; 
    margin-right: auto;
}

.transitCont {
  margin-left: auto;
  margin-right: auto;
  height: auto;
  width: 100%;
  position: relative;
  display: grid;
}

.CSSimage,
.OGimage {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.CSSimage,
.OGimage {
    grid-area: 1/2;
}

.transitCont img {
    -webkit-transition: opacity 0.7s ease-in-out;
    -moz-transition: opacity 0.7s ease-in-out;
    -o-transition: opacity 0.7s ease-in-out;
    transition: opacity 0.7s ease;

}

.transitCont img.top:hover {
  opacity: 0;
}

@media screen and (max-width: 40em) {
  .container {
    grid-template-columns: 1rem 1fr 1rem;
  }
  
  #navbar {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    align-items: center;
  }
  
  .navhome {
    grid-row-start:1;
    grid-row-end:2;
    padding: 0 0.5rem;
    margin: 0 0.25rem;
    text-align: center;
  }
  
  .navhome a {
    font-size: 1.2rem;
  }
  
  .navitems {
    grid-column-start: 1;
    grid-column-end: 2;
    grid-row-start: 2;
    grid-row-end: 3;
    margin-bottom: 0.5rem;
    text-align: center;
  }
  
  .navitems a {
    font-size: 1rem;
  }
  
  h1 {
    margin-block-start: 0.3rem;
    margin-block-end: 0.6rem;
  }
  
}

@media (prefers-color-scheme: dark) {
  body {
    background-color: #1E1124;
    color: white;
  }
  
  a {
    color: #51A3A3;
  }
  
  #navbar {
    background-color: #1E1124;
    color: white;
  }
  
  .navitems a {
    color: white;
  }
  
  .navhome a {
    color: white;
  }
  
  .code {
    background-color: #566D2B;
    color: #E6C49F;
  }

}