:root {
  --ink: #0f172a; /* primærtekst */
  --muted: #64748b; /* sekundærtekst */
  --bg: #ffffff; /* bakgrunn */
  --panel: #f6f7fb; /* lys seksjonsbakgrunn */
  --card: #ffffff; /* kortbakgrunn */
  --line: #cacaca; /* border */
  --shadow: 0 8px 22px rgba(2, 8, 23, 0.1);
  --accent: #d20a1b; /* side-spesifikk accent */
}

.support-page {
  background: var(--bg);
  color: var(--ink);
}

/* Lenker kun inne i main på support-siden */
.support-page main a {
  color: var(--accent);
}
.support-page main a:hover,
.support-page main a:focus {
  text-decoration: underline;
}
.support-page main img {
  max-width: 100%;
  height: auto;
  display: block;
}
.support-page main :focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* WRAPPER */
.support-page .container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 28px 20px;
}

/* ================= HERO ================= */
.support-page .hero {
  position: relative;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #0b1220;
}
.support-page .hero__bg {
  position: absolute;
  inset: 0;
  background: url(../images/nicol-JrMzz7jUD5s-unsplash.jpg) center/cover
    no-repeat;
  filter: brightness(0.9);
}
.support-page .hero__scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.35),
    rgba(15, 23, 42, 0.65)
  );
}
.support-page .hero__content {
  position: relative;
  z-index: 1;
  color: #fff;
  text-align: center;
  padding: 48px 20px;
  max-width: 1100px;
}
.support-page .hero h1 {
  font-size: clamp(30px, 5vw, 48px);
  margin: 0 0 0.25rem;
}
.support-page .hero p {
  margin: 0.25rem 0 1.25rem;
  opacity: 0.95;
}
.support-page .quick-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 14px;
  font-size: 14px;
}

/* =============== SERVICES-BÅND =============== */
.support-page .band {
  background: var(--panel);
  padding: 36px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

/* Overlapp bandet over hero */
.support-page .band--overlap {
  position: relative;
  z-index: 2; /* over hero-bakgrunnen */
  margin-top: -96px;
  background: transparent; /* la hero-bildet synes */
  border-top: 0;
  border-bottom: 0;
  padding-top: 0;
}
@media (max-width: 980px) {
  .support-page .band--overlap {
    margin-top: -64px;
  }
}
@media (max-width: 640px) {
  .support-page .band--overlap {
    margin-top: -48px;
  }
}

.support-page .band h2 {
  margin: 0 0 0.25rem;
  text-align: center;
  font-size: 28px;
}
.support-page .band p.sub {
  margin: 0 0 22px;
  text-align: center;
  color: var(--muted);
}

.support-page .services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
.support-page .service-card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  display: block; /* <a> skal opptre som kort */
  color: inherit;
  text-decoration: none;
}
.support-page .service-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(2, 8, 23, 0.12);
}
.support-page .service-card .icon {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin: 0 auto 10px;
  overflow: hidden;
  background: #fff;
}
.support-page .service-card .icon svg {
  display: block;
  width: 44px;
  height: 44px;
}
.support-page .service-card .icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain; /* PNG-logoer passer pent */
}
.support-page .service-card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}
.support-page .service-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* =============== SEKSJONER (innhold) =============== */
.support-page .section {
  padding: 22px;
  border-bottom: 1px solid var(--line);
  background: #fff;
  margin-top: 18px;
}
.support-page .section h3 {
  margin: 0 0 8px;
}

/* Section header row: title + Back to Top */
/* Section header row: title + Back to Top */
.support-page .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 2px 0 14px;
  padding: 6px 0 12px;
  background: transparent; /* remove dark bar */
  border-bottom: 1px solid var(--line); /* subtle divider */
}

