html {
  max-width: 100%;
  margin: auto;
}
h1 {
  margin: auto;
  text-align: center;
}

body {
  background-image: url(../pics/kartta.png);
  background-repeat: repeat;
  background-size: auto;
  background-color: #ede2d0;
  max-width: 100%;
  margin: 0;
}

a {
  font-family: 'Poppins', sans-serif;
  text-decoration: none;
}
/* Navbar styles moved to `navbar.css` (nav, .brand, .nav-list, .nav-item, .hamburger, etc.). */
#info {
  margin: auto;
  text-align: center;
}


#kuva {
  display: block;
  margin-left: auto;
  margin-right: auto;
  width: 40%;
}

.logo {
  display: block;
  margin-left: auto;
  margin-right: auto;
  max-width: 20%;
}
#tilaanappula {
  text-align: center; /* nappula keskelle */
  margin-top: 50px;
}

#tilaanappula button {
  background: #ffffff;
  color: #0984e3;
  padding: 15px 30px;
  font-size: 18px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
}

#tilaanappula button:hover {
  background: #0984e3;
  color: #ffffff;
  transform: translateY(-3px);
  box-shadow: 0 6px 14px rgba(0,0,0,0.3);
}

#alkudiv {
  width: 75%;
  margin-top: 3vw;
  font-family: 'MedievalSharp', cursive;
  font-size: 20px;
  min-height: 400px;;
  margin: auto;
}

.linkki {
  color: black;
  text-decoration: underline;
}
.pagination {
  text-align: center;
  margin: 20px 0;
}

.pagination button {
  padding: 8px 15px;
  margin: 0 10px;
  cursor: pointer;
  border: none;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.93);
  color: white;
  font-size: 16px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#tarinat-container {
  display: grid;
  grid-template-columns: repeat(3, 250px);
  justify-content: center;
  gap: 20px;

  width: 100%;
  margin-bottom: 30px;
}


.kirjakuvat {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: 250px;
  box-sizing: border-box;

  background-color: #fff9;
  border-radius: 10px;
}
.kirjakuvat > a {
  display: block;
  width: 100%;
  color: black;
}

.kirjakuvat img {
  display: block;
  width: 75%;
  height: auto;
  margin: 0 auto;
}

.kirjan-nimi {
  color: black;
  text-align: center;
}


.wrapper{
  overflow: auto;
  margin: auto;
  width: 52%;
}


#posti {
  font-family: 'MedievalSharp', cursive;
  color: black;
}

.linkit {
  font-size: 17px;
  margin-top: auto;
}


#socialmedia {
  display: inline;
  width: 3vw;
  margin-left: 0.5vw;
}


h2 {
  
  color: black;
  font-size: 29px;
  position: relative;
  text-align: center;
  top: 1vw;
  left: 0vw;
  font-family: 'MedievalSharp', cursive;
}
h3 {
  color: black;
  text-align: center;
  font-family: 'MedievalSharp', cursive;
}

#alaotsikko {
  text-align: center;
  font-family: 'MedievalSharp', cursive;
}

#ekakuva {
  float: left;
  left: 15vw;
  margin-right: 3vw;
  border: 1px solid;
}
p {
  font-size: 19px;
  color: rgb(0, 0, 0);
  width: 75%;
  margin: auto;
  margin-bottom: 2vw;
  margin-top: 2vw;
  text-align: center;
  left: 0vw;
  top: 2vw;

}

.selostus {
  background-color: #ffffff99;
  border-radius: 10px;
  padding: 2vw;
}

#luettelo {
  font-size: 19px;
  color: rgb(0, 0, 0);
  width: 100%;
  margin: auto;
  margin-bottom: 3vw;
  margin-top: 3vw;
  text-align: center;
  left: 0vw;
  top: 2vw;
  font-family: 'Poppins', sans-serif;
}

.tilaajalomake {
  background-color: #ffffff99;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  max-width: 500px;
  font-family: Arial, sans-serif;
  margin: auto;
}

.tilaajalomake h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
  color: #333;
  text-align: center;
}

.tilaajalomake label {
  display: block;
  margin-bottom: 1rem;
  font-weight: bold;
}

.tilaajalomake input,
.tilaajalomake textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  margin-top: 0.5rem;
  box-sizing: border-box;
}

.tilaajalomake textarea {
  resize: vertical;
  min-height: 100px;
}

.tilaajalomake button {
  background-color: #007bff;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  transition: background-color 0.2s ease;
  margin-top: 1rem;
  display: block;
  width: 100%;
}

.tilaajalomake button:hover {
  background-color: #0056b3;
}

