/* Mediasidene for Arcem og Bonum. Designspråket er hentet fra arcem.no og bonum.no. */

:root, [data-site='arcem'] {
  --bg: #071c19; --bg-2: #0e2c28; --bg-3: #17453d;
  --text: #f5f5ef; --muted: #a6b7b0; --accent: #bc896d; --accent-2: #d9b399;
  --line: rgba(220, 237, 225, .17); --line-2: rgba(220, 237, 225, .38);
  --font-head: 'Work Sans', Arial, sans-serif; --font-body: 'Work Sans', Arial, sans-serif;
  --h-weight: 400; --h-track: -.05em; --h-line: 1.06;
  --btn-radius: 100px; --card-radius: 0; --logo-filter: brightness(0) invert(1);
  --page-bg: var(--bg);
  --gutter: clamp(22px, 5.1vw, 106px); --content: 1440px;
  --ease: cubic-bezier(.22, .68, .15, 1);
}
[data-site='bonum'] {
  --bg: #0b1220; --bg-2: #16243f; --bg-3: #283a5b;
  --text: #fff; --muted: rgba(255, 255, 255, .78); --accent: #ece3d4; --accent-2: #fff;
  --line: rgba(255, 255, 255, .22); --line-2: rgba(255, 255, 255, .4);
  --font-head: 'Playfair Display', Georgia, serif; --font-body: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --h-weight: 400; --h-track: -.01em; --h-line: 1.1;
  --btn-radius: 4px; --card-radius: 2px; --logo-filter: none;
  --page-bg: linear-gradient(180deg, #0b1220 0%, #101a30 14%, #16243f 32%, #20314f 55%, #283a5b 78%, #2f4264 100%);
  --gutter: clamp(22px, 5vw, 72px); --content: 1440px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; color: var(--text); background: var(--page-bg); background-attachment: fixed;
  font-family: var(--font-body); font-size: 16px; line-height: 1.65; -webkit-font-smoothing: antialiased;
}
body.is-loading { background: var(--bg); }
#root, body > main { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: inherit; text-underline-offset: .22em; }
img { display: block; max-width: 100%; height: auto; }
svg { width: 16px; height: 16px; flex-shrink: 0; }
h1, h2, h3 { font-family: var(--font-head); font-weight: var(--h-weight); letter-spacing: var(--h-track); line-height: var(--h-line); margin: 0; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--bg); }
.wrap { width: min(calc(100% - var(--gutter) * 2), var(--content)); margin-inline: auto; }
.skip { position: fixed; left: 16px; top: 10px; z-index: 99; padding: 10px 16px; background: var(--text); color: var(--bg); transform: translateY(-200%); }
.skip:focus { transform: none; }

.eyebrow { font-family: var(--font-body); font-size: 11px; letter-spacing: .17em; text-transform: uppercase; color: var(--accent); display: flex; align-items: center; gap: 16px; }
.eyebrow::before { content: ''; width: 32px; height: 1px; background: var(--accent); }
[data-site='bonum'] .eyebrow { font-family: var(--font-head); font-size: 13px; letter-spacing: .2em; color: rgba(255,255,255,.6); }
[data-site='bonum'] .eyebrow::before { background: rgba(255,255,255,.5); }

.button { display: inline-flex; align-items: center; gap: 16px; min-height: 48px; padding: 12px 22px; border: 1px solid var(--line-2); border-radius: var(--btn-radius); color: var(--text); background: transparent; text-decoration: none; font-size: 13px; letter-spacing: .03em; transition: background .2s, color .2s, border-color .2s; }
.button:hover { background: rgba(255,255,255,.08); }
.button--light { background: var(--text); color: var(--bg); border-color: var(--text); }
.button--light:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }
[data-site='bonum'] .button { font-size: 13px; letter-spacing: .12em; text-transform: uppercase; }
.text-link { display: inline-flex; align-items: center; gap: 14px; padding-bottom: 6px; border-bottom: 1px solid var(--line-2); font-size: 13px; text-decoration: none; transition: color .2s, border-color .2s; }

