/* =============================
   Base reset
============================= */

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #222;
  background: #fff;
  line-height: 1.7;
}

/* =============================
   Global links
============================= */

a {
  color: #111;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* =============================
   Layout
============================= */

.appbar {
  border-bottom: 1px solid #e0e0e0;
  background: #fff;
}

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

.logo {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #111;
}

nav a {
  font-size: 0.95rem;
  color: #555;
}

/* =============================
   Main container
============================= */

main {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.75rem 1rem 1.25rem;
}

/* =============================
   Typography
============================= */

h1 {
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 0 2.25rem;
  color: #111;
}

p {
  font-size: 1.05rem;
  margin: 0 0 1.35rem;
  color: #222;
}

/* Article-specific text tuning */
article p {
  max-width: 65ch;
}

/* =============================
   Notices
============================= */

.notices {
  border-left: 3px solid #bec5a9;
  padding-left: 1rem;
  margin-bottom: 2.25rem;
}

.notices p {
  font-size: 0.9rem;
  color: #5f6456; /* hieman lämmin harmaa, ei suoraa vihreää */
  line-height: 1.5;
  margin-bottom: 0.75rem;
}


/* =============================
   Homepage intro
============================= */

.intro p {
  font-size: 1.05rem;
  color: #333;
  margin-bottom: 1.25rem;
  max-width: 65ch;
}

/* =============================
   Article lists (index & clusters)
============================= */

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

.article-list li {
  margin-bottom: 0.75rem;
}

.article-list a {
  font-size: 1.05rem;
}

/* =============================
   Cluster intro
============================= */

.cluster-intro h1 {
  margin-bottom: 1.25rem;
}

.cluster-intro p {
  max-width: 65ch;
  margin-bottom: 2.5rem;
  color: #333;
}

/* =============================
   Footer
============================= */

.footer {
  border-top: 1px solid #e6e6e6;
  padding: 2rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  background-color: rgba(190, 197, 169, 0.08);
}

/* =============================
   Homepage clusters
============================= */

.clusters {
  margin-top: 2.5rem;
}

.cluster {
  margin-bottom: 1.75rem;
}

.cluster summary {
  font-size: 1.1rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: #111;
}

.cluster summary::-webkit-details-marker {
  display: none;
}

.cluster summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.5rem;
  transform: translateY(-1px);
}

.cluster[open] summary::before {
  content: "▾";
}

.cluster ul {
  list-style: none;
  padding-left: 1.5rem;
  margin-top: 0.75rem;
}

.cluster li {
  margin-bottom: 0.5rem;
}

.cluster a {
  font-size: 1.02rem;
}

.clusters-intro {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 1.75rem;
  max-width: 65ch;
}

/* =============================
   Navigator wrapper
============================= */

.navigator-wrapper {
  margin: 1.75rem auto 2rem;
  padding: 1.5rem 1.5rem;

  background: #fafafa;
  border: 1px solid #e6e6e6;
  border-radius: 12px;
}

/* =============================
   Navigator layout
============================= */

.navigator {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(260px, 1.2fr);
  gap: 1.1rem;
}


/* =============================
   Select styling
============================= */

.navigator select {
  width: 100%;

  font-size: 0.95rem;
  line-height: 1.25;

  padding: 0.7rem 0.9rem;

  border-radius: 8px;
  border: 1px solid #cfcfcf;

  background-color: #ffffff;
  color: #111;

  appearance: none;
  -webkit-appearance: none;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background-color 0.15s ease;
}


.navigator select:hover {
  border-color: #bec5a9;
}

.navigator select:focus {
  outline: none;
  border-color: #bec5a9;
  box-shadow: 0 0 0 2px rgba(190, 197, 169, 0.25);
}


.navigator select:disabled {
  background-color: #f3f3f3;
  color: #888;
  border-color: #ddd;
  cursor: not-allowed;
}


/* =============================
   Mobile behavior
============================= */

@media (max-width: 720px) {
  .navigator-wrapper {
    padding: 1.75rem 1.5rem;
  }

  .navigator {
    grid-template-columns: 1fr;
  }
}


.intro-divider {
  width: 48px;
  height: 1px;
  background: #ddd;
  margin: 1.25rem auto 1.75rem;
}

.intro strong {
  font-weight: 600;
}

.hint {
  font-size: 0.9rem;
  color: #777;
  margin-top: 1rem;
  max-width: 65ch;
}


.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.logo-mark {
  font-weight: 400;
  font-size: 0.9em;
  letter-spacing: 0.02em;
  color: #555;
  transform: translateY(-0.02em);
}

:root {
  --accent: #bec5a9;
}

.logo-dots {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 0.15rem;
}

.logo-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent);

  /* tekee niistä pehmeämmät, ei-nappulamaiset */
  opacity: 0.9;
}



