:root {
  --text: #1a1a1a;
  --muted: #666;
  --bg: #fff;
  --bg-alt: #f7f7f5;
  --border: #e5e5e2;
  --link: #0066cc;
  --link-hover: #004499;
  --accent: #d4543c;
}

* { box-sizing: border-box; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  margin: 0;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.75rem 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}

.logo-icon { font-size: 1.5rem; }
.logo-text { letter-spacing: -0.02em; }
.logo-dot { color: var(--accent); }

/* Navigaatio */
.main-nav {
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0.25rem;
  align-items: center;
}

.nav-list > li {
  position: relative;
}

.nav-list > li > a {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.6rem 0.9rem;
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background 0.15s;
}

.nav-list > li > a:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.caret {
  font-size: 0.7rem;
  color: var(--muted);
  transition: transform 0.2s;
}

.has-dropdown:hover .caret { transform: rotate(180deg); }

/* Alasvetovalikko */
.dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  padding: 0.5rem;
  min-width: 280px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  z-index: 200;
}

.has-dropdown:hover > .dropdown,
.has-dropdown:focus-within > .dropdown,
.has-dropdown.is-open > .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.6rem 0.85rem;
  color: var(--text);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.dropdown a:hover {
  background: var(--bg-alt);
  color: var(--accent);
}

.dropdown a strong { display: block; font-weight: 600; }
.dropdown a .dd-meta { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }

/* Leveä alasveto (megamenu) */
.dropdown-wide {
  min-width: 760px;
  padding: 1.25rem;
}

.dropdown-cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
}

.dropdown-col h4 {
  margin: 0 0 0.5rem;
  padding-bottom: 0.4rem;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}

.dropdown-col a {
  padding: 0.35rem 0.5rem;
  font-size: 0.88rem;
}

/* Mobiili-toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  width: 40px;
  height: 40px;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s, opacity 0.2s;
}

.nav-toggle.is-active span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobiilinäkymä */
@media (max-width: 900px) {
  .nav-toggle { display: flex; }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 16px rgba(0,0,0,0.06);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
  }

  .main-nav.is-open {
    max-height: 80vh;
    overflow-y: auto;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    gap: 0;
  }

  .nav-list > li > a {
    padding: 0.85rem 1rem;
    border-radius: 0;
    border-bottom: 1px solid var(--bg-alt);
    justify-content: space-between;
  }

  .dropdown,
  .dropdown-wide {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0;
    min-width: 0;
    opacity: 1;
    visibility: visible;
    transform: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s;
    background: var(--bg-alt);
    border-radius: 0;
  }

  .has-dropdown.is-open > .dropdown,
  .has-dropdown.is-open > .dropdown-wide {
    max-height: 1500px;
    padding: 0.5rem 0;
  }

  .has-dropdown:hover > .dropdown,
  .has-dropdown:focus-within > .dropdown {
    /* hover-toiminta poistetaan mobiilissa, käytetään is-open */
    max-height: 0;
  }

  .has-dropdown.is-open > .dropdown,
  .has-dropdown.is-open > .dropdown-wide {
    max-height: 2000px;
  }

  .dropdown-cols {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  .dropdown a {
    padding: 0.7rem 1.5rem;
  }

  .dropdown-col h4 {
    padding: 0.5rem 1.5rem 0.35rem;
    margin: 0;
    border-bottom: none;
    background: var(--bg);
  }

  .dropdown-col a {
    padding: 0.6rem 2rem;
  }
}

/* Eski .site-header nav -tuki vanhoille käyttöpaikoille (jos vielä on) */
.site-header nav.legacy-nav {
  display: flex;
  gap: 1.5rem;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

.post-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 3rem;
}

@media (max-width: 768px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
}
.breadcrumb a:hover {
  color: var(--link);
}
.breadcrumb .sep {
  margin: 0 0.4rem;
}

.post h1 {
  font-size: 2rem;
  line-height: 1.2;
  margin: 0 0 0.75rem;
}

.post-meta {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.post-content {
  font-size: 1.05rem;
}

.post-content p {
  margin: 0 0 1.25rem;
}

.post-content h2 {
  font-size: 1.4rem;
  margin: 2rem 0 0.75rem;
}

.post-content h3 {
  font-size: 1.15rem;
  margin: 1.5rem 0 0.5rem;
}

.post-content a {
  color: var(--link);
}

.post-content a:hover {
  color: var(--link-hover);
}

.post-content img {
  max-width: 100%;
  height: auto;
}

.post-footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.back-link {
  color: var(--muted);
  text-decoration: none;
}
.back-link:hover {
  color: var(--link);
}

.post-sidebar {
  padding-top: 3rem;
}

.recent-posts h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 1rem;
  letter-spacing: 0.5px;
}

.recent-posts ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.recent-posts li {
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
  line-height: 1.4;
}

.recent-posts a {
  color: var(--text);
  text-decoration: none;
}

.recent-posts a:hover {
  color: var(--link);
}

.blog-layout .page-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.blog-layout h1 {
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-list-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
}

.post-list-item h2 {
  font-size: 1.3rem;
  margin: 0 0 0.25rem;
  line-height: 1.3;
}

.post-list-item h2 a {
  color: var(--text);
  text-decoration: none;
}

.post-list-item h2 a:hover {
  color: var(--link);
}

.post-list-date {
  color: var(--muted);
  font-size: 0.85rem;
}

.post-list-excerpt {
  color: var(--text);
  margin: 0.5rem 0 0.75rem;
}

.read-more {
  color: var(--link);
  text-decoration: none;
  font-size: 0.9rem;
}

.site-footer {
  margin-top: 4rem;
  padding: 2rem 0;
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
}

.site-footer .container {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}
