/* Across website styling */
body {
  margin: 0;
  height: 100vh;
  display: flex; /* Main and footer will be positioned by flex */
  flex-direction: column; /* Main and footer will be positioned in a column */
  background-color: #eaeaf1;
  font-family: 'Lato', sans-serif;
}

main {
  width: 90%;
  margin: 0 auto;
  flex-grow: 1; /* The main container will grow to fill the left over space, keeping the footer sticking to the bottom of the window */
}

h1 {
  color: #2c318e;
  font-family: 'Kaushan Script', cursive;
  font-size: 2.5em;
  letter-spacing: 0.05em;
  word-spacing: 0.4em;
  line-height: 1.2em;
  font-weight: 400;
}

h2 {
  color: #c43329;
}

h1, h2 {
  text-align: center;
}

.image-container {
  width: 80%;
  margin: 0 auto;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.image {
  width: 100%;
  max-height: 100%;
}

.text-container {
  margin-top: 2rem;
  margin-bottom: 2rem;
}

/* Navigation specific styling */
nav {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  box-sizing: border-box;
}

.anchor-button {
  text-align: center;
  box-sizing: border-box;
  border-width: 2px;
  border-style: outset;
}

button, .anchor-button {
  padding: 6px 8px;
  border-radius: 4px;
  border-color: #3f3636;
  background-color: #c43329;
  margin: 15px 8px;
  font-size: larger;
  text-decoration: none;
  color: #ffffff;
  cursor: pointer;
}

button:hover, .anchor-button:hover {
  background-color: #ffffff;
  color: #c43329;
}

/* Footer specific styling */
footer {
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem;
  line-height: 2rem;
  background-color: #adb9db;
  box-sizing: border-box;
}

#creator > p {
  display: inline;
}

#wild-isles {
  float: right;
  margin-left: 2rem;
}

#wild-isles > p {
  display: inline;
}

footer a {
  display: inline-block;
  padding-left: 1rem;
  font-size: 1.5rem;
  color: #1118a6;
}

footer a:hover {
  color: #c43329;
}

#wild-isles > a {
  padding-left: 0.5rem;
  padding-right: 1rem;
}

.extra-info {
  display: none;
}

/* Styling specific to index.html */
#key-word-paragraph {
  display: flex;
  justify-content: space-between;
  font-size: 1.1em;
  color: #c43329;
}

#landing-page-images {
  width: 100%;
  aspect-ratio: 3/2;
  margin-top: 0rem;
  margin-bottom: 0rem;
  position: relative;
}

.landing-image {
  width: 40%;
  border: 1px solid black;
  padding: 2px;
  background-color: white;
  box-shadow: 10px 10px 15px grey;
  position: absolute;
}

#puffin-landing-image {
  z-index: 1;
  top: 5%;
  left: 10%;
  transform: rotate(13deg);
}

#bee-landing-image {
  z-index: 2;
  top: 15%;
  right: 10%;
  transform: rotate(335deg);
}

#landing-page-nav {
  width: 80%;
  margin: 0 auto;
}

/* Styling specefic to the puzzle */
#puzzle-grid-container {
  /* Size of the container will change relative to the size of the window while maintaining its aspect ratio */
  width: 80%;
  aspect-ratio: 1/1;
  /* Centre align grid and maintain even white space around it */
  margin: 10%;
  /* CSS grid styling */
  display: grid;
  grid-template-columns: [left] 1fr [middle] 1fr [right] 1fr; /* Value of 1fr causes the space to be evenly distributed */
  grid-template-rows: [top] 1fr [center] 1fr [bottom] 1fr;
  box-shadow: 10px 10px 15px grey;
}

.grid-box {
  border: 1px solid black;
  background-size: cover;
  /* Animation settings that will activate once the clicked tile is given an animation name*/
  position: relative;
  animation-duration: 0.5s;
  animation-timing-function: ease-in-out;
  animation-iteration-count: 1;
  animation-direction: normal;
  animation-play-state: running;
}

/* Animations for tile slides activated in JavaScript 
functions: tileSlideDown, tileSlideUp, tileSlideLeft tileSlideRight */
@keyframes down-slide {
  from {
    top: 0;
  }
  to {
    top: 100%;
  }
}

@keyframes up-slide {
  from {
    bottom: 0;
  }
  to {
    bottom: 100%;
  }
}

@keyframes left-slide {
  from {
    right: 0;
  }
  to {
    right: 100%;
  }
}

@keyframes right-slide {
  from {
    left: 0;
  }
  to {
    left: 100%;
  }
}

/* Styling for the three modal pop-ups. The following was created following the steps given in 
    'How To - CSS/JS Modal' by W3 Schools https://www.w3schools.com/howto/howto_css_modals.asp */
.modal {
  display: none; /* The modals will not be displayed until activated by JavaScript */
  position: fixed;
  z-index: 3;
  width: 80%;
  max-height: 80%;
  right: 10%;
  top: 12%;
  background-color: #e2e8ff;
  border: 4px solid black;
  overflow: scroll;
}

