/* Laget for alle: zoom fra ett utkast til hele kjeden.
   Hentet fra side-v2 (css/abri.css), avgrenset til #losninger og tilpasset
   v9-fontene og -fargene. Logikken ligger i js/laget-for-alle.js. */

#losninger {
  --flate: #F5F1E8;
  --linje: #E6DECF;
  --blekk: #0A1A32;
  --tekst-2: #3D4A5E;
  --tekst-3: #5B6577;
  --marine: #0A1A32;
  --havbla: #2E5C9A;
  --gronn: #23704A; /* hakene, som i hero-animasjonen */
  --ut: cubic-bezier(0.16, 1, 0.3, 1);
  --topp: 73px; /* høyden på v9-toppmenyen */
  justify-content: flex-start !important;
}
#losninger ul, #losninger ol { margin: 0; padding: 0; list-style: none; }

.zoom-rutenett {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  column-gap: clamp(32px, 5vw, 80px);
  align-items: start;
}
.rolle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 78vh;
  padding-block: 6vh;
}
.rolle:first-child { min-height: 64vh; justify-content: flex-start; padding-top: 4vh; }
/* Siste rolle får plass nok til at scenen hviler mens teksten leses */
.rolle:last-child { min-height: 100vh; }
.rolle-tittel {
  font-family: var(--ab-head, 'Source Serif 4', Georgia, serif);
  font-weight: var(--ab-hw, 400);
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.08;
  letter-spacing: -0.015em;
  color: var(--blekk);
  text-wrap: balance;
}
.rolle .for {
  margin-bottom: 14px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--havbla);
}
.rolle-brod { margin-top: 18px; font-size: 17px; line-height: 1.6; color: var(--tekst-2); max-width: 44ch; text-wrap: pretty; }
/* #losninger foran, ellers vinner nullstillingen av lister over og listen klistrer seg til teksten */
#losninger .rolle .hakeliste { margin-top: 28px; display: grid; gap: 10px; }
.rolle .hakeliste li { display: flex; gap: 10px; font-size: 15.5px; line-height: 1.5; color: var(--blekk); }
/* Grønn hake som i hero-animasjonen */
.rolle .hakeliste .ikon { flex: none; width: 24px; height: 24px; margin-top: -1px; color: var(--gronn); }
.zoom .rolle { opacity: 0.28; transition: opacity 420ms var(--ut); }
.zoom .rolle.aktiv { opacity: 1; }

