/* === MOBILE FIX: Prevent horizontal scrolling === */
html {
  overflow-x: hidden;
}

body {
  overflow-x: hidden;
  max-width: 100vw;
}

/* Hjem-seksjonen med nodes-forside.jpg */
.hero-bg[data-bg="nodes-forside.jpg"]::before {
  background-image: url('nodes-forside.jpg');
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  will-change: transform;
}
/* KI-forordningen i skolen - Ekstern stylesheet */

/* === CSS Variables === */
:root {
  --bg: #0b0f14;
  --panel: #121821;
  --text: #e6eaf0;
  --muted: #9aa6b2;
  --accent: #4da3ff;
  --ok: #1fa971;
  --warn: #f0b429;
  --risk: #ff7a45;
  --stop: #ff3b3b;
}

/* Light mode */
:root[data-theme="light"] {
  --bg: #f5f7fa;
  --panel: #ffffff;
  --text: #1a202c;
  --muted: #4a5568;
  --accent: #2b6cb0;
  --ok: #38a169;
  --warn: #d69e2e;
  --risk: #dd6b20;
  --stop: #e53e3e;
}

/* === Base Styles === */
* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body {
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* === Layout === */
.wrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* === Header & Navigation === */
header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 15, 20, 0.8);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid #1f2733;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

:root[data-theme="light"] header {
  background: rgba(255, 255, 255, 0.8);
  border-bottom: 1px solid #e2e8f0;
}

nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  align-items: center;
}

nav a {
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: var(--text);
  transition: all 0.2s ease;
}

:root[data-theme="light"] nav a {
  border-color: rgba(0, 0, 0, 0.1);
}

nav a[aria-current="page"] {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.1);
}

:root[data-theme="light"] nav a[aria-current="page"] {
  background: rgba(43, 108, 176, 0.1);
}

/* === Theme Toggle === */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid #1f2733;
  border-radius: 10px;
  padding: 8px 12px;
  cursor: pointer;
  color: var(--text);
  transition: all 0.2s ease;
  position: relative;
  width: 44px;
  height: 44px;
  margin-left: auto;
}

.theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(77, 163, 255, 0.1);
}

.theme-toggle svg {
  position: absolute;
  transition: all 0.3s ease;
}

.theme-toggle .sun-icon {
  opacity: 0;
  transform: rotate(90deg) scale(0);
}

.theme-toggle .moon-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

:root[data-theme="light"] .theme-toggle .sun-icon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

:root[data-theme="light"] .theme-toggle .moon-icon {
  opacity: 0;
  transform: rotate(-90deg) scale(0);
}

:root[data-theme="light"] .theme-toggle {
  border-color: #e2e8f0;
}

:root[data-theme="light"] .theme-toggle:hover {
  border-color: var(--accent);
  background: rgba(43, 108, 176, 0.1);
}

/* === Typography === */
h1 {
  font-size: clamp(36px, 5vw, 56px);
  margin: 0 0 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #ef4444 0%, #f59e0b 25%, #10b981 50%, #06b6d4 75%, #8b5cf6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 20px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(20px, 3vw, 28px);
  margin: 0 0 16px;
  font-weight: 600;
}

/* More spacing between sections in Lær view */
#laer h3 {
  margin-top: 48px;
}

#laer h3:first-of-type {
  margin-top: 0;
}

.lead {
  color: var(--muted);
  max-width: 70ch;
  font-size: 1.125rem;
  line-height: 1.7;
}

.hero .lead {
  font-size: 1.35rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: var(--text);
  opacity: 0.95;
}

