/* ============================================================
   Euphoria Bygg: main.css
   Shared parts: base, buttons, the menu and the phone menu.
   Colours and sizes come from tokens.css only.
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--svartbeis);
}

body {
  margin: 0;
  background: var(--kalk);
  color: var(--tekst);
  font-family: var(--font);
  font-size: var(--brod);
  font-weight: var(--vekt-tekst);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

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

.til-innhold {
  position: absolute;
  left: var(--side);
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--runding);
  background: var(--kalk);
  color: var(--tekst);
  text-decoration: none;
}

.til-innhold:focus {
  top: 12px;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- buttons ---------- */

.knapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55em;
  height: var(--knapp-h);
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: var(--runding);
  font-size: 16px;
  font-weight: var(--vekt-sterk);
  letter-spacing: -0.005em;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.knapp svg {
  width: 17px;
  height: 17px;
  flex: none;
}

.knapp-lys {
  background: var(--kalk);
  color: var(--tekst);
}

.knapp-lys:hover {
  background: var(--hvit);
}

.knapp-strek {
  border-color: var(--linje-lys);
  color: var(--tekst-lys);
}

.knapp-strek:hover {
  border-color: var(--tekst-lys);
}

.knapp-mork {
  background: var(--knapp-flate);
  color: var(--tekst-lys);
}

.knapp-mork:hover {
  background: var(--knapp-flate-hover);
}

.knapp-strek-mork {
  border-color: var(--linje-mork-2);
  color: var(--tekst);
}

.knapp-strek-mork:hover {
  border-color: var(--tekst);
}

.knapp-liten {
  height: 42px;
  padding: 0 18px;
  font-size: var(--liten);
}

/* ---------- the menu ---------- */

.meny {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--meny-h);
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 var(--side);
  color: var(--tekst-lys);
  transition: background-color 0.35s ease, color 0.35s ease, box-shadow 0.35s ease;
}

html:not(.js) .meny:not(.fast) {
  position: absolute;
}

.meny.fast {
  background: var(--meny-fast);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  color: var(--tekst);
  box-shadow: 0 1px 0 var(--linje-mork);
}

/* on the front page the menu lies on the light hero's own ground while the hero holds the screen: no bar, no line */
.meny.fast.flat {
  background: transparent;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  box-shadow: none;
}

.meny-merke {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex: none;
}

.meny-merke img {
  width: 44px;
  height: 44px;
}

.meny-merke .merke-mork,
.meny.fast .meny-merke .merke-lys {
  display: none;
}

.meny.fast .meny-merke .merke-mork {
  display: block;
}

.meny-navn {
  font-size: 18px;
  font-weight: var(--vekt-sterk);
  letter-spacing: -0.02em;
  line-height: 1;
}

.meny-lenker {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: var(--liten);
}

.meny-lenker a {
  position: relative;
  text-decoration: none;
  padding: 6px 0;
}

.meny-punkter > li > a::after,
.meny-pil::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.35s var(--ease-ut);
}

.meny-punkter > li > a:hover::after,
.meny-pil:hover::after,
.meny-pil[aria-expanded="true"]::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Prosjekter and Tjenester open a list of all of them (Sverre 27.10.2026: «begge to med en pil ned der du kan se alle»):
   the mouse opens it, a click keeps it, Escape and a click outside close it (js/main.js) */
.meny-punkter {
  display: flex;
  align-items: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.meny-punkter > li {
  position: relative;
}

.meny-pil {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.meny-pil .ned {
  width: 12px;
  height: 12px;
  transition: transform 0.25s var(--ease-ut);
}

.meny-pil[aria-expanded="true"] .ned {
  transform: rotate(180deg);
}

.meny-liste {
  position: absolute;
  top: calc(100% + 14px);
  left: -18px;
  z-index: 2;
  display: none;
  min-width: 300px;
  max-height: calc(100svh - var(--meny-h) - 24px);
  overflow-y: auto;
  margin: 0;
  padding: 8px;
  list-style: none;
  border-radius: 6px;
  background: var(--kalk);
  color: var(--tekst);
  box-shadow: var(--skygge-liste);
}

.meny-liste.apen {
  display: block;
}

/* the gap between the word and the list belongs to the open item, so the mouse can cross it (a bridge inside the list was
   cut off by the list's own overflow, and the list closed on the way down); only while open, so it never opens a list by itself */
.meny-lenker .har-liste.apen::after,
html:not(.js) .meny-lenker .har-liste:hover::after {
  content: "";
  position: absolute;
  top: 100%;
  left: -18px;
  width: max(calc(100% + 36px), 300px);
  height: 16px;
}

.meny-lenker .meny-liste a {
  display: block;
  padding: 9px 12px;
  border-radius: 4px;
  line-height: 1.3;
}

.meny-lenker .meny-liste a:hover,
.meny-lenker .meny-liste a:focus-visible {
  background: var(--kalk-2);
}

.meny-liste a[aria-current="page"] {
  font-weight: var(--vekt-sterk);
}

.meny-alle {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--linje-mork);
}

.meny-lenker .meny-alle a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-weight: var(--vekt-sterk);
}

.meny-alle .pil {
  width: 16px;
  height: 16px;
}

/* without JavaScript the list opens on hover and keyboard focus */
html:not(.js) .har-liste:hover > .meny-liste,
html:not(.js) .har-liste:focus-within > .meny-liste {
  display: block;
}

.meny-ikoner {
  display: flex;
  align-items: center;
  gap: 14px;
}

.meny-ikon svg {
  width: 18px;
  height: 18px;
}

.meny-ikon:hover {
  opacity: 0.7;
}

.meny-hoyre {
  display: flex;
  align-items: center;
  gap: 18px;
}

