/* --- Base --- */
:root{
  --bg: #f5f1e8;
  --text: #222;
  --primary: #2a4d7a;
  --primary-dark: #1a2e4b;
  --accent: #5A1624;
  --accent-dark: #3a0e17;
  --panel: #e3eaf5;
  --panel-2: #f7f7fa;
  --border: #cfd8dc;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0 1em;

  /* NEW: prevent overly wide lines on large screens */
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

/* Improve readability */
p{
  line-height: 1.6;
  margin: 0.6em 0;
}

/* --- Headings --- */
h1 {
  color: var(--primary);
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: 2px;
  padding-bottom: 0.3em;
  margin: 1.2em 0 0.4em;
}

h2 {
  color: var(--primary-dark);
  font-size: 1.7em;
  font-weight: 600;
  background: var(--panel);
  padding: 0.25em 0.6em;
  border-radius: 8px;
  margin: 1.4em 0 0.6em;
}

h3 {
  color: #4b6fa1;
  font-size: 1.3em;
  margin: 1.2em 0 0.4em;
}

h4 {
  color: var(--text);
  font-size: 1.1em;
  text-transform: uppercase;
  margin-top: 0.8em;
}

h5 {
  color: #666;
  font-size: 1em;
  font-weight: 400;
  margin-top: 0.6em;
}

h6 {
  color: #999;
  font-size: 0.9em;
  font-weight: 300;
  margin-top: 0.4em;
}
/* --- */

.site-title {
  font-size: 2.4em;
  margin-bottom: 0.2em;
}

.tagline {
  font-size: 1.8em;
}

/* HERO fills one viewport so next section starts below the fold */
.hero{
  min-height: 100vh;              /* täyttää yhden näytön */
  display: flex;
  flex-direction: column;
  justify-content: center;         /* keskittää sisällön pystysuunnassa */
  align-items: center;             /* keskittää vaakasuunnassa */
  text-align: center;
  gap: 1.2rem;                     /* tasainen väli elementeille */
  padding: 2rem 1rem;
}

/* Prevent huge margins from pushing content */
.hero-title{
  margin: 0;
  line-height: 1.15;
  letter-spacing: 0.5px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-title span{
  display: block;
}

/* site-name jos käytät sitä */
.site-name{
  margin: 0;
  font-size: clamp(1.4rem, 2.2vw, 2.2rem);
  font-weight: 700;
  color: var(--primary);
}

/* Optional: ensure next section starts clearly after hero */
.content-start{
  padding-top: 0.5rem;
}

/* --- Images --- */
.center-img {
  display: block;
  margin: 1.2em auto;
  max-width: min(80%, 920px);
  height: auto;
}

/* --- Lists --- */
ul, ol {
  padding-left: 1.1em;
  margin: 0.4em 0 0.9em;
}

ul li, ol li {
  line-height: 1.5;
  margin: 0.25em 0;
}

/* If you choose to use <ul class="questions"> */
ul.questions {
  padding-left: 1.1em !important;
  margin-left: 0 !important;
}

/* --- Text emphasis --- */
strong { color: var(--primary-dark); }

/* --- Links --- */
a {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--primary-dark);
  text-decoration: none;
}

/* --- Buttons --- */
.button-center {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 1.6em 0 0;
}

.button-test {
  display: inline-block;
  padding: 0.85em 2.1em;
  background-color: var(--accent);
  color: #fff;
  text-align: center;
  font-size: 1.1em;
  font-weight: 700;
  text-decoration: none;
  border-radius: 12px;
  border: none;
  box-shadow: var(--shadow);
  transition: transform 0.08s ease, background 0.2s ease;
  cursor: pointer;
}

.button-test:hover { background-color: var(--accent-dark); }
.button-test:active { transform: translateY(1px); }

/* --- Navbar --- */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--panel);
  padding: 0.6em 1em;
  border-radius: 10px;
  margin-top: 1em;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
  overflow: visible;
}

/* Left side navigation */
.nav-left {
  display: flex;
  align-items: center;
  gap: 1em;
}

/* All top-level nav links */
.nav-left a {
  text-decoration: none;
  color: var(--primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
}

/* Dropdown wrapper */
.nav-item {
  position: relative;
}

/* Dropdown panel */
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 340px;
  background: #fff;
  border: 1px solid rgba(207,216,220,0.9);
  border-radius: 12px;
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  padding: 0.6em;
  z-index: 10000;
}

/* Show dropdown */
.nav-item:hover .dropdown,
.nav-item:focus-within .dropdown {
  display: block;
}

