/* =========================================================
   Hermansen Maskin AS — designsystem
   Merkefarge hentet fra eksisterende profil: #800015
   ========================================================= */

:root {
  --red: #800015;
  --red-700: #66000f;
  --red-900: #47000b;
  --red-050: #fbf2f3;

  --ink: #16130f;
  --ink-2: #55504a;
  --ink-3: #7d7770;

  --bg: #ffffff;
  --bg-alt: #f6f4f1;
  --line: #e4e0da;
  --line-strong: #cfc9c1;

  --container: 1200px;
  --gutter: 20px;

  --radius: 3px;
  --header-h: 68px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;

  --shadow: 0 1px 2px rgba(22, 19, 15, .04), 0 8px 24px rgba(22, 19, 15, .06);
  --shadow-lg: 0 2px 4px rgba(22, 19, 15, .06), 0 18px 48px rgba(22, 19, 15, .12);
}

/* ---------- 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(--ink-2);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

h1, h2, h3, h4 {
  color: var(--ink);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.12;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2.1rem, 6.2vw, 3.6rem); }
h2 { font-size: clamp(1.6rem, 4.2vw, 2.4rem); }
h3 { font-size: 1.2rem; line-height: 1.3; }
p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
}

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section { padding: 64px 0; }
.section--alt { background: var(--bg-alt); }
.section--tight { padding: 44px 0; }
@media (min-width: 768px) {
  .section { padding: 96px 0; }
  .section--tight { padding: 64px 0; }
  :root { --gutter: 32px; }
}

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--red); color: #fff; padding: 12px 18px;
}
.skip-link:focus { left: 0; }

/* ---------- Typografiske hjelpere ---------- */
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  font-size: .78rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--red);
  margin: 0 0 18px;
}
.eyebrow::before {
  content: ""; width: 28px; height: 2px; background: var(--red); flex: none;
}
.lead { font-size: 1.12rem; color: var(--ink-2); max-width: 62ch; }
.section-head { max-width: 62ch; margin-bottom: 40px; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-size: .95rem; font-weight: 600; letter-spacing: .01em;
  text-decoration: none;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { text-decoration: none; }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-700); }
