/* Kevytkannabis.com — style.css
   Yksi tiedosto koko sivustolle. Ei ulkoisia fontteja, ei kirjastoja. */

/* ---------- 1. Tokenit ---------- */
:root {
  --paper: #fbfbf9;
  --surface: #f2f1ec;
  --surface-2: #eae8e0;
  --rule: #dedcd3;
  --ink: #14201c;
  --ink-soft: #4e5b55;
  --pine: #1e4d3b;
  --pine-deep: #143427;
  --slate: #2f4858;
  --rust: #8a2a22;
  --amber-ink: #7a5200;
  --amber-bg: #fbf3de;

  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-data: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --s1: 4px;
  --s2: 8px;
  --s3: 12px;
  --s4: 16px;
  --s5: 24px;
  --s6: 32px;
  --s7: 48px;
  --s8: 64px;

  --measure: 68ch;
  --w-text: 720px;
  --w-wide: 1040px;
  --radius: 6px;
  --radius-lg: 8px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #101512;
    --surface: #182119;
    --surface-2: #1f2a22;
    --rule: #2c3a30;
    --ink: #e8eae6;
    --ink-soft: #a8b3ac;
    --pine: #7fbfa3;
    --pine-deep: #a6d8bf;
    --slate: #9fbdd0;
    --rust: #e39d94;
    --amber-ink: #e3bd72;
    --amber-bg: #2a2418;
  }
}

/* ---------- 2. Perusta ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1.0625rem;
  line-height: 1.65;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; height: auto; }

a {
  color: var(--pine);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
a:hover { color: var(--pine-deep); }

:focus-visible {
  outline: 3px solid var(--pine);
  outline-offset: 2px;
  border-radius: 2px;
}

h1, h2, h3 {
  line-height: 1.2;
  margin: 0 0 var(--s4);
  font-weight: 700;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 1.2rem + 0.8vw, 1.6rem); margin-top: var(--s7); }
h3 { font-size: 1.1rem; margin-top: var(--s6); font-weight: 650; }

p, ul, ol { margin: 0 0 var(--s4); }
li { margin-bottom: var(--s2); }

.eyebrow {
  font-family: var(--font-data);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin: 0 0 var(--s2);
}

/* ---------- 3. Layout ---------- */
.wrap { width: 100%; max-width: var(--w-text); margin-inline: auto; padding-inline: var(--s5); }
.wrap-wide { width: 100%; max-width: var(--w-wide); margin-inline: auto; padding-inline: var(--s5); }
main { display: block; padding-bottom: var(--s8); }
main p, main li { max-width: var(--measure); }
section { margin-bottom: var(--s6); }

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--pine);
  color: #fff;
  padding: var(--s3) var(--s4);
  z-index: 100;
}
.skip:focus { left: var(--s3); top: var(--s3); }

/* ---------- 4. Header ja navigaatio ---------- */
.site-header {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s4);
  min-height: 64px;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: var(--ink);
  text-decoration: none;
}
.logo svg { display: block; }

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  min-height: 44px;
  padding: var(--s2) var(--s3);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
}
.nav-toggle:hover { background: var(--surface); }
.nav-toggle-bars { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
}
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0 0 var(--s3);
}
.site-nav li { margin: 0; }
.site-nav a {
  display: block;
  padding: var(--s3) 0;
  min-height: 44px;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
  font-weight: 500;
}
.site-nav a:hover { color: var(--pine); }
.site-nav a[aria-current="page"] { color: var(--pine); font-weight: 650; }
.site-nav[hidden] { display: none; }

@media (min-width: 800px) {
  .nav-toggle { display: none; }
  .site-nav { display: block !important; }
  .site-nav[hidden] { display: block; }
  .site-nav ul { display: flex; gap: var(--s5); padding: 0; }
  .site-nav a { border-bottom: 0; padding: var(--s2) 0; min-height: 0; }
}

/* ---------- 5. Statusmerkki (signature) ---------- */
.status {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--slate);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s3) var(--s4);
  margin-bottom: var(--s3);
  max-width: 100%;
}
.status-label {
  font-family: var(--font-data);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--slate);
}
.status-meta {
  font-family: var(--font-data);
  font-size: 0.75rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}
.status--sallittu { border-left-color: var(--pine); }
.status--sallittu .status-label { color: var(--pine); }
.status--laake { border-left-color: var(--slate); }
.status--laake .status-label { color: var(--slate); }
.status--huume { border-left-color: var(--rust); }
.status--huume .status-label { color: var(--rust); }
.status--epaselva { border-left-color: var(--amber-ink); background: var(--amber-bg); }
.status--epaselva .status-label { color: var(--amber-ink); }

.status-row { display: flex; flex-wrap: wrap; gap: var(--s3); margin: var(--s5) 0; }
.status-row .status { margin-bottom: 0; }

/* ---------- 6. Kortit ---------- */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s3);
  padding: 0;
  margin: 0 0 var(--s4);
  list-style: none;
}
@media (min-width: 620px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .card-grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  margin: 0;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
}
.card a {
  display: block;
  padding: var(--s4);
  text-decoration: none;
  color: var(--ink);
  height: 100%;
}
.card a:hover { background: var(--surface-2); border-radius: var(--radius-lg); }
.card-title { display: block; font-weight: 650; color: var(--pine); margin-bottom: var(--s1); }
.card-desc { display: block; font-size: 0.95rem; color: var(--ink-soft); line-height: 1.5; }

