/* ============================================================
   Leafwise — shared stylesheet
   Editorial "green & paper" system. Plain CSS, no frameworks.
   ============================================================ */

:root {
  --paper:      #FBF9F4;   /* page background */
  --surface:    #FFFFFF;
  --surface-2:  #F3F0E7;   /* tinted block */
  --ink:        #1C2A22;   /* near-black with green tint (headings) */
  --text:       #2E3A33;   /* body text */
  --muted:      #6B7268;   /* secondary text */
  --border:     #E2DCCF;
  --border-lt:  #EFEBE0;

  --green:      #2F6B4F;   /* primary accent (forest) */
  --green-dk:   #1F4E39;
  --green-soft: #E4EFE8;
  --sand:       #C9A36A;   /* warm highlight */
  --sand-soft:  #F3EAD9;
  --amber:      #B4692E;
  --amber-soft: #F6E7D9;
  --danger:     #9E3B2E;
  --danger-soft:#F6E0DC;

  --radius:     14px;
  --radius-sm:  10px;
  --shadow-sm:  0 1px 2px rgba(28,42,34,.06), 0 1px 3px rgba(28,42,34,.05);
  --shadow-md:  0 6px 20px rgba(28,42,34,.08);
  --maxw:       1120px;
  --serif:      "Fraunces", Georgia, "Times New Roman", serif;
  --sans:       "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--paper);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--ink);
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3.1rem); font-weight: 600; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); margin-top: 2em; }
h3 { font-size: 1.3rem; margin-top: 1.6em; }
h4 { font-size: 1.08rem; margin-top: 1.3em; }

p { margin: 0 0 1.1em; }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dk); text-decoration: underline; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.3em; }
li { margin: 0 0 .45em; }
li::marker { color: var(--green); }

img { max-width: 100%; height: auto; display: block; }

hr { border: none; border-top: 1px solid var(--border); margin: 2.5em 0; }

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  background: var(--surface-2);
  padding: .15em .4em;
  border-radius: 6px;
  font-size: .9em;
}

/* ---------- layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }

/* ---------- header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,249,244,.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border-lt);
}
.navbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 66px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--serif); font-weight: 600; font-size: 1.3rem;
  color: var(--ink); letter-spacing: -0.02em;
}
.brand svg { width: 30px; height: 30px; color: var(--green); }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex; align-items: center; gap: 26px;
  list-style: none; margin: 0; padding: 0;
}
.nav-links a {
  color: var(--text); font-weight: 500; font-size: .96rem;
  padding: 4px 0; position: relative;
}
.nav-links a:hover { color: var(--green); text-decoration: none; }
.nav-links a.active { color: var(--green); }
.nav-links a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 2px; background: var(--green); border-radius: 2px;
}

.nav-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 42px; height: 42px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); cursor: pointer; padding: 0;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  display: block; width: 20px; height: 2px; background: var(--ink);
}
.nav-toggle span { position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0;
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 56px;
  background:
    radial-gradient(1200px 380px at 80% -10%, var(--green-soft), transparent 60%),
    linear-gradient(180deg, var(--surface) 0%, var(--paper) 100%);
  border-bottom: 1px solid var(--border-lt);
}
.hero .eyebrow {
  display: inline-block; font-size: .82rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--green);
  margin-bottom: 14px;
}
.hero h1 { max-width: 16ch; }
.hero p.lead {
  font-size: 1.18rem; color: var(--muted); max-width: 56ch; margin-top: .6em;
}
.hero-actions { margin-top: 26px; display: flex; gap: 14px; flex-wrap: wrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: 10px; font-weight: 600;
  font-size: .98rem; cursor: pointer; border: 1px solid transparent;
  transition: transform .04s ease, background .15s ease;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dk); color: #fff; }
.btn-ghost { background: transparent; color: var(--green); border-color: var(--green); }
.btn-ghost:hover { background: var(--green-soft); }

/* ---------- cards / grids ---------- */
.grid { display: grid; gap: 22px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s ease, transform .06s ease, border-color .15s ease;
}
.card:hover { box-shadow: var(--shadow-md); border-color: #d6cda9; transform: translateY(-2px); }
.card h3 { margin-top: 0; font-size: 1.18rem; }
.card p { color: var(--muted); font-size: .96rem; margin: 0; }
.card .icon { color: var(--green); margin-bottom: 10px; }
.card .icon svg { width: 30px; height: 30px; }
.card .more { display: inline-block; margin-top: 12px; font-weight: 600; font-size: .92rem; }

.section { padding: 56px 0; }
.section.alt { background: var(--surface-2); border-top: 1px solid var(--border-lt); border-bottom: 1px solid var(--border-lt); }
.section-head { max-width: 60ch; margin-bottom: 30px; }
.section-head .eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .08em;
  text-transform: uppercase; color: var(--green);
}
.section-head p { color: var(--muted); font-size: 1.05rem; }

