/* Delad stil för nya billigbergvarme.se. Färgerna kommer från berg, kyla och värme. */
:root {
  --bg: #eff3f2;
  --surface: #ffffff;
  --fg: #182529;
  --muted: #526166;
  --line: #cbd5d3;
  --accent: #0d6468;
  --accent-soft: #d6e8e6;
  --heat: #b83f14;
  --heat-soft: #f8e2d8;
  --cold: #1f6fa8;
  --soil: #b9ab97;
  --rock: #7c8b8d;
  --rock-deep: #63737a;
  --font-display: "Bricolage Grotesque", "Avenir Next", "Segoe UI", sans-serif;
  --font-body: "Atkinson Hyperlegible", "Helvetica Neue", Arial, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #11191c;
    --surface: #1a2529;
    --fg: #e6edec;
    --muted: #a3b2b4;
    --line: #34444a;
    --accent: #55c3bf;
    --accent-soft: #1d3a3c;
    --heat: #ff8c5e;
    --heat-soft: #40261c;
    --cold: #6db8ee;
    --soil: #6e6355;
    --rock: #3e4d53;
    --rock-deep: #2c3a40;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
a { color: var(--accent); text-underline-offset: 0.15em; }
a:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.14;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(2.3rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.6rem, 3.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1.15rem; font-weight: 700; }
p, ul, ol { margin: 0; }
ul, ol { padding-left: 1.25em; display: grid; gap: 0.35em; }

.frame {
  max-width: 760px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.site-head { border-bottom: 1px solid var(--line); }
.site-head .frame {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 24px;
  padding-block: 14px;
}
.logo { font-family: var(--font-display); font-weight: 800; color: var(--fg); text-decoration: none; }
.site-head nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.95rem; }
.site-head nav a { color: var(--muted); text-decoration: none; }
.site-head nav a:hover { color: var(--fg); }
.site-foot { border-top: 1px solid var(--line); margin-top: 64px; }
.site-foot p { padding-block: 20px; color: var(--muted); font-size: 0.9rem; }

/* Artikel */
.article { display: grid; gap: clamp(36px, 6vw, 56px); padding-block: 32px 0; }
.article section { display: grid; gap: 14px; scroll-margin-top: 16px; min-width: 0; }
.article-head { display: grid; gap: 14px; }
.lede { font-size: 1.22rem; line-height: 1.5; }
.stamp { font-family: var(--font-data); font-size: 0.82rem; color: var(--muted); }
.note { color: var(--muted); font-size: 0.95rem; }

.figure { margin: 0; display: grid; gap: 6px; }
.figure img { display: block; width: 100%; height: auto; border-radius: 8px; }
.figure figcaption { color: var(--muted); font-size: 0.85rem; }
.figure-small { max-width: 320px; }

.facts { display: grid; gap: 0; border-top: 2px solid var(--fg); }
.facts div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.facts dt { font-weight: 700; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }

.alert {
  background: var(--heat-soft);
  border-left: 4px solid var(--heat);
  padding: 14px 16px;
}
.toc { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 0.97rem; }

.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.98rem; }
th, td { text-align: left; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font-family: var(--font-display); border-bottom: 2px solid var(--fg); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; padding-right: 0; }

