/* hemmabatterier.se: lokala typsnitt (SIL OFL 1.1), se _design/fontlicens.md */
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/hemmabatterier-se/barlow-condensed-600.woff2") format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/hemmabatterier-se/barlow-condensed-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/hemmabatterier-se/ibm-plex-sans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/hemmabatterier-se/ibm-plex-sans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/hemmabatterier-se/ibm-plex-sans-700.woff2") format("woff2"); }

/* Hemmabatterier designlabb. Typsnitt: Barlow Condensed (SIL OFL 1.1) och IBM Plex Sans (SIL OFL 1.1). */

:root {
  --hb-steel: #e6e8ea;        /* panelbakgrund, kopplad till skåpets plåt */
  --hb-steel-2: #d5d9dd;      /* sektionsbakgrund för växling */
  --hb-paper: #f7f8f8;        /* kort och ytor */
  --hb-ink: #1c2026;          /* brödtext och rubriker, 14:1 mot steel */
  --hb-muted: #4b535c;        /* sekundär text, 7:1 mot steel */
  --hb-line: #bcc3ca;         /* linjer och kanter */
  --hb-lamp: #f2b01e;         /* indikatorlampan: tänd = rekommenderat val och köp */
  --hb-lamp-ink: #1c2026;     /* text på lampan, ca 10:1 */
  --hb-link: #7a3510;         /* textlänkar, understrukna, ca 8:1 mot paper */
  --hb-dark: #1c2026;         /* mörk fot och sticky-yta */
  --hb-dark-ink: #eef0f2;

  --hb-font-display: "Barlow Condensed", "Arial Narrow", Arial, sans-serif;
  --hb-font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --hb-radius: 4px;
  --hb-gap: 40px;
  --hb-section: 56px;
  --hb-wrap: 1180px;
}

@media (min-width: 900px) {
  :root { --hb-section: 96px; }
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--hb-steel);
  color: var(--hb-ink);
  font-family: var(--hb-font-body);
  font-size: 17px;
  line-height: 1.65;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

main p, main li, main td { font-variant-numeric: tabular-nums; }

.hb-wrap {
  width: 100%;
  max-width: var(--hb-wrap);
  margin: 0 auto;
  padding: 0 16px;
}

/* Textlänkar i löptext: understrukna och tydligt annan färg än brödtexten */
main p a, main li a, main td a, .hb-prose a {
  color: var(--hb-link);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

:focus-visible {
  outline: 3px solid var(--hb-ink);
  outline-offset: 3px;
}

/* ---------- Rubriker: rytm med mer luft ovanför än under ---------- */
h1, h2, h3 {
  font-family: var(--hb-font-display);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.005em;
  margin: 0;
}

h2 {
  font-size: clamp(32px, 4.6vw, 48px);
  margin-bottom: 0.7rem;
  max-width: 24ch;
}

.hb-section h2 { margin-top: 0; }

h3 {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 0.5rem;
}

main p + h2, main p + h3, main ul + h2, main ul + h3 { margin-top: 2.2rem; }
main h2 + p, main h3 + p { margin-top: 0; }
main p { margin: 0 0 0.9rem; }
main p:last-child { margin-bottom: 0; }

/* ---------- Header ---------- */
.hb-header {
  background: var(--hb-paper);
  border-bottom: 1px solid var(--hb-line);
  position: sticky;
  top: 0;
  z-index: 40;
}

.hb-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 16px;
}

.hb-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--hb-ink);
  text-decoration: none;
  font-family: var(--hb-font-display);
  font-weight: 700;
  font-size: 26px;
  letter-spacing: 0.01em;
}

.hb-brand svg { width: 28px; height: 28px; flex: 0 0 auto; }

.hb-nav { display: none; }
.hb-nav.is-open {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--hb-paper);
  border-bottom: 1px solid var(--hb-line);
  padding: 8px 16px 20px;
}

.hb-nav ul { list-style: none; margin: 0; padding: 0; }
.hb-nav a {
  display: block;
  padding: 14px 0;
  color: var(--hb-ink);
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid var(--hb-line);
}

.hb-burger {
  appearance: none;
  background: transparent;
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  color: var(--hb-ink);
}

