/* -------------------------------------------------- YLEISET -------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; font-family: 'Montserrat', sans-serif; background-color: #f7f9fb; color: #1a1a1a; }
img { max-width: 100%; display: block; }
section { padding: 60px 20px; max-width: 1100px; margin: auto; }
h2 { text-align: center; margin-bottom: 40px; color: #1f4e79; font-size: 3rem; }

/* -------------------------------------------------- NAVIGAATIO -------------------------------------------------- */
.nav { background-color: #1f4e79; padding: 14px 20px; text-align: center; }
.nav a { color: white; text-decoration: none; margin: 0 18px; font-weight: 600; font-size: 1.1rem; }
.nav a:hover { opacity: 0.7; }
.nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 30px;
}

.logo img {
  height: 60px;   /* voit säätää */
  width: auto;
}

/* -------------------------------------------------- HERO -------------------------------------------------- */
.hero {
  position: relative;
  height: 85vh;
  background-image: url('nettisivut.jpg');
  background-size: cover;
  background-position: center 35%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: white;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(31,78,121,0.65), rgba(0,0,0,0.45));
}
.hero-content { position: relative; z-index: 2; }
.hero-content h1 { font-size: 3rem; margin-bottom: 10px; }
.hero-content p { font-size: 1.25rem; margin-bottom: 20px; }
.cta-btn {
  background-color: #1f4e79;
  color: white;
  padding: 14px 32px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
}
.cta-btn:hover { transform: translateY(-3px); }

/* -------------------------------------------------- PALVELUT -------------------------------------------------- */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; }
.service-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  overflow: hidden;
  text-align: center;
  padding-bottom: 20px;
  transition: transform 0.25s ease;
}
.service-box:hover { transform: translateY(-6px); }
.service-img {
  height: 260px;
  background-size: cover;
  background-position: center;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}
.service-title { font-size: 1.4rem; font-weight: 700; color: #0a4d8c; margin: 14px 0; }

/* Palvelukohtaiset kuvasäädöt */
.service-box.yksilo .service-img { background-position: center 45%; }
.service-box.pienryhma .service-img { background-position: center 45%; }
.service-box.yritys .service-img { background-position: center 65%; }

/* -------------------------------------------------- MIKSI VALITA -------------------------------------------------- */
.miksi-valita-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 15px; }
.miksi-box {
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  overflow: hidden;
  text-align: center;
  padding-bottom: 20px;
  transition: transform 0.25s ease;
  flex: 1 1 22%;
  max-width: 22%;
  box-sizing: border-box;
}
.miksi-box:hover { transform: translateY(-6px); }
.miksi-img { height: 180px; background-size: cover; background-position: center; border-radius: 8px; }
.miksi-box p {
  color: #003399;
  font-weight: 700;
  font-size: 1.2rem;
  text-align: center;
  margin-top: 8px;
}

/* -------------------------------------------------- REFERENSSIT -------------------------------------------------- */
.ref-img {
  width: 100%;
  height: 250px;
  background-size: cover;
  background-position: center;
  border-radius: 8px;
}
.referenssit-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: nowrap;
}
.ref-box {
  background: #ffffff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 23%;
  box-sizing: border-box;
}
.ref-name {
  color: #1e6bd6;
  font-weight: 700;
  text-align: center;
  font-size: 1.1rem;
  margin-bottom: 10px;
}
.ref-box p:not(.ref-name) {
  font-style: italic;
  text-align: center;
  line-height: 1.5;
}

/* -------------------------------------------------- HOVER-TEKSTIT -------------------------------------------------- */
.hover-info {
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  padding: 14px;
  font-size: 1rem;
  color: #0a4d8c;
}
@media (min-width: 769px) {
  .service-box:hover .hover-info,
  .miksi-box:hover .hover-info {
    display: block;
    opacity: 1;
  }
}

