:root {
  /* Background Colors: */
  --background-color: #354ab2;
  --header-background-color: #22896e;
  --content-background-color: #14665b;
  --sidebar-header-background-color: #53a1ad;
  --sidebar-background-color: #3b768f;
  --footer-background-color: #721c2f;
  --box-shadow-color: #12173d;

  /* Text Colors: */
  --text-color: #ffffff;
  --sidebar-text-color: #ffffff;
  --link-color: #50b9eb;
  --link-color-hover: #8cdaff;

  /* Text: */
  --font: "PixelMPlus12Reg";
  --header-font: "RomanceA";
  --header-font-two: "Yoster";
  --font-size: 18px;

  /* Other Settings: */
  --margin: 0 auto;
  --padding: 20px;
  --border: 2px solid #000000;
  --round-borders: 0px;
  --sidebar-width: 220px;
}

@font-face {
  font-family: "PixelMPlus12Reg";
  src: url("/fonts/PixelMplus10-Regular.woff") format("woff");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "PixelMPlus12Bold";
  src: url("/fonts/PixelMplus10-Bold.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* From https://www.asterism-m.com/font/ */
@font-face {
  font-family: "RomanceA";
  src: url("/fonts/RomanceA.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

/* From https://www.1001fonts.com/users/codeman38/ */
@font-face {
  font-family: "Yoster";
  src: url("/fonts/Yoster.woff") format("woff");
  font-weight: normal;
  font-style: normal;
}

html {
  background-color: var(--background-color);
  background-image: url("/images/WaterSunset.png");
  background-repeat:no-repeat;
  background-size: cover;
  cursor: url("/images/dinosire.png"), auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges; /* Firefox support */
  image-rendering: crisp-edges; /* Older browser support */
}

#container {
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--font-size);
  color: var(--text-color);
  padding: var(--padding);
  margin: var(--margin);
  max-width: 1000px;
}

#middle-container {
  display: flex;
  flex-direction: row;
  position: relative;
}

.moving-image {
  position: fixed;
  z-index: -10;
  animation: fly 50s linear infinite;
  top: 50vh;
}

@keyframes fly {
  0% {
    transform: translateX(-60vw) translateY(5vh);
  }
  15% {
    transform: translateX(-30vw) translateY(-5vh);
  }
  30% {
    transform: translateX(0vw) translateY(5vh);
  }
  45% {
    transform: translateX(30vw) translateY(-5vh);
  }
  60% {
    transform: translateX(60vw) translateY(5vh);
  }
  75% {
    transform: translateX(90vw) translateY(-5vh);
  }
  100% {
    transform: translateX(120vw) translateY(5vh);
  }
}

.flex-column {
  display: flex;
  flex-direction: column;
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.align-center {
  text-align: center;
}

a:link,
a:visited {
  color: var(--link-color);
}
a:hover,
a:active {
  color: var(--link-color-hover);
}

ul {
  list-style: url("images/Snail.gif") auto;
}

::selection {
  /* (Text highlighted by the user) */
  background: rgba(0, 0, 0, 0.2);
}

/* -------------------------------------------------------- */
/* HEADER */
/* -------------------------------------------------------- */

#header-container {
  height: fit-content !important;
  justify-content: center;
  margin: auto;
}

#header-container > img {
  object-fit: cover;
  margin-top: auto;
  margin-bottom: auto;
  height: 100px;
}

header {
  border: 20px solid transparent;
  border-radius: var(--round-borders);
  border-image: url("/images/medievalborder.png") 10 round;
  background: var(--header-background-color);
  box-shadow: 4px 4px var(--box-shadow-color);
}

h1 {
  text-align: center;
  font-size: 4em;
  font-family: var(--header-font);
  padding: 0px;
  margin: 10px;
}

h2 {
  font-family: var(--header-font-two);
}

/* -------------------------------------------------------- */
/* SIDEBARS */
/* -------------------------------------------------------- */

