/* =========================================================================
   Avansert Matteregner & Kalkulator — design system
   Light + dark theme, mobile-first, fast. Tier-1 clean aesthetic.
   ========================================================================= */
:root{
  --bg:#f6fae9; --surface:#ffffff; --surface-2:#f3f7e3;
  --text:#1a2010; --muted:#5f6b4e; --border:#dde3c4; --border-soft:#e8edd6;
  --accent:#65a30d; --accent-2:#4d7c0f; --accent-ink:#ffffff;
  --ring:rgba(101,163,13,.18); --shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px rgba(30,41,10,.06);
  --radius:16px; --radius-sm:11px; --maxw:1120px;
}
:root[data-theme=dark]{
  --bg:#12160c; --surface:#1a1f12; --surface-2:#20261699; --text:#eef2e2; --muted:#a7b394;
  --border:#2c341d; --border-soft:#242b17; --accent:#8fce34; --accent-2:#a3e04a; --accent-ink:#14180d;
  --ring:rgba(143,206,52,.22); --shadow:0 1px 2px rgba(0,0,0,.3),0 10px 30px rgba(0,0,0,.35);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{
  margin:0; background:var(--bg); color:var(--text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,Roboto,Helvetica,Arial,sans-serif;
  -webkit-font-smoothing:antialiased; line-height:1.6; letter-spacing:-.01em;
}
.container{max-width:var(--maxw); margin:0 auto; padding:0 20px}
a{color:var(--accent-2); text-decoration:none}
a:hover{text-decoration:underline}
img{max-width:100%; height:auto}
h1,h2,h3{line-height:1.22; letter-spacing:-.02em}
.no-print{}
@media print{.no-print{display:none!important}}

/* scroll progress bar */
.progress{position:fixed; top:0; left:0; height:3px; width:0; background:linear-gradient(90deg,var(--accent),var(--accent-2)); z-index:100; transition:width .1s}

/* ============ Nav ============ */
.site-nav{position:sticky; top:0; z-index:50; background:color-mix(in srgb,var(--surface) 88%,transparent); backdrop-filter:saturate(1.4) blur(10px); border-bottom:1px solid var(--border-soft)}
.nav-inner{display:flex; align-items:center; gap:16px; height:64px}
.brand{display:flex; align-items:center; gap:10px; font-weight:800; color:var(--text)!important; text-decoration:none!important; font-size:19px}
.brand-logo{height:34px; width:auto}
.logo{width:36px; height:36px; border-radius:10px; background:linear-gradient(135deg,var(--accent),var(--accent-2)); display:grid; place-items:center; flex-shrink:0}
.brand-text span{color:var(--accent-2)}
.nav-links{display:flex; align-items:center; gap:4px; margin-left:auto}
.nav-links>a,.nav-drop-btn{padding:9px 13px; border-radius:10px; color:var(--text); font-weight:600; font-size:15px; background:none; border:0; cursor:pointer; font-family:inherit}
.nav-links>a:hover,.nav-drop-btn:hover{background:var(--surface-2); text-decoration:none}
.nav-drop{position:relative}
.nav-drop-menu{position:absolute; top:calc(100% + 8px); left:0; min-width:260px; background:var(--surface); border:1px solid var(--border); border-radius:14px; box-shadow:var(--shadow); padding:8px; display:none; grid-template-columns:1fr; gap:2px; z-index:60}
.nav-drop.open .nav-drop-menu{display:grid}
.nav-drop-menu a{padding:9px 12px; border-radius:9px; color:var(--text); font-weight:600; font-size:14px}
.nav-drop-menu a:hover{background:var(--surface-2); text-decoration:none}
.nav-drop-all{color:var(--accent-2)!important; border-top:1px solid var(--border-soft); margin-top:4px; padding-top:11px!important}
.icon-btn{display:inline-grid; place-items:center; width:42px; height:42px; border-radius:11px; border:1px solid var(--border); background:var(--surface); color:var(--text); cursor:pointer}
.icon-btn:hover{background:var(--surface-2)}
.mobile-only{display:none}
.mobile-nav{display:none; flex-direction:column; padding:8px 20px 16px; border-top:1px solid var(--border-soft); background:var(--surface)}
.mobile-nav a{padding:12px 8px; border-radius:9px; color:var(--text); font-weight:600; border-bottom:1px solid var(--border-soft)}
.mobile-nav.open{display:flex}

/* ============ Layout ============ */
.page{padding:28px 20px 60px; min-height:60vh}
.section-title{font-size:26px; margin:0 0 18px}
.breadcrumb{font-size:13px; color:var(--muted); margin-bottom:14px}
.breadcrumb a{color:var(--muted)}

/* ============ Hero ============ */
.hero{text-align:center; padding:46px 16px 30px}
.hero h1{font-size:clamp(30px,5vw,46px); margin:0 0 12px; background:linear-gradient(120deg,var(--text),var(--accent-2)); -webkit-background-clip:text; background-clip:text; color:transparent}
.hero-sub{font-size:clamp(16px,2.4vw,20px); color:var(--muted); max-width:640px; margin:0 auto 22px}
.hero-search{max-width:520px; margin:0 auto}
.hero-search input{width:100%; padding:15px 18px; font-size:16px; border-radius:999px; border:1px solid var(--border); background:var(--surface); color:var(--text); box-shadow:var(--shadow)}
.hero-search input:focus{outline:none; border-color:var(--accent); box-shadow:0 0 0 4px var(--ring)}

/* ============ Tool grid ============ */
.tools-section{margin-top:10px}
.section-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap}
.home-blog,.home-faq-wrap{margin-top:36px}
.home-faq-wrap .faq{max-width:840px;margin-left:auto;margin-right:auto}
.cat-title{font-size:16px; text-transform:uppercase; letter-spacing:.06em; color:var(--muted); margin:26px 0 12px}
.tool-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(200px,1fr)); gap:14px}
.tool-card{display:flex; flex-direction:column; gap:6px; padding:18px; background:var(--surface); border:1px solid var(--border-soft); border-radius:var(--radius); box-shadow:var(--shadow); transition:transform .12s,border-color .12s; color:var(--text)!important; text-decoration:none!important}
.tool-card:hover{transform:translateY(-3px); border-color:var(--accent)}
.tool-ico{font-size:26px}
.tool-name{font-weight:700; font-size:16px}
.tool-desc{font-size:13px; color:var(--muted)}
.empty-note{color:var(--muted)}