/* Dropdown links */
.dropdown a {
  display: block;
  padding: 0.55em 0.65em;
  border-radius: 10px;
  text-decoration: none;
  color: var(--primary);
  font-weight: 600;
}

.dropdown a:hover {
  background: var(--panel);
}

/* Helper text */
.dropdown .hint {
  display: block;
  padding: 0.35em 0.65em 0.65em;
  color: #555;
  font-weight: 400;
  font-size: 0.95em;
}

/* Right side (language buttons) */
.nav-right a {
  margin-left: 0.5em;
  padding: 0.25em 0.7em;
  text-decoration: none;
  color: var(--accent);
  font-weight: 700;
  border-radius: 8px;
  background: var(--panel-2);
  transition: background 0.2s ease;
}

.nav-right a:hover {
  background: var(--panel);
}

.nav-right a.active {
  background: #fff;
  outline: 2px solid rgba(90,22,36,0.25);
}

/* --- Tables --- */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.8em 0;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 10px;
  overflow: hidden; /* helps rounded corners */
}

th, td {
  border: 1px solid var(--border);
  padding: 0.8em;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--panel);
  color: var(--primary);
}

/* Responsive: allow horizontal scroll on small screens */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.2em 0;
}

/* --- Footer --- */
footer {
  margin-top: 2em;
  padding: 1em 0;
  background: var(--panel);
  border-radius: 10px;
  text-align: center;
}

/* --- Cookie banner --- */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--primary-dark);
  color: #fff;
  padding: 1em;
  display: none;
  justify-content: space-between;
  align-items: center;
  z-index: 9999;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.cookie-banner p {
  margin: 0;
  font-size: 0.95em;
}

.cookie-buttons button {
  margin-left: 0.5em;
  padding: 0.45em 1.05em;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 800;
}

.cookie-buttons button:first-child {
  background: var(--accent);
  color: #fff;
}

.cookie-buttons button:last-child {
  background: #ccc;
  color: var(--text);
}

.brand {
  display: inline-flex;
  flex-direction: column;   /* ← tärkein muutos */
  align-items: center;      /* keskittää vaakasuunnassa */
  gap: 0.4em;               /* väli logon ja tekstin väliin */
  text-decoration: none;
}

.brand-logo {
  width: 60px;
  height: 60px;
  display: block;
}

.brand-name {
  font-size: 1.3em;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--primary);
}

/* --- Small screens --- */

.blog-trigger { cursor: default; }
.blog-trigger:hover { text-decoration: underline; }

.blog-top {
  margin-top: 1em;
  margin-bottom: 1.5em;
}

.back-link {
  text-decoration: none;
  font-weight: 600;
  color: var(--primary);
}

.back-link:hover {
  text-decoration: underline;
}

.blog-article {
  max-width: 780px;
  margin: 0 auto;
}

.blog-meta {
  color: #666;
  font-size: 0.9em;
  margin-bottom: 1.5em;
}


*/
/* ============================= */
/*        MOBILE OPTIMISATION    */
/* ============================= */

@media (max-width: 720px){

  /* 1) Etusivu näkyy heti */
  .hero{
    min-height: auto;
    padding: 1.2rem 0.6rem;
  }
  h1{ font-size: 1.75rem; }

  /* 2) Navbar tiiviiksi */
  .navbar{
    padding: 0.6em 0.6em;
    gap: 0.6em;
    flex-wrap: wrap;           /* sallii 2 riviä */
    align-items: center;
  }

  /* brand pienemmäksi */
  .brand-logo{ width: 48px; height: 48px; }
  .brand-name{ font-size: 1.05em; }

  /* 3) Nav-linkit yhdeksi “rullaavaksi riviksi” */
  .nav-left{
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.6em;
    flex-wrap: nowrap;
  }

  /* Oletus: nav-linkit ovat .nav-left sisällä <a>... */
  .nav-left a{
    white-space: nowrap;
  }

  /* Tee linkkilistasta rullaava (jos sinulla on erillinen wrapper, laita siihen) */
  .nav-left{
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25em;
  }

  /* 4) Oikean reunan napit tiiviiksi */
  .nav-right{
    width: 100%;
    display: flex;
    gap: 0.5em;
    justify-content: flex-start;
    flex-wrap: wrap;
  }
  .button-test{
    padding: 0.55em 0.8em;     /* pienempi CTA mobiilissa */
    font-size: 0.95em;
  }

  /* 5) Dropdown mobiilissa pois (tai vähintään ei hover-logiikkaa) */
  .dropdown{ display: none; }  /* suositus: mobiilissa pelkkä Blog-linkki */
}

