/* ============================================================
   Tyylit — lämmin greige-ilme (inspiraationa Agenda Digital).
   Muokkaa värit ja fontit :root-lohkosta.
   ============================================================ */

:root {
  --paper:          #f3efe9;   /* lämmin taustavaalea */
  --greige:         #d8cdc5;   /* hero-kaista, panelit (teemaväri) */
  --greige-vaalea:  #e7dfd6;
  --muste:          #24211e;   /* teksti, alatunniste, painikkeet */
  --muste-2:        #3a352f;
  --himmea:         #6f6960;
  --raja:           #ddd5cc;
  --valkoinen:      #ffffff;

  --leveys:         64rem;
  --pyoristys:      6px;

  --fontti:        "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --fontti-otsikko:"Sora", var(--fontti);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--fontti);
  color: var(--muste);
  background: var(--paper);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

main { display: block; }

h1, h2, h3 {
  font-family: var(--fontti-otsikko);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
}
h1 { font-size: clamp(2.5rem, 7vw, 5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; margin-bottom: 1.25rem; }
h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: 0.4rem; }

p { margin: 0 0 1rem; }
.lead { color: var(--himmea); font-size: 1.15rem; max-width: 46ch; }

a { color: var(--muste); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Header --- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--leveys);
  margin: 0 auto;
  padding: 1.5rem;
}
.logo { font-family: var(--fontti-otsikko); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em; }
.logo:hover { text-decoration: none; }
.nav a { margin-left: 1.5rem; color: var(--himmea); font-size: 0.95rem; }
.nav a:hover { color: var(--muste); }

/* --- Hero: greige-kaista --- */
.hero {
  background: var(--greige);
}
.hero-sisalto {
  max-width: var(--leveys);
  margin: 0 auto;
  padding: clamp(3.5rem, 9vw, 7rem) 1.5rem;
}
.hero h1 { max-width: 16ch; }
.hero .lead { margin-top: 1.5rem; }

.haku { position: relative; margin-top: 2.5rem; max-width: 34rem; }
#haku {
  width: 100%;
  padding: 0.95rem 1.1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--muste);
  border: 1px solid transparent;
  border-radius: var(--pyoristys);
  background: var(--valkoinen);
}
#haku:focus {
  outline: none;
  border-color: var(--muste);
  box-shadow: 0 0 0 3px rgba(36, 33, 30, 0.12);
}
.tulokset {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  position: absolute;
  left: 0; right: 0;
  background: var(--valkoinen);
  border: 1px solid var(--raja);
  border-radius: var(--pyoristys);
  box-shadow: 0 12px 30px rgba(36, 33, 30, 0.12);
  overflow: hidden;
  z-index: 10;
}
.tulokset:empty { display: none; }
.tulokset li a {
  display: block;
  padding: 0.75rem 1.1rem;
  color: var(--muste);
  border-bottom: 1px solid var(--raja);
}
.tulokset li:last-child a { border-bottom: none; }
.tulokset li a:hover,
.tulokset li a:focus {
  background: var(--greige-vaalea);
  text-decoration: none;
}
.tulokset .tyhja { padding: 0.75rem 1.1rem; color: var(--himmea); }

/* --- Sisältöosiot --- */
.sisalto, .yhteys {
  max-width: var(--leveys);
  margin: 0 auto;
  padding: clamp(3rem, 6vw, 5rem) 1.5rem;
}
.kortit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.kortti {
  background: var(--valkoinen);
  border: 1px solid var(--raja);
  border-radius: var(--pyoristys);
  padding: 1.5rem;
}
.kortti h3 { margin-bottom: 0.5rem; }
.kortti p { margin: 0; color: var(--himmea); }

/* Linkitetyt kortit (esim. palvelut-esittely etusivulla) */
a.kortti { display: block; color: inherit; transition: border-color 0.15s ease; }
a.kortti:hover {
  text-decoration: none;
  border-color: var(--muste);
}
a.kortti:hover h3 { text-decoration: underline; }

/* Painikkeen näköinen linkki */
.painike-linkki {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-weight: 600;
  color: var(--paper);
  background: var(--muste);
  border-radius: var(--pyoristys);
}
.painike-linkki:hover { background: var(--muste-2); text-decoration: none; }

/* Yhteystietolista */
.yhteystiedot { margin: 2rem 0 0; }
.yhteystiedot > div {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 0.5rem 1rem;
  padding: 0.75rem 0;
  border-top: 1px solid var(--raja);
}
.yhteystiedot > div:last-child { border-bottom: 1px solid var(--raja); }
.yhteystiedot dt { font-weight: 600; }
.yhteystiedot dd { margin: 0; color: var(--himmea); }

/* Aktiivinen navigointilinkki */
.nav a[aria-current="page"] { color: var(--muste); font-weight: 600; }

/* --- Lomake --- */
.yhteys { border-top: 1px solid var(--raja); }
.lomake { max-width: 34rem; margin-top: 2rem; }
.lomake label {
  display: block;
  margin-bottom: 1.1rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.lomake input,
.lomake textarea {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.8rem 0.95rem;
  font: inherit;
  font-weight: 400;
  color: var(--muste);
  border: 1px solid var(--raja);
  border-radius: var(--pyoristys);
  background: var(--valkoinen);
}
.lomake input:focus,
.lomake textarea:focus {
  outline: none;
  border-color: var(--muste);
  box-shadow: 0 0 0 3px rgba(36, 33, 30, 0.1);
}
.lomake textarea { resize: vertical; }

/* Hunajapurkki piiloon näkyvistä ja ruudunlukijoilta */
.hunaja {
  position: absolute;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

button[type="submit"] {
  padding: 0.85rem 1.75rem;
  font: inherit;
  font-weight: 600;
  color: var(--paper);
  background: var(--muste);
  border: none;
  border-radius: var(--pyoristys);
  cursor: pointer;
}
button[type="submit"]:hover { background: var(--muste-2); }
button[type="submit"]:focus-visible {
  outline: 2px solid var(--muste);
  outline-offset: 2px;
}
button[type="submit"]:disabled { opacity: 0.6; cursor: default; }

/* AJAX-palaute lomakkeen alla */
.lomake-status {
  margin: 1.1rem 0 0;
  font-size: 0.95rem;
}
.lomake-status:empty { display: none; }
.lomake-status.ok    { color: var(--muste); font-weight: 600; }
.lomake-status.virhe { color: #a3352b; font-weight: 600; }

/* --- Footer: tumma --- */
.site-footer {
  background: var(--muste);
  color: var(--greige);
  margin-top: 2rem;
}
.site-footer .footer-sisalto {
  max-width: var(--leveys);
  margin: 0 auto;
  padding: 3rem 1.5rem;
  font-size: 0.9rem;
}
.site-footer a { color: var(--greige); text-decoration: underline; }
.site-footer a:hover { color: var(--valkoinen); }
.footer-linkit { margin-bottom: 1rem; }
.footer-linkit a { margin-right: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