/* Kalkyl */
.calc {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(16px, 3vw, 24px);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.field { display: grid; gap: 4px; align-content: start; }
.field label { font-size: 0.92rem; font-weight: 700; }
.field-input { display: flex; align-items: center; gap: 8px; }
.field input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  color: var(--fg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px 10px;
  font-family: var(--font-data);
  font-size: 1rem;
}
.unit { font-family: var(--font-data); font-size: 0.82rem; color: var(--muted); }
.calc-result { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 4px; }
.calc-label { font-size: 0.92rem; color: var(--muted); }
.calc-value { font-family: var(--font-display); font-size: clamp(1.45rem, 5vw, 2.1rem); font-weight: 800; color: var(--accent); line-height: 1.15; }

/* Startsida */
.site-head .frame, .site-foot .frame, .wide { max-width: 1060px; }
.wide {
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.home-hero {
  --bg: #0d3f44;
  --fg: #f2f7f6;
  --muted: #bcd0cf;
  --surface: #1a2529;
  --accent: #55c3bf;
  --heat: #ff8c5e;
  background: var(--bg);
  color: var(--fg);
}
.home-hero .wide {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  padding-block: clamp(32px, 6vw, 64px);
}
.hero-text { display: grid; gap: 18px; justify-items: start; }
.hero-text h1 { font-size: clamp(2.5rem, 6.5vw, 4.4rem); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.btn {
  display: inline-block;
  padding: 11px 18px;
  border-radius: 6px;
  border: 2px solid var(--fg);
  font-weight: 700;
  text-decoration: none;
  color: var(--fg);
}
.btn-primary { background: var(--fg); color: #0d3f44; }
.home { display: grid; gap: clamp(36px, 6vw, 60px); padding-block: 0 8px; }
.now {
  background: var(--heat-soft);
  border-bottom: 1px solid var(--line);
}
.now p { padding-block: 12px; }
.paths { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.path {
  display: grid;
  gap: 12px;
  align-content: start;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
}
.path ul { list-style: none; padding: 0; gap: 8px; }
.path a { font-weight: 700; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin: 0; }
.stats div { display: grid; gap: 2px; border-top: 2px solid var(--fg); padding-top: 10px; align-content: start; }
.stats dd { order: -1; margin: 0; font-family: var(--font-display); font-size: clamp(1.5rem, 3.4vw, 2.1rem); font-weight: 800; line-height: 1.15; }
.stats dt { color: var(--muted); }
.home h2 { margin-bottom: 14px; }
.crumb { font-size: 0.92rem; color: var(--muted); }

/* Jämförelsesida */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(20px, 4vw, 40px);
  align-items: center;
}
.diagram { margin: 0; display: grid; gap: 6px; min-width: 0; }
.diagram svg { display: block; width: 100%; max-width: 300px; height: auto; margin-inline: auto; }
.diagram figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; }
.svg-label { font-family: var(--font-data); font-size: 14px; fill: var(--fg); }
.svg-label-rock { font-family: var(--font-data); font-size: 14px; fill: #ffffff; }
.guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.guide {
  display: grid;
  gap: 2px;
  align-content: start;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--fg);
  text-decoration: none;
}
.guide strong { font-family: var(--font-display); color: var(--accent); line-height: 1.2; }
.guide span { color: var(--muted); font-size: 0.92rem; line-height: 1.35; }
.guide:hover { border-color: var(--accent); }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.two-col > div { display: grid; gap: 10px; align-content: start; min-width: 0; }
.compare { min-width: 640px; }
.calc-output { display: grid; gap: 12px; }
.bar-row { display: grid; gap: 3px; }
.bar-head { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 4px 12px; font-size: 0.95rem; }
.bar-value { font-family: var(--font-data); font-size: 0.9rem; }
.bar-track { height: 12px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar { height: 100%; width: 0; background: var(--muted); }
.bar.is-main { background: var(--accent); }
.calc-output .facts { margin-top: 8px; }
.error { color: var(--heat); font-weight: 700; }

.faq { display: grid; gap: 18px; }
.faq div { display: grid; gap: 4px; }

@media (max-width: 760px) {
  .hero, .home-hero .wide, .paths { grid-template-columns: minmax(0, 1fr); }
  .guides { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  .stats { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .two-col { grid-template-columns: minmax(0, 1fr); }
  .calc { grid-template-columns: minmax(0, 1fr); }
  .facts div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .lede { font-size: 1.12rem; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
.prose-home { max-width: 66ch; }

/* Offertruta */
.offer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px 24px;
  align-items: center;
  margin: 32px 0;
  padding: 20px;
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
}
.offer h2 { margin: 0 0 4px; font-size: 1.3rem; }
.offer p { margin: 0; }
.offer-cta { display: grid; gap: 4px; justify-items: center; }
.btn-offer {
  display: inline-block;
  padding: 11px 20px;
  background: var(--accent);
  color: var(--bg);
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.btn-inline { font-weight: 700; }

/* Karta och kommuner */
.map { height: clamp(380px, 62vh, 620px); margin: 20px 0; background: var(--line); }
.map-small { height: 320px; }
.leaflet-container { font-family: var(--font-body); color: #182529; }
.kommuner { list-style: none; padding: 0; columns: 3 170px; column-gap: 24px; }
.kommuner li { break-inside: avoid; padding: 2px 0; }
.firms { display: grid; gap: 0; list-style: none; padding: 0; border-top: 2px solid var(--fg); }
.firms li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 2px 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.firms span { color: var(--muted); font-size: 0.95rem; }
.firms .dist { font-family: var(--font-data); font-size: 0.9rem; white-space: nowrap; }

/* Pumpar */
.pump-filter { margin: 20px 0; }
.pump-need { grid-column: 1 / -1; }
.pumps { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; list-style: none; padding: 0; }
.pump { display: grid; gap: 6px; align-content: start; padding: 16px; background: var(--surface); border: 1px solid var(--line); }
.pump h3 { margin: 0; font-size: 1.12rem; }
.pump p { margin: 0; font-size: 0.97rem; }
.pump .kw { font-family: var(--font-data); font-weight: 500; }
.pump .tag { color: var(--muted); }
.field select {
  width: 100%;
  min-height: 44px;
  padding: 8px;
  font: inherit;
  color: var(--fg);
  background: var(--surface);
  border: 1px solid var(--line);
}
@media (max-width: 639px) {
  .offer { grid-template-columns: minmax(0, 1fr); }
  .offer-cta { justify-items: start; }
}