/* =============================
   Homepage entry section
============================= */

.entry {
  max-width: 820px;
  margin: 0.5rem auto 0.75rem;
  padding: 2.25rem;

  background: #ffffff;
  border-radius: 16px;

  /* brändiaksentit */
  border-left: 4px solid var(--brand-accent, #bec5a9);
  border-top: 4px solid var(--brand-accent, #bec5a9);

  /* kevyt kehys */
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.04),
    0 8px 24px rgba(0, 0, 0, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.03);
}



.entry-intro {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #222;

  max-width: 60ch;
  margin: 0 auto 2.5rem;
}

.navigator-wrapper {
  margin: 0 auto;
  padding: 0;

  background: none;
  border: none;
}

.entry-hint {
  font-size: 0.9rem;
  color: #777;

  margin-top: 1.75rem;
  text-align: center;
}

@media (max-width: 720px) {
  .entry {
    margin: 0.25rem auto 0.5rem;
    padding: 1.75rem 1.5rem;
  }

  .entry-intro {
    font-size: 1.05rem;
  }
}

.entry-stats {
  margin-top: 1.25rem;

  display: flex;
  justify-content: center;
  gap: 1.25rem;

  font-size: 0.9rem;
  color: #666;
}

.entry-stats .stat {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.entry-stats .pill {
  display: inline-block;

  padding: 0.15rem 0.55rem;
  border-radius: 999px;

  background-color: var(--accent);
  color: #111;

  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1;
}

.appbar-nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-btn {
  background: none;
  border: none;
  font-size: 1.05rem;
  cursor: pointer;
}


.search-overlay {
  position: absolute;
  top: var(--appbar-height);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: none;
  z-index: 20;
}

.search-overlay.is-open {
  display: block;
}


.search-panel {
  background: #fff;
  width: min(700px, 92%);
  border-radius: 10px;
  padding: 1rem;
}

.search-panel input {
  width: 100%;
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

#search-results {
  list-style: none;
  margin-top: 0.75rem;
  padding: 0;
}

#search-results li a {
  display: block;
  padding: 0.5rem 0;
  text-decoration: none;
  color: #111;
}

.search-overlay {
  position: absolute;
  top: var(--appbar-height);
  left: 0;
  right: 0;
  background: #fff;
  border-bottom: 1px solid #e5e5e5;
  display: none;
  z-index: 20;
}

.search-overlay.is-open {
  display: block;
}

.result-title {
  display: block;
}

.result-cluster {
  font-size: 0.75rem;
  color: #777;
}

/* ----------------------------
   All Articles controls
---------------------------- */

.article-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  max-width: 860px;
  margin: 28px 0 36px;
}

.article-controls select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #d6d6d6;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.article-controls select:focus {
  outline: none;
  border-color: #9aa37a; /* brändivihreä */
}

/* ----------------------------
   All Articles controls
---------------------------- */

.article-controls {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  max-width: 860px;
  margin: 28px 0 36px;
}

.article-controls select {
  width: 100%;
  padding: 12px 14px;
  font-size: 15px;
  border-radius: 10px;
  border: 1px solid #d6d6d6;
  background: #fff;
  color: #111;
  cursor: pointer;
}

.article-controls select:focus {
  outline: none;
  border-color: #cfd7b3; /* brändivihreä */
}

/* ----------------------------
   Cluster pill
---------------------------- */

.cluster-pill {
  font-size: 11px;
  padding: 0px 8px;
  border-radius: 999px;
  background: #cfd7b3;   /* sama sävy kuin hero */
  color: #2e3322;
  white-space: nowrap;
}

.article-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}


/* ----------------------------
   Mobile layout for article rows
---------------------------- */

@media (max-width: 640px) {
  .article-list a {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .cluster-pill {
    margin-left: 0;
  }
}

.search-panel {
  position: sticky;
  top: var(--appbar-height, 64px);
  z-index: 1000;

  background: #fff;
  border-bottom: 1px solid #e5e5e5;

  padding: 12px 16px;
  display: none;
}

.search-panel.is-open {
  display: block;
}

.search-panel {
  max-width: 960px;        /* sama leveys kuin content */
  margin: 0 auto;
  padding: 16px;
}


#search-input {
  width: 100%;
  font-size: 16px;
  padding: 10px 12px;
}

#search-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

#search-results li a {
  display: flex;
  justify-content: space-between;
  gap: 10px;

  padding: 8px 4px;
  text-decoration: none;
  color: inherit;
}

#search-results li a:hover {
  background: #f5f5f5;
}

.result-cluster {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #cfd7b5; /* brändiväri */
}

#search-results {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
}

/* Yksi tulos */
#search-results li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f0f0;
  text-decoration: none;
  color: inherit;
}

