/* public/assets/css/site.css – Svalbard 360 */

:root {
  --ink: #0F1B2D;
  --ink-2: #4B5B70;
  --ink-3: #6B7A8F;
  --bg: #F4F6F9;
  --card: #FFFFFF;
  --line: #E3E8EF;
  --line-2: #E7ECF2;
  --accent: #1F5FA8;
  --accent-bg: #EAF1FA;
  --glass: rgba(8, 16, 34, 0.38);
  --glass-line: rgba(255, 255, 255, 0.16);
  --radius: 16px;
  --font: 'Schibsted Grotesk', 'Helvetica Neue', Arial, sans-serif;
  --wrap: 1280px;
  --pad: clamp(20px, 4vw, 40px);
  --panel-w: 460px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
}
body.article-open { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font-family: inherit; }
a { color: inherit; }
:focus-visible { outline: 3px solid #4C9BE8; outline-offset: 2px; border-radius: 6px; }

.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;
}
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: #fff; color: var(--ink); padding: 10px 14px; border-radius: 10px; font-weight: 600;
}
.skip-link:focus { top: 12px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); }

/* ─── Hero ───────────────────────────────────────────────────── */
.hero {
  position: relative;
  height: min(780px, 100svh);
  min-height: 640px;
  overflow: hidden;
  color: #fff;
  background-color: #1B2147;
  display: flex;
  flex-direction: column;
}
.hero-img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: center 70%;
  transition: filter .6s ease;
}
.hero-shade-x {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, rgba(4,10,24,.62) 0%, rgba(4,10,24,.28) 48%, rgba(4,10,24,0) 72%);
}
.hero-shade-y {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(4,10,24,.5) 0%, rgba(4,10,24,0) 26%, rgba(4,10,24,0) 72%, rgba(4,10,24,.45) 100%);
}
.hero-fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ─── Toppmeny ───────────────────────────────────────────────── */
.topbar { position: relative; z-index: 5; padding-top: 20px; }
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 8px 10px 8px 18px; border-radius: 16px;
  background: rgba(8,16,34,.34); border: 1px solid rgba(255,255,255,.14);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; min-height: 44px; }