.hb-burger svg { width: 22px; height: 22px; }
.hb-burger .hb-burger__close { display: none; }
.hb-burger[aria-expanded="true"] .hb-burger__open { display: none; }
.hb-burger[aria-expanded="true"] .hb-burger__close { display: block; }

@media (min-width: 900px) {
  .hb-burger { display: none; }
  .hb-nav {
    display: flex;
    gap: 28px;
  }
  .hb-nav ul { display: flex; gap: 28px; }
  .hb-nav a {
    border: 0;
    padding: 6px 0;
  }
}

/* ---------- Hero ---------- */
.hb-hero {
  padding: 40px 0 var(--hb-section);
}

.hb-hero__grid {
  display: grid;
  gap: 32px;
  align-items: start;
}

.hb-hero__text {
  container-type: inline-size;
  min-width: 0;
}

.hb-hero h1 {
  font-size: min(60px, 13cqi);
  max-width: 14ch;
  margin-bottom: 1.1rem;
}

.hb-hero__lead {
  font-size: 19px;
  color: var(--hb-ink);
  max-width: 44ch;
  margin-bottom: 1.5rem;
}

.hb-date {
  font-size: 15px;
  color: var(--hb-muted);
  margin: 0 0 0.6rem;
}

.hb-ads {
  font-size: 14px;
  color: var(--hb-muted);
  margin: 0 0 1rem;
}

.hb-hero__pick {
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-left: 6px solid var(--hb-lamp);
  border-radius: var(--hb-radius);
  padding: 24px;
  display: grid;
  gap: 18px;
}

.hb-hero__pick-img {
  background: var(--hb-steel);
  border-radius: var(--hb-radius);
  aspect-ratio: 4 / 3;
  padding: 16px;
}

.hb-hero__pick-img img,
.hb-product-card__img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.hb-hero__pick h2 {
  font-size: 34px;
  margin: 0 0 0.4rem;
  max-width: none;
}

.hb-hero__pick p { margin: 0; }

.hb-price {
  font-family: var(--hb-font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
}

.hb-price small {
  display: block;
  font-family: var(--hb-font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--hb-muted);
  margin-top: 4px;
  white-space: normal;
}

.hb-shop {
  color: var(--hb-muted);
  margin-bottom: 0;
}

/* Knappar: fyllda, primära i lampfärgen */
.hb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 12px 22px;
  border-radius: var(--hb-radius);
  border: 2px solid var(--hb-lamp);
  background: var(--hb-lamp);
  color: var(--hb-lamp-ink);
  font-family: var(--hb-font-body);
  font-weight: 700;
  font-size: 17px;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
}

.hb-btn:hover { background: #e0a000; border-color: #e0a000; }

.hb-btn--ghost {
  background: transparent;
  color: var(--hb-ink);
  border-color: var(--hb-ink);
}
.hb-btn--ghost:hover { background: var(--hb-ink); color: var(--hb-paper); }

.hb-hero__visual {
  margin: 0;
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  padding: 20px;
}

.hb-hero__visual svg { width: 100%; height: auto; }

.hb-hero__visual figcaption {
  font-size: 14px;
  color: var(--hb-muted);
  margin-top: 12px;
}

/* Hero: diagrammet ligger under texten i vänsterspalten, förstavalskortet i högerspalten */
@media (min-width: 900px) {
  .hb-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; }
  .hb-hero__pick { align-self: start; }
}

/* Visuell rullhint för tabellen, bara på mobil */
.hb-scroll-hint {
  font-size: 14px;
  color: var(--hb-muted);
  margin: 0 0 10px;
}

@media (min-width: 900px) {
  .hb-scroll-hint { display: none; }
}

/* ---------- Sektioner ---------- */
.hb-section {
  padding: var(--hb-section) 0;
}

.hb-section--paper {
  background: var(--hb-paper);
  border-top: 1px solid var(--hb-line);
  border-bottom: 1px solid var(--hb-line);
}

.hb-section__intro {
  margin-bottom: var(--hb-gap);
}

.hb-section__intro p { max-width: 60ch; }

