/* Skrifttyper lastes fra egen server (ikke Google) – SIL Open Font License.
   Samme @font-face ligger i fonts.css (for adminen i /nimda) – endres skriftene, endre begge. */
@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/barlow-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/barlow-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/barlow-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Barlow";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/barlow-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Oswald";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("/fonts/oswald-700.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Mechtronic AS – stilark */
:root {
  --blue: #17559b;
  --blue-dark: #11447d;
  --orange: #ffa500;
  --orange-dark: #e69500;
  --header-bg: #f0f0f0;
  --surface: #eef1f5;
  --line: #d5dae2;
  --light-grey: #f0f0f0;
  --text: #000;
  --container: 1170px;
  --wide: 1440px; /* toppmeny og delte seksjoner (bilde + kort) */
  --focus: #0b3d78;
  --border: #595959;
  --font-text: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --font-display: "Barlow", "Helvetica Neue", Arial, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: #fff;
  color: var(--text);
  font-family: var(--font-text);
  font-size: 19px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

/* Responsive bilder ligger i <picture>; la <img> være den som deltar i layouten */
picture { display: contents; }
picture > source { display: none; }

a { color: inherit; }

a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; margin: 0; }

p { margin: 0 0 1.4em; }

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

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: #fff;
  padding: 8px 16px;
  z-index: 200;
}
.skip-link:focus { left: 16px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  height: 90px;
}

.site-header .inner {
  height: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 52px 0 43px;
}

.logo img { width: 302px; height: auto; }

.main-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 28px;
}

.main-nav a {
  text-decoration: none;
  font-size: 18px;
  color: #000;
  padding: 4px 0;
}

.main-nav a:hover,
.main-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

.nav-toggle {
  display: none;
  background: none;
  border: 0;
  width: 44px;
  height: 44px;
  padding: 10px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 2px;
  background: #000;
  margin: 5px 0;
  transition: transform .2s, opacity .2s;
}

.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  height: clamp(300px, 40vw, 1100px);
  overflow: hidden;
}

.hero img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }

.hero--home { height: clamp(300px, 33vw, 960px); }

