/* ─────────────────────────────────────────────────────────────────────────────
   bas.css — delade grundstilar för byggbalans.com (startsidan och kunskapsbanken).
   ENDA stället för typsnitt, färgvariabler, grundstilar, nav och sidfot.
   Nav- och sidfots-HTML genereras av scripts/bygg-kunskap.cjs — även på startsidan,
   mellan NAV- och SIDFOT-markörerna. Sidspecifikt: <style> i index.html och kunskap.css.
   ───────────────────────────────────────────────────────────────────────────── */

/* Självhostade fonter — ingen tredjepart, GDPR-säkert. Inter/Playfair variabla; Plex Mono för ÄTA-nr, datum och belopp. */
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/playfair-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Playfair Display'; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url('/fonts/playfair-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 500; font-display: swap; src: url('/fonts/ibm-plex-mono-latin-500-normal.woff2') format('woff2'); }

:root {
  --gron-djup: #0d2b1a;
  --gron-yta: #163d26;
  --gron-kort: #1a4a2e;
  --gron-hover: #1f5535;
  --linje: #2a6040;
  --barnsten: #e8a020;
  --barnsten-ljus: #f5c060;
  --klar: #8fdcaa;      /* bara för "klart/godkänt" — matchar appens statusfärg */
  --text: #ffffff;
  --brod: #a8cbb5;
  --dampad: #86b596;
  --mono: 'IBM Plex Mono', ui-monospace, Consolas, monospace;
  --serif: 'Playfair Display', Georgia, serif;
  --bredd: 1120px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--gron-djup); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--barnsten); outline-offset: 3px; border-radius: 3px; }
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--barnsten); color: var(--gron-djup); padding: 10px 16px;
  font-size: 13px; font-weight: 500; text-decoration: none; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

/* ── Nav ── */
nav { background: rgba(13,43,26,0.97); border-bottom: 0.5px solid var(--linje); position: sticky; top: 0; z-index: 100; }
.nav-inner { max-width: var(--bredd); margin: 0 auto; padding: 0 2.5rem; display: flex; justify-content: space-between; align-items: center; height: 60px; }
.logo { display: flex; align-items: center; gap: 0.7rem; text-decoration: none; }
.logo-text { font-family: var(--serif); font-size: 19px; color: #fff; }
.logo-sub { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dampad); display: block; margin-top: -2px; }
.nav-menu { display: flex; align-items: center; gap: 0.75rem; }
.nav-tabs { display: flex; }
.nav-tab { font-size: 13px; color: var(--dampad); padding: 0 1rem; height: 60px; display: flex; align-items: center; text-decoration: none; border-bottom: 2px solid transparent; transition: color 0.15s, border-color 0.15s; }
.nav-tab:hover { color: #fff; }
.nav-tab.active { color: #fff; border-bottom-color: var(--barnsten); }
.nav-cta { font-size: 13px; font-weight: 500; color: var(--gron-djup); background: var(--barnsten); border-radius: 6px; padding: 8px 18px; text-decoration: none; white-space: nowrap; transition: transform 0.15s, background 0.15s; }
.nav-cta:hover { background: var(--barnsten-ljus); transform: scale(1.03); }
.nav-login { font-size: 13px; font-weight: 500; color: #fff; border: 0.5px solid var(--linje); border-radius: 6px; padding: 8px 18px; text-decoration: none; white-space: nowrap; transition: border-color 0.15s, background 0.15s; }
.nav-login:hover { border-color: #fff; background: var(--gron-yta); }
.nav-toggle { display: none; background: none; border: 0.5px solid var(--linje); color: #fff; border-radius: 6px; width: 38px; height: 38px; font-size: 18px; cursor: pointer; align-items: center; justify-content: center; }

/* ── Sidfot ── */
footer { background: #081a10; border-top: 1px solid var(--linje); padding: 2.25rem 0; font-size: 13px; color: var(--dampad); }
.footer-inner { max-width: var(--bredd); margin: 0 auto; padding: 0 2.5rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.25rem 3rem; align-items: center; }
.footer-logo { font-family: var(--serif); font-size: 16px; color: var(--text); margin-right: 0.6rem; }
.footer-sub { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; }
.footer-lankar { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; list-style: none; }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }

/* Menyn fälls ihop innan länkarna trycks ihop (behövs ~900 px) */
@media (max-width: 920px) {
  .nav-toggle { display: flex; }
  .nav-menu { position: absolute; top: 60px; left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; background: var(--gron-djup); border-bottom: 0.5px solid var(--linje); box-shadow: 0 12px 24px rgba(0,0,0,0.35); padding: 0.5rem 2.5rem 1.25rem; display: none; }
  .nav-menu.open { display: flex; }
  .nav-tabs { flex-direction: column; }
  .nav-tab { height: 44px; border-bottom: none; border-left: 2px solid transparent; padding: 0 0.75rem; }
  .nav-tab.active { border-bottom: none; border-left-color: var(--barnsten); }
  .nav-cta, .nav-login { text-align: center; margin-top: 0.5rem; }
}

@media (max-width: 680px) {
  .nav-inner, .footer-inner { padding-left: 1.5rem; padding-right: 1.5rem; }
  .nav-menu { padding-left: 1.5rem; padding-right: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  html { scroll-behavior: auto; }
}
