@import url("https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Permanent+Marker&display=swap");

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  color: #fff;
}

/* Kun mobiilivalikko on avattu */
body.overflow-hidden {
  overflow: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  /*background: url(earth.jpg);*/
  background-size: cover;
  background-position: center;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/*HEADER*/
/*------------------------------------*/
header {
  font-family: arial;
  width: 100%;
  height: 100px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 99;
  box-shadow: 0 0 10px #000;
  /*background: rgba(0, 0, 0, 0.5);*/
  background: #1b1b1e;
}

header h1 a {
  text-decoration: none;
  color: #fff;
}
header .logo {
  display: flex;
  flex: 1;
  margin-left: 50px;
  text-transform: uppercase;
  font-size: 15px;
}

header ul {
  display: flex;
  flex: 1;
  justify-content: space-evenly;
  transition: transform 0.5s ease-in-out, max-height 0.5s ease-in-out;
}

header a i {
  color: #fff;
  margin-left: 10px;
}

header ul li {
  list-style: none;
}

header ul li a {
  text-decoration: none;
  color: #fff;
  font-weight: 600;
  text-transform: uppercase;
  margin-right: 10px;
  position: relative;

  &:hover:after {
    width: 100%;
    left: 0;
  }

  &:after {
    content: "";
    position: absolute;
    display: block;
    height: 2px;
    background: orange;
    right: 100%;
    width: 0;
    bottom: -10px;
    transition: width 0.3s ease, left 0.3s ease;
  }
}

header .menu {
  font-size: 2em;
  display: none;
}

#check1 {
  display: none;
}
.fa-bars {
  color: #fff;
}

/*MAIN*/
/*------------------------------------*/
main {
  flex: 1;
}

/* SECTION WEATHER */

.weatherSection {
  position: relative;
  width: 100%;
  min-height: 100vh;
  background: linear-gradient(to bottom, #0f2027, #203a43, #2c5364);
  
  padding: 20px 0;
  
  display: flex;
  flex-direction: column;
  align-items: center;
}

.weatherSection-headline {
  text-align: center;
  padding-top: 80px;
  margin-bottom: 50px;
}

.weatherSection-headline h2 {
  color: #fff;
  font-family: "Fjalla One", sans-serif;
  font-size: 54px;
  font-weight: 800;
  text-transform: uppercase;
}

.weatherSection-headline p {
  color: #fff;
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 600;
}

/* Soft landing dialogi */

/*
.soft-landing {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 40px;
  line-height: 1.6;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
  z-index: 10;
}
*/


.soft-landing {
background: rgba(255, 255, 255, 0.95);
padding: 30px;
border-radius: 10px;
max-width: 90%;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
margin: 0 auto;



}
.soft-landing input {
  cursor: pointer;
}

.soft-landing label {
  margin-left: 10px;
  color: #000;
  font-family: "Nunito", sans-serif;
  font-weight: bold;
}

.privacy-info {
  font-size: 0.85rem;
  color: #444;
  margin-top: 15px;
  line-height: 1.4;
}

#button_choice {
  background-color: #000;
  border: none;
  color: #fff;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  margin-top: 15px;
  width: 100%;
  cursor: pointer;
}

#button_choice:hover {
  background-color: #04AA6D;
}

/* Kartta + säälaatikko */

#map-container {
  display: none; /* näkyviin JS:llä */
  width: 95%;
  height: 100vh;
  flex-direction: row;
  gap: 10px;
  padding: 5px;
  
    
}

#map {
  flex-basis: 80%;
  height: 80vh;
  border-radius: 5px;
  
}


/* Popupin sisältö */
.leaflet-popup-content {
  color: #000;
  font-family: 'Segoe UI', sans-serif;
}

.leaflet-popup-content-wrapper {
  background-color: rgba(255, 255, 255, 0.95);
  color: #000;
  border-radius: 8px;
  box-shadow: 0 0 8px rgba(0,0,0,0.2);
}

/* Piilotettu tila */
.weather-collapsed {
  
  max-height: 0;  
  overflow: hidden;
  transition: max-height 0.4s ease-in-out;
}

/* Näkyvä tila */
.weather-expanded {
  max-height: 800px; /* säädetään tarpeen mukaan */
  
}

#weather-box {
 
  flex-basis: 20%;
  display: none; /* näkyviin JS:llä */
  display: flex;
  flex-direction: column;
  padding: 0px 0px 10px 10px;
  line-height: 1.6;
  height: 80vh;
  background-color: inherit;
  font-family: "Nunito", sans-serif;
  overflow: hidden;
}

