/* ====== Base ====== */
:root { --brand:#40c475; --ink:#333; --card:#f9fafb; --muted:#f3f4f6; --primary:#1e3a8a; --primary-600:#3749b6; }
* { box-sizing: border-box; }
body { margin: 0; font-family: Arial, sans-serif; line-height: 1.6; color: var(--ink); }
h1, h2, h3 { margin: 0 0 0.5em; }

/* ====== Hero ====== */
.hero {
  position: relative;
  background: url("easypagetausta.jpg") no-repeat center/cover;
  color: #fff;
  text-align: center;
  padding: 4rem 2rem;
  overflow: hidden;

  display: flex;              /* otetaan käyttöön flexbox */
  flex-direction: column;     /* oletuksena pystysuunnassa */
  align-items: center;        /* keskittää sisällön */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(158, 152, 152, 0.45);
  z-index: 0;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero .logo {
  align-self: center;     /* logo vasempaan laitaan */
}

.hero .logo img {
  height: 5rem;
  width: auto;
  border-radius: 0.5rem;
}
.btn {
  display: inline-block;
  margin-top: 1rem;
  padding: 0.7rem 1.5rem;
  background: var(--brand);
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}
.btn:hover {
  background: #36b766;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* ====== Layout ====== */
section { padding: 3rem 2rem; max-width: 1000px; margin: auto; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }

/* ====== Cards ====== */
.card { background: var(--card); padding: 1rem; border-radius: 8px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; transition: transform 0.25s ease; }
.card:hover { transform: translateY(-2px) scale(1.02); }
.card img { max-width: 100%; border-radius: 6px; display:block; margin:0 auto 0.5rem; }
.price { font-weight: bold; margin-top: 0.5rem; }

/* ====== Form ====== */
form { display: flex; flex-direction: column; gap: 1rem; }
form input, form textarea { padding: 0.7rem; border: 1px solid #ccc; border-radius: 6px; width: 100%; font: inherit; }
form button { background: var(--primary); color: #fff; border: none; padding: 0.8rem; border-radius: 6px; cursor: pointer; }
form button:hover { background: var(--primary-600); }

/* ====== Footer ====== */
footer { text-align: center; padding: 1rem; background: var(--muted); }

/* ====== Modal Preview ====== */
.modal { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.9); z-index: 9999; }
.modal .close { position: absolute; top: 20px; right: 30px; font-size: 2rem; color: #fff; cursor: pointer; user-select:none; }
.modal iframe {
  width: 90%;
  height: 90%;
  margin: 2% auto;
  border-radius: 12px;
  border: none;
  background: #fff;
}
.modal-footer { text-align: center; margin-top: -2rem; }
.modal-footer a { color: var(--brand); font-weight: bold; text-decoration: none; }
.modal-footer a:hover { text-decoration: underline; }

.language-switcher {
  position: absolute; top: 1rem; right: 1rem;
}
.language-switcher button {
  background: transparent; color: white; border: 2px solid white;
  padding: 0.25rem 0.75rem; margin-left: 0.5rem; border-radius: 5px;
  cursor: pointer; font-weight: 600;
}

@media (max-width: 480px) { .modal iframe { width: 96%; height: 86%; margin: 7% auto; } }
.preview-img {
  width: 320px;
  height: 320px;
  object-fit: cover;
  border-radius: 8px;
  margin: 0 auto 0.5rem;
  display: block;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.slider-wrapper {
  overflow-x: auto;
  display: flex;
  gap: 16px;
  scroll-behavior: smooth;
  padding: 2rem 0;
}
.slider-wrapper::-webkit-scrollbar { display: none; }

.slider-container {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
}
.card { flex: 0 0 auto; width: 320px; }

.slider-btn {
  background: rgba(0,0,0,0.5);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 24px;
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
.slider-btn.left { left: -20px; }
.slider-btn.right { right: -20px; }
.slider-btn:hover { background: rgba(0,0,0,0.8); }

@media (max-width: 600px) {
  .card { width: 240px; flex: 0 0 calc((100% - 16px)/2); }
  .preview-img { width: 240px; height: 150px; }
  .slider-btn { width: 30px; height: 30px; font-size: 18px; }
}