.modal-content {
  margin: 5% auto;
  width: 90%;
}

.modal-content > h2 {
  color: #2c318e;
}

h3 {
  color: #c8281d;
}

.close {
  float: right;
  width: 40px;
  height: 40px;
  font-size: 30px;
  font-weight: bold;
  text-align: center;
}

.close:hover, .close:focus {
  color:black;
  text-decoration: none;
  cursor: pointer;
}

/* Sneaky Peek modal */
#sneaky-peek-pic {
  width: 100%;
  border: 1px solid black;
}

/* Instructions modal */
ol {
  list-style-type: circle;
  padding-inline-start: 1rem;
}

li {
  margin-bottom: 1rem;
}

#help-section {
  margin-top: 1.5rem;
}

ul {
  list-style-type: square;
  padding-inline-start: 1rem;
}

/* Tips modal */
.tips-image {
  display: block;
  width: 60%;
  margin: 0 auto;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

/* Styling specific to the win page */
#original-picture {
  box-shadow: 10px 10px 15px grey;
  border: 1.8px solid black;
  border-radius: 2px;
  width: 230px;
  height: 230px;
}

#container-subject-information {
  width: 90%;
  margin: 0 auto;
}

#container-subject-information p {
  margin-bottom: 1.8rem;
}

/* Responsive styling for screens larger than width 500px */
@media screen and (min-width:500px) {
  footer {
    padding-left: 4rem;
    padding-right: 4rem;
  }
  #key-word-paragraph {
    font-size: 1.5em;
    width: 90%;
    margin: 0 auto;
  }
  #original-picture {
    width: 350px;
    height: 350px;
  }
}

/* Responsive styling for screens larger than width 580px */
@media screen and (min-width:580px) {
  /* Add back in the extra footer text */
  .extra-info {
    display: inline;
  }
  footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    padding: 0.5rem;
  }

  #landing-page-images {
    width: 80%;
  }

  #puzzle-grid-container {
    width: 60%;
    margin-right: 20%;
    margin-left: 20%;
    margin-bottom: 4rem;
  }
  
  .modal {
    width: 350px;
  }
}

/* Responsive styling for screens larger than width 700px */
@media screen and (min-width:700px) {
  body {
    font-size: 20px;
  }
  h1 {
    margin-bottom: 4rem;
  }
  nav {
    margin-bottom: 2rem;
  }
  .text-container p {
    margin-top: 2rem;
  }

  /* Landing page */
  #landing-page-images {
    margin-top: 4rem;
  }
  #landing-page-nav {
    width: 60%;
    margin-bottom: 2rem;  
  }
  
  /* Win page */
  #information {
    font-size: 18px;
  }
  #original-picture {
    width: 450px;
    height: 450px;
  }

  /* Modals */
  .modal {
    width: 450px;
    right: 5%;
  }
}

/* Responsive styling for screens larger than width 1000px */
@media screen and (min-width:1000px) {
  h1 {
    margin-bottom: 2rem;
  }
  main {
    width: 80%;
  }

  /* Landing page */
  .text-container p {
    display: inline;
  }
  #key-word-paragraph {
    margin-bottom: 1rem;
  }
  #landing-page-images {
    margin-top: 1rem;
    aspect-ratio: 9/5;
    width: 100%;
  }
  #landing-page-nav {
    margin-bottom: 0;
    flex-direction: column;
    align-content: space-around;
  }
  #image-plus-nav {
    display: flex;
    justify-content: space-between;
  }

  /* Puzzle page */
  #puzzle-plus-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 4rem;
  }
  #puzzle-grid-container {
    margin: 0 5rem 0 5rem;
    width: 410px;
  }
  #puzzle-page-nav {
    flex-direction: column;
    align-content: space-around;
    height: 410px;
    margin: 0 auto;
  }

  /* Modals */
  .modal {
    top: 5%;
  }
  
  /* Win page */
  #original-picture {
    float: left;
  }
  #container-subject-information {
    width: 45%;
    float: right;
    margin-bottom: 0;
  }
  #container-subject-information p {
    display: inline-block;
    margin-bottom: 0;
  }
  #win-nav {
    float: left;
    flex-direction: column;
    width: 450px;
    align-content: space-around;
  }
  #win-nav a {
    margin: 30px 8px;
  }
  #win-main {
    width: 90%;
  }
}

/* Responsive styling for screens larger than width 1300px */
@media screen and (min-width:1300px) {
  button, .anchor-button {
    font-size: 30px;
    padding: 12px 15px;
  }
  
  /* landing page */
  .text-container p {
    display: block;
    text-align: center;
    font-size: 26px;
  }
  
  /* Puzzle page */
  #puzzle-grid-container {
    width: 600px;
  }
  #puzzle-page-nav {
    margin-top: 6rem;
  }

  /* Win page */
  #win-main {
    width: 80%;
  }

  /* Modals */
  .modal {
    font-size: 26px;
  }
}