/* ---------- category tiles ---------- */
.tile { display: flex; gap: 16px; align-items: flex-start; }
.tile .icon {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 12px;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center;
}
.tile .icon svg { width: 24px; height: 24px; }
.tile h3 { margin: 0 0 4px; font-size: 1.12rem; }
.tile p { margin: 0; color: var(--muted); font-size: .94rem; }

/* ---------- article ---------- */
.page-header {
  padding: 52px 0 30px;
  border-bottom: 1px solid var(--border-lt);
}
.page-header .eyebrow {
  font-size: .82rem; font-weight: 600; letter-spacing: .07em;
  text-transform: uppercase; color: var(--green); margin-bottom: 10px;
  display: inline-block;
}
.page-header h1 { max-width: 20ch; }
.page-header .sub { color: var(--muted); font-size: 1.12rem; max-width: 60ch; }

.article { padding: 36px 0 60px; }
.article .body { font-size: 1.06rem; }
.article .body h2 { border-top: none; }
.article .body > p:first-of-type { font-size: 1.1rem; }

.byline {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
  padding: 16px 0; margin: 0 0 28px;
  border-top: 1px solid var(--border-lt); border-bottom: 1px solid var(--border-lt);
  color: var(--muted); font-size: .92rem;
}
.byline .avatar {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--green-soft); color: var(--green);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600;
}
.byline strong { color: var(--text); font-weight: 600; }
.byline .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }

/* ---------- callouts ---------- */
.callout {
  border: 1px solid var(--border); border-left: 4px solid var(--green);
  background: var(--surface); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 1.6em 0;
}
.callout h4 { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }
.callout.green  { background: var(--green-soft); border-color: var(--green); border-left-color: var(--green); }
.callout.amber  { background: var(--amber-soft);  border-left-color: var(--amber); }
.callout.danger { background: var(--danger-soft); border-left-color: var(--danger); }

/* ---------- table ---------- */
.table-wrap { overflow-x: auto; margin: 1.6em 0; }
table { width: 100%; border-collapse: collapse; font-size: .96rem; min-width: 520px; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border-lt); }
thead th { background: var(--surface-2); color: var(--ink); font-family: var(--serif); font-weight: 600; }
tbody tr:hover { background: var(--surface-2); }
td.yes { color: var(--green); font-weight: 600; }
td.no  { color: var(--danger); font-weight: 600; }

/* ---------- blockquote ---------- */
blockquote {
  margin: 1.6em 0; padding: 6px 0 6px 22px;
  border-left: 3px solid var(--sand); color: var(--ink);
  font-family: var(--serif); font-size: 1.15rem; font-style: italic;
}

/* ---------- illustration figure ---------- */
.figure { margin: 1.8em 0; }
.figure .frame {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm);
}
.figure svg { width: 100%; height: auto; display: block; }
.figure figcaption { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 10px; }

/* ---------- real photos ---------- */
.hero-photo { margin: 0 0 26px; }
.hero-photo img { width: 100%; height: auto; display: block; border-radius: var(--radius);
  background: #eef0ea; box-shadow: var(--shadow-sm); border: 1px solid var(--border); }
.hero-photo figcaption { text-align: right; color: var(--muted); font-size: .82rem; margin-top: 8px; }

/* ---------- steps ---------- */
.steps { counter-reset: step; list-style: none; padding: 0; margin: 1.6em 0; }
.steps > li {
  position: relative; padding: 0 0 18px 52px; margin: 0 0 6px;
  border-left: 2px solid var(--border-lt); min-height: 40px;
}
.steps > li:last-child { border-left-color: transparent; }
.steps > li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green); color: #fff; font-weight: 700;
  display: grid; place-items: center; font-family: var(--serif);
}
.steps > li h4 { margin: 4px 0 4px; }
.steps > li p { margin: 0; color: var(--muted); }

