/* Yleiset tyylit */
body {
  font-family: Arial, sans-serif;
  margin: 0;
  background: #f4f4f9;
  color: #333;
  text-align: center;
  overflow-x: hidden; /* Estää sivuttaisskrollauksen */
}

header {
  background: #3f51b5;
  color: white;
  padding: 1em;
}

h1 {
  margin: 0;
  font-size: 1.8em;
}

/* Intro + nappi */
.intro {
  margin: 2em 1em;
}

.button {
  display: inline-block;
  margin-top: 1em;
  padding: 0.8em 1.5em;
  background: #3f51b5;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.1em;
}

/* Karuselli */
.carousel {
  width: 100vw; /* täysi näkymän leveys */
  overflow: hidden;
  position: relative;
  height: 350px; /* desktop */
}

.slides {
  display: flex;
  animation: scroll 60s linear infinite; /* hidas ja saumaton */
  width: max-content;
}

.slides img {
  height: 350px;
  width: auto;
  flex-shrink: 0;
  object-fit: cover;
}

@keyframes scroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); } /* liike 50 % kuvista, jos tuplattu */
}

/* Läsy-sivu keskitys */
.centered {
  max-width: 600px;
  margin: auto;
  padding: 1em;
}

/* Accordion */
.accordion {
  background-color: #eee;
  cursor: pointer;
  padding: 1.2em;
  width: 100%;
  text-align: left;
  border: none;
  outline: none;
  transition: 0.3s;
  font-weight: bold;
  margin: 0.7em 0;
  border-radius: 10px;
  font-size: 1.1em;
}

.accordion.active, .accordion:hover {
  background-color: #ccc;
}

.panel {
  display: none;
  padding: 1.2em;
  background-color: white;
  border-left: 4px solid #3f51b5;
  border-radius: 0 0 10px 10px;
  text-align: left;
  font-size: 1em;
  line-height: 1.5em;
}

/* Takaisin-nappi */
.back-button {
  display: inline-block;
  margin-bottom: 20px;
  padding: 10px 20px;
  background: #eee;
  color: #333;
  text-decoration: none;
  border-radius: 6px;
  font-weight: bold;
}
.back-button:hover {
  background: #ccc;
}

/* 📱 Mobiilimuutokset */
@media (max-width: 600px) {
  .accordion {
    font-size: 1.1em;
    padding: 1em;
  }

  .panel {
    font-size: 0.9em; /* pienempi tekstikoko mobiilissa */
    line-height: 1.4em;
    padding: 0.8em;
  }

  .centered {
    width: 95%;
    max-width: none;
  }

  .carousel {
    height: 220px; /* matalampi */
  }

  .slides img {
    height: 220px;
  }

  h1 {
    font-size: 1.4em;
  }

  h2 {
    font-size: 1.1em;
  }

  body {
    font-size: 14px;
  }
}