.hero--contain { background: #fff; }
.hero--contain img { object-fit: contain; }

.hero--single { background: #eef3fb; }
.hero--single img { object-fit: cover; object-position: right center; }

.hero-text {
  position: absolute;
  left: 50%;
  top: 57%;
  transform: translate(-50%, -50%);
  text-align: center;
  width: max-content;
  max-width: calc(100% - 32px);
}

.hero-text h1 {
  background: var(--header-bg);
  font-weight: 700;
  font-size: 66px;
  padding: 2px 48px 6px;
  letter-spacing: -0.5px;
}

.hero-text .tagline {
  display: block;
  margin-top: 8px;
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 42px;
  line-height: 1.15;
  text-transform: uppercase;
  text-shadow: 0 2px 6px rgba(0, 0, 0, .7);
  background: rgba(0, 0, 0, .5);
  padding: 0 14px;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Blått bånd / sidetittel ---------- */
.band {
  background: var(--blue);
  color: #fff;
  text-align: center;
  padding: 26px 24px;
}

.band h1,
.band h2 {
  font-family: var(--font-text);
  hyphens: auto;
  overflow-wrap: break-word;
  font-weight: 600;
  letter-spacing: .5px;
  font-size: 36px;
  line-height: 1.2;
}

.band--intro p {
  margin: 0 auto;
  max-width: 900px;
  font-size: 30px;
  line-height: 1.35;
}

/* ---------- Innhold ---------- */
.content { padding: 56px 0 50px; }

.content h2 {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 30px;
  margin-bottom: 16px;
}

.content h2.sub,
.content h3 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 1.4em;
}

.content ul { margin: 0 0 1.6em; padding-left: 35px; }
.content ul li { margin: 0; }

.plain-list { list-style: none; padding: 0 !important; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 28px;
  border: 0;
  border-radius: 3px;
  background: var(--orange);
  color: #000;
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 18px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s;
}

.btn:hover { background: var(--orange-dark); }

.btn--large { padding: 15px 34px; font-size: 19px; }

/* ---------- Delt seksjon (bilde + kort) ---------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  max-width: var(--wide);
  margin: 0 auto 10px;
  padding: 0 6px;
}

.split > picture > img,
.split .split-media img { width: 100%; height: 100%; max-height: 760px; object-fit: cover; }

.card-grey {
  background: var(--surface);
  border-radius: 10px;
  padding: 36px 48px 44px;
}

.card-grey h2 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 30px;
  margin-bottom: 12px;
}

.card-grey > p { font-size: 19px; line-height: 1.6; }

.card-orange {
  background: var(--orange);
  border-radius: 10px;
  padding: 36px 36px 30px;
}

.card-orange h2 {
  font-family: "Oswald", var(--font-display);
  font-weight: 700;
  font-size: 34px;
  text-transform: uppercase;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.card-orange h3 {
  font-family: var(--font-text);
  font-weight: 600;
  font-size: 19px;
  margin: 0 0 1.2em;
}

.split--simplex { align-items: center; margin-bottom: 6px; }
.split--simplex img { object-fit: contain; max-height: 700px; }

/* ---------- Skjema: ledetekst inne i feltet + emnevalg ---------- */
.form { padding: 12px 0 0; }

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 18px;
}

.field { position: relative; }
.field--full { grid-column: 1 / -1; }

.field input,
.field textarea {
  font: inherit;
  font-size: 17px;
  width: 100%;
  min-height: 58px;
  border: 1.5px solid #8a929e;
  border-radius: 8px;
  background: #fff;
  color: #000;
  padding: 24px 14px 8px;
}

.field textarea { min-height: 130px; padding-top: 28px; resize: vertical; }

/* Ledeteksten ligger inne i feltet og glir opp når feltet får fokus eller innhold */
.field label {
  position: absolute;
  left: 15px;
  top: 17px;
  font-size: 17px;
  color: #3f4650;
  pointer-events: none;
  transition: top .15s ease, font-size .15s ease, color .15s ease;
}

.field input:focus + label,
.field input:not(:placeholder-shown) + label,
.field textarea:focus + label,
.field textarea:not(:placeholder-shown) + label {
  top: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--blue);
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 85, 155, .3);
}