.brand img { height: 24px; width: auto; }
.nav { display: flex; align-items: center; gap: 8px; flex: 1; justify-content: flex-end; min-width: 0; }
.nav-links {
  display: grid; grid-template-columns: repeat(5, minmax(0, 128px)); flex: 0 1 640px; min-width: 0;
  list-style: none; margin: 0 0 0 auto; padding: 0;
}
.nav-links li { min-width: 0; }
.nav-links a {
  display: flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 4px; border-radius: 10px;
  color: #fff; text-decoration: none; font-size: 15px; font-weight: 500; opacity: .92; white-space: nowrap;
}
.nav-links a:hover { background: rgba(255,255,255,.12); opacity: 1; }
.lang {
  display: flex; margin-left: 10px; padding: 3px; border-radius: 12px; background: rgba(255,255,255,.12);
}
.lang button {
  min-height: 36px; min-width: 44px; border: 0; border-radius: 9px; cursor: pointer;
  background: transparent; color: #fff; font-size: 13px; font-weight: 600;
}
.lang button[aria-pressed="true"] { background: #fff; color: var(--ink); font-weight: 700; }
.menu-btn {
  display: none; min-height: 44px; min-width: 44px; border: 0; border-radius: 10px; cursor: pointer;
  background: rgba(255,255,255,.12); color: #fff; align-items: center; justify-content: center;
}

/* ─── Hero-innhold ───────────────────────────────────────────── */
.hero-body {
  position: relative; z-index: 2; flex: 1;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px; flex-wrap: wrap;
  padding-top: clamp(56px, 10vh, 112px); padding-bottom: 56px;
}
.hero-copy { max-width: 800px; text-shadow: 0 2px 24px rgba(4,10,24,.45); }
.eyebrow { margin: 0 0 18px; font-size: 13px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; opacity: .9; }
.hero-title { margin: 0 0 18px; font-weight: 800; font-size: clamp(40px, 6.2vw, 80px); line-height: .98; letter-spacing: -.035em; }
.hero-title span { display: block; white-space: nowrap; }
.hero-lead { margin: 0 0 30px; font-size: clamp(17px, 1.6vw, 19px); max-width: 540px; opacity: .95; }

.ask {
  display: flex; align-items: center; gap: 8px; max-width: 640px;
  padding: 8px 8px 8px 20px; border-radius: 18px; background: #fff;
  box-shadow: 0 18px 50px rgba(4,10,24,.35); text-shadow: none;
}
.ask svg.search { flex: none; width: 20px; height: 20px; stroke: #7A8799; fill: none; stroke-width: 2; stroke-linecap: round; }
.ask input {
  flex: 1; min-width: 0; border: 0; outline: none; background: transparent;
  font: 400 17px var(--font); color: var(--ink); padding: 14px 4px;
}
.ask input::placeholder { color: #7A8799; }
.btn-primary {
  min-height: 52px; padding: 0 22px; border: 0; border-radius: 12px; cursor: pointer;
  background: var(--ink); color: #fff; font: 700 15px var(--font);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { background: #1c2d45; }
.btn-primary svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary:disabled { opacity: .5; cursor: default; }

.langs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
  max-width: 640px; margin: 14px 0 0; font-size: 14px; opacity: .95;
}
.langs svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; flex: none; }
.langs-list { opacity: .8; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; text-shadow: none; }
.chip {
  min-height: 40px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 20px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28); color: #fff;
  font-size: 14px; font-weight: 500; cursor: pointer;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.chip:hover { background: rgba(255,255,255,.24); }

.wx {
  position: relative; flex: none; width: 104px; box-sizing: border-box;
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; margin-right: 4px;
  border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; font-size: 14px; white-space: nowrap; cursor: default;
}
.wx[hidden] { display: none; }
.wx svg { width: 20px; height: 20px; fill: none; stroke: #fff; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wx b { font-size: 15px; font-weight: 700; }
.wx-text {
  position: absolute; left: 0; top: calc(100% + 8px); z-index: 10;
  padding: 8px 12px; border-radius: 10px; background: rgba(8,16,34,.92); border: 1px solid rgba(255,255,255,.14);
  font-size: 14px; white-space: nowrap; opacity: 0; transform: translateY(-4px); pointer-events: none;
  transition: opacity .15s, transform .15s;
}
.wx:hover .wx-text, .wx:focus-visible .wx-text { opacity: 1; transform: none; }

/* ─── Temaer ─────────────────────────────────────────────────── */
.section { padding-top: 88px; padding-bottom: 24px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 32px; }
.kicker { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.h2 { margin: 0; font-weight: 800; font-size: clamp(30px, 3.4vw, 44px); letter-spacing: -.03em; line-height: 1.05; }
.section-lead { margin: 0; max-width: 380px; font-size: 17px; color: var(--ink-2); }
.topics { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; list-style: none; margin: 0; padding: 0; }
.topic {
  width: 100%; height: 100%; display: flex; flex-direction: column; gap: 14px; text-align: left; cursor: pointer;
  padding: 24px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--ink);
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
.topic:hover { border-color: #B9C7D8; box-shadow: 0 10px 30px rgba(15,27,45,.08); transform: translateY(-2px); }
.topic-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--accent-bg); display: flex; align-items: center; justify-content: center; }
.topic-icon svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.topic-t { display: block; font-size: 19px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 6px; }
.topic-d { display: block; font-size: 15px; color: var(--ink-2); }

/* ─── Nyheter ────────────────────────────────────────────────── */
.news { padding-top: 56px; padding-bottom: 96px; }
.news-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; margin-bottom: 8px; }
.news-head h2 { margin: 0; font-weight: 800; font-size: 26px; letter-spacing: -.02em; }
.news-head a { color: var(--accent); font-weight: 600; text-decoration: none; }
.news-head a:hover { text-decoration: underline; }
.news-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); column-gap: 48px; }
.news-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 16px;
  width: 100%; padding: 16px 0; border: 0; border-top: 1px solid var(--line-2);
  background: none; text-align: left; cursor: pointer; color: var(--ink);
}
.news-meta { grid-column: 1; font-size: 13px; font-weight: 600; color: var(--ink-3); }
.news-title { grid-column: 1; font-size: 17px; font-weight: 600; }
.news-arrow { grid-column: 2; grid-row: 1 / span 2; width: 20px; height: 20px; fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.news-row:hover .news-title { color: var(--accent); }
.news-empty { color: var(--ink-3); padding: 16px 0; margin: 0; }

/* ─── Bunn ───────────────────────────────────────────────────── */
.footer { background: var(--ink); color: #B8C4D4; }
.footer-inner { display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; padding-top: 48px; padding-bottom: 48px; font-size: 14px; }
.footer img { height: 72px; width: auto; }

/* ─── Sofia-panel ────────────────────────────────────────────── */
.sofia {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 40;
  width: min(var(--panel-w), 100vw);
  display: flex; flex-direction: column;
  background: #fff; box-shadow: -20px 0 60px rgba(15,27,45,.18);
  transform: translateX(100%); transition: transform .22s ease;
}
.sofia.is-open { transform: none; }
.sofia-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 16px 14px 22px; border-bottom: 1px solid var(--line-2);
}
.sofia-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.sofia-head p { margin: 2px 0 0; font-size: 13px; color: var(--ink-3); }
.sofia-actions { display: flex; gap: 6px; }
.icon-btn {
  min-height: 40px; min-width: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px;
  background: #fff; color: var(--ink); cursor: pointer; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sofia-log { flex: 1; overflow-y: auto; padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.msg { max-width: 88%; padding: 12px 16px; border-radius: 16px; font-size: 15.5px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-user { align-self: flex-end; background: var(--ink); color: #fff; border-bottom-right-radius: 6px; white-space: pre-wrap; }
.msg-ai { align-self: flex-start; background: var(--bg); color: var(--ink); border-bottom-left-radius: 6px; }
.msg-ai p { margin: 0 0 .6em; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai ul, .msg-ai ol { margin: .3em 0 .6em; padding-left: 1.3em; }
.msg-ai a { color: var(--accent); }
.msg-thinking { align-self: flex-start; background: var(--bg); border-bottom-left-radius: 6px; }
.thinking-text {
  font-weight: 500; color: var(--ink-2);
  background: linear-gradient(90deg, var(--ink-2) 0%, var(--ink-2) 40%, #C3CEDB 50%, var(--ink-2) 60%, var(--ink-2) 100%);
  background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: shimmer 1.6s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
.type-cursor { display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -0.15em; background: var(--ink); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.msg-typing { align-self: flex-start; background: var(--bg); display: flex; gap: 5px; padding: 16px; }
.msg-typing .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); animation: blink 1.2s infinite ease-in-out; }
.msg-typing .dot:nth-child(2) { animation-delay: .15s; }
.msg-typing .dot:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.sofia-foot { border-top: 1px solid var(--line-2); padding: 12px 16px 14px; }
.sofia-form { display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); border-radius: 14px; }
.sofia-form:focus-within { border-color: #9DB5D3; }
.sofia-form textarea {
  flex: 1; min-width: 0; border: 0; outline: none; resize: none; background: transparent;
  font: 400 15.5px var(--font); color: var(--ink); padding: 10px 0; max-height: 160px;
}
.sofia-form .btn-primary { min-height: 44px; padding: 0 14px; }
.sofia-note { margin: 8px 2px 0; font-size: 12px; color: var(--ink-3); }

/* ─── Kartlag ────────────────────────────────────────────────── */
.kart {
  position: fixed; top: 0; left: 0; bottom: 0; right: var(--panel-w); z-index: 35;
  background: #DDE7EE; opacity: 0; transition: opacity .22s ease;
}
.kart.is-open { opacity: 1; }
.kart-map { position: absolute; inset: 0; }
.kart-close { position: absolute; left: 16px; top: 16px; z-index: 12; background: #fff; box-shadow: 0 6px 20px rgba(15,27,45,.15); }

/* ─── Artikkel ───────────────────────────────────────────────── */
.article { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 24px; opacity: 0; transition: opacity .2s; }
.article.is-open { opacity: 1; }
.article-backdrop { position: absolute; inset: 0; background: rgba(8,16,34,.55); }
.article-panel {
  position: relative; width: min(760px, 100%); max-height: calc(100svh - 48px); overflow-y: auto;
  background: #fff; border-radius: 20px; padding: 40px clamp(20px, 5vw, 48px) 32px;
}
.article-close { position: absolute; right: 16px; top: 16px; }
.article-loading { color: var(--ink-3); margin: 0; }
.article-meta { font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 10px; }
.article-headline { margin: 0 0 20px; font-size: clamp(26px, 3vw, 34px); line-height: 1.15; letter-spacing: -.02em; font-weight: 800; }
.article-image { border-radius: 14px; margin: 0 0 20px; }
.article-text p { margin: 0 0 1em; font-size: 17px; line-height: 1.65; }
.article-original { display: inline-block; margin-top: 8px; color: var(--accent); font-weight: 600; text-decoration: none; }
.article-original:hover { text-decoration: underline; }

/* ─── Mobil ──────────────────────────────────────────────────── */
@media (max-width: 920px) {
  .menu-btn { display: inline-flex; }
  .nav-links {
    display: none; grid-template-columns: none; position: absolute; left: 0; right: 0; top: calc(100% + 8px);
    flex-direction: column; align-items: stretch; padding: 8px; border-radius: 16px;
    background: rgba(8,16,34,.86); border: 1px solid rgba(255,255,255,.14);
    backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  }
  .nav-links.is-open { display: flex; }
  .topbar-inner { position: relative; }
  .lang { margin-left: 6px; }
}
@media (max-width: 760px) {
  .hero { height: auto; min-height: auto; }
  .hero-title span { white-space: normal; }
  .hero-body { padding-top: 48px; padding-bottom: 40px; }
  .ask { padding-left: 14px; }
  .ask svg.search { display: none; }
  .btn-primary { padding: 0 16px; }
  .kart { right: 0; bottom: 45vh; }
  .sofia { top: auto; height: 100svh; width: 100vw; }
  body.kart-open .sofia { height: 45vh; border-radius: 18px 18px 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sofia, .kart, .article, .topic, .hero-img { transition: none; }
  .msg-typing .dot { animation: none; opacity: .6; }
  .thinking-text { animation: none; background: none; color: var(--ink-2); }
  .type-cursor { animation: none; }
}