.btn--ghost { border-color: var(--line-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); background: var(--ink); color: #fff; }
.btn--light { background: #fff; color: var(--red); }
.btn--light:hover { background: rgba(255, 255, 255, .88); }
.btn--outline-light { border-color: rgba(255, 255, 255, .5); color: #fff; }
.btn--outline-light:hover { border-color: #fff; background: #fff; color: var(--red); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

.arrow-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: .95rem; color: var(--red);
}
.arrow-link svg { transition: transform .18s ease; }
.arrow-link:hover { text-decoration: none; }
.arrow-link:hover svg { transform: translateX(4px); }

/* ---------- Header ---------- */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header__inner {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.logo:hover { text-decoration: none; }
.logo__mark { width: 6px; height: 30px; background: var(--red); flex: none; }
.logo__text { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name {
  font-size: 1.02rem; font-weight: 800; color: var(--ink);
  letter-spacing: -0.015em; white-space: nowrap;
}
.logo__sub {
  font-size: .63rem; font-weight: 600; letter-spacing: .16em;
  text-transform: uppercase; color: var(--ink-3);
}

.nav { display: none; }
.nav__list { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav__link {
  display: block; padding: 8px 14px;
  font-size: .9rem; font-weight: 600; color: var(--ink);
  border-radius: var(--radius);
}
.nav__link:hover { background: var(--bg-alt); text-decoration: none; }
.nav__link[aria-current="page"] { color: var(--red); }

.header__actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; color: var(--ink);
}
.icon-btn:hover { border-color: var(--ink); text-decoration: none; }
.header__cta { display: none; }

.burger {
  width: 42px; height: 42px; display: inline-flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 5px;
  background: none; border: 1px solid var(--line); border-radius: var(--radius);
}
.burger span {
  display: block; width: 18px; height: 2px; background: var(--ink);
  transition: transform .2s ease, opacity .2s ease;
}
.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  position: fixed; inset: var(--header-h) 0 0; z-index: 99;
  background: #fff; padding: 24px var(--gutter) 40px;
  overflow-y: auto;
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.mobile-nav.is-open { opacity: 1; transform: none; pointer-events: auto; }
.mobile-nav__list { list-style: none; margin: 0 0 28px; padding: 0; }
.mobile-nav__list a {
  display: block; padding: 16px 0;
  font-size: 1.3rem; font-weight: 700; color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.mobile-nav__list a:hover { text-decoration: none; color: var(--red); }
body.nav-open { overflow: hidden; }

@media (min-width: 900px) {
  .nav { display: block; }
  .burger { display: none; }
  .mobile-nav { display: none; }
  .header__cta { display: inline-flex; }
}

/* Små telefoner (iPhone SE o.l.): gi headeren plass */
@media (max-width: 400px) {
  :root { --gutter: 16px; }
  .logo__mark { height: 26px; }
  .logo__name { font-size: .9rem; }
  .logo__sub { font-size: .58rem; letter-spacing: .12em; }
  .header__actions .icon-btn { display: none; } /* Facebook ligger i footeren */
}

/* ---------- Hero ---------- */
.hero {
  border-bottom: 1px solid var(--line); overflow: hidden;
  padding-bottom: 36px; /* luft ned mot faktastripen */
}
.hero__grid { display: grid; gap: 0; }
.hero__content { padding: 52px 0 56px; }
.hero__title { margin-bottom: 20px; }
.hero__media { position: relative; margin-inline: calc(var(--gutter) * -1); }
.hero__media img { width: 100%; height: 280px; object-fit: cover; object-position: center; }
.hero .btn-row { margin-top: 30px; }

@media (min-width: 900px) {
  .hero { padding-bottom: 40px; }
  .hero__grid {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 64px;
  }
  .hero__content { padding: 80px 0; }
  /* Bildet holdes innenfor samme bredde som resten av innholdet, slik at det
     ikke blir dominerende og limt inntil headeren på brede skjermer. */
  .hero__media { margin: 0; }
  .hero__media img {
    height: auto; aspect-ratio: 4 / 3;
    max-height: 400px; width: 100%;
    object-fit: cover; object-position: center 45%;
    border-radius: var(--radius);
  }
}

/* ---------- Faktastripe ---------- */
.facts { border-bottom: 1px solid var(--line); }
.facts__grid {
  display: grid; grid-template-columns: repeat(2, 1fr);
}
.facts__item {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}
.facts__item:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 20px; }
.facts__item:nth-child(even) { padding-left: 20px; }
.facts__item:nth-last-child(-n+2) { border-bottom: 0; }
.facts__value {
  display: block; font-size: 1.7rem; font-weight: 800; color: var(--ink);
  letter-spacing: -0.02em; line-height: 1.1;
}
.facts__label {
  display: block; margin-top: 4px;
  font-size: .76rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3);
}
@media (min-width: 768px) {
  .facts__grid { grid-template-columns: repeat(4, 1fr); }
  .facts__item {
    padding: 34px 26px; border-bottom: 0; border-right: 1px solid var(--line);
  }
  .facts__item:first-child { padding-left: 0; }
  .facts__item:last-child { border-right: 0; }
  .facts__item:nth-child(odd), .facts__item:nth-child(even) { padding-left: 26px; padding-right: 26px; }
  .facts__item:first-child { padding-left: 0; }
}

/* ---------- Kort / tjenester ---------- */
.grid { display: grid; gap: 20px; }
.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid--2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid--3 { grid-template-columns: repeat(3, 1fr); } }

.card {
  display: flex; flex-direction: column;
  padding: 30px 26px 28px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-top-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.card:hover { border-top-color: var(--red); box-shadow: var(--shadow); transform: translateY(-2px); }
.card__icon { color: var(--red); margin-bottom: 18px; }
.card h3 { margin-bottom: 10px; }
.card p { font-size: .96rem; }
.card .arrow-link { margin-top: auto; padding-top: 18px; }

/* nummererte tjenestekort */
.card__num {
  font-size: .78rem; font-weight: 700; letter-spacing: .12em;
  color: var(--ink-3); margin-bottom: 14px;
}

/* ---------- Split (bilde + tekst) ---------- */
.split { display: grid; gap: 32px; align-items: center; }
.split__media img {
  width: 100%; height: 280px; object-fit: cover; border-radius: var(--radius);
}
@media (min-width: 900px) {
  .split { grid-template-columns: 1fr 1fr; gap: 64px; }
  .split__media img { height: 460px; }
  .split--reverse .split__media { order: 2; }
}

/* ---------- Bildebånd ---------- */
.band {
  height: 200px;
  background: var(--red-900) url("/img/band-lastebil.jpg") center 55% / cover no-repeat;
}
@media (min-width: 768px) { .band { height: 300px; } }

/* ---------- Sjekkliste ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.checklist li {
  position: relative; padding: 10px 0 10px 32px;
  border-bottom: 1px solid var(--line);
  color: var(--ink); font-size: .98rem;
}
.checklist li:last-child { border-bottom: 0; }
.checklist li::before {
  content: ""; position: absolute; left: 6px; top: 20px;
  width: 8px; height: 8px; background: var(--red);
}

/* ---------- CTA-seksjon ---------- */
.cta {
  background: var(--red); color: #fff;
  padding: 56px 0;
}
.cta h2 { color: #fff; }
.cta p { color: rgba(255, 255, 255, .88); }
.cta__grid { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) {
  .cta { padding: 76px 0; }
  .cta__grid { grid-template-columns: 1.2fr auto; gap: 48px; }
}

/* ---------- Kontaktkort ---------- */
.contact-cards { display: grid; gap: 16px; }
@media (min-width: 620px) { .contact-cards { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .contact-cards { grid-template-columns: repeat(3, 1fr); } }
.contact-card {
  padding: 26px 24px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
.contact-card__label {
  font-size: .76rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ink-3); margin-bottom: 8px;
}
.contact-card__value {
  font-size: 1.05rem; font-weight: 700; color: var(--ink);
  overflow-wrap: break-word;
}
.contact-card__value a { color: var(--ink); }
.contact-card__value a:hover { color: var(--red); }
.contact-card__note {
  font-size: .88rem; color: var(--ink-3); margin-top: 6px;
  overflow-wrap: anywhere;
}

/* ---------- Kart med samtykke ---------- */
.map {
  position: relative;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; background: var(--bg-alt);
  min-height: 320px;
}
.map iframe { display: block; width: 100%; height: 420px; border: 0; }
.map__placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 14px; text-align: center;
  min-height: 320px; padding: 40px 24px;
}
.map__placeholder p { max-width: 46ch; font-size: .95rem; }
@media (min-width: 768px) { .map__placeholder, .map { min-height: 420px; } }

/* ---------- Sertifiseringer ---------- */
.certs { border-top: 1px solid var(--line); background: var(--bg-alt); padding: 40px 0; }
.certs__title {
  font-size: .76rem; font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--ink-3);
  text-align: center; margin-bottom: 26px;
}
.certs__row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 28px 40px;
}
.certs__row img {
  height: 52px; width: auto; max-width: 120px; object-fit: contain;
  filter: grayscale(1); opacity: .72;
  transition: filter .2s ease, opacity .2s ease;
}
.certs__row img:hover { filter: none; opacity: 1; }
@media (min-width: 768px) { .certs__row img { height: 62px; max-width: 140px; } }

/* ---------- Footer ---------- */
.footer { background: var(--red); color: rgba(255, 255, 255, .84); }
.footer a { color: rgba(255, 255, 255, .84); }
.footer a:hover { color: #fff; }
.footer__grid { display: grid; gap: 36px; padding: 52px 0 40px; }
@media (min-width: 768px) {
  .footer__grid { grid-template-columns: 1.4fr 1fr 1fr; gap: 48px; padding: 68px 0 48px; }
}
.footer h3 {
  color: #fff; font-size: .78rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; margin-bottom: 18px;
}
.footer__name { color: #fff; font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; }
.footer__list {
  list-style: none; margin: 0; padding: 0; font-size: .95rem;
  overflow-wrap: anywhere;
}
.footer__list li { margin-bottom: 10px; }
.footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, .18);
  padding: 20px 0 28px;
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  align-items: center; justify-content: space-between;
  font-size: .86rem;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 10px 20px; }
/* Merk: må skrives som .footer a.footer__social for å slå .footer a:hover over,
   ellers arver knappen hvit tekst på hvit bakgrunn ved hover. */
.footer a.footer__social {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .4); border-radius: var(--radius);
  color: #fff; font-size: .9rem; font-weight: 600;
}
.footer a.footer__social:hover {
  background: #fff; color: var(--red); border-color: #fff; text-decoration: none;
}
.linkbutton {
  background: none; border: 0; padding: 0;
  color: inherit; font-size: inherit; text-decoration: underline;
}

/* ---------- Innholdsside (personvern o.l.) ---------- */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; font-size: 1.5rem; }
.prose h3 { margin-top: 1.6em; }
.prose ul { padding-left: 20px; }
.prose li { margin-bottom: .5em; }
.table-wrap { overflow-x: auto; margin: 24px 0; }
table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: .93rem; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
th { color: var(--ink); font-weight: 700; background: var(--bg-alt); }

/* ---------- Sidetopp ---------- */
.pagehead {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--line);
  padding: 48px 0 44px;
}
@media (min-width: 768px) { .pagehead { padding: 76px 0 68px; } }
.breadcrumbs { font-size: .84rem; color: var(--ink-3); margin-bottom: 16px; }
.breadcrumbs a { color: var(--ink-3); }

/* ---------- Cookie-banner ---------- */
.cookie {
  position: fixed; z-index: 150;
  left: 12px; right: 12px; bottom: 12px;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 24px 22px;
  max-width: 560px;
  display: none;
}
.cookie.is-visible { display: block; animation: cookie-in .25s ease both; }
@keyframes cookie-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .cookie.is-visible { animation: none; }
  html { scroll-behavior: auto; }
}
.cookie__title { font-size: 1.05rem; font-weight: 700; color: var(--ink); margin-bottom: 8px; }
.cookie p { font-size: .92rem; margin-bottom: 16px; }
.cookie__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.cookie__actions .btn { padding: 12px 20px; font-size: .9rem; flex: 1 1 auto; }
@media (min-width: 560px) {
  .cookie { left: 24px; right: auto; bottom: 24px; padding: 28px 26px; }
  .cookie__actions .btn { flex: 0 0 auto; }
}

/* ---------- Diverse ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.notice {
  border-left: 3px solid var(--red);
  background: var(--red-050);
  padding: 18px 22px;
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: .95rem;
}
