/* ================================================================
   Låne.no — Global stylesheet
   Lyst, lett og moderne design inspirert av enkelheten i lendo.no
   ================================================================ */

:root {
  --navy: #0B2D4F;
  --navy-900: #081F38;
  --navy-700: #123E6B;
  --blue: #1E5AA8;
  --blue-500: #2D6BC4;
  --blue-50: #EAF2FB;
  --accent: #F5B400;
  --text: #0F172A;
  --text-soft: #334155;
  --muted: #64748B;
  --border: #E4EAF2;
  --border-light: #F0F4F9;
  --surface: #FFFFFF;
  --bg: #F7FAFD;
  --success: #16A34A;

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;

  --shadow-sm: 0 1px 2px rgba(11,45,79,0.04), 0 1px 3px rgba(11,45,79,0.06);
  --shadow: 0 4px 14px rgba(11,45,79,0.08);
  --shadow-lg: 0 16px 40px rgba(11,45,79,0.12);

  --container: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-heading: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.3em; }
li { margin-bottom: 0.3em; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--navy);
  line-height: 1.22;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
}
h1 { font-size: clamp(2rem, 4vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); font-weight: 700; margin-top: 2em; }
h3 { font-size: 1.2rem; font-weight: 700; margin-top: 1.6em; }
p { margin: 0 0 1em; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 22px; }

/* Skip link for a11y */
.skip { position: absolute; top: -40px; left: 8px; background: var(--navy); color: #fff; padding: 8px 12px; border-radius: 6px; z-index: 200; }
.skip:focus { top: 8px; }

/* =========== HEADER =========== */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 50;
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 24px;
}
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.2rem; color: var(--navy);
  text-decoration: none; font-family: var(--font-heading);
}
.logo:hover { text-decoration: none; }
.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--navy); color: #fff;
  font-weight: 900; font-size: 1.15rem; letter-spacing: -0.02em;
}
.nav-links {
  display: flex; align-items: center; gap: 28px;
}
.nav-links a {
  color: var(--text-soft); font-weight: 500; font-size: 0.97rem;
  padding: 8px 2px;
}
.nav-links a:hover { color: var(--navy); text-decoration: none; }
.nav-links a.cta {
  background: var(--navy); color: #fff;
  padding: 10px 18px; border-radius: 10px;
  font-weight: 600;
}
.nav-links a.cta:hover { background: var(--navy-700); color: #fff; }

.mobile-toggle { display: none; background: none; border: 0; cursor: pointer; padding: 10px; }
.mobile-toggle span { display: block; width: 22px; height: 2px; background: var(--navy); margin: 4px 0; border-radius: 2px; }

@media (max-width: 820px) {
  .nav-links {
    display: none;
    position: absolute; top: 72px; left: 0; right: 0;
    background: #fff; flex-direction: column; padding: 20px;
    border-bottom: 1px solid var(--border); gap: 12px;
  }
  body.nav-open .nav-links { display: flex; }
  .mobile-toggle { display: block; }
}

/* =========== BREADCRUMBS =========== */
.breadcrumbs { background: var(--bg); border-bottom: 1px solid var(--border-light); font-size: 0.88rem; }
.breadcrumbs ol { list-style: none; padding: 12px 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li { margin: 0; color: var(--muted); }
.breadcrumbs li + li::before { content: "›"; margin-right: 6px; color: var(--muted); }
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--navy); }
.breadcrumbs [aria-current] { color: var(--navy); font-weight: 600; }

/* =========== MAIN =========== */
.site-main { padding: 48px 0 72px; }
article.prose {
  background: var(--surface);
  padding: 40px clamp(22px, 4vw, 56px);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  max-width: 820px; margin: 0 auto;
}
article.prose .lede { font-size: 1.12rem; color: var(--text-soft); margin-bottom: 1.6em; }
article.prose ul li::marker { color: var(--blue); }

/* =========== HERO (hub pages) =========== */
.hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff; padding: 72px 0 88px; border-radius: 0 0 0 0;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -120px; top: -120px;
  width: 380px; height: 380px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(2.1rem, 4.5vw, 3.2rem); max-width: 760px; }