.scene {
  --scene-h: min(700px, calc(100svh - 120px));
  position: sticky;
  top: calc(var(--topp) + (100svh - var(--topp) - var(--scene-h)) / 2);
  height: var(--scene-h);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.scene-vindu {
  position: relative;
  flex: 1;
  min-height: 0;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background: var(--flate);
  box-shadow: inset 0 0 0 1px var(--linje);
}
.verden {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  grid-template-columns: repeat(3, 816px);
  gap: 64px;
  transform-origin: 0 0;
  font-family: Geist, system-ui, sans-serif;
}
.kontor {
  padding: 28px;
  border-radius: 28px;
  background: rgba(10, 26, 50, 0.04);
  transition: box-shadow 500ms var(--ut), background-color 500ms var(--ut);
}
.kontor-hode { display: block; width: 168px; height: 14px; margin-bottom: 22px; border-radius: 7px; background: rgba(10, 26, 50, 0.1); }
.kontor-ark { display: grid; grid-template-columns: repeat(3, 240px); gap: 20px; }
.scene[data-niva="0"] .kontor.eget, .scene[data-niva="1"] .kontor.eget, .scene[data-niva="3"] .kontor.eget {
  background: rgba(46, 92, 154, 0.07);
  box-shadow: inset 0 0 0 3px rgba(46, 92, 154, 0.45);
}
/* Papir: skyggen står i verdens mål, så den krymper naturlig når zoomen går ut */
.ark {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 240px;
  height: 312px;
  padding: 24px 22px;
  box-sizing: border-box;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(10, 26, 50, 0.08), 0 10px 26px -10px rgba(10, 26, 50, 0.22);
}
/* Nabodokumentene dempes når zoomen når meglerens utkast */
.ark:not(.helt) { opacity: calc(0.3 + 0.7 * var(--naer, 1)); }
.ark > .ark-hode { display: block; width: 62%; height: 16px; margin-bottom: 10px; border-radius: 4px; background: #dce2ea; }
.ark .linje { display: block; height: 9px; border-radius: 5px; background: #e7ebf0; }
.ark .l1 { width: 100%; } .ark .l2 { width: 90%; } .ark .l3 { width: 96%; } .ark .l4 { width: 68%; } .ark .l6 { width: 82%; }

.ark.helt { gap: 9px; padding: 20px 20px 18px; }
.ark.helt .ark-hode { display: flex; align-items: center; gap: 10px; width: auto; height: auto; margin-bottom: 6px; background: none; }
.ark-merke { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--marine); }
.ark.helt b { display: block; font-size: 14px; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; color: var(--blekk); }
.ark.helt i { display: block; font-size: 10.5px; line-height: 1.3; font-style: normal; color: var(--tekst-3); }
.ark-felt { font-size: 9.5px; font-weight: 600; letter-spacing: 0.02em; color: var(--tekst-3); }
.ark-tekst { font-size: 11px; line-height: 1.5; color: var(--blekk); }
.ark-tekst u {
  text-decoration: none;
  background: rgba(46, 92, 154, 0.14);
  box-shadow: inset 0 -1.5px 0 var(--havbla);
  border-radius: 2px;
}
.kildelapp {
  align-self: flex-start;
  padding: 3px 7px;
  border-radius: 5px;
  background: #eaf1fb;
  color: var(--havbla);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.2;
}

/* Kontrollen: de fleste ark er i orden, noen har motstrid eller mangler */
.ark .kontroll {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 108px;
  height: 108px;
  margin: -54px 0 0 -54px;
  border-radius: 999px;
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 260ms var(--ut), transform 520ms var(--ut);
  transition-delay: calc(var(--i) * 9ms);
}
.ark .kontroll .ikon { width: 64px; height: 64px; }
.ark .kontroll.ok { background: var(--gronn); color: #fff; box-shadow: 0 8px 18px -6px rgba(10, 26, 50, 0.35); }
.ark .kontroll.avvik { background: #fff; color: var(--marine); box-shadow: inset 0 0 0 9px var(--marine), 0 8px 18px -6px rgba(10, 26, 50, 0.35); }
.ark.helt .kontroll {
  left: auto;
  top: auto;
  right: 14px;
  bottom: 14px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  width: auto;
  height: auto;
  margin: 0;
  padding: 4px 9px 4px 6px;
  font-size: 10px;
  font-weight: 600;
  box-shadow: none;
}
.ark.helt .kontroll .ikon { width: 13px; height: 13px; }
.scene.kontrollert .kontroll { opacity: 1; transform: none; }

.scene-faner {
  display: flex;
  justify-content: center;
  gap: 6px;
}
.scene-faner li {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--tekst-3);
  font-size: 14px;
  font-weight: 500;
  box-shadow: inset 0 0 0 1px var(--linje);
  transition: background-color 300ms var(--ut), color 300ms var(--ut), box-shadow 300ms var(--ut);
}
.scene-faner li.aktiv { background: var(--marine); color: #fff; box-shadow: inset 0 0 0 1px var(--marine); }

@media (max-width: 899px) {
  .zoom-rutenett { grid-template-columns: 1fr; }
  .scene {
    --scene-h: 44svh;
    order: -1;
    top: var(--topp);
    z-index: 3;
    gap: 8px;
    padding-bottom: 8px;
    background: #fff;
    box-shadow: 0 -8px 0 #fff;
  }
  .scene-vindu { border-radius: 18px; }
  .rolle, .rolle:first-child { min-height: 62svh; justify-content: center; padding-block: 4svh; }
  .rolle:last-child { min-height: 70svh; }
  .scene-faner { gap: 4px; }
  .scene-faner li { padding: 5px 10px; font-size: 12px; }
}

/* Når toppmenyen er gledet bort, bruker den klebrige scenen hele høyden */
html.hode-skjult #losninger { --topp: 0px; }
.scene { transition: top .45s cubic-bezier(.2, .8, .2, 1); }