/* ---------- Snabbval ---------- */
.hb-quick-choice {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.hb-quick-choice li {
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  padding: 20px 22px;
}

.hb-quick-choice strong {
  display: block;
  font-family: var(--hb-font-display);
  font-size: 24px;
  line-height: 1.15;
  margin-bottom: 4px;
}

.hb-quick-choice a {
  color: var(--hb-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.hb-quick-choice span { color: var(--hb-muted); }

/* ---------- Produktkort ---------- */
.hb-product-grid {
  display: grid;
  gap: 40px;
  grid-template-columns: minmax(0, 1fr);
}

.hb-product-card {
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.hb-product-card--pick {
  border-left: 6px solid var(--hb-lamp);
}

.hb-product-card__img {
  background: var(--hb-steel);
  aspect-ratio: 4 / 3;
  padding: 20px;
}

.hb-product-card__body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.hb-product-card__tag {
  font-size: 15px;
  font-weight: 600;
  color: var(--hb-ink);
  margin: 0;
}

.hb-product-card h3 { margin: 0; }

.hb-product-card__fit { margin: 0; }

.hb-product-card dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.hb-product-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--hb-line);
  padding-bottom: 10px;
}

.hb-product-card dt { color: var(--hb-muted); }
.hb-product-card dd { margin: 0; font-weight: 600; text-align: right; }

.hb-product-card__price {
  margin-top: auto;
  padding-top: 8px;
}

.hb-product-card__price .hb-price { font-size: 30px; }

.hb-card-cta { width: 100%; }

.hb-product-card__ad {
  font-size: 13px;
  color: var(--hb-muted);
  margin: 0;
  text-align: center;
}

@media (min-width: 720px) {
  .hb-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1080px) {
  .hb-product-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Spec-tabell ---------- */
.hb-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
}

.hb-spec {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.hb-spec th,
.hb-spec td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--hb-line);
  vertical-align: top;
}

.hb-spec thead th {
  font-family: var(--hb-font-display);
  font-size: 22px;
  line-height: 1.15;
}

.hb-spec tbody th { font-weight: 400; color: var(--hb-muted); width: 30%; }

.hb-spec tbody tr:last-child th,
.hb-spec tbody tr:last-child td { border-bottom: 0; }

.hb-spec-note {
  margin-top: 24px;
  max-width: 62ch;
}

/* ---------- Breddlista ---------- */
.hb-range {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--hb-line);
}

.hb-range li {
  display: grid;
  gap: 4px;
  padding: 18px 0;
  border-bottom: 1px solid var(--hb-line);
}

.hb-range__name { font-weight: 600; }
.hb-range__meta { color: var(--hb-muted); font-size: 15px; }

.hb-range .hb-btn {
  justify-self: start;
  min-height: 44px;
  padding: 8px 16px;
  font-size: 15px;
  background: transparent;
  color: var(--hb-ink);
  border-color: var(--hb-ink);
}

@media (min-width: 720px) {
  .hb-range li {
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 24px;
  }
}

/* ---------- Guider ---------- */
.hb-guides {
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.hb-guides li {
  background: var(--hb-paper);
  border: 1px solid var(--hb-line);
  border-radius: var(--hb-radius);
  padding: 26px;
}

.hb-guides h3 { margin-bottom: 0.6rem; }
.hb-guides p { margin: 0; color: var(--hb-muted); }

.hb-guides a {
  color: var(--hb-link);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (min-width: 720px) {
  .hb-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- FAQ ---------- */
.hb-faq { max-width: 70ch; }

.hb-faq details {
  border-bottom: 1px solid var(--hb-line);
  padding: 18px 0;
}

.hb-faq details:first-of-type { border-top: 1px solid var(--hb-line); }

.hb-faq summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 18px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hb-faq summary::-webkit-details-marker { display: none; }

.hb-faq summary::after {
  content: "";
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  border-right: 2px solid var(--hb-ink);
  border-bottom: 2px solid var(--hb-ink);
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.2s ease;
}

.hb-faq details[open] summary::after { transform: rotate(-135deg); }

.hb-faq .hb-faq__answer {
  padding-top: 12px;
  color: var(--hb-ink);
}

.hb-faq .hb-faq__answer p { margin: 0; }

/* ---------- Trustrad ---------- */
.hb-trust {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
  margin: 0;
  list-style: none;
}

.hb-trust li {
  border-left: 3px solid var(--hb-ink);
  padding: 4px 0 4px 16px;
}

.hb-trust strong { display: block; }
.hb-trust span { color: var(--hb-muted); font-size: 15px; }

@media (min-width: 720px) {
  .hb-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; }
}

/* ---------- Sticky köp-CTA (mobil) ---------- */
.hb-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: var(--hb-dark);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  box-shadow: 0 -2px 0 var(--hb-lamp);
  transform: translateY(0);
  transition: transform 0.2s ease;
}

.hb-sticky.is-hidden { transform: translateY(120%); }

.hb-sticky a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  background: var(--hb-lamp);
  color: var(--hb-lamp-ink);
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--hb-radius);
}