.hero .lede { font-size: 1.2rem; color: #CFE0F2; max-width: 680px; margin-bottom: 1.8em; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 14px 24px; border-radius: 10px; font-weight: 600;
  text-decoration: none; font-size: 1rem; border: 1px solid transparent;
  transition: transform .15s ease, background .15s ease, color .15s ease;
  cursor: pointer;
}
.btn-primary { background: var(--accent); color: var(--navy); }
.btn-primary:hover { background: #E8A900; text-decoration: none; }
.btn-ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,0.25); }
.btn-ghost:hover { background: rgba(255,255,255,0.08); color: #fff; text-decoration: none; }

/* Page hero (sub-pages) */
.page-hero {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-700) 100%);
  color: #fff; padding: 52px 0 64px;
  position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; right: -100px; top: -100px;
  width: 300px; height: 300px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
}
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 3.5vw, 2.6rem); max-width: 720px; }
.page-hero .lede { font-size: 1.1rem; color: #CFE0F2; max-width: 640px; margin-bottom: 0; }

/* Card grid */
.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px; margin: 40px 0;
}
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration: none; color: inherit; display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-2px); box-shadow: var(--shadow);
  border-color: var(--blue-50); text-decoration: none;
}
.card h3 { font-size: 1.12rem; color: var(--navy); margin: 0 0 6px; }
.card p { color: var(--text-soft); font-size: 0.96rem; margin: 0 0 14px; }
.card .read { color: var(--blue); font-weight: 600; font-size: 0.9rem; margin-top: auto; }
.card .icon { width: 38px; height: 38px; background: var(--blue-50); border-radius: 9px; display: flex; align-items: center; justify-content: center; color: var(--navy); font-weight: 800; margin-bottom: 16px; }

/* Callout / info boxes */
.callout {
  background: var(--blue-50); border-left: 4px solid var(--blue);
  padding: 18px 22px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 28px 0; color: var(--navy-900); font-size: 0.97rem;
}
.callout strong { color: var(--navy); }

.disclaimer {
  background: #FFF7E6; border-left: 4px solid var(--accent);
  padding: 16px 20px; border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 0.92rem; color: #5B4200; margin: 20px 0;
}

/* FAQ */
.faq { margin: 32px 0; border-top: 1px solid var(--border); }
.faq details {
  border-bottom: 1px solid var(--border); padding: 18px 0; cursor: pointer;
}
.faq summary {
  list-style: none; font-weight: 600; color: var(--navy);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-weight: 400; color: var(--blue); font-size: 1.4rem;
  transition: transform .2s ease;
}
.faq details[open] summary::after { content: "−"; }
.faq details p { margin-top: 10px; color: var(--text-soft); font-size: 0.98rem; }

/* Related links block */
.related {
  margin-top: 40px; padding: 26px; background: var(--bg);
  border-radius: var(--radius); border: 1px solid var(--border-light);
}
.related h2 { margin-top: 0; font-size: 1.1rem; color: var(--navy); }
.related ul { margin: 0; padding-left: 1.1em; }
.related li { font-size: 0.96rem; }

/* Calculator */
.calc-card {
  background: var(--surface); padding: 34px;
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  border: 1px solid var(--border-light);
  display: grid; grid-template-columns: 1fr 1fr; gap: 36px;
  margin: 24px 0;
}
@media (max-width: 760px) { .calc-card { grid-template-columns: 1fr; } }
.calc-form label { display: block; margin-bottom: 16px; font-weight: 600; color: var(--navy); font-size: 0.95rem; }
.calc-form input[type="number"], .calc-form input[type="range"] {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border);
  border-radius: 10px; font-size: 1rem; font-family: inherit;
  background: var(--bg);
}
.calc-form input[type="number"]:focus {
  outline: 2px solid var(--blue); outline-offset: 1px; border-color: var(--blue);
}
.calc-form .field { margin-bottom: 18px; }
.calc-form .range-row { display: flex; gap: 12px; align-items: center; }
.calc-form .range-row input[type="range"] { flex: 1; }
.calc-form .val { min-width: 92px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--navy); }
.calc-results {
  background: linear-gradient(180deg, var(--blue-50), #fff 60%);
  border-radius: var(--radius); padding: 26px; border: 1px solid var(--border-light);
}
.calc-results h3 { margin-top: 0; }
.result-row { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0; border-bottom: 1px dashed var(--border); }
.result-row:last-of-type { border-bottom: 0; }
.result-row .label { color: var(--muted); font-size: 0.92rem; }
.result-row .value { font-size: 1.25rem; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.result-row.primary .value { color: var(--navy); font-size: 1.6rem; }

/* Pill/tag */
.tag { display: inline-block; background: var(--blue-50); color: var(--navy); padding: 4px 10px; border-radius: 999px; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.02em; margin-bottom: 10px; }

/* Footer */
.site-footer { background: var(--navy); color: #CBD9E8; margin-top: 60px; padding: 54px 0 28px; }
.site-footer a { color: #CBD9E8; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 36px; margin-bottom: 36px; }
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-col h4 { color: #fff; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 14px; }
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 8px; font-size: 0.94rem; }
.footer-col p { font-size: 0.92rem; color: #9FB6CE; }
.logo-footer .logo-mark { background: #fff; color: var(--navy); }
.logo-footer { color: #fff; margin-bottom: 14px; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 20px; font-size: 0.84rem; color: #9FB6CE; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

/* Page illustration */
.page-fig {
  margin: 32px auto;
  max-width: 820px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  line-height: 0;
}
.page-fig img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 300px;
  object-fit: cover;
}

/* Utilities */
.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.mt-0 { margin-top: 0; }
.text-center { text-align: center; }
