/* Yleiset perusasetukset */
* {
  box-sizing: border-box;
}

body {
  background-color: #c598af;
  font-family: 'Roboto', sans-serif;
  margin: 0;
  padding: 15px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Yläpalkki ja navigointi */
header {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  margin: 0 0 30px 0;
  padding: 20px 5vw;
  border-bottom: 2px solid #9fabe0;
}

.logo {
  font-size: 22px;
  font-weight: 700;
  color: #070b08;
  text-transform: uppercase;
  text-align: center;
}

nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.valikko-linkki {
  color: #070b08;
  text-decoration: none;
  font-size: 16px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 4px;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.valikko-linkki:hover,
.valikko-linkki.aktiivinen {
  background-color: #070b08;
  color: #9fabe0;
  border: 2px solid #070b08;
}

/* Pääteksti */
h1 {
  color: #070b08;
  font-size: 28px;
  text-align: center;
  margin-bottom: 30px;
}

p {
  font-family: 'Roboto', sans-serif;
  font-size: 18px;
  line-height: 1.6;
  margin: 0;
}

/* Sisältö */
.sisalto {
  background-color: #ffffff;
  padding: 25px;
  border-radius: 8px;
  width: 100%;
  max-width: 600px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
}

.sisalto {
    margin-bottom: 30px;
}

/* Vaakaviiva */
.viiva {
  width: 100%;
  height: 2px;
  background-color: #9fabe0;
  margin: 20px auto;
}

/* Suodattimet */
.suodattimet {
  display: flex;
  gap: 15px;
  margin: 30px 0;
  justify-content: center;
  flex-wrap: wrap;
}

.suodattimet button {
  background-color: white;
  color: #070b08;
  border: 2px solid #070b08;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  font-size: 16px;
}

.suodattimet button:hover {
  background-color: #070b08;
  color: white;
}

/* MAALAUSTEN KUVAT */

.grid-kuva {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  width: 100%;
  max-width: 1000px;
  margin: 0 auto 40px auto;
}

.grid-kuva figure {
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.grid-kuva .maalauskuva {
  width: 450px;
  max-width: 100%;
  height: 500px;
  max-height: 75%;
  border: 2px solid #070B08;
  border-radius: 30px;
  object-fit: cover;
  box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
  display: block;
}

.grid-kuva .maalauskuva:hover {
  transform: scale(1.05);
}

/* Kuvatekstit */
.grid-kuva figcaption {
  text-align: center;
  margin-top: 10px;
  color: #ffffff;
  width: 100%;
}

.grid-kuva figcaption span {
  display: block;
  margin-top: 5px;
}

.kuva-popup {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

.kuva-popup img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 10px;
}

.sulje {
  position: absolute;
  top: 20px;
  right: 35px;
  color: white;
  font-size: 45px;
  cursor: pointer;
}
/*etusivun kuva*/
.hero-wrapper > figure .kuva {
  width: 100%;
  max-width: 350px;
  height: auto;
  display: block;
  margin: 0 auto;
}
/* Yleiset figcaption-asetukset */
figcaption {
  font-size: 12px;
  color: #ffffff;
  text-align: center;
  margin-top: 6px;
  font-style: italic;
}

/* TOIMINTAKEHOTE */

.toimintakehote {
  display: inline-block;
  width: auto;
  align-self: center;
  background-color: #9fabe0;
  margin-top: 0;
  color: #070b08;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 6px;
  border: 2px solid #070b08;
  font-weight: 600;
  transition: all 0.2s ease;
}

.toimintakehote:hover {
  background-color: #070b08;
  color: #ffffff;
}

/* PALVELUT */

.palvelut {
  width: 100%;
  max-width: 100%;
  padding: 40px 0;
  margin: 40px auto;
  box-sizing: border-box;
}

.palvelut h2 {
  font-size: 22px;
  color: #070b08;
  margin-bottom: 20px;
  text-transform: uppercase;
  text-align: center;
}

.palvelut-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.palvelu-kortti {
  background-color: #ffffff;
  padding: 20px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.palvelu-kortti h3 {
  font-size: 20px;
  margin-top: 0;
  margin-bottom: 8px;
  color: #070b08;
}

.palvelu-kortti p {
  font-size: 14px;
  color: #070b08;
  line-height: 1.4;
}

/* FOOTER */

.footer {
  width: 100%;
  background-color: #9fabe0;
  padding: 15px 0;
  margin-top: auto;
  border-radius: 8px;
}

.footer-sisalto {
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.footer-sisalto p {
  color: #070b08;
  font-size: 14px;
  font-weight: 500;
}

/* TABLETIT JA TIETOKONEET */

@media (min-width: 768px) {

  body {
    padding: 20px 40px;
  }

  /* Yläpalkki */
  header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 20px 5vw;
  }

  .logo {
    text-align: left;
  }

  nav {
    justify-content: flex-end;
    gap: 15px;
  }

  h1 {
    font-size: 44px;
    text-align: left;
    max-width: 100%;
    margin-left: 0;
  }
/* ETUSIVU */

  .hero-wrapper {
    display: grid;
    grid-template-columns: 1fr 400px;
    grid-template-rows: auto 1fr;
    gap: 0 40px;
    align-items: stretch;
  }

  .hero-wrapper .sisalto {
    grid-column: 1;
    grid-row: 1;
    max-width: 100%;
    margin: 0;
  }

  .hero-wrapper .toimintakehote {
    grid-column: 1;
    grid-row: 2;
    align-self: start;
    margin-top: 20px;
    display: inline-block;
    width: fit-content;
    margin-left: 0;
  }

  /* VAIN ETUSIVUN KUVA */
  .hero-wrapper > figure {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
  }

  .hero-wrapper > figure .kuva {
    width: 100%;
    max-width: 400px;
    height: auto;
    border-radius: 8px;
    display: block;
  }

  .hero-wrapper > figure figcaption {
    text-align: right;
    width: 100%;
  }

  /* Palvelut */
  .palvelut h2 {
    text-align: left;
  }

  .palvelut-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 30px;
  }
}
/* Puhelin */ 
@media (max-width: 500px) {

  .grid-kuva {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .grid-kuva .maalauskuva {
    width: 100%;
    max-width: 450px;
    height: auto;
    min-height: 400px;
  }
  /* palvelukortit */
  .palvelut-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

  /* Maalaukset */

 #Maalaukset .footer-sisalto p {
  color: #070b08;
  font-size: 14px;
  font-weight: 500;
}

   #Maalaukset p {
    font-size: 20px;
}

   #Maalaukset .suodattimet button {
    font-size: 18px;
}

   #Maalaukset .grid-kuva figcaption strong {
    font-size: 20px;
}

   #Maalaukset .grid-kuva figcaption span {
    font-size: 18px;
}

  .grid-kuva {
    grid-template-columns: repeat(2, 1fr);
    gap: 50px 40px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
  }

  .grid-kuva figure {
    align-items: center;
  }

  .grid-kuva .maalauskuva {
    width: 450px;
    max-width: 100%;
    height: 500px;
  }

  .grid-kuva figcaption {
    text-align: center;
    width: 100%;
  }