.support-page .section-header h3 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.2;
  display: flex;
  align-items: center;
  gap: 10px;
}
.support-page .section-header h3::before {
  content: "";
  width: 6px;
  height: 1.1em;
  border-radius: 3px;
  background: var(--accent);
  flex: 0 0 6px; /* slim accent bar */
}
/* Back to Top button in section header */
.support-page .section-header .back-to-top {
  margin: 0;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1;
  background: #fff;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease,
    transform 0.1s ease;
}
.support-page .section-header .back-to-top:hover,
.support-page .section-header .back-to-top:focus-visible {
  background: var(--panel);
  color: var(--ink);
  border-color: color-mix(in srgb, var(--accent) 40%, var(--line));
  transform: translateY(-1px);
}
@media (max-width: 560px) {
  .support-page .section-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .support-page .section-header .back-to-top {
    order: 2; /* drop below title on very small screens */
  }
}
.support-page .toplink {
  margin: 4px 0 12px;
}
.support-page .pill {
  display: inline-block;
  background: #fff;
  color: var(--muted);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
}

/* Lenkelister/kort */
.support-page .list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
}
.support-page .list a {
  display: block;
  background: #fff; /* nøytral (ikke rød) */
  border-radius: 12px;
  padding: 10px 12px;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.support-page .list a:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}
.support-page .list small {
  display: block;
  color: var(--muted);
}

/* Punktlister i tekst */
.support-page .bullets {
  padding-left: 18px;
  margin: 8px 0;
}

/* FAQ – minimal list style (thin separators + chevron on right) */
.support-page .faq {
  padding: 0; /* section already has padding */
}
.support-page .faq details {
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 0;
}

.support-page .faq details:first-of-type {
  border-top: 0; /* ingen linje over første */
}

.support-page .faq details:last-of-type {
  border-bottom: 1px solid var(--line);
}
.support-page .faq details + details {
  margin-top: 0; /* lines handle separation */
}
/* clickable row */
.support-page .faq summary {
  list-style: none;
  margin: 0;
  margin-left: 10px;
  padding: 16px 0; /* vertical rhythm like the reference */
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.support-page .faq summary::-webkit-details-marker {
  display: none;
}
/* chevron icon */
.support-page .faq summary::after {
  content: "";
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  background: no-repeat center / 16px 16px
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%230f172a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  transition: transform 0.2s ease;
}
.support-page .faq details[open] summary::after {
  transform: rotate(180deg);
}
/* answer content spacing */
.support-page .faq details > *:not(summary) {
  padding: 0 0 16px 0; /* reset left padding for non-summary content */
  margin: 0;
}

.support-page .faq details > p {
  margin-left: 20px; /* indent only answer paragraphs */
}
.support-page .faq p em {
  color: var(--muted);
}

/* =============== TOC (Support Topics Overview) =============== */
.support-page .toc {
  background: #fff;

  border-radius: 14px;
  padding: 18px;
  margin-top: 24px;
}
.support-page .toc h2 {
  margin: 0 0 6px;
}
.support-page .toc p {
  margin: 0 0 10px;
  color: var(--muted);
}
.support-page .toc ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 8px;
}
.support-page .toc a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s ease, transform 0.1s ease;
}
.support-page .toc a:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

/* =============== LEGACY blokk =============== */
.support-page details.legacy {
  max-width: 1100px;
  margin: 28px auto;
}
.support-page details.legacy > summary {
  cursor: pointer;
  padding: 12px 0;
  font-weight: 700;
}

/* =============== GARANTI-SEKSJON: 2-kolonne m/bilde =============== */
.support-page .section-grid {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr; /* bilde / tekst */
  gap: 24px 28px;
  align-items: start;
}
.support-page .section-media {
  margin: 0; /* fjern default figure-margin */
  padding: 0;
}
.support-page .section-media img {
  width: 100%;
  max-width: 450px;
  height: auto;
  display: block;
  margin-inline: auto; /* center when stacked on small screens */
  border-radius: 12px;

  box-shadow: var(--shadow);
  background: #fff;
}
.support-page .section-content > h3 {
  margin-top: 0; /* la tittelen flukte med toppen av bildet */
}