/* Title */
.result-title {
  font-size: 16px;
  line-height: 1.4;
  flex: 1;
}

/* Cluster pill */
.result-cluster {
  background: #d7ddbb;
  color: #4a4f32;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

@media (max-width: 640px) {
  #search-results li a {
    flex-direction: column;
    align-items: flex-start;
  }

  .result-cluster {
    margin-top: 2px;
    font-size: 12px;
  }
}

/* Search result cluster pill */
.search-panel .result-cluster {
  font-size: 11px;
  line-height: 1;
  padding: 4px 10px;
  border-radius: 999px;

  background: #cfd7b3;     /* brändiväri */
  color: #4b4f3a;

  white-space: nowrap;
}

.footer-notice {
  max-width: 700px;
  margin: 0 auto 1rem;
  padding: 1.1rem 1.25rem;

  font-size: 0.85rem;
  line-height: 1.5;
  color: #555;

  background: #ffffff;
  border-radius: 10px;

  /* brändiaksentti */
  border-bottom: 4px solid var(--brand-accent, #bec5a9);
  border-right: 4px solid var(--brand-accent, #bec5a9);

  /* sama shadow-logiikka, hillitympi */
  box-shadow:
    inset 0 0 0 2px rgba(0, 0, 0, 0.04),
    0 6px 16px rgba(0, 0, 0, 0.035),
    0 1px 4px rgba(0, 0, 0, 0.025);
}



.article-card {
  max-width: 720px;
  margin: 1.75rem auto;
  padding: 2.25rem 2.25rem;

  background: #ffffff;
  border-radius: 18px;

  /* brändiaksentit */
  border-left: 4px solid var(--brand-accent, #bec5a9);
  border-top: 4px solid var(--brand-accent, #bec5a9);

  /* muu kehys erittäin hillitty */
  border-right: 1px solid rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);

  /* editoriaalinen koho */
  box-shadow:
    0 8px 24px rgba(0, 0, 0, 0.04),
    0 2px 6px rgba(0, 0, 0, 0.03);
}

/* =========================
   BASE / DESKTOP
   ========================= */

.site-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Nav links – desktop */
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.5rem;

  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  list-style: none;
}

/* =========================
   SEARCH BUTTON
   ========================= */

.search-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.search-btn svg {
  width: 20px;
  height: 20px;
  stroke: var(--brand-accent, #bec5a9);
  stroke-width: 2;
  fill: none;
}

/* =========================
   HAMBURGER TOGGLE
   ========================= */

.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;

  flex-direction: column;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  height: 2px;
  width: 22px;
  background: #111;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* =========================
   MOBILE
   ========================= */

@media (max-width: 768px) {

  /* show hamburger */
  .nav-toggle {
    display: flex;
  }

  /* hide nav by default */
  .nav-links {
    display: none;
    position: absolute;
    top: 56px;
    right: 0.75rem;

    width: 220px;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;

    background: #ffffff;
    border-radius: 14px;
    padding: 1.25rem;

    box-shadow:
      0 12px 30px rgba(0,0,0,0.08),
      0 4px 10px rgba(0,0,0,0.04);
  }

  /* open state */
  .nav-links.is-open {
    display: flex;
    animation: navDrop 0.25s ease-out;
  }
}

/* =========================
   ANIMATION
   ========================= */

@keyframes navDrop {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (min-width: 769px) {
  .site-nav {
    gap: 1rem;
  }
}

#search-input {
  border: 1px solid #d0d0d0;
  outline: none;
}

#search-input:focus {
  border-color: var(--brand-accent, #bec5a9);
  box-shadow: 0 0 0 2px color-mix(
    in srgb,
    var(--brand-accent, #bec5a9) 35%,
    transparent
  );
  outline: none;
}

.footer-meta p {
  margin-bottom: 0;
}


.footer-links {
  display: flex;
  justify-content: center;
  gap: 1.25rem;
  margin-bottom: 0.75rem;
  font-size: 0.85rem;
}

.footer-links a {
  color: #888;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

.page.not-found {
  max-width: 640px;
  margin: 6rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.page.not-found h1 {
  font-size: 2rem;
  margin-bottom: 1.5rem;
}

.page.not-found p {
  color: #555;
  margin-bottom: 1.25rem;
}

.not-found-actions {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.not-found-actions a {
  text-decoration: none;
  padding: 0.7rem 1.2rem;
  border-radius: 999px;
  font-size: 0.95rem;
}

.btn-primary {
  background: var(--brand-accent, #bec5a9);
  color: #111;
}

.btn-secondary {
  border: 1px solid var(--brand-accent, #bec5a9);
  color: #111;
}

.appbar {
  background-color: rgba(190, 197, 169, 0.08);
}