.note {
  color: var(--muted);
  font-size: 0.9rem;
  padding: 8px 16px;
  background: rgba(77, 163, 255, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  display: inline-block;
}

:root[data-theme="light"] .note {
  background: rgba(43, 108, 176, 0.08);
  border-left: 3px solid var(--accent);
}

.hero .note {
  font-size: 0.95rem;
  opacity: 0.85;
  margin-bottom: 2rem;
  background: rgba(77, 163, 255, 0.1);
  border-radius: 10px;
}

.hero-subtext {
  font-size: 1rem;
  color: var(--muted);
  margin: 1rem 0;
  max-width: 70ch;
  margin-left: auto;
  margin-right: auto;
}

:root[data-theme="light"] .hero .note {
  background: rgba(43, 108, 176, 0.12);
}

.hero h1 {
  font-size: 3rem;
  line-height: 1.2;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

:root[data-theme="light"] .hero h1 {
  text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

.hero .cta {
  margin-top: 2rem;
  font-size: 1.15rem;
  padding: 16px 32px;
  box-shadow: 0 8px 24px rgba(77, 163, 255, 0.4);
  animation: pulse 2s ease-in-out infinite;
}

.hero .cta:hover {
  box-shadow: 0 12px 32px rgba(77, 163, 255, 0.5);
  animation: none;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 8px 24px rgba(77, 163, 255, 0.4);
  }
  50% {
    box-shadow: 0 12px 32px rgba(77, 163, 255, 0.5);
  }
}

/* === Sections === */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
}

.hero > * {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

main section {
  padding: 28px 0;
}

/* === View System === */
.view {
  display: none;
  opacity: 0;
  animation: fadeInView 0.4s ease-out forwards;
  min-height: auto;
  position: relative;
  padding: 40px 20px;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
}

/* Hjem-view skal ikke ha avrundede hjørner siden hero er full-width */
#hjem {
  padding: 0;
  border-radius: 0;
  overflow: visible;
}

.view.active {
  display: block;
}

@keyframes fadeInView {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Sørg for at innhold er over bakgrunnen */
.view > * {
  position: relative;
  z-index: 1;
}

/* === Grid & Cards === */
.grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

/* Risk cards - 4 columns on larger screens */
#laer .grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

@media (min-width: 1024px) {
  #laer .grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  #laer .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.card {
  background: rgba(18, 24, 33, 0.6);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

:root[data-theme="light"] .card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(12px);
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

:root[data-theme="light"] .card:hover {
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.12);
}

/* === Tags & Badges === */
.tag {
  display: inline-block;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid;
  font-weight: 600;
  letter-spacing: 0.3px;
}

/* === Risk Level Colors === */
.r-min {
  border-left: 5px solid var(--ok);
}

.r-min .tag {
  background: rgba(31, 169, 113, 0.15);
  border-color: var(--ok);
  color: var(--ok);
}

.r-tra {
  border-left: 5px solid var(--warn);
}

.r-tra .tag {
  background: rgba(240, 180, 41, 0.15);
  border-color: var(--warn);
  color: var(--warn);
}

.r-hoy {
  border-left: 5px solid var(--risk);
}

.r-hoy .tag {
  background: rgba(255, 122, 69, 0.15);
  border-color: var(--risk);
  color: var(--risk);
}

.r-uat {
  border-left: 5px solid var(--stop);
}

.r-uat .tag {
  background: rgba(255, 59, 59, 0.15);
  border-color: var(--stop);
  color: var(--stop);
}

/* Light mode adjustments for risk cards */
:root[data-theme="light"] .r-min .tag {
  background: rgba(56, 161, 105, 0.15);
  color: #2f855a;
  font-weight: 600;
}

:root[data-theme="light"] .r-tra .tag {
  background: rgba(214, 158, 46, 0.15);
  color: #b7791f;
  font-weight: 600;
}

:root[data-theme="light"] .r-hoy .tag {
  background: rgba(221, 107, 32, 0.15);
  color: #c05621;
  font-weight: 600;
}

:root[data-theme="light"] .r-uat .tag {
  background: rgba(229, 62, 62, 0.15);
  color: #c53030;
  font-weight: 600;
}

/* === Buttons === */
.cta {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: linear-gradient(135deg, var(--accent) 0%, #5eb0ff 100%);
  color: #ffffff;
  border: 0;
  padding: 12px 24px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(77, 163, 255, 0.3);
}

.cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(77, 163, 255, 0.4);
}

:root[data-theme="light"] .cta {
  background: linear-gradient(135deg, #2b6cb0 0%, #3182ce 100%);
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.3);
}

:root[data-theme="light"] .cta:hover {
  box-shadow: 0 8px 20px rgba(43, 108, 176, 0.4);
}

.cta:active {
  transform: translateY(0);
}

.cta-secondary {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cta-secondary:hover {
  background: var(--accent);
  color: #031120;
  transform: translateY(-1px);
}

.cta-secondary:active {
  transform: translateY(0);
}

/* === Lists === */
ol, ul {
  line-height: 1.8;
}

li {
  margin-bottom: 8px;
}

/* === Footer === */
footer {
  padding: 0;
  color: var(--muted);
  text-align: center;
  flex-shrink: 0;
}

footer .wrap {
  padding: 16px 20px;
}

footer small {
  font-size: 0.85rem;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-content a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

.footer-logo {
  height: 35px;
  width: auto;
  border-radius: 8px;
  object-fit: cover;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.footer-logo:hover {
  transform: scale(1.1);
  opacity: 0.8;
}

/* === Quiz/Veiviser Elementer === */
.progress-container {
  margin-bottom: 20px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #1f2733;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
  transition: background-color 0.3s ease;
}

:root[data-theme="light"] .progress-bar {
  background: #e2e8f0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--ok));
  border-radius: 10px;
  transition: width 0.3s ease;
}

.help-text {
  background: rgba(77, 163, 255, 0.1);
  border-left: 3px solid var(--accent);
  padding: 12px;
  margin: 16px 0;
  border-radius: 8px;
  font-size: 14px;
  color: var(--muted);
  transition: background-color 0.3s ease;
}

:root[data-theme="light"] .help-text {
  background: rgba(43, 108, 176, 0.1);
}

.options-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.options-container .cta {
  width: 100%;
  justify-content: flex-start;
  text-align: left;
}

.nav-buttons {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #1f2733;
}

.result-card {
  background: var(--panel);
  border: 1px solid #1f2733;
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 16px;
}

.result-text {
  line-height: 1.8;
  margin: 16px 0;
  white-space: pre-line;
}

.actions-list {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #1f2733;
}

.actions-list h4 {
  margin: 0 0 12px 0;
  color: var(--accent);
}

.actions-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.actions-list li {
  padding: 8px 0 8px 24px;
  position: relative;
  line-height: 1.6;
}

.actions-list li:before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* === Artikkel/Juridisk seksjon === */
.articles-list,
.gdpr-list,
.other-laws-list {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #1f2733;
}

:root[data-theme="light"] .articles-list,
:root[data-theme="light"] .gdpr-list,
:root[data-theme="light"] .other-laws-list {
  border-top-color: #e2e8f0;
}

.articles-list h4,
.gdpr-list h4,
.other-laws-list h4 {
  margin: 0 0 16px 0;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 8px;
}

.articles-grid {
  display: grid;
  gap: 12px;
}

.article-card {
  display: flex;
  gap: 12px;
  padding: 12px;
  background: rgba(77, 163, 255, 0.05);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  transition: background-color 0.3s ease;
}

:root[data-theme="light"] .article-card {
  background: rgba(43, 108, 176, 0.05);
}

.article-number {
  flex-shrink: 0;
  font-weight: 700;
  color: var(--accent);
  font-size: 13px;
  min-width: 80px;
}

.article-content {
  flex: 1;
}

.article-content strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 14px;
}

.article-content p {
  margin: 0 0 8px 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.article-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: transform 0.2s ease;
}

.article-link:hover {
  transform: translateX(4px);
  text-decoration: underline;
}

.compact-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.compact-list li {
  padding: 6px 0 6px 20px;
  position: relative;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.compact-list li:before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

/* === Accessibility === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === Page Transition Overlay === */
.page-transition {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  backdrop-filter: blur(8px);
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-in-out;
}

.page-transition.active {
  opacity: 1;
  pointer-events: auto;
}

/* === Accordion === */
.accordion {
  margin: 24px 0;
}

.accordion-item {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.accordion-item:hover {
  border-color: var(--accent);
}

.accordion-header {
  width: 100%;
  padding: 16px 20px;
  background: transparent;
  border: none;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  text-align: left;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  transition: background-color 0.2s ease;
}

.accordion-header:hover {
  background: rgba(77, 163, 255, 0.1);
}

.accordion-header[aria-expanded="true"] {
  background: rgba(77, 163, 255, 0.15);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.accordion-title {
  flex: 1;
}

.accordion-icon {
  flex-shrink: 0;
  transition: transform 0.3s ease;
  color: var(--accent);
}

.accordion-header[aria-expanded="true"] .accordion-icon {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease, padding 0.4s ease;
  padding: 0 20px;
}

.accordion-header[aria-expanded="true"] + .accordion-content {
  max-height: 1000px;
  padding: 20px;
}

.accordion-content p {
  margin: 0 0 16px 0;
}

.accordion-content ul {
  margin: 12px 0;
  padding-left: 24px;
}

.accordion-content li {
  margin: 8px 0;
  line-height: 1.6;
}

.accordion-content strong {
  color: var(--accent);
}

.external-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 500;
  margin-top: 12px;
  transition: opacity 0.2s ease;
}

.external-link:hover {
  opacity: 0.8;
}

.external-link::after {
  content: '↗';
  font-size: 14px;
}

/* === Timeline === */
.timeline {
  margin: 32px 0;
  padding: 24px;
  background: rgba(18, 24, 33, 0.4);
  backdrop-filter: blur(12px);
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.timeline-item {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  position: relative;
}

.timeline-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 40px;
  width: 2px;
  height: calc(100% - 16px);
  background: rgba(77, 163, 255, 0.3);
}

.timeline-marker {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--panel);
  border: 3px solid rgba(77, 163, 255, 0.5);
  flex-shrink: 0;
  margin-top: 2px;
  transition: all 0.3s ease;
}

.timeline-item.complete .timeline-marker {
  background: var(--ok);
  border-color: var(--ok);
  box-shadow: 0 0 0 4px rgba(31, 169, 113, 0.2);
}

.timeline-item:hover .timeline-marker {
  transform: scale(1.15);
}

.timeline-content {
  flex: 1;
  padding-top: 2px;
}

.timeline-content strong {
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

/* === Resources Layout === */
.resources-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 2rem;
}

@media (max-width: 900px) {
  .resources-layout {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* === Info Box === */
.info-box {
  background: rgba(18, 24, 33, 0.4);
  backdrop-filter: blur(12px);
  border-left: 4px solid var(--accent);
  padding: 20px 24px;
  margin: 24px 0;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.info-box h4 {
  margin: 0 0 16px 0;
  color: var(--accent);
  font-size: 18px;
}

.info-box ul {
  margin: 0;
  padding-left: 24px;
}

.info-box li {
  margin: 10px 0;
  line-height: 1.6;
}

.info-box strong {
  color: var(--text);
  font-weight: 600;
}

/* Light mode adjustments for new components */
:root[data-theme="light"] .accordion-item {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.5);
}

:root[data-theme="light"] .accordion-item:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(43, 108, 176, 0.08);
}

:root[data-theme="light"] .accordion-header[aria-expanded="true"] {
  background: rgba(43, 108, 176, 0.05);
  border-bottom-color: rgba(0, 0, 0, 0.08);
}

:root[data-theme="light"] .timeline-item:not(:last-child)::before {
  background: rgba(43, 108, 176, 0.2);
}

:root[data-theme="light"] .info-box {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

:root[data-theme="light"] .timeline {
  background: rgba(255, 255, 255, 0.6);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* === Tiltak Cards === */
.tiltak-grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  margin: 24px 0;
}

.tiltak-card {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
}

.tiltak-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  border-color: var(--accent);
}

.tiltak-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.tiltak-number {
  background: var(--accent);
  color: #ffffff;
  font-weight: bold;
  font-size: 14px;
  padding: 4px 10px;
  border-radius: 6px;
  flex-shrink: 0;
}

.tiltak-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.3;
}

.tiltak-card > p {
  color: var(--muted);
  margin: 0 0 16px 0;
  line-height: 1.5;
}

.tiltak-details {
  margin: 16px 0;
  background: rgba(77, 163, 255, 0.05);
  border-radius: 8px;
  overflow: hidden;
}

.tiltak-details summary {
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 600;
  color: var(--accent);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.tiltak-details summary::-webkit-details-marker {
  display: none;
}

.tiltak-details summary::before {
  content: '▶';
  font-size: 12px;
  transition: transform 0.3s ease;
}

.tiltak-details[open] summary::before {
  transform: rotate(90deg);
}

.tiltak-details summary:hover {
  background: rgba(77, 163, 255, 0.1);
}

.tiltak-details ul {
  margin: 0;
  padding: 16px 16px 16px 40px;
  list-style: none;
}

.tiltak-details li {
  margin: 8px 0;
  line-height: 1.6;
  position: relative;
  padding-left: 8px;
}

.tiltak-details li::before {
  content: '•';
  position: absolute;
  left: -12px;
  color: var(--accent);
  font-weight: bold;
}

.tiltak-action {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
}

.tiltak-action strong {
  color: var(--accent);
}

.tiltak-action a {
  color: var(--accent);
  text-decoration: underline;
}

.tiltak-action a:hover {
  opacity: 0.8;
}

/* Risk level color text */
.r-min-text {
  color: var(--ok);
}

.r-tra-text {
  color: var(--warn);
}

.r-hoy-text {
  color: var(--risk);
}

.r-uat-text {
  color: var(--stop);
}

/* Alert box */
.alert-box {
  background: rgba(255, 122, 69, 0.1);
  border-left: 4px solid var(--risk);
  padding: 20px 24px;
  margin: 32px 0;
  border-radius: 0 8px 8px 0;
}

.alert-box h4 {
  margin: 0 0 16px 0;
  color: var(--risk);
}

.alert-box ol {
  margin: 0;
  padding-left: 24px;
}

.alert-box li {
  margin: 12px 0;
  line-height: 1.6;
}

.alert-box strong {
  color: var(--text);
  font-weight: 600;
}

/* Download box */
.download-box {
  background: rgba(77, 163, 255, 0.1);
  border: 2px solid var(--accent);
  padding: 24px;
  margin: 32px 0;
  border-radius: 12px;
  text-align: center;
}

.download-box p {
  margin: 0 0 16px 0;
  color: var(--text);
}

.download-box .cta {
  margin: 0;
}

/* Light mode adjustments for tiltak */
:root[data-theme="light"] .tiltak-card {
  border-color: rgba(0, 0, 0, 0.1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .tiltak-card:hover {
  box-shadow: 0 4px 12px rgba(43, 108, 176, 0.15);
}

:root[data-theme="light"] .tiltak-details {
  background: rgba(43, 108, 176, 0.05);
}

:root[data-theme="light"] .tiltak-details summary:hover {
  background: rgba(43, 108, 176, 0.1);
}

:root[data-theme="light"] .tiltak-action {
  border-top-color: rgba(0, 0, 0, 0.1);
}

:root[data-theme="light"] .alert-box {
  background: rgba(221, 107, 32, 0.08);
}

:root[data-theme="light"] .download-box {
  background: rgba(43, 108, 176, 0.08);
}

/* Responsive hero adjustments */
@media (max-width: 768px) {
  /* Mobilfix: Prevent horizontal scroll */
  * {
    max-width: 100%;
  }
  
  .wrap {
    overflow-x: hidden;
  }
  
  /* Sørg for at grid ikke går utenfor */
  .grid, 
  .tiltak-grid, 
  .resources-layout {
    grid-template-columns: 1fr;
  }
  
  /* Kort skal ikke gå utenfor */
  .card, 
  .tiltak-card,
  .info-box {
    max-width: 100%;
    min-width: 0;
  }
  
  /* Modal skal ikke være bredere enn skjerm */
  .modal-content {
    max-width: calc(100vw - 2rem);
    margin: 1rem;
  }

  .hero {
    padding: 60px 20px 40px;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero .lead {
    font-size: 1.1rem;
  }
  
  .hero .cta {
    font-size: 1rem;
    padding: 12px 24px;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }
  
  .hero .lead {
    font-size: 1rem;
  }
}

/* === Hero background for other sections === */
.hero-bg {
  position: relative;
  padding: 40px 20px;
  margin: -28px calc(-50vw + 50%) 28px calc(-50vw + 50%);
  width: 100vw;
  overflow: hidden;
  min-height: 80vh;
}

.hero-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.22;
  z-index: 0;
}

.hero-bg[data-bg="nodes-2.png"]::before {
  background-image: url('nodes-2.png');
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
  transform: translateZ(0);
  will-change: transform;
}

.hero-bg::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
    ellipse at top,
    rgba(37, 99, 235, 0.10) 0%,
    rgba(3, 17, 32, 0.75) 50%,
    rgba(3, 17, 32, 0.85) 100%
  );
  z-index: 1;
}

:root[data-theme="light"] .hero-bg::after {
  background: radial-gradient(
    ellipse at top,
    rgba(37, 99, 235, 0.07) 0%,
    rgba(255, 255, 255, 0.85) 50%,
    rgba(255, 255, 255, 0.92) 100%
  );
}

.hero-bg > * {
  position: relative;
  z-index: 2;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.hero-bg h2,
.hero-bg h3 {
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

:root[data-theme="light"] .hero-bg h2,
:root[data-theme="light"] .hero-bg h3 {
  text-shadow: 0 1px 3px rgba(255, 255, 255, 0.5);
}

@media (max-width: 768px) {
  .hero-bg {
    padding: 30px 20px;
    min-height: 70vh;
  }
}

/* === RISK LEVEL MODAL === */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  animation: fadeIn 0.3s ease;
}

.modal.active {
  display: flex;
  align-items: center;
  justify-content: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: var(--panel);
  border: 2px solid var(--accent);
  border-radius: 20px;
  padding: 2rem;
  max-width: 700px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp 0.3s ease;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  font-size: 2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: all 0.2s ease;
}

.modal-close:hover {
  background: var(--accent);
  color: white;
  transform: rotate(90deg);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--accent);
}

.modal-icon {
  font-size: 3rem;
  line-height: 1;
}

.modal-title {
  flex: 1;
}

.modal-title h2 {
  margin: 0 0 0.5rem 0;
  color: var(--accent);
  font-size: 1.8rem;
}

.modal-subtitle {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin: 0;
}

.modal-section {
  margin-bottom: 1.5rem;
}

.modal-section h3 {
  color: var(--accent);
  margin: 0 0 0.75rem 0;
  font-size: 1.2rem;
}

.modal-section p {
  margin: 0 0 0.75rem 0;
  line-height: 1.7;
}

.modal-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem 0;
}

.modal-list li {
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  position: relative;
}

.modal-list li:before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: bold;
}

.modal-examples {
  background: rgba(37, 99, 235, 0.1);
  border-left: 3px solid var(--accent);
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.modal-examples h4 {
  margin: 0 0 0.75rem 0;
  color: var(--accent);
  font-size: 1rem;
}

.modal-warning {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.modal-warning strong {
  color: #ef4444;
}

.modal-success {
  background: rgba(34, 197, 94, 0.1);
  border-left: 3px solid #22c55e;
  padding: 1rem;
  border-radius: 8px;
  margin: 1rem 0;
}

.modal-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
}

.modal-footer .cta {
  margin: 0;
}

.clickable {
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.clickable:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 16px 32px rgba(77, 163, 255, 0.25);
}

.clickable:active {
  transform: translateY(-2px) scale(1.01);
}

.card-hint {
  display: block;
  text-align: center;
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
  font-weight: 600;
}

.clickable:hover .card-hint {
  opacity: 1;
}

/* Light mode adjustments */
:root[data-theme="light"] .modal {
  background-color: rgba(0, 0, 0, 0.5);
}

:root[data-theme="light"] .modal-content {
  border-color: var(--accent);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
}

:root[data-theme="light"] .modal-examples {
  background: rgba(43, 108, 176, 0.06);
  border-radius: 12px;
}

:root[data-theme="light"] .clickable:hover {
  box-shadow: 0 16px 32px rgba(43, 108, 176, 0.2);
}