/* -------------------------------------------------- MINUSTA -------------------------------------------------- */
.minusta-container { display: flex; gap: 40px; flex-wrap: wrap; align-items: center; }
.minusta-image img { width: 70%; max-width: 280px; border-radius: 10px; display: block; margin: 0 auto; }
.minusta-text { flex: 1; max-width: 600px; line-height: 1.6; font-size: 1.05rem; }
.minusta-text h3 { margin-top: 20px; margin-bottom: 10px; }
.filosofia { font-style: italic; line-height: 1.6; margin-bottom: 20px; font-size: 1.05rem; }

/* -------------------------------------------------- YHTEISTYÖKUMPPANIT -------------------------------------------------- */
.partners-section { background: #f5f7fa; text-align: center; padding: 60px 20px; }
.partners-list {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 30px;
  flex-wrap: wrap;
}
.partner-box {
  width: 32%;
  text-align: center;
}
.partner-box img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  display: block;
  margin: 0 auto 10px auto;
}
.partner-box:nth-child(2) p { display: block; margin-top: 8px; line-height: 1.4; }
.partner-box:nth-child(3) {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
}
.partner-box:nth-child(3) .team-urhola-title {
  color: #1e6bd6;
  font-weight: 700;
  font-size: 1.1rem;
  text-align: center;
  margin-bottom: 8px;
}
/* YHTEISTYÖKUMPPANIT DESKTOP – ISOMMAT LOGOT JA LEVEÄMMÄT BOKSIT */
.partners-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 50px;
    justify-items: center;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

.partner-box {
    width: 100%;
    max-width: 350px;   /* kasvatettu 320px → 350px */
    text-align: center;
}

.partner-box img {
    width: 100%;
    max-width: 300px;   /* kasvatettu 180px → 300px */
    height: auto;
    object-fit: contain;
    margin-bottom: 10px;
}



/* -------------------------------------------------- YHTEYDENOTTO -------------------------------------------------- */
.contact-form { max-width: 500px; margin: auto; display: flex; flex-direction: column; gap: 15px; }
.contact-form input, .contact-form textarea {
  padding: 12px;
  border: 1px solid #ccc;
  border-radius: 6px;
}
.contact-form button {
  background-color: #1f4e79;
  color: white;
  padding: 14px;
  border: none;
  border-radius: 6px;
}
#yhteydenotto {
    padding: 40px 20px 120px 20px;
    display: block;
}

/* -------------------------------------------------- FOOTER -------------------------------------------------- */
footer { 
   background-color: #1f4e79; 
   color: white; 
   text-align: 
   center; 
   padding: 30px 20px; 
   margin-top 40px;
}