@media (min-width: 900px) {
  .hb-sticky { display: none; }
}

/* Sidfot och luft under sticky på mobil */
.hb-main { padding-bottom: 96px; }
@media (min-width: 900px) { .hb-main { padding-bottom: 0; } }

/* ---------- Footer ---------- */
.hb-footer {
  background: var(--hb-dark);
  color: var(--hb-dark-ink);
  padding: 56px 0 40px;
}

.hb-footer a { color: var(--hb-dark-ink); }

.hb-footer__grid {
  display: grid;
  gap: 24px;
}

.hb-footer p { margin: 0; font-size: 15px; color: #c3c9cf; }

.hb-footer .hb-brand { color: var(--hb-dark-ink); }

@media (min-width: 720px) {
  .hb-footer__grid { grid-template-columns: 1fr auto; align-items: end; }
}

/* Reducerad rörelse */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

h1,h2,h3{text-wrap:balance}

/* ---------- v3: löptext, rytm och luft (visual-audit 20/10) ---------- */
.hb-prose { max-width: 46rem; }
.hb-prose > :first-child { margin-top: 0; }
.hb-prose p, .hb-prose li { max-width: 68ch; }
.hb-prose h2 { margin: 2.4rem 0 0.7rem; }
.hb-prose h3 { margin: 1.9rem 0 0.5rem; }
.hb-prose table { margin-bottom: 1.25rem; }
.hb-faq__answer p, details p { max-width: 68ch; }
.hb-hero__visual { margin-bottom: 1.75rem; }
.hb-spec { margin-bottom: 0; }
.hb-table-scroll { max-width: 100%; margin-bottom: 1.25rem; }
.hb-table-scroll + p, .hb-spec + p, .hb-spec-note { margin-top: 1rem; }
.hb-hero__grid > *, .hb-wrap > *, .hb-product-card, .hb-product-card__body { min-width: 0; }
.hb-spec th, .hb-spec td { padding-inline: 12px; }
.hb-footer__links { margin-top: 0.75rem; line-height: 2; }
.hb-footer__links a { text-decoration: underline; text-underline-offset: 3px; }
.hb-footer { padding-bottom: 96px; }
@media (min-width: 900px) {
  :root { --hb-section: 68px; }
  .hb-footer { padding-bottom: 40px; }
}

/* ---------- v4: sol-chrome 20/10 ---------- */
h1 { font-size: clamp(34px, 5.4vw, 56px); }
.hb-product-card__img { position: relative; overflow: hidden; padding: 0; }
.hb-product-card__img img { position: absolute; inset: 16px; width: calc(100% - 32px); height: calc(100% - 32px); object-fit: contain; }
.hb-hero__visual img, .hb-prose img, figure img { width: 100%; height: auto; }
.hb-hero__visual img { aspect-ratio: 3 / 2; object-fit: cover; max-height: 240px; }
@media (min-width: 900px) { .hb-hero__visual img { max-height: 340px; } }
dl.hb-product-card { display: grid; padding: 20px 24px; background: var(--hb-paper); border: 1px solid var(--hb-line); border-radius: var(--hb-radius); }
dl.hb-product-card > div { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px solid var(--hb-line); }
dl.hb-product-card > div:last-child { border-bottom: 0; }
dl.hb-product-card dd { margin: 0; font-weight: 700; text-align: right; }

@media (min-width: 720px) { .hb-product-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 52rem; } }