/* ---------- 7. Taulukot ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 var(--s4); }
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 460px;
  font-size: 0.95rem;
}
caption {
  text-align: left;
  font-size: 0.85rem;
  color: var(--ink-soft);
  padding-bottom: var(--s2);
}
th, td {
  text-align: left;
  padding: var(--s3);
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}
th { font-weight: 650; }
thead th { border-bottom: 2px solid var(--rule); }
tbody tr:nth-child(odd) { background: var(--surface); }
td.num, th.num { font-family: var(--font-data); font-variant-numeric: tabular-nums; }

/* ---------- 8. Näyttöblokit (tutkimus / käytännössä / ei tiedetä) ---------- */
.evidence {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: var(--s4);
  margin: 0 0 var(--s3);
  background: var(--paper);
}
.evidence h3 { margin: 0 0 var(--s2); font-size: 1rem; }
.evidence p:last-child { margin-bottom: 0; }
.evidence--tutkimus { border-left: 3px solid var(--pine); }
.evidence--kaytannossa { border-left: 3px solid var(--slate); }
.evidence--tuntematon { border-left: 3px solid var(--amber-ink); }

/* ---------- 9. Huomiolaatikot ---------- */
.callout {
  border: 1px solid var(--rule);
  border-left: 3px solid var(--slate);
  border-radius: var(--radius);
  background: var(--surface);
  padding: var(--s4);
  margin: 0 0 var(--s5);
}
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout--varoitus { border-left-color: var(--rust); }
.callout--laki { border-left-color: var(--amber-ink); background: var(--amber-bg); }

/* ---------- 10. CTA ja mainostunniste ---------- */
.ad-label {
  display: inline-block;
  font-family: var(--font-data);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 2px var(--s2);
  margin-bottom: var(--s3);
}
.ad-note { font-size: 0.9rem; color: var(--ink-soft); margin-bottom: var(--s4); }

.cta {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--surface);
  padding: var(--s5);
  margin: 0 0 var(--s5);
}
.cta h2, .cta h3 { margin-top: 0; }
.cta-brand { font-weight: 700; font-size: 1.15rem; margin-bottom: var(--s2); }

.code-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); margin-bottom: var(--s4); }
.code {
  font-family: var(--font-data);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--paper);
  border: 1px dashed var(--rule);
  border-radius: var(--radius);
  padding: var(--s2) var(--s3);
}
.copy-btn {
  min-height: 44px;
  padding: var(--s2) var(--s4);
  border: 1px solid var(--pine);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--pine);
  font: inherit;
  font-size: 0.95rem;
  cursor: pointer;
}
.copy-btn:hover { background: var(--surface-2); }

.trust { list-style: none; padding: 0; margin: 0 0 var(--s5); font-size: 0.95rem; }
.trust li {
  padding-left: var(--s5);
  position: relative;
  color: var(--ink-soft);
}
.trust li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--pine);
}

.btn {
  display: inline-block;
  min-height: 48px;
  padding: 13px var(--s5);
  background: var(--pine);
  color: #fff;
  border: 0;
  border-radius: var(--radius-lg);
  font-weight: 650;
  text-decoration: none;
  box-shadow: 0 1px 2px rgb(20 32 28 / 0.12);
}
.btn:hover { background: var(--pine-deep); color: #fff; }
@media (prefers-color-scheme: dark) { .btn { color: #0f1512; } .btn:hover { color: #0f1512; } }
.btn--block { display: block; text-align: center; }
.cta-small { font-size: 0.85rem; color: var(--ink-soft); margin: var(--s3) 0 0; }

/* ---------- 11. Breadcrumb, meta, lähteet, FAQ ---------- */
.breadcrumb { font-size: 0.875rem; margin: var(--s4) 0 var(--s3); color: var(--ink-soft); }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: var(--s2); padding: 0; margin: 0; }
.breadcrumb li { margin: 0; }
.breadcrumb li + li::before { content: "› "; color: var(--ink-soft); }

.article-meta {
  font-family: var(--font-data);
  font-size: 0.8125rem;
  color: var(--ink-soft);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: var(--s3) 0;
  margin: 0 0 var(--s5);
}

.sources { font-size: 0.9rem; }
.sources ol { padding-left: var(--s5); }

details {
  border-bottom: 1px solid var(--rule);
  padding: var(--s3) 0;
}
details summary {
  cursor: pointer;
  font-weight: 650;
  min-height: 44px;
  display: flex;
  align-items: center;
  list-style: none;
}
details summary::-webkit-details-marker { display: none; }
details summary::before {
  content: "+";
  font-family: var(--font-data);
  color: var(--pine);
  margin-right: var(--s3);
  font-weight: 700;
}
details[open] summary::before { content: "−"; }
details > *:not(summary) { padding-left: var(--s5); }

/* ---------- 12. Footer ---------- */
.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--surface);
  padding: var(--s7) 0 var(--s6);
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s5);
  margin-bottom: var(--s6);
}
@media (min-width: 620px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .footer-grid { grid-template-columns: repeat(4, 1fr); } }
.footer-grid h2 { font-size: 0.8125rem; font-family: var(--font-data); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin: 0 0 var(--s3); font-weight: 700; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: var(--s2); }
.footer-grid a { color: var(--ink); text-decoration: none; }
.footer-grid a:hover { color: var(--pine); text-decoration: underline; }
.footer-legal { border-top: 1px solid var(--rule); padding-top: var(--s4); color: var(--ink-soft); font-size: 0.875rem; }
.footer-legal p { max-width: var(--measure); }
.footer-legal p:last-child { margin-bottom: 0; }

/* ---------- 13. Apuluokat ---------- */
.lead { font-size: 1.15rem; color: var(--ink-soft); }
.center { text-align: center; }
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