.sidebar {
  background: var(--sidebar-background-color);
  padding: var(--padding);
  color: var(--sidebar-text-color);
  width: var(--sidebar-width);
  margin-top: 10px;
  box-shadow: 4px 4px var(--box-shadow-color);
  border: 20px solid transparent;
  border-radius: var(--round-borders);
  border-image: url("/images/medievalborder.png") 10 round;
  max-height: 350px;
  flex-grow: 1;
  overflow: auto;
}
.sidebar > .sidebar-heading {
  border: 2px solid #000000;
  text-align: center;
  padding: 10px;
  margin: 0px;
  font-size: 1.5em;
  background-color: var(--sidebar-header-background-color);
  color: #ffffff;
  font-family: var(--header-font-two);
}

/* -------------------------------------------------------- */
/* CONTENT */
/* -------------------------------------------------------- */

.main-content {
  flex-grow: 1;
  max-height: 1050px;
  padding: var(--padding);
  background: var(--content-background-color);
  margin-top: 10px;
  margin-left: 10px;
  box-shadow: 4px 4px var(--box-shadow-color);
  border: 20px solid transparent;
  border-radius: var(--round-borders);
  border-image: url("/images/medievalborder.png") 10 round;
  overflow: auto;
}

#sleeping-knight {
  text-align: center;
  display: block;
  margin: 0 auto;
  padding-top: 30px;
  width: 100%;
}

.content-spacer {
  padding-top: 30px;
  text-align: center;
  width: 100%;
}
.content-spacer-double {
  padding-top: 30px;
  width: 50%;
}

#dragon-knight {
  height: 120px;
  position: absolute;
  top: -2em;
  left: 84%;
  transform: scaleX(-1);
}

/* -------------------------------------------------------- */
/* FOOTER */
/* -------------------------------------------------------- */

footer {
  display: flex;
  justify-content: center;
  border: 20px solid transparent;
  border-radius: var(--round-borders);
  border-image: url("/images/medievalborder.png") 10 round;
  padding: var(--padding);
  background: var(--footer-background-color);
  margin-top: 10px;
  overflow: hidden;
  font-size: 0.9em;
  box-shadow: 4px 4px var(--box-shadow-color);
}

/* -------------------------------------------------------- */
/* ACCESSIBILITY */
/* -------------------------------------------------------- */

#skip-to-content-link {
  position: fixed;
  top: 0;
  left: 0;
  display: inline-block;
  padding: 0.375rem 0.75rem;
  line-height: 1;
  font-size: 1.25rem;
  background-color: var(--content-background-color);
  color: var(--text-color);
  transform: translateY(-3rem);
  transition: transform 0.1s ease-in;
  z-index: 99999999999;
}

#skip-to-content-link:focus,
#skip-to-content-link:focus-within {
  transform: translateY(0);
}

/* Trying to get mobile working */
@media only screen and (max-width: 800px) {
  .flex {
      margin-top: 0px;
  }
}

@media only screen and (max-width: 800px) {
  .sidebar,
  body,
  #container {
      width: auto;
      padding: 10px;
  }

  #middle-container {
      flex-direction: column;
  }

  .main-content {
      margin-left: 0;
      margin-right: 0;
  }

  #dragon-knight {
    top: -2em;
    left: 64%;
  }

  #primary-nav ul {
      font-size: 1.1em;
  }
}

@media only screen and (max-width: 500px) {
  .grid-container-right,
  .grid-container-left {
      grid-template-columns: auto !important;
      width: 100% !important;
  }

  .grid-container-right {
      display: flex !important;
      flex-direction: column-reverse !important;
  }

  h1 {
    font-size: 2em;
    height: auto;
  }

  #header-container {
    height: fit-content !important;
    justify-content: center;
  }

  #header-container > img {
    height: 60px;
  }
  #dragon-knight {
    height: 80px;
    top: -1em;
    left: auto;
    right: -10px;
  }
}