/* Liubovin sivu. text and map side-by-side */
.paasisalto {
  display: flex;
  flex-direction: row;     /* text and map next to each other */
  gap: 30px;               /* space between text and map */
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 40px auto;
  align-items: stretch;    /* equal height */
}

/* Modifies my existing .sisalto class to share space nicely */
.sisalto {
  flex: 1;                 
  max-width: 600px;        
}

/* MAP CONTAINER STYLES */
.kartta-sivu {
  flex: 1;                 /* map equal width allocation */
  min-height: 400px;
}

.kartta-sivu iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.15);
}

/* PHONE LAYOUT: map go down on small screens */
@media (max-width: 768px) {
  .paasisalto {
    flex-direction: column; /* map underneath the text */
    gap: 20px;
    align-items: flex-start; /* stops the vertical stretching*/
  }
  
  .sisalto {
    max-width: 100%;       /* text fill mobile screen width */
  }

  .kartta-sivu {
    width: 100%;
    min-height: auto; 
    height: 350px;         /* map height for mobile */
  }
}
/* Container to align the button with the content layout */
.nappi-alue {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto 60px auto; /* space between the button and the footer */
  display: flex;
}

/* button same width as the layout blocks */
.nappi-alue .toimintakehote {
  width: 100%;
  text-align: center;
  margin-top: 0; /* Clears old top margins */
}