.sprak {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 42px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: 14px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.sprak [data-lang] {
  opacity: 0.66;
}

.sprak [data-lang].valgt {
  opacity: 1;
  font-weight: 600;
}

.sprak i {
  font-style: normal;
  opacity: 0.4;
}

.meny.fast .knapp-lys {
  background: var(--knapp-flate);
  color: var(--tekst-lys);
}

.meny.fast .knapp-lys:hover {
  background: var(--knapp-flate-hover);
}

.meny-knapp {
  display: none;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: var(--liten);
  font-weight: var(--vekt-sterk);
  cursor: pointer;
}

.meny-knapp .streker,
.meny-uten-js .streker {
  position: relative;
  width: 20px;
  height: 10px;
}

.meny-knapp .streker::before,
.meny-knapp .streker::after,
.meny-uten-js .streker::before,
.meny-uten-js .streker::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease-ut);
}

.meny-knapp .streker::before,
.meny-uten-js .streker::before {
  top: 0;
}

.meny-knapp .streker::after,
.meny-uten-js .streker::after {
  bottom: 0;
}

.meny-ring-ikon {
  display: none;
}

/* the phone menu */
.mobilmeny {
  position: fixed;
  inset: 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: calc(var(--meny-h) + 24px) var(--side) 40px;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--svartbeis);
  color: var(--tekst-lys);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s ease, visibility 0s linear 0.35s;
}

.mobilmeny[hidden] {
  display: none;
}

.mobilmeny.apen {
  visibility: visible;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.mobilmeny nav {
  display: flex;
  flex-direction: column;
  margin-top: auto;
}

.mobilmeny nav a {
  padding: 10px 0;
  border-bottom: 1px solid var(--linje-lys);
  font-size: 34px;
  font-weight: var(--vekt-tittel);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mobilmeny .meny-punkter {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.mobilmeny .meny-pil {
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  border-bottom: 1px solid var(--linje-lys);
  font-size: 34px;
  font-weight: var(--vekt-tittel);
  letter-spacing: -0.03em;
  text-align: left;
}

.mobilmeny .meny-pil::after,
.mobilmeny .meny-punkter > li > a::after {
  content: none;
}

.mobilmeny .meny-pil .ned {
  width: 20px;
  height: 20px;
}

.mobilmeny .meny-liste {
  position: static;
  min-width: 0;
  max-height: none;
  padding: 6px 0 14px;
  background: none;
  color: inherit;
  box-shadow: none;
}

.mobilmeny .meny-liste a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 0;
  font-size: 19px;
  font-weight: var(--vekt-tekst);
  letter-spacing: 0;
  color: var(--tekst-lys-2);
}

.mobilmeny .meny-liste a[aria-current="page"],
.mobilmeny .meny-alle a {
  color: var(--tekst-lys);
}

.mobilmeny .meny-alle {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 0;
}

.mobilmeny-bunn {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
}

.mobilmeny-bunn .meny-ikoner {
  margin-left: auto;
}

@media (max-height: 520px) {
  .mobilmeny {
    gap: 18px;
    padding-top: calc(var(--meny-h) + 8px);
    padding-bottom: 20px;
  }

  .mobilmeny nav a,
  .mobilmeny .meny-pil {
    padding: 6px 0;
    font-size: 24px;
  }

  .mobilmeny .meny-liste a {
    padding: 6px 0;
    font-size: 17px;
  }
}

/* without JavaScript the menu button cannot open anything: a link to the page list in the footer stands in */
.meny-uten-js {
  display: none;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 4px;
  font-size: var(--liten);
  font-weight: var(--vekt-sterk);
  text-decoration: none;
}

body.meny-apen {
  overflow: hidden;
}

.meny.over-mobilmeny {
  background: transparent;
  box-shadow: none;
  color: var(--tekst-lys);
}

.meny.over-mobilmeny .meny-merke .merke-lys {
  display: block;
}

.meny.over-mobilmeny .meny-merke .merke-mork {
  display: none;
}

.meny.over-mobilmeny .meny-ring-ikon {
  border-color: var(--linje-lys);
}

.meny.over-mobilmeny .meny-knapp .streker::before {
  transform: translateY(4.25px) rotate(45deg);
}

.meny.over-mobilmeny .meny-knapp .streker::after {
  transform: translateY(-4.25px) rotate(-45deg);
}

@media (max-width: 1023px) {
  .meny-lenker,
  .meny-hoyre .knapp-ring {
    display: none;
  }

  .meny-hoyre {
    margin-left: auto;
  }

  .meny-knapp {
    display: inline-flex;
  }

  html:not(.js) .meny-knapp {
    display: none;
  }

  html:not(.js) .meny-uten-js {
    display: inline-flex;
  }

  .meny-ring-ikon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 1px solid var(--linje-lys);
    border-radius: 50%;
  }

  .meny.fast .meny-ring-ikon {
    border-color: var(--linje-mork);
  }

  .meny.fast.over-mobilmeny .meny-ring-ikon {
    border-color: var(--linje-lys);
  }

  .meny-ring-ikon svg {
    width: 17px;
    height: 17px;
  }
}

.mobilmeny .sprak {
  display: none;
}

@media (max-width: 767px) {
  .meny-hoyre .sprak {
    display: none;
  }

  .mobilmeny .sprak {
    display: inline-flex;
    font-size: 16px;
  }

  .meny-merke img {
    width: 38px;
    height: 38px;
  }

  .meny-navn {
    font-size: 16px;
  }

  .meny-hoyre {
    gap: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}

.meny-punkter > li > a[aria-current]::after,
.meny-pil.aktiv::after {
  transform: scaleX(1);
}