/* Header */
.mh { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.mh-in { height: 84px; display: flex; align-items: center; gap: 24px; }
.brand img { width: auto; height: 30px; filter: var(--logo-filter); }
[data-site='bonum'] .brand img { height: 36px; }
.mh-cap { padding-left: 24px; border-left: 1px solid var(--line); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.mh-nav { margin-left: auto; display: flex; align-items: center; gap: 26px; font-size: 13px; }
.mh-nav a { text-decoration: none; position: relative; padding: 8px 0; display: inline-flex; align-items: center; gap: 6px; }
.mh-nav a::after { content: ''; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.mh-nav a:hover::after { transform: scaleX(1); }
.mh-ext { color: var(--muted); }
.mh-nav a.mh-lang { gap: 8px; padding: 6px 12px; border: 1px solid var(--line-2); border-radius: var(--btn-radius); font-size: 12px; letter-spacing: .06em; }
.mh-nav a.mh-lang::after { display: none; }
.mh-nav a.mh-lang:hover { background: var(--text); color: var(--bg); border-color: var(--text); }
.mh-lang-code { font-weight: 500; }
.mh-lang-name { color: inherit; opacity: .75; }

/* Hero */
.hero { padding: clamp(70px, 9vw, 140px) 0 clamp(40px, 5vw, 70px); }
.hero h1 { font-size: clamp(46px, 6.4vw, 104px); margin-top: 26px; max-width: 15ch; }
.hero-intro { margin-top: 24px; max-width: 540px; font-size: 17px; color: var(--muted); }
.hero--nf { min-height: 60vh; }
.actions { margin-top: 32px; }
.chips { margin-top: 42px; display: flex; flex-wrap: wrap; gap: 10px; }
.chips a { padding: 8px 16px; border: 1px solid var(--line); border-radius: var(--btn-radius); font-size: 12px; text-decoration: none; color: var(--muted); transition: all .2s; }
.chips a:hover { color: var(--text); border-color: var(--line-2); }
.chips a[aria-current] { color: var(--bg); background: var(--text); border-color: var(--text); }

/* Liste og kort */
.list { padding-bottom: clamp(80px, 9vw, 140px); }
.empty { color: var(--muted); padding: 40px 0; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3vw, 48px) clamp(20px, 2.4vw, 36px); }
.card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; }
.card-img { aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-2); border-radius: var(--card-radius); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.card a:hover .card-img img { transform: scale(1.035); }
.card-ph { display: block; width: 100%; height: 100%; background: radial-gradient(120% 90% at 85% 10%, color-mix(in srgb, var(--accent) 34%, transparent), transparent 60%), linear-gradient(135deg, var(--bg-2), var(--bg-3)); }
.card-body { display: flex; flex-direction: column; gap: 14px; padding-top: 22px; flex: 1; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
.meta span { color: var(--accent); }
[data-site='bonum'] .meta span { color: var(--text); }
.card-title { font-size: clamp(22px, 1.8vw, 28px); }
.card-ex { color: var(--muted); font-size: 15px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card .text-link { margin-top: auto; align-self: flex-start; }
.card a:hover .text-link { color: var(--accent-2); border-color: var(--accent); }
.card--big { margin-bottom: clamp(48px, 5vw, 80px); padding-bottom: clamp(48px, 5vw, 80px); border-bottom: 1px solid var(--line); }
.card--big a { display: grid; grid-template-columns: 1.35fr 1fr; gap: clamp(28px, 4vw, 72px); align-items: center; }
.card--big .card-body { padding-top: 0; }
.card--big .card-title { font-size: clamp(32px, 3.4vw, 56px); }
.card--big .card-ex { font-size: 17px; -webkit-line-clamp: 4; }

/* Fremhevet-karusell: hver slide er et vanlig .card--big. Sveip/scroll med scroll-snap, JS styrer kun autoplay og knapper. */
.feat { margin-bottom: clamp(48px, 5vw, 80px); padding-bottom: clamp(28px, 3vw, 44px); border-bottom: 1px solid var(--line); }
.feat-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 0; }
.feat-track::-webkit-scrollbar { display: none; }
.feat-slide { flex: 0 0 100%; min-width: 0; scroll-snap-align: start; scroll-snap-stop: always; }
.feat .card--big { margin-bottom: 0; padding-bottom: 0; border-bottom: 0; }
.feat-ctrl { display: flex; align-items: center; gap: 14px; margin-top: clamp(24px, 2.6vw, 36px); }
.feat-dots { display: flex; gap: 4px; }
.feat-dot { width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.feat-dot::before { content: ''; width: 28px; height: 2px; background: var(--line-2); transition: background .3s, width .3s var(--ease); }
.feat-dot[aria-current]::before { background: var(--accent); width: 44px; }
.feat-btn { width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line-2); border-radius: var(--btn-radius); background: transparent; color: var(--text); cursor: pointer; transition: background .2s; }
.feat-btn:hover { background: rgba(255,255,255,.08); }
.feat-btn:focus-visible, .feat-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .feat-track { scroll-behavior: auto; } }
.pager { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--line); }
.pager-n { font-size: 12px; color: var(--muted); letter-spacing: .1em; }