/* Toggle-napin tyyli */
.toggle-weather {
  position: sticky;
  top: 0;
  z-index: 1;
  margin-bottom: 10px;
  background-color: #04AA6D;
  color: white;
  border: none;
  cursor: pointer;
  font-family: "Nunito", sans-serif;
  padding: 10px 15px 10px 15px;
  margin-bottom: 25px; 
  font-size: 16px;
  width: 80%;
  
}

#weather-content {
  flex-grow: 1;
  overflow-y: auto;
  padding-right: 5px;
}

#weather-content.hidden {
  display: none;
}


#weather-box p { 
  font-size: 18px;
  margin: 6px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
}

#weather-icon {
  width: 80px;
  height: auto;
  display: block;
}

#reset_choice {
  background-color: #000;
  border: none;
  color: #fff;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  display: inline-block;
  font-size: 16px;
  width: 80%;
  cursor: pointer;
  font-family: "Nunito", sans-serif; 
  margin-top: 10px;
  

}

#reset_choice:hover {
  background-color: #04AA6D;
}

#showMapAndWeather-button {
  background-color: #000;
  border: none;
  color: #fff;
  padding: 15px 32px;
  text-align: center;
  text-decoration: none;
  font-size: 16px;
  width: 100%;
  cursor: pointer;
  font-family: "Nunito", sans-serif; 
  
}

#showMapAndWeather-button:hover {
  background-color: #04AA6D;
  
}

/*SECTION1*/
/*------------------------------------*/

.section1 {
  width: 100%;
  /*height: 95vh;*/
  /*height: auto;*/
  min-height: 95vh;
  /*background-color: #8b8982;*/
  background-color: #1e2d2f;
  /*background-color: #f7ff58;*/
  display: flex;
  flex-wrap: wrap; /* Lisää wrap-ominaisuus, jotta flex-items siirtyvät uudelle riville kun eivät mahdu rinnakkain. */
}

.pageSide1 {
  /*background-color: #f7ff58;*/
  width: 100%;
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/*
.pageSide2 {
  background-color: black;
  background: no-repeat url("portfolio/css/coding.png");
  width: 50%;
  display: flex;
  justify-content: center;
  align-items: left;
  flex-direction: column;
}
*/
.pageSide1 h2 {
  /*color: #1b1b1e;*/
  color: #fff;
  font-family: "Fjalla One", sans-serif;
  font-size: 64px;
  font-weight: 800;
  text-transform: uppercase;
}

.pageSide1 p {
  color: #fff;
  font-size: 20px;
  font-family: "Nunito", sans-serif;
  font-weight: 600;
}

/*SECTION 2*/
/*------------------------------------*/
.section2 {
  width: 100%;
  /*height: 100vh;*/
  min-height: 95vh;
  /*height: auto;*/
  /*background-color: #f7ff58;*/
  background-color: #eeeeee;
  padding-bottom: 50px;
}

.section2-headline {
  text-align: center;
  padding-top: 80px;
}

.section2-headline h2 {
  color: #1b1b1e;
  font-family: "Fjalla One", sans-serif;
  font-size: 54px;
  font-weight: 800;
  text-transform: uppercase;
}
.section2-headline p {
  color: #000;
  font-family: "Nunito", sans-serif;
  font-size: 20px;
  font-weight: 600;
}

/* SECTION 3*/
.section3 {
  background-color: #52aa8a;
  width: 100%;
  min-height: 95vh;
  /*height: 100vh;*/
  /*height: auto;*/
}

.section3-headline h2 {
  text-align: center;
  color: #1b1b1e;
  font-family: "Fjalla One", sans-serif;
  font-size: 54px;
  font-weight: 800;
  text-transform: uppercase;
  padding-top: 60px;
}

/*CARD */
/*------------------------------------*/

.card-container {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 30px;
  margin-top: 70px;
}

.card {
  position: relative;
  width: 300px;
  background-color: #f4f4f4;
  border-radius: 10px;
  box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.3);
  /*transition: transform 0.6s ease;*/
}

.card-content {
  padding: 15px;
}

.card-image {
  height: 250px;
  width: 100%;
  max-height: 80%;
  border-radius: 10px 10px 0px 0px;
  object-fit: cover;
  /*object-position: center center !important;*/
  margin: 0 auto;
}

.card-content h1 {
  font-size: 24px;
  font-family: "Fjalla One", sans-serif;
  color: #000;
  text-transform: uppercase;
}

.card-content p {
  font-family: "Nunito", sans-serif;
  font-size: 18px;
  color: #666;
  margin-bottom: 20px;
  font-weight: 600;
}

.card-button {
  display: inline-block;
  background-color: #1b1b1e;
  color: #fff;
  text-decoration: none;
  font-family: "Nunito", sans-serif;
  padding: 8px 16px;
  transition: transform 0.6s ease;
}