@media (max-width: 2000px) {
  #moromoro {

    bottom: 13vw;
  }
}

@media (max-width: 1500px) {
  #moromoro {

    bottom: 15vw;
  }
  .wrapper {
    width: 65%;
  }
  #hkuva1, #esittely1 {
    min-height: 48vw;
  }
  #hkuva2, #esittely2 {
    min-height: 43vw;
  }
}

@media (max-width: 1200px) {
  #moromoro {

    bottom: 20vw;
  }

}

@media (max-width: 900px) {
  h2 {
    font-size: 23px;
  }
  p {
    font-size: 17px;
  }
  p > #ekakuva {
    width: 50%;
  }
  #alkudiv {
    font-size: 17px;
    width: 95%;
  }
}



/* Mobiili ja animaatiot alle 775px */
@media (max-width: 775px) {
  /* Yleiset mobiiliasetukset */
  #moromoro { max-width: 100%; background-size: 70%; bottom: 20vw }
  h2 { font-size: 23px; }
  p { font-size: 16px; width: 90%; }
  #socialmedia { display: inline; width: 10vw; margin-left: 3vw; }
  .logo { max-width: 50%; }
  footer {
    position: relative;
    width: 100%;
    font-size: 19px;
    color: white;
    border: none;
    background-color: rgba(0, 0, 0, 0.35);
    padding: 1px;
    font-family: 'Poppins', sans-serif;
  }

  .wrapper{
    overflow:auto;
    margin: auto;
    width: 86%;
  }
  #esittely1 {
    width: 50%;
    min-height: 63vw;
    background-color: #ece1cfd6;
    border-radius: 12px;
    float: right;
  }
  #hkuva1 {
    background-image: linear-gradient(to right, rgba(255, 153, 153, 0) 0%,rgba(255, 153, 153, 0) 94%,rgb(237, 226, 208) 100%), url(./pics/hkuva1.jpg);
    background-size: 100%;
    min-height: 63vw;
    background-repeat: no-repeat;
    background-color: #ece1cfd6;
    border-radius: 12px;
    width: 50%;
    float: left;
  }

  #esittely2 {
    width: 50%;
    min-height: 56vw;
    background-color: #ece1cfd6;
    border-radius: 12px;
    float: left;
  }
  #hkuva2 {
    background-image: linear-gradient(to left, rgba(255, 153, 153, 0) 0%,rgba(255, 153, 153, 0) 94%,rgb(237, 226, 208) 100%), url(./pics/hkuva2.JPG);
    background-size: 100%;
    min-height: 56vw;
    background-repeat: no-repeat;
    background-color: #ece1cfd6;
    border-radius: 12px;
    width: 50%;
    float: right;
  }
  #tarinat-container {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    margin-bottom: 30px;
  }


  .kirjakuvat {
    width: 100%;
    min-width: 0;
    max-width: none;

    background-color: #eee5d7a3;
    border-radius: 12px;

    box-sizing: border-box;
    overflow: hidden;
  }


  .kirjakuvat > a {
    display: flex;
    flex-direction: column;
    align-items: center;

    width: 100%;
    min-width: 0;
    min-height: 210px;

    padding: 10px 4px 12px;
    box-sizing: border-box;

    color: black;
  }

  .kirjakuvat img {
    display: block;
    width: auto;
    height: 95px;
    max-width: 75px;

    margin: 0 auto;

    object-fit: contain;
    flex-shrink: 0;
  }
  .kirjan-nimi {
    width: 100%;
    margin: 12px 0 0;
    padding: 0 2px;

    box-sizing: border-box;

    font-size: 14px;
    line-height: 1.35;
    text-align: center;

    color: black;
    word-break: normal;
    overflow-wrap: normal;
  }


  .linkit {
    width: 100%;
    margin-top: auto;
    font-size: 12px;
  }
  footer {
    clear: both;
    margin-top: 25px;
  }


  /* Pienemmät näytöt */
  @media (max-width: 600px) {
    #moromoro {
      background-position: center top;
    } 
    .nav-list {
      top: 15vw;
    }
  }

  @media (max-width: 500px) {
    #posti {
      font-size: 12px;
    }
    #esittely1 > p, #esittely2 > p {
      font-size: 15px;
    }  
  }  
  @media (max-width: 450px) { 
    .nav-list {
      top: 20vw;
    } 
   }
  @media (max-width: 390px) { 
    .nav-item a { padding: 1vw 2vw; }
    .wrapper { width: 97%;}
    #hkuva1, #esittely1 {min-height: 70vw}
  }
}