/* Artikkel */
.post { padding: clamp(48px, 6vw, 96px) 0 clamp(56px, 6vw, 96px); }
.post-wrap { max-width: 1100px; }
.back { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 40px; font-size: 13px; color: var(--muted); text-decoration: none; }
.back:hover { color: var(--text); }
.post-title { font-size: clamp(38px, 4.6vw, 72px); margin-top: 22px; }
.post-lead { margin-top: 26px; font-size: clamp(18px, 1.5vw, 21px); line-height: 1.6; color: var(--muted); }
.post-img { margin: clamp(40px, 5vw, 72px) auto; max-width: 1100px; }
.post-img img { width: 100%; border-radius: var(--card-radius); }
.post-img figcaption { margin-top: 10px; font-size: 12px; color: var(--muted); letter-spacing: .02em; }
.prose { margin-top: 40px; font-size: 18px; line-height: 1.78; }
.post-img + .post-wrap .prose { margin-top: 0; }
.prose > * + * { margin-top: 1.15em; }
.prose h2 { font-size: clamp(28px, 2.4vw, 36px); margin-top: 1.8em; }
.prose h3 { font-size: clamp(22px, 1.8vw, 26px); margin-top: 1.6em; }
.prose a { color: var(--accent-2); text-decoration-color: var(--accent); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .4em; }
.prose blockquote { margin-left: 0; margin-right: 0; padding-left: 26px; border-left: 2px solid var(--accent); font-family: var(--font-head); font-size: 1.25em; line-height: 1.45; }
.prose figure { margin-left: 0; margin-right: 0; }
.prose img { border-radius: var(--card-radius); }
.prose figcaption { margin-top: 10px; font-size: 13px; color: var(--muted); }
.prose hr { border: 0; border-top: 1px solid var(--line); }
.prose iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }
.prose .kg-card, .prose .kg-image-card { margin-left: 0; margin-right: 0; }
.prose .kg-width-wide, .prose .kg-width-full { margin-left: 0; margin-right: 0; width: 100%; }
.prose .kg-video-container, .prose .kg-embed-card { position: relative; }
.prose .kg-video-container video { width: 100%; height: auto; display: block; }
.prose .kg-video-overlay, .prose .kg-video-player-container { display: none; }
.prose .kg-embed-card iframe { width: 100%; aspect-ratio: 16 / 9; height: auto; }
.source { margin-top: 56px; padding: 32px; border: 1px solid var(--line); display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
.share { margin-top: 40px; }
.post-tags { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 10px; }
.post-tags a { padding: 6px 14px; border: 1px solid var(--line); border-radius: var(--btn-radius); font-size: 12px; text-decoration: none; color: var(--muted); }
.related { padding-top: clamp(56px, 6vw, 96px); border-top: 1px solid var(--line); }
.rel-h { font-size: clamp(30px, 3vw, 46px); margin-bottom: 44px; }
.preview-bar { position: sticky; top: 84px; z-index: 30; padding: 10px var(--gutter); background: var(--accent); color: var(--bg); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-align: center; }

/* Footer */
.ft { border-top: 1px solid var(--line); padding: 34px 0; font-size: 12px; color: var(--muted); }
.ft-in { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.ft nav { display: flex; gap: 22px; }
.ft a { text-decoration: none; }
.ft a:hover { color: var(--text); }

/* Testvisning på cloudrizz-domenet */
.switcher { position: fixed; right: 16px; bottom: 16px; z-index: 50; display: flex; align-items: center; gap: 4px; padding: 6px; background: #111; color: #fff; border: 1px solid rgba(255,255,255,.2); border-radius: 100px; font: 12px/1 Arial, sans-serif; }
.switcher span { padding: 0 8px; opacity: .6; }
.switcher a { padding: 8px 12px; border-radius: 100px; text-decoration: none; }
.switcher a[aria-current] { background: #fff; color: #111; }

@media (max-width: 1000px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card--big a { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .mh-in { height: 68px; gap: 14px; }
  .mh-cap, .mh-ext, .mh-lang-name { display: none; }
  .preview-bar { top: 68px; }
  .prose { font-size: 17px; }
  .source { padding: 22px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
