/* =========================================================
   Humitop – teeman päätyyli (rakennettu HTML-demon pohjalta)
   Demo: theme-1 (tummansininen + vihreä), lite + nav-dark
   ========================================================= */

:root {
  --maxw: 1200px;
  --radius: 10px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 3px rgba(10, 48, 91, .08), 0 1px 2px rgba(10, 48, 91, .06);
  --shadow-md: 0 6px 24px rgba(10, 48, 91, .10);
  --gap: 24px;
  --font-head: "Poppins", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --ink: #1c2733;
  --ink-soft: #54616e;
  --line: #e4e9ef;
  --bg: #ffffff;
  --bg-soft: #f5f7fa;
}

/* ---------- TEEMA 1: tummansininen + vihreä ---------- */
.theme-1 {
  --brand: #0a305b;
  --brand-2: #86b839;
  --brand-2-dark: #6f9c2c;
  --on-brand: #ffffff;
  --hero-overlay: linear-gradient(120deg, rgba(10, 48, 91, .82), rgba(10, 48, 91, .45));
  --accent: var(--brand-2);
}

/* Fallback jos body-luokkaa ei jostain syystä ole */
body:not(.theme-1):not(.theme-2) {
  --brand: #0a305b;
  --brand-2: #86b839;
  --brand-2-dark: #6f9c2c;
  --on-brand: #ffffff;
  --hero-overlay: linear-gradient(120deg, rgba(10, 48, 91, .82), rgba(10, 48, 91, .45));
  --accent: var(--brand-2);
}

/* ============================ Perus ============================ */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--brand);
  line-height: 1.2;
  margin: 0 0 .5em;
  font-weight: 600;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; color: var(--ink-soft); }

a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-2-dark); }

img { max-width: 100%; display: block; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: 24px;
}

.section { padding: clamp(48px, 8vw, 96px) 0; }
.section--soft { background: var(--bg-soft); }

.eyebrow {
  display: inline-block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .8rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .6rem;
}