/*FOOTER*/
footer {
  width: 100%;
  z-index: 100;
  box-shadow: 0 0 10px #000;
  background: #1b1b1e;
  /*background: rgba(0, 0, 0, 0.5);*/
  transition: opacity 0.5s ease;
  display: flex;
  justify-content: center;
  align-items: center;
}

footer .headline ul li {
  list-style: none;
}

footer .headline a i {
  color: #fff;
  font-size: 25px;
  padding: 20px;
  margin: 10px 0 10px 0;
  text-decoration: none;
}

footer .info ul li {
  list-style: none;
}

/*MEDIA QUARY*/
/*------------------------------------*/

/*
@media (min-width: 1024px) {
  #toggle-weather {
    display: none;
  }
}
*/
@media (max-width: 1024px) {
  header ul {
    color: #fff;
    position: fixed;
    top: 100px;
    right: -100px;
    background: rgba(0, 0, 0, 0.5);
    flex-direction: column;
    align-items: center;
    height: 100%;
    width: 100%;
    transform: translateX(100%);
    overflow-y: auto;
    min-height: 100vh;
  }
  header .menu {
    display: block;
    width: 100px;
    text-align: center;
  }
  #check1:checked ~ ul {
    right: 0;
    transform: translateX(0);
    height: 100vh;
    backdrop-filter: blur(10px);
  }
  header .fa-facebook,
  header .fa-instagram {
    display: none;
  }
  .section2 {
    padding-bottom: 50px;
  }

  footer .headline {
    display: flex;
    justify-content: center;
  }

  footer .info ul {
    display: flex;
    flex-direction: column;
    text-align: center;
    padding: 0;
    margin-bottom: 20px;
  }

  #map-container {
    flex-direction: column;
  }

  #map, #weather-box {
    flex-basis: 100%;
    height: 45vh;
  }


  #weather-box {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
    padding: 10px;
    overflow-y: auto;
    
  }


  #weather-box p {
    margin: 10px;
    min-width: 50%;
    font-size: 1rem;
  
  }

  .image-wrapper {
    width: 100%;
    display: flex;
    justify-content: flex-start;
  }

  #weather-icon {
    width: 60px;
    height: auto;
  }

  #reset_choice,
  #showMapAndWeather-button {
    width: 100%;
    font-size: 0.9rem;
  }

  #toggle-weather {
    width: 100%;
  }
}


@media (max-width: 768px) {
  .section1 {
    flex-direction: row;
  }
  .pageSide1 {
    width: 100%;
  }
  
  .section2,
  .section3 {
    height: auto;
    padding-bottom: 50px;
  }
  .weatherContainer {
    margin: 10px;
  }
  .weatherSection-headline {
    margin-bottom: 50px;
  }

  #map-container {
    flex-direction: column;

  }

  #weather-box {
    width: 100%;
    
  }

  #map, #weather-box {
    flex-basis: 100%;
    height: 45vh;
   
  }

  /* Aloitus collapsed-tilassa */
  #weather-box.weather-collapsed {
    display: flex; /* jotta sisältö pysyy näkyvissä laajennettaessa */
    flex-direction: column;
  }

}
  

@media (max-width: 425px) {
  .section2,
  .section3 {
    height: auto;
    padding-bottom: 50px;
  }
  .weatherContainer {
    margin-left: 20px;
    margin-right: 20px;
  }
  .weatherSection-headline {
    margin-bottom: 50px;
    
  }

  .weatherSection-headline h2 {
    padding: 7px;
  }

  .soft-landing {
    width: 95%;
    margin-top: 30px;
  }

  #map {
    flex-basis: 80%;
  }

  .soft-landing {
    margin-top: 80px;
  }
}

@media screen and (orientation: landscape) and (max-width: 480px) {
  header {
    flex-direction: column;
    height: auto;
  }

  .section1,
  .section2,
  .section3 {
    height: auto; /* Varmistetaan, että korkeus on automaattinen */
    padding: 20px 0; /* Lisätään hieman paddingia */
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .card-container {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Keskitetään kortit */
    gap: 20px; /* Varmistetaan tarpeeksi tilaa korttien väliin */
    align-items: flex-start;
    height: auto;
  }

  .card {
    width: 70%; /* Tehdään korteista leveämpiä, jotta ne mahtuvat paremmin vaakasuunnassa */
    margin-bottom: 15px;
  }

  .card-image {
    width: 100%;
    height: auto;
  }

  .card-content {
    padding: 8px;
  }

  .card-content h1,
  .card-content p {
    font-size: 80%;
  }

  .card-button {
    padding: 6px 10px;
    font-size: 80%;
  }

  .weatherContainer {
    width: 90%;
  }

  .soft-landing {
    margin-top: 200px;
  }

  footer {
    flex-direction: column;
  }

  footer .headline ul,
  footer .info ul {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  footer .headline a i {
    margin: 10px;
  }
}