/* ============ Tool page ============ */
.tool-page{max-width:840px; margin:0 auto}
.tool-head h1{font-size:clamp(26px,4vw,36px); margin:0 0 6px}
.tool-sub{color:var(--muted); font-size:18px; margin:0 0 18px}
.calc-wrap{background:var(--surface); border:1px solid var(--border); border-radius:var(--radius); padding:22px; box-shadow:var(--shadow); margin:8px 0 22px}
.home-calc{max-width:840px; margin:22px auto}
.home-calc-link{text-align:center; margin:16px 0 0}
.tool-intro{font-size:17px; color:var(--muted)}
.article-body{font-size:17px; line-height:1.75; margin-top:8px}
.article-body h2{font-size:24px; margin:34px 0 12px; scroll-margin-top:80px}
.article-body h3{font-size:20px; margin:24px 0 10px; scroll-margin-top:80px}
.article-body p{margin:0 0 16px}
.article-body table{width:100%; border-collapse:collapse; margin:16px 0}
.article-body th,.article-body td{border:1px solid var(--border); padding:9px 12px; text-align:left}
.article-body th{background:var(--surface-2)}

/* ============ TOC ============ */
.toc{background:var(--surface-2); border:1px solid var(--border-soft); border-radius:14px; padding:6px 18px; margin:20px 0}
.toc summary{cursor:pointer; font-weight:800; padding:10px 0; list-style:none}
.toc summary::-webkit-details-marker{display:none}
.toc summary::before{content:"📑 "}
.toc ol{margin:4px 0 12px; padding-left:22px}
.toc li{margin:5px 0}
.toc .toc-sub{margin-left:16px; list-style:circle}
.toc a{color:var(--text)}
.toc a.active{color:var(--accent-2); font-weight:700}

/* ============ FAQ ============ */
.faq{margin:34px 0}
.faq h2{font-size:24px; margin:0 0 14px}
.faq-item{background:var(--surface); border:1px solid var(--border-soft); border-radius:12px; margin-bottom:10px; overflow:hidden}
.faq-item summary{cursor:pointer; padding:15px 18px; font-weight:700; list-style:none}
.faq-item summary::-webkit-details-marker{display:none}
.faq-item summary::after{content:"+"; float:right; color:var(--accent-2); font-weight:800}
.faq-item[open] summary::after{content:"−"}
.faq-a{padding:0 18px 16px; color:var(--muted)}

/* ============ Link pools ============ */
.link-pool{display:grid; grid-template-columns:1fr 1fr; gap:24px; margin:34px 0; padding:22px; background:var(--surface-2); border:1px solid var(--border-soft); border-radius:var(--radius)}
.link-col h2{font-size:18px; margin:0 0 12px}
.link-grid{list-style:none; margin:0; padding:0; display:grid; gap:8px}
.link-grid a{color:var(--accent-2); font-weight:600; font-size:14px}
@media(max-width:640px){.link-pool{grid-template-columns:1fr}}

/* ============ Ads ============ */
.ad-slot{margin:22px 0; text-align:center; min-height:1px; overflow:hidden}
.ad-slot--sticky-footer{position:fixed; bottom:0; left:0; right:0; z-index:40; margin:0; background:var(--surface); border-top:1px solid var(--border)}

/* ============ Buttons ============ */
.btn{display:inline-flex; align-items:center; gap:7px; padding:12px 20px; background:var(--accent); color:var(--accent-ink)!important; border:0; border-radius:999px; font-weight:700; font-size:15px; cursor:pointer; text-decoration:none!important; transition:background .15s,transform .08s}
.btn:hover{background:var(--accent-2)}
.btn:active{transform:scale(.98)}
.btn-soft{background:var(--surface); color:var(--text)!important; border:1px solid var(--border)}

/* ============ Footer ============ */
.site-footer{margin-top:50px; background:var(--surface); border-top:1px solid var(--border-soft)}
.footer-grid{display:grid; grid-template-columns:2fr 1fr 1fr; gap:30px; padding:44px 20px 26px}
.footer-grid h3{font-size:16px; margin:0 0 12px}
.footer-brand p{color:var(--muted); max-width:38ch}
.footer-grid ul{list-style:none; margin:0; padding:0; display:grid; gap:8px}
.footer-grid a{color:var(--muted)}
.footer-bottom{border-top:1px solid var(--border-soft); padding:18px 20px; color:var(--muted); font-size:13px; text-align:center}
@media(max-width:760px){.footer-grid{grid-template-columns:1fr 1fr}}

/* ============ 404 ============ */
.notfound{text-align:center; padding:70px 16px}
.notfound h1{font-size:80px; margin:0; color:var(--accent-2)}

/* ============ Responsive nav ============ */
@media(max-width:860px){
  .nav-links{display:none}
  .mobile-only{display:inline-grid}
}