/* Emnevalg */
.topics { border: 0; padding: 0; margin: 0 0 18px; min-width: 0; }
.topics legend { font-weight: 600; font-size: 16px; padding: 0; margin-bottom: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

.chip { position: relative; }

.chip input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.chip span {
  display: inline-block;
  padding: 8px 16px;
  border: 1.5px solid #8a929e;
  border-radius: 999px;
  background: #fff;
  font-size: 16px;
  line-height: 1.3;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.chip:hover span { border-color: var(--blue); }
.chip input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }

.form-note { font-size: 15px; margin: 0 0 14px; }
.form-privacy { font-size: 15px; margin: 14px 0 0; }

.form-submit {
  width: 100%;
  margin-top: 22px;
  border-radius: 8px;
  padding: 15px 20px;
  background: var(--blue);
  color: #fff;
  font-size: 18px;
}

.form-submit:hover { background: var(--blue-dark); }

.hidden { display: none !important; }
.mb-0 { margin-bottom: 0 !important; }

.form-status {
  margin: 16px 0 0;
  font-size: 17px;
  font-weight: 600;
}

.form-status.error { color: #a00; }

/* ---------- Adresse og kart ---------- */
.map-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-address {
  background: var(--surface);
  border-radius: 10px;
  padding: 28px 32px;
  font-size: 18px;
  line-height: 1.6;
}

.map-address h2 {
  font-family: var(--font-text);
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 10px;
}

.map-address p { margin: 0 0 12px; }
.map-address p:last-child { margin: 0; }

.map-slot {
  flex: 1;
  display: flex;
  min-height: 320px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.map {
  flex: 1;
  min-height: 320px;
  z-index: 0; /* hold Leaflet-lagene under header og popup */
}

.map:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
.map .leaflet-popup-content { font-family: var(--font-text); font-size: 15px; line-height: 1.5; }
.map .leaflet-control-attribution { font-size: 12px; }

/* ---------- Merkevarer ---------- */
.brands { padding: 56px 0 64px; border-top: 1px solid var(--line); }

.brands h2 {
  font-family: var(--font-text);
  font-weight: 500;
  font-size: 30px;
  margin: 0 0 28px;
}

.brand-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px 24px;
}

.brand img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  background: #f5f5f5;
  mix-blend-mode: multiply;
}

.brand { background: #f5f5f5; padding-bottom: 16px; }
.brand h3,
.brand p { padding: 0 16px; }

.brand h3 {
  font-family: var(--font-text);
  font-size: 18px;
  font-weight: 700;
  margin: 12px 0 2px;
}

.brand p { font-size: 15px; line-height: 1.45; margin: 0; color: #333; }

/* ---------- Kontaktside ---------- */
.contact-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  max-width: var(--wide);
  margin: 0 auto;
}

.contact-details {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 22px;
  line-height: 1.75;
  padding: 48px 24px;
}

.contact-details p { margin: 0 0 1.75em; }
.contact-details strong { font-weight: 500; }
.contact-details p:last-child { margin: 0; }


.contact-logos img { width: 100%; height: 100%; object-fit: cover; }

.people {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
  max-width: var(--wide);
  margin: 24px auto 40px;
  padding: 0 24px;
}

.person {
  min-width: 0;
  overflow-wrap: anywhere;
  background: var(--light-grey);
  padding: 20px 28px;
  font-size: 19px;
  line-height: 1.8;
}

.person h3 { font-family: var(--font-text); font-size: 19px; font-weight: 700; margin: 0; }
.person p { margin: 0; }

/* ---------- Personvern ---------- */
.legal h2 { font-weight: 600; font-size: 24px; margin: 1.6em 0 .6em; }
.legal h2:first-child { margin-top: 0; }
.legal h1 { font-family: var(--font-text); font-size: 30px; font-weight: 500; margin-bottom: 1.2em; }

.legal h3 { font-weight: 600; font-size: 20px; margin: 1.4em 0 .4em; }
.legal h2.doc-title { font-size: 30px; font-weight: 500; margin: 0 0 .4em; }
.legal .updated { color: #333; font-size: 16px; }
.legal ul { margin-bottom: 1.4em; }

.table-wrap { overflow-x: auto; margin: 0 0 1.6em; }

.legal table {
  border-collapse: collapse;
  width: 100%;
  font-size: 16px;
  line-height: 1.5;
}

.legal th,
.legal td {
  border: 1px solid #8a8a8a;
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.legal th { background: var(--light-grey); font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--blue);
  color: #fff;
  font-size: 21px;
  line-height: 1.65;
  padding: 30px 0 26px;
}

.site-footer .inner {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 32px;
}

.site-footer p { margin: 0; }
.site-footer strong { font-weight: 700; }
.site-footer a { color: #fff; text-decoration: underline; }
.site-footer a:focus-visible,
.site-footer button:focus-visible { outline-color: #fff; box-shadow: 0 0 0 5px var(--blue); }
.site-footer .contact-col p { margin: 0; }
.site-footer ul { margin: 0; padding-left: 38px; }
.site-footer .link-button {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: #fff;
  text-decoration: underline;
  cursor: pointer;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
}

.footer-logo img { width: 276px; height: auto; margin-bottom: 8px; }
.footer-logo a { text-decoration: none; }
.footer-logo a:hover { text-decoration: underline; }

/* ---------- Popup ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(0, 0, 0, .6);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal[hidden] { display: none; }

.modal-dialog:focus { outline: none; box-shadow: none; }

.modal-dialog {
  position: relative;
  background: #fff;
  width: 100%;
  max-width: 580px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  padding: 32px 36px 36px;
  border-top: 6px solid var(--orange);
}

.modal-dialog h2 { font-weight: 700; font-size: 36px; line-height: 1.1; padding-right: 48px; }
.modal-dialog .modal-sub { font-size: 18px; margin: 6px 0 22px; }

.modal-close {
  position: absolute;
  top: 22px;
  right: 22px;
  width: 44px;
  height: 44px;
  border: 0;
  background: none;
  cursor: pointer;
  padding: 8px;
}

.modal-close svg { width: 24px; height: 24px; }

.modal .form { padding: 0; }

body.modal-open { overflow: hidden; }

/* ---------- Samtykkebanner (bare når Google Analytics er slått på) ---------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  background: #fff;
  border-top: 4px solid var(--blue);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .18);
  max-height: 100vh;
  overflow-y: auto;
}

.cookie-banner[hidden] { display: none; }

.cookie-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 22px 24px 24px;
  font-size: 16px;
  line-height: 1.55;
}

.cookie-inner .cookie-title { font-family: var(--font-text); font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.cookie-inner p { margin: 0 0 14px; }

.cookie-actions { display: flex; flex-wrap: wrap; gap: 10px; }

/* Godta og Avvis ser like ut, så det er like lett å si nei som ja */
.cookie-btn {
  min-width: 150px;
  min-height: 44px;
  padding: 8px 20px;
  border: 2px solid var(--blue);
  border-radius: 5px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.cookie-btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }

/* ---------- Responsivt ---------- */
@media (max-width: 1100px) {
  .site-header .inner { padding: 0 24px; }
  .logo img { width: 240px; }
  .main-nav ul { gap: 20px; }
  .main-nav a { font-size: 16px; }
  .hero-text h1 { font-size: 52px; }
  .hero-text .tagline { font-size: 32px; }
  .site-footer .inner { grid-template-columns: 1fr 1fr; }
  .footer-logo { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  body { font-size: 17px; }
  .site-header { height: 72px; }
  .logo img { width: 200px; }
  .nav-toggle { display: block; }
  .main-nav {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-top: 1px solid #ddd;
    box-shadow: 0 8px 16px rgba(0, 0, 0, .08);
    display: none;
  }
  .nav-open .main-nav { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 8px 0; }
  .main-nav a { display: block; padding: 12px 24px; font-size: 18px; }

  .hero, .hero--home { height: 300px; }
  .hero-text { top: 50%; }
  .hero-text h1 { font-size: 30px; padding: 4px 16px; }
  .hero-text .tagline { font-size: 20px; }

  .band h1, .band h2 { font-size: 26px; }
  .band--intro p { font-size: 21px; }
  .content { padding: 36px 0; }
  .content h2, .card-grey h2 { font-size: 24px; }

  .split,
  .contact-info { grid-template-columns: 1fr; }
  .split > picture > img, .split .split-media img { max-height: 380px; }
  .split--simplex img { max-height: 420px; }
  .card-grey { padding: 28px 20px 32px; }
  .brand-grid { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
  .card-grey > p { font-size: 17px; }
  .card-orange { padding: 28px 20px; }
  .form-grid { grid-template-columns: 1fr; }
  .map-address { padding: 24px 20px; }

  .contact-details { font-size: 18px; padding: 36px 16px; }
  .people { grid-template-columns: 1fr; padding: 0 16px; }


  .site-footer { font-size: 17px; }
  .site-footer .inner { grid-template-columns: 1fr; gap: 24px; }

  .modal-dialog { padding: 24px 20px 28px; }
  .modal-dialog h2 { font-size: 28px; }
  .modal-close { top: 14px; right: 10px; }
}

@media (max-width: 480px) {
  .container { padding: 0 16px; }
  .hero { grid-auto-flow: row; grid-template-columns: 1fr; }
  .hero > picture:not(:first-child) { display: none; }
  .btn--large { width: 100%; }
}

@media (max-width: 600px) {
  .cookie-btn { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