/* ===============  Buyers' Guide – images / charts =============== */
.buyers-illustrations {
  margin-top: 12px;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  align-items: start;
}

.media-card {
  background: #fff;

  border-radius: 12px;
  padding: 12px;
  box-shadow: var(--shadow);
}

.media-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.media-card figcaption {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  text-align: left;
}

/* PDF buttons under left image in Buyers' Guide */
.support-page .section-media .doc-links {
  margin-top: 10px;
}
.support-page .section-media .list {
  grid-template-columns: 1fr; /* stack buttons under image */
  gap: 8px;
}
.support-page .section-media .list a {
  text-align: center;
  padding: 12px;
}

/* PDF-ikon + avstand til tekst */
.support-page a[href$=".pdf"] {
  /* juster disse verdiene etter smak */
  --pdf-icon-left: 12px; /* avstand fra venstre kant på lenka til ikon */
  --pdf-icon-w: 30px; /* ikonbredde */
  --pdf-icon-h: 50px; /* ikonhøyde (ca. linjehøyde) */
  --pdf-icon-gap: 8px; /* ← G A P  mellom ikon og tekst */

  position: relative;
  padding-left: calc(
    var(--pdf-icon-left) + var(--pdf-icon-w) + var(--pdf-icon-gap)
  );
  line-height: 1.4;
}

.support-page a[href$=".pdf"]::before {
  content: "";
  position: absolute;
  left: var(--pdf-icon-left);
  top: 50%;
  transform: translateY(-50%);
  width: var(--pdf-icon-w);
  height: var(--pdf-icon-h);
  background: no-repeat center / contain
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23E41F26' d='M6 2h8l6 6v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z'/%3E%3Cpath fill='%23ffffff' d='M14 2v6h6'/%3E%3Crect x='5' y='14' width='14' height='6' rx='1.2' fill='%23ffffff'/%3E%3Ctext x='12' y='18.3' font-family='Arial,Helvetica,sans-serif' font-size='5' font-weight='700' text-anchor='middle' fill='%23E41F26'%3EPDF%3C/text%3E%3C/svg%3E");
  opacity: 0.95;
}

/* Ikon på diagram-lenker i seksjon #6 og #7 */
.support-page section:is([id="6"], [id="7"]) .list a[href$=".jpg" i],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".jpeg" i],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".png" i],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".webp" i],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".svg" i],
/* Fallbacks without the case-insensitive flag, for tools that don't parse it */
.support-page section:is([id="6"], [id="7"]) .list a[href$=".JPG"],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".JPEG"],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".PNG"],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".WEBP"],
.support-page section:is([id="6"], [id="7"]) .list a[href$=".SVG"] {
  --wire-icon-left: 12px;
  --wire-icon-w: 30px;
  --wire-icon-h: 50px;
  --wire-icon-gap: 8px;

  position: relative;
  padding-left: calc(
    var(--wire-icon-left) + var(--wire-icon-w) + var(--wire-icon-gap)
  );
  line-height: 1.4;
}

.support-page section:is([id="6"], [id="7"]) .list a[href$=".jpg" i]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".jpeg" i]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".png" i]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".webp" i]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".svg" i]::before,
/* Fallbacks without the case-insensitive flag */
.support-page section:is([id="6"], [id="7"]) .list a[href$=".JPG"]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".JPEG"]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".PNG"]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".WEBP"]::before,
.support-page section:is([id="6"], [id="7"]) .list a[href$=".SVG"]::before {
  content: "";
  position: absolute;
  left: var(--wire-icon-left);
  top: 50%;
  transform: translateY(-50%);
  width: var(--wire-icon-w);
  height: var(--wire-icon-h);
  background: url("../files/supportPage/wiring_diagram.png") no-repeat center /
    contain;
  opacity: 0.95;
}