/* -------------------------------------------------- MOBIILIKORJAUS YHDISTETTY -------------------------------------------------- */
@media (max-width: 768px) {

  /* Navigaatio */
  .nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 10px 8px;
  }
  .nav a {
    font-size: 0.9rem;
    margin: 0;
    padding: 6px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 6px;
  }

  /* Hero-osio */
  .hero {
    height: 70vh;
    min-height: 480px;
    background-position: center 30%;
    padding: 20px 10px;
  }
  .hero-content h1 {
    font-size: 1.6rem;
    line-height: 1.3;
  }
  .hero-content p {
    font-size: 1rem;
    margin-bottom: 16px;
  }
  .cta-btn {
    font-size: 1rem;
    padding: 10px 22px;
  }

  /* PALVELUT MOBIILI */
  .services {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: center;
    align-items: start;
    padding: 10px 0;
  }
  .service-box {
    width: 95%;
    max-width: 180px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 10px;
  }
  .service-img {
    height: 100px;
    background-size: cover;
    background-position: center 70%;
    background-repeat: no-repeat;
    border-radius: 10px 10px 0 0;
    overflow: hidden;
  }
  .service-title {
    font-size: 0.9rem;
    margin: 6px 0;
    font-weight: 700;
    color: #0a4d8c;
  }
  .service-box .hover-info { display: none !important; }
  .service-box:nth-child(1) .service-img { background-size: 95%; background-position: center 20%; }
  .service-box:nth-child(2) .service-img { background-size: 100%; background-position: center 40%; }
  .service-box:nth-child(3) .service-img { background-size: cover; background-position: center 60%; }

  /* MIKSI VALITA MEIDÄT MOBIILI 2x2 */
  .miksi-valita-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-items: center;
    align-items: start;
    padding: 10px 0;
  }
  .miksi-box {
    width: 95%;
    max-width: 180px;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
    padding-bottom: 10px;
  }
  .miksi-img {
    height: 100px;
    background-size: cover;
    background-position: center 70%;
    border-radius: 10px 10px 0 0;
  }
  .miksi-box p {
    font-size: 0.9rem;
    margin: 6px 0;
    font-weight: 700;
    color: #0a4d8c;
  }
  .miksi-box:nth-child(4) { grid-column: auto; justify-self: auto; }
  .miksi-box .hover-info { display: none !important; }
  .miksi-box:nth-child(1) .miksi-img { background-size: 95%; background-position: center 85%; }
  .miksi-box:nth-child(2) .miksi-img { background-size: cover; background-position: center 50%; }
  .miksi-box:nth-child(3) .miksi-img { background-size: cover; background-position: center 55%; }
  .miksi-box:nth-child(4) .miksi-img { background-size: cover; background-position: center 40%; }

  /* REFERENSSIT MOBIILI */
  .referenssit-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    justify-items: center;
    padding: 10px 0;
  }
  .ref-box {
    width: 80%;
    max-width: 320px;
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    text-align: center;
    padding: 15px;
    overflow: hidden;
  }
  .ref-img {
    width: 100%;
    height: 160px;
    background-size: cover;
    background-position: center 60%;
    border-radius: 12px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    margin-bottom: 12px;
  }
  .ref-name {
    font-weight: 700;
    color: #0a4d8c;
    font-size: 1rem;
    margin-bottom: 8px;
    text-align: center;
  }
  .ref-box p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #333;
    margin-bottom: 8px;
  }
  .ref1 .ref-img { background-size: 100%; background-position: center 55%; }
  .ref2 .ref-img { background-size: 95%; background-position: center 60%; }
  .ref3 .ref-img { background-size: 85%; background-position: center 65%; }
  .ref4 .ref-img { 
    background-size: contain; 
    background-repeat: no-repeat;
    background-position: center;
}

  /* MINUSTA MOBIILI */
  .minusta-section { padding: 40px 20px; }
  .minusta-image img {
    width: 80%;
    max-width: 280px;
    border-radius: 10px;
    margin: 0 auto 20px auto;
    display: block;
  }
  .minusta-text { font-size: 1rem; line-height: 1.5; }
  .minusta-text p { margin-bottom: 14px; }
  .minusta-text ul { padding-left: 20px; }
  .minusta-text li { margin-bottom: 6px; }

  /* YHTEISTYÖKUMPPANIT MOBIILI */
  #yhteistyokumppanit h2 {
    font-size: 1.4rem;
    line-height: 1.3;
    margin-bottom: 25px;
    color: #1f4e79;
    text-align: center;
  }
  .partners-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 25px;
    padding: 0 10px;
  }
  .partner-box {
    width: 90%;
    max-width: 320px;
    text-align: center;
  }
  .partner-box img {
    width: 100%;
    max-width: 180px;
    height: auto;
    margin: 0 auto 10px auto;
    display: block;
    object-fit: contain;
  }
  .partner-box p {
    font-size: 0.95rem;
    line-height: 1.4;
    color: #1a1a1a;
    margin: 0 auto;
  }
  .partner-box h3,
  .partner-box .team-name {
    color: #0a4d8c;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
  }
  /* YHTEYDENOTTO MOBIILI */
  #yhteydenotto {
    padding: 40px 20px 120px 20px;
  }

  .contact-form {
    width: 90%;
    max-width: 360px;
    margin: 0 auto;
  }

  .contact-form button {
    width: 100%;
    margin-top: 10px;
  }
}