/* ---------- breadcrumb ---------- */
.breadcrumb { font-size: .86rem; color: var(--muted); padding: 18px 0 0; }
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--green); }

/* ---------- TOC ---------- */
.toc {
  background: var(--surface-2); border: 1px solid var(--border-lt);
  border-radius: var(--radius); padding: 18px 22px; margin: 1.8em 0;
}
.toc h4 { margin: 0 0 8px; font-family: var(--sans); font-size: .82rem;
  letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc a { color: var(--text); }

/* ---------- FAQ ---------- */
.faq { margin: 1.4em 0; }
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 4px 18px; margin-bottom: 10px; background: var(--surface);
}
.faq summary {
  cursor: pointer; font-weight: 600; color: var(--ink);
  padding: 12px 0; list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; float: right; color: var(--green); font-weight: 700; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 0 0 14px; color: var(--text); }

/* ---------- related ---------- */
.related { margin-top: 40px; }
.related .card h3 { font-size: 1.05rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfd8d1; padding: 52px 0 28px; margin-top: 40px; }
.site-footer h4 { color: #fff; font-family: var(--sans); font-size: .82rem;
  letter-spacing: .07em; text-transform: uppercase; margin: 0 0 14px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-brand { font-family: var(--serif); font-size: 1.25rem; color: #fff; display: flex; gap: 10px; align-items: center; }
.footer-brand svg { width: 26px; height: 26px; color: var(--sand); }
.site-footer a { color: #cfd8d1; }
.site-footer a:hover { color: #fff; text-decoration: none; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 0 0 9px; font-size: .94rem; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 34px; padding-top: 18px;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .86rem; color: #9fae9f;
}

/* ---------- misc ---------- */
.tag {
  display: inline-block; font-size: .78rem; font-weight: 600;
  background: var(--green-soft); color: var(--green-dk);
  padding: 3px 10px; border-radius: 999px; margin: 0 6px 6px 0;
}
.pull-stat { display: flex; gap: 28px; flex-wrap: wrap; margin: 1.6em 0; }
.pull-stat .item { flex: 1 1 140px; }
.pull-stat .num { font-family: var(--serif); font-size: 2rem; color: var(--green); font-weight: 600; }
.pull-stat .lbl { color: var(--muted); font-size: .92rem; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}
@media (max-width: 768px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none; position: absolute; top: 66px; left: 0; right: 0;
    flex-direction: column; gap: 0; background: var(--paper);
    border-bottom: 1px solid var(--border-lt); padding: 8px 24px 16px;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open { display: flex; }
  .nav-links li { padding: 12px 0; border-bottom: 1px solid var(--border-lt); }
  .nav-links li:last-child { border-bottom: none; }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 0 40px; }
}

/* ---------- print ---------- */
@media print {
  .nav-toggle, .site-header, .site-footer, .related, .toc { display: none; }
}

/* ---------- cookie consent banner (EU CMP) ---------- */
.cmp {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: center; padding: 16px;
  background: rgba(28, 42, 34, 0.30); backdrop-filter: blur(2px);
}
.cmp[hidden] { display: none; }
.cmp-card {
  width: min(720px, 100%); background: var(--paper);
  border: 1px solid var(--border-lt); border-radius: 14px;
  box-shadow: var(--shadow-md); padding: 18px 20px;
}
.cmp-text { margin: 0 0 14px; color: var(--ink); font-size: .95rem; line-height: 1.55; }
.cmp-text a { color: var(--green); }
.cmp-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.cmp-btn {
  border: 0; border-radius: 10px; padding: 10px 18px; cursor: pointer;
  font: 600 .92rem/1 var(--sans, system-ui, sans-serif); color: #fff;
  background: var(--green); transition: background .15s;
}
.cmp-btn:hover { background: var(--green-dk); }
.cmp-btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--border-lt); }
.cmp-btn.ghost:hover { background: var(--green-soft); }
@media (max-width: 768px) {
  .cmp-actions { justify-content: stretch; }
  .cmp-btn { flex: 1; text-align: center; }
}
