/* © Haut Forvalting AS (Org.nr. 931 603 760) — Altibedrift.
Konfidensiell arkitektur/arbeidsdokument. Uautorisert kopiering/distribusjon forbudt. */
/* ==========================================================================
   MTA MOTION-PATCH: AI & VERKTØY (TILLEGG)
   DOMAIN: body[data-ws-tools-surface="1"] main
   ========================================================================== */

/* 1. NATIVE DETAILS: Rask strukturell åpning (kun transform) */
body[data-ws-tools-surface="1"] main details[open] summary ~ * {
  transform-origin: top;
  animation: mta-details-expand 150ms ease-out;
}
@keyframes mta-details-expand {
  from { transform: scaleY(0.95); }
  to { transform: scaleY(1); }
}

/* 2. INTERAKSJON: CTA Hover & Fokus */
body[data-ws-tools-surface="1"] main .insight-editorial-exit__primary {
  transition: background-color 150ms ease, transform 150ms ease, outline-color 150ms ease;
}
@media (hover:hover) and (pointer:fine) and (prefers-reduced-motion:no-preference) {
  body[data-ws-tools-surface="1"] main .insight-editorial-exit__primary:hover {
    background-color: #E2DFD8;
    transform: translateY(-2px);
  }
}
body[data-ws-tools-surface="1"] main .insight-editorial-exit__primary:focus-visible {
  outline: 3px solid #326d51;
  outline-offset: 4px;
  transform: translateY(0);
}

/* 3. RO: Konsoll tvinges statisk, ingen falsk puls */
body[data-ws-tools-surface="1"] main .ws-tool-console * {
  animation: none !important;
}

/* 4. LEVENDE LOGO: Pauset default, gjenbruker eksisterende keyframes */
body[data-ws-tools-surface="1"] main .ws-exit-brand__orbit--outer {
  animation: ws-exit-orbit 24s linear infinite paused;
}
body[data-ws-tools-surface="1"] main .ws-exit-brand__orbit--middle {
  animation: ws-exit-orbit-reverse 18s linear infinite paused;
}
body[data-ws-tools-surface="1"] main .ws-exit-brand__core {
  animation: ws-exit-breathe 4s ease-in-out infinite alternate paused;
}

/* Aktiveres KUN via IntersectionObserver / Lifecycle state */
body[data-ws-tools-surface="1"]main [data-ws-brand-running="true"] .ws-exit-brand__orbit--outer,
body[data-ws-tools-surface="1"]main [data-ws-brand-running="true"] .ws-exit-brand__orbit--middle,
body[data-ws-tools-surface="1"]main [data-ws-brand-running="true"] .ws-exit-brand__core {
  animation-play-state: running;
}

/* 5. SIKKERHETSNETT: Reduced motion fjerner alt */
@media (prefers-reduced-motion: reduce) {
  body[data-ws-tools-surface="1"] main * {
    animation: none !important;
    transition: none !important;
  }
}

/* Integration: lifecycle is on decoration, never the body; inherited loops stay stopped. */
html body[data-ws-tools-surface="1"] main :is(.ws-tool-console,.ws-tool-console *,.source-graph-live__pulse,.source-route__status),
html body[data-ws-tools-surface="1"] main .ws-tool-console::before,
html body[data-ws-tools-surface="1"] main .ws-tool-console::after { animation: none !important; }
html body[data-ws-tools-surface="1"] main :is(.ws-exit-brand,.ws-exit-brand *) { animation: none !important; }
@media(prefers-reduced-motion:no-preference) {
 html body[data-ws-tools-surface="1"] main .ws-exit-brand__orbit--outer { animation: ws-exit-orbit 24s linear infinite paused !important; }
 html body[data-ws-tools-surface="1"] main .ws-exit-brand__orbit--middle { animation: ws-exit-orbit-reverse 18s linear infinite paused !important; }
 html body[data-ws-tools-surface="1"] main .ws-exit-brand__core { animation: ws-exit-breathe 4s ease-in-out infinite paused !important; }
 html body[data-ws-tools-surface="1"] main .ws-exit-brand[data-ws-brand-running="true"] :is(.ws-exit-brand__orbit,.ws-exit-brand__core) { animation-play-state: running !important; }
}
html body[data-ws-tools-surface="1"] main :is(a,button,summary):focus-visible { outline: 3px solid #326d51 !important; outline-offset: 3px; box-shadow: 0 0 0 3px #fff !important; }
html body[data-ws-tools-surface="1"] main .ws-tools-motion-control { display: inline-flex; align-items: center; position: relative; z-index: 5; min-height: 44px; margin: .75rem 0; padding: .7rem 1rem; border-radius: 999px; border: 1px solid #a0b8a7; background: #143e34; color: #fff; font: inherit; font-size: .85rem; cursor: pointer; }
html body[data-ws-tools-surface="1"] main .ws-tools-motion-control[hidden] { display: none !important; }
@media(prefers-reduced-motion:reduce) {
 html body[data-ws-tools-surface="1"] main *, html body[data-ws-tools-surface="1"] main *::before, html body[data-ws-tools-surface="1"] main *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
 html body[data-ws-tools-surface="1"] main .insight-editorial-exit__primary:hover { transform: none !important; }
}