/* ================= RESPONSIVE: TABLET (≤1024px) & PHONE (≤768px) ================ */

/* Make anchors land below sticky navbar on small screens */
.support-page .section {
  scroll-margin-top: 90px;
}

/* ---------- 1024px (iPad landscape/portrait) ---------- */
@media (max-width: 1024px) {
  /* Wrapper padding a bit tighter */
  .support-page .container {
    padding: 24px 16px;
  }

  /* Hero height & text scale */
  .support-page .hero {
    min-height: 380px;
  }
  .support-page .hero__content {
    padding: 36px 16px;
  }

  /* Overlap band spacing follows hero reduction */
  .support-page .band--overlap {
    margin-top: -64px;
  }

  /* Services: 4-up grid even on tablet */
  .support-page .services {
    /* Keep 4-up even on tablet */
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }
  .support-page .service-card {
    padding: 12px;
  }
  .support-page .service-card .icon {
    width: 44px;
    height: 44px;
  }
  .support-page .service-card h3 {
    font-size: 14px;
  }
  .support-page .service-card p {
    font-size: 12px;
  }

  /* Stack TEXT above MEDIA for content sections on tablet/phone */
  .support-page .section-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .support-page .section-content {
    order: 1; /* text first */
  }
  .support-page .section-media {
    order: 2; /* image/figures second */
  }
  .support-page .section-media img {
    border-radius: 12px;
  }

  /* Section header: move the Back to Top pill under the title */
  .support-page .section-header {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .support-page .section-header .back-to-top {
    order: 2;
  }

  /* Download lists fit better in one column at this width */
  .support-page .list {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---------- 768px (large phones / small tablets) ---------- */
@media (max-width: 768px) {
  .support-page .container {
    padding: 20px 14px;
  }

  .support-page .hero {
    min-height: 300px;
  }
  .support-page .hero__content h1 {
    font-size: clamp(26px, 6vw, 36px);
  }

  /* Overlap refinement */
  .support-page .band--overlap {
    margin-top: -48px;
  }

  /* Services: 4-up grid even on phone */
  .support-page .services {
    /* Keep 4-up even on phone */
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
  .support-page .service-card {
    padding: 10px;
  }
  .support-page .service-card .icon {
    width: 36px;
    height: 36px;
    margin-bottom: 6px;
  }
  .support-page .service-card h3 {
    font-size: 13px;
  }
  .support-page .service-card p {
    font-size: 11px;
  }

  /* Section content spacing */
  .support-page .section {
    padding: 18px;
  }
  .support-page .section h3 {
    font-size: clamp(18px, 5vw, 22px);
  }

  /* Lists become a single column for comfortable tap targets */
  .support-page .list {
    grid-template-columns: 1fr;
  }

  /* FAQ titles a tad smaller so they don’t wrap awkwardly */
  .support-page .faq summary {
    padding: 14px 0;
  }
}

/* ---- Specific sizing tweaks ---- */
/* Section #2 (Warranty): limit image size so it never overwhelms */
.support-page section#2 .section-media img {
  max-width: 360px;
  max-height: 240px;
  object-fit: contain;
  margin-inline: auto;
}
@media (max-width: 768px) {
  .support-page section#2 .section-media img {
    max-width: 300px;
    max-height: 200px;
  }
}

/* Section #3 (Buyers' Guide): PDF buttons not full-width on small screens */
.support-page section#3 .section-media .list {
  grid-template-columns: repeat(2, minmax(140px, 1fr));
  max-width: 420px;
  margin: 10px auto 0;
}
.support-page section#3 .section-media .list a {
  text-align: center;
  padding: 10px; /* slightly smaller */
}
@media (max-width: 380px) {
  .support-page section#3 .section-media .list {
    grid-template-columns: 1fr; /* fall back to single column on very narrow */
    max-width: 300px;
  }
}