.lead { font-size: 1.1rem; max-width: 60ch; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .95rem;
  padding: .8rem 1.5rem;
  border-radius: 50px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, background .2s ease, color .2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn--primary,
.btn--accent { background: var(--brand-2); color: #fff; }
.btn--primary:hover,
.btn--accent:hover { background: var(--brand-2-dark); color: #fff; }
.btn--ghost { border-color: currentColor; color: var(--brand); background: transparent; }
.btn--light { background: #fff; color: var(--brand); }

/* ============================ Header ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffff;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 84px;
}
.brand img,
.site-header .custom-logo { height: 46px; width: auto; }
.custom-logo-link { display: inline-flex; align-items: center; }

.header-contact {
  display: flex;
  gap: 28px;
  font-size: .85rem;
  margin-left: auto;
}
.header-contact a { color: var(--ink-soft); }
.header-contact a:hover { color: var(--brand); }
.header-contact .label {
  display: block;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand-2-dark);
}

/* Navi – tummansininen palkki (nav-dark) */
.main-nav {
  background: var(--brand);
  border-top: none;
}
.main-nav .container { position: relative; }
.nav-inner {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-inner li { margin: 0; }
.nav-inner a {
  display: block;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .92rem;
  color: rgba(255, 255, 255, .85);
  padding: 16px 18px;
  border-bottom: 3px solid transparent;
  transition: color .2s ease, border-color .2s ease;
}
.nav-inner a:hover { color: #fff; }
.nav-inner a.is-active,
.nav-inner .current-menu-item > a,
.nav-inner a[aria-current="page"] {
  color: var(--brand-2);
  border-bottom-color: var(--brand-2);
}

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
  padding: 8px;
}

/* ============================ Hero ============================ */
.hero {
  position: relative;
  min-height: 72vh;
  display: grid;
  align-items: center;
  color: #fff;
  overflow: hidden;
}
.hero__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background:
    var(--hero-overlay),
    linear-gradient(120deg, var(--brand), var(--brand-2));
  background-size: cover;
  background-position: center;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--hero-overlay);
}
.hero__inner { position: relative; z-index: 2; max-width: 640px; }
.hero h1 { color: #fff; }
.hero .eyebrow { color: var(--brand-2); }
.hero p { color: rgba(255, 255, 255, .92); font-size: 1.15rem; }
.hero__actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 1.5rem; }

/* ============================ Tuotekortit ============================ */
.grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.card__media {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  display: grid;
  place-items: center;
  color: #fff;
}
.card__media img { width: 64px; height: 64px; opacity: .95; object-fit: contain; }
.card__body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.card__body h3 { margin-bottom: .35rem; }
.card__body p { font-size: .95rem; flex: 1; }
.card__link {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .9rem;
  color: var(--accent);
  margin-top: .5rem;
}
.card__link::after { content: " →"; }

/* ============================ Sisältö ============================ */
.split {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}
.media-frame {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }

.feature-list { list-style: none; padding: 0; margin: 1rem 0 0; }
.feature-list li {
  position: relative;
  padding: .35rem 0 .35rem 1.8rem;
  color: var(--ink-soft);
}
.feature-list li::before {
  content: "";
  position: absolute;
  left: 0; top: .85rem;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand-2);
}

/* Spec-taulukko */
.spec {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: .95rem;
}
.spec th, .spec td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.spec th { color: var(--brand); font-family: var(--font-head); width: 45%; }

/* Brändilogot rivissä */
.brand-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 1.5rem;
}
.brand-chip {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: .85rem;
  letter-spacing: .05em;
  padding: 10px 20px;
  border: 1px solid var(--line);
  border-radius: 50px;
  color: var(--brand);
  background: #fff;
}

/* ============================ Lomake ============================ */
.form {
  display: grid;
  gap: 18px;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  padding: clamp(24px, 4vw, 40px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.form .full { grid-column: 1 / -1; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-family: var(--font-head);
  font-weight: 500;
  font-size: .85rem;
  color: var(--brand);
}
.field label .req { color: #d23b3b; }
.field input,
.field textarea {
  font-family: inherit;
  font-size: .95rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand-2);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand-2) 25%, transparent);
  background: #fff;
}
.field textarea { resize: vertical; min-height: 130px; }
.field input:user-invalid,
.field textarea:user-invalid { border-color: #d23b3b; }
.form-note { font-size: .82rem; color: var(--ink-soft); }
.form-status,
.contact-response {
  grid-column: 1 / -1;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--brand-2-dark);
}
.contact-response--error { color: #d23b3b; }
.contact-response--success { color: var(--brand-2-dark); }

/* ============================ Footer ============================ */
.site-footer {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-top: 3px solid var(--brand-2);
  padding-top: 56px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}
.site-footer h4 { color: var(--brand); font-size: 1rem; margin-bottom: 1rem; }
.site-footer a { color: var(--ink-soft); }
.site-footer a:hover { color: var(--brand); }
.footer-logo { height: 44px; margin-bottom: 18px; }
.footer-list { list-style: none; padding: 0; margin: 0; }
.footer-list li { padding: 5px 0; }
.footer-map {
  border: 0;
  width: 100%;
  height: 200px;
  border-radius: var(--radius);
  filter: grayscale(.3);
}
.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-size: .82rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

/* ============================ Yleinen sivusisältö ============================ */
.site-main .page-content,
.entry-content {
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(48px, 8vw, 96px) 24px;
}
.screen-reader-text {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ============================ Responsiivisuus ============================ */
@media (max-width: 880px) {
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .form { grid-template-columns: 1fr; }
  .header-contact { display: none; }
  .nav-toggle { display: block; }
  .nav-inner {
    display: none;
    flex-direction: column;
    align-items: stretch;
  }
  .nav-inner.is-open { display: flex; }
  .nav-inner a { padding: 14px 0; border-bottom: 1px solid rgba(255, 255, 255, .1); }
  .nav-inner a.is-active { border-bottom-color: var(--brand-2); }
}
