:root {
  --accent: #db8a00;
  --accent-bright: #f5b942;
  --accent-soft: rgb(219 138 0 / .22);
  --dark: #0a0a0a;
  --text: #3c4858;
  --text-light: #6b7785;
  --text-strong: #2b333e;
  --border: #e7e9ec;
  --line: rgb(60 72 88 / .12);
  --panel: #f5efe2;
  --card-bg: #fffbf2;
  --thumb-bg: #f1f1f1;
  --input-bg: #fff;
  --max-width: 1040px;
  /* Ljust/mörkt tema: följer systemets inställning, eller besökarens val via knappen i menyn
     (data-theme på <html>, sparat i localStorage). */
  color-scheme: light dark;
  /* Svävande skuggor i flera lager: skarp nära kanten, stor och mjuk längre ned. */
  --float-shadow:
    0 0 0 1px rgb(255 255 255 / .08),
    0 3px 6px rgb(0 0 0 / .35),
    0 16px 34px -6px rgb(0 0 0 / .6),
    0 55px 110px -18px rgb(0 0 0 / .9);
  --card-shadow:
    0 2px 4px rgb(0 0 0 / .3),
    0 10px 22px -6px rgb(0 0 0 / .55),
    0 30px 60px -18px rgb(0 0 0 / .8);
  --card-shadow-hover:
    0 3px 6px rgb(0 0 0 / .3),
    0 16px 30px -6px rgb(0 0 0 / .6),
    0 42px 80px -16px rgb(0 0 0 / .85);
}

/* Mörkt tema: läspaneler, kort och rutor blir mörka i varma toner. Sidhuvud, hjältebild,
   bakgrund och guldaccenter är desamma i båda temana. Webbläsare utan light-dark() får det ljusa. */
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@supports (color: light-dark(#000, #fff)) {
  :root {
    --text: light-dark(#3c4858, #d6d0c4);
    --text-light: light-dark(#6b7785, #a29b8e);
    --text-strong: light-dark(#2b333e, #f4eee3);
    --border: light-dark(#e7e9ec, #3b372f);
    --line: light-dark(rgb(60 72 88 / .12), rgb(255 255 255 / .1));
    --panel: light-dark(#f5efe2, #1b1915);
    --card-bg: light-dark(#fffbf2, #26231d);
    --thumb-bg: light-dark(#f1f1f1, #2c2922);
    --input-bg: light-dark(#fff, #1b1915);
  }
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }
/* Ingen synlig skrollbar – förloppsmarkören i överkant (.reading-progress) visar var på sidan man är. */
html, body { scrollbar-width: none; }
html::-webkit-scrollbar, body::-webkit-scrollbar { display: none; }

body {
  margin: 0;
  font-family: 'Mulish', system-ui, sans-serif;
  color: var(--text);
  background: var(--dark);
  line-height: 1.65;
}


/* Locked backdrop photo: stays put while everything else scrolls over it.
   Blurred and slightly scaled up (so the soft edges fall outside the viewport) -
   reads as a soft frame around the narrower panels instead of a sharp, busy photo. */
.site-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/assets/img/hero/hero-2.jpg') center/cover no-repeat;
  filter: blur(18px);
  transform: scale(1.1);
}
.site-bg::after {
  content: "";
  position: absolute; inset: 0;
  /* Vinjett: mörkare kanter runt om döljer skarven mot hjälte-bilden och andra ytor när man skrollar. */
  background:
    radial-gradient(ellipse at center, rgba(10,10,10,0) 38%, rgba(10,10,10,.6) 100%),
    linear-gradient(rgba(10,10,10,.45), rgba(10,10,10,.45));
}

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

img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-weight: 800;
  color: var(--text);
  line-height: 1.25;
}

/* ---------- Header ---------- */
.site-header {
  background: rgb(10 10 10 / .75);
  backdrop-filter: saturate(1.3) blur(14px);
  -webkit-backdrop-filter: saturate(1.3) blur(14px);
  position: sticky;
  top: 0;
  z-index: 50;
}
/* Startsidan: hjältebilden täcker hela skärmen och menyn är dold tills man skrollar ned en bit. */
.is-home .site-header {
  position: fixed;
  left: 0; right: 0; top: 0;
  transition: opacity .8s ease, transform .8s ease;
}
.js .is-home:not(.ui-revealed) .site-header {
  opacity: 0;
  transform: translateY(-100%);
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .is-home .site-header { transition: opacity .3s ease; }
}
.site-header__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
}
.brand__logo { height: 36px; width: auto; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 16px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  color: #f1f1f1;
  font-weight: 600;
  font-size: 0.95rem;
}
.main-nav a:hover, .main-nav a.is-active { color: var(--accent); text-decoration: none; }
/* Menyraden: versaler, och en liten guldprick mellan alla delar (Hem · Skrivet · Om · jordglob · sök) */
.main-nav .nav-item > a { text-transform: uppercase; letter-spacing: .08em; font-size: 0.95rem; }
.main-nav .nav-item { position: relative; }
.main-nav .nav-item + .nav-item::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  translate: 0 -50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--accent-bright);
  opacity: .5;
}
.main-nav .has-dropdown { position: relative; }
.main-nav .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--dark);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  min-width: 140px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35);
}
.main-nav .has-dropdown:hover > .dropdown { display: block; }
.main-nav .dropdown li a { display: block; padding: 6px 18px; }

/* Andra nivån: "Skrivet" -> Årtal/Tags -> respektive lista, som flyout åt sidan. */
.main-nav .has-submenu { position: relative; }
.main-nav .dropdown__label {
  display: block;
  padding: 6px 18px;
  color: #f1f1f1;
  font-weight: 700;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: default;
}
.main-nav .has-submenu::after {
  content: "›";
  position: absolute;
  right: 10px; top: 5px;
  color: rgb(255 255 255 / .5);
}
.main-nav .dropdown--sub {
  top: -8px;
  left: 100%;
  max-height: 60vh;
  overflow-y: auto;
}
.main-nav .has-submenu:hover .dropdown--sub { display: block; }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.6rem;
  cursor: pointer;
}

@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .main-nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--dark);
    padding: 10px 20px 20px;
    gap: 12px;
  }
  .main-nav ul.is-open {
    display: flex;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  /* Ingen hover på touch: alla nivåer ligger statiskt synliga istället för flyouts. */
  .main-nav .has-dropdown .dropdown,
  .main-nav .has-submenu .dropdown--sub {
    position: static;
    box-shadow: none;
    display: block;
    max-height: none;
  }
  .main-nav .dropdown--sub { padding-left: 14px; }
  .main-nav .has-submenu::after { display: none; }
  .search-form--header { width: 100%; }
  .search-form--header input[type="search"] { width: 100%; }
  .search-form--header input[type="search"]:focus { width: 100%; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-align: center;
  padding: 110px 20px;
  isolation: isolate;
}
.is-home .hero {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; background: #000; }
.hero-bg__layer {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  opacity: 0;
  transition: opacity 2.4s ease;
}
.hero-bg__layer.is-current { opacity: 1; }
.hero::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  /* Ljus upptill så bilden syns tydligt; en mjuk tyngd nedtill håller texten läsbar.
     Vinjetten mörkar kanterna runt om, så övergången mot resten av sidan blir mjukare. */
  background:
    radial-gradient(ellipse at center, rgba(0,0,0,0) 45%, rgba(0,0,0,.55) 100%),
    linear-gradient(to bottom, rgba(0,0,0,.12) 0%, rgba(0,0,0,.2) 45%, rgba(0,0,0,.6) 100%);
}
.hero__inner > * { animation: hero-in 1.1s cubic-bezier(.22,.61,.36,1) both; }
.hero__inner > p { animation-delay: .18s; }
.hero h1 {
  font-family: 'Cormorant Garamond', 'Mulish', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(2.8rem, 7vw, 4.6rem);
  margin: 0 0 18px;
  letter-spacing: .01em;
  filter: drop-shadow(0 2px 3px rgb(0 0 0 / .85)) drop-shadow(0 6px 22px rgb(0 0 0 / .6));
  background: linear-gradient(100deg, #caa454 0%, #caa454 30%, #fff3d6 48%, #f8e6ac 55%, #caa454 70%, #caa454 100%);
  background-size: 220% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: hero-in 1.1s cubic-bezier(.22,.61,.36,1) both, gold-shimmer 6s linear 1.1s infinite;
}
.hero p { color: #f1f1f1; max-width: 640px; margin: 0 auto; font-size: 1.1rem; font-style: italic; text-shadow: 0 2px 10px rgb(0 0 0 / .6); }

/* Logga längst ned i hjältesektionen: tonar in vid laddning, tonar bort och glider ned när man skrollar. */
.hero__mark {
  position: absolute;
  left: 50%;
  bottom: 36px;
  z-index: 2;
  opacity: var(--mark-fade, 1);
  transform: translate(-50%, var(--mark-lift, 0px));
}
.hero__mark img {
  height: 34px;
  width: auto;
  filter: drop-shadow(0 2px 10px rgb(0 0 0 / .5));
  animation: hero-in 1.2s cubic-bezier(.22,.61,.36,1) .5s both;
}
@keyframes hero-in { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes gold-shimmer { to { background-position: 220% center; } }
@media (prefers-reduced-motion: reduce) {
  .hero__inner > * { animation: none; }
  .hero h1 { animation: none; background-position: 0 center; }
  .hero-bg__layer { transition: none; }
  .hero__mark img { animation: none; }
  .hero__mark { transition: none; }
}

/* ---------- Sections: light (not white) panels framing the text, floating over the locked backdrop ---------- */
.section { max-width: var(--max-width); margin: 40px auto; padding: 60px 20px; }
.section-title { text-align: center; margin-bottom: 8px; }
.section-subtitle { text-align: center; color: var(--text-light); margin-bottom: 40px; }

:is(.section, .page, .article) {
  background: var(--panel);
  border-radius: 16px;
  box-shadow: var(--float-shadow);
}

/* Förstasidan: rutornas panel är mörk och halvgenomskinlig i stället, så den låsta bakgrunden syns igenom. */
.is-home .section {
  background: rgb(10 10 10 / .5);
  backdrop-filter: blur(6px) saturate(1.2);
  -webkit-backdrop-filter: blur(6px) saturate(1.2);
}
.is-home .section-title, :is(.section--skrivet, .page--om, .search-page) .section-title {
  margin-top: 0;
  font-family: 'Outfit', 'Mulish', sans-serif;
  font-weight: 200;
  font-size: clamp(2.1rem, 4.5vw, 2.8rem);
  letter-spacing: .04em;
  line-height: 1.15;
  color: #fff;
}
:is(.section--skrivet, .page--om, .search-page) .section-title { font-weight: 300; color: var(--text-strong); }
.page--om .section-title { margin-bottom: 24px; text-align: left; }
.page.page--om .section-title::after { margin-left: 0; }
/* Kort guldstreck under rubriken */
:is(.is-home, .section--skrivet, .page--om, .search-page) .section-title::after {
  content: "";
  display: block;
  width: 44px;
  height: 2px;
  margin: 12px auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--accent-bright), transparent);
}
.is-home .section-subtitle { color: rgb(255 255 255 / .7); margin-bottom: 24px; }
.is-home .section { margin: 24px auto; padding: 32px 20px 28px; }
.section-more { text-align: center; margin: 24px 0 0; }

/* ---------- Article cards / grid ---------- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 28px;
}
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  box-shadow: var(--card-shadow);
  transition: transform .25s, box-shadow .25s;
}
.card:hover, .card:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--card-shadow-hover);
  text-decoration: none;
}
.thumb-frame { position: relative; overflow: hidden; border-radius: 6px; background: var(--thumb-bg); }
.card .thumb-frame { height: 170px; }
.thumb-frame img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s; }
.card:hover .thumb-frame img { transform: scale(1.04); }
.thumb-frame--wide { margin-bottom: 30px; }
.thumb-frame--wide img { height: auto; object-fit: initial; }
.card__body { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card__meta { font-size: 0.8rem; color: var(--text-light); text-transform: uppercase; letter-spacing: .03em; }
.card__title { font-size: 1.1rem; margin: 0; color: var(--text); }
.card__excerpt { font-size: 0.92rem; color: var(--text-light); flex: 1; }
.card__link { font-weight: 700; font-size: 0.88rem; color: var(--accent); }
a.card__link:hover { text-decoration: underline; }

/* ---------- Year archive ---------- */
.list-label {
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--text-strong);
  margin: 0 0 12px;
}
.year-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
}
.year-nav.tag-nav { margin-bottom: 40px; }
.year-nav a {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card-bg);
  color: var(--text);
  font-weight: 600;
  font-size: 0.9rem;
  box-shadow: 0 1px 2px rgb(0 0 0 / .14), 0 4px 10px -3px rgb(0 0 0 / .28);
  transition: transform .2s, box-shadow .2s, background-color .2s, color .2s;
}
.year-nav a.is-active, .year-nav a:hover { background: var(--accent); color: #fff; border-color: var(--accent); text-decoration: none; }
.year-nav a:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgb(0 0 0 / .16), 0 8px 16px -4px rgb(0 0 0 / .35); }
.year-nav a.is-active { box-shadow: 0 1px 2px rgb(0 0 0 / .18), 0 6px 14px -4px rgb(219 138 0 / .6); }

/* ---------- Single article ---------- */
.article {
  max-width: 680px;
  margin: 20px auto 40px;
  padding: 28px 20px 32px;
}
.article__meta { color: var(--text-light); font-size: 0.9rem; margin-bottom: 10px; }
.article__meta a { color: var(--accent); }
.article h1 { font-size: 2rem; margin: 0 0 20px; }
.article__thumb { width: 100%; border-radius: 6px; margin-bottom: 30px; }
.article-body :is(p, ul, ol, blockquote, figure, h2, h3, h4, h5) { margin: 0 0 22px; }
.article-body figure { margin: 0 0 22px; }
.article-body img {
  display: block;
  margin: 0 auto;
  max-width: 90%;
  height: auto;
  border: 1px solid rgb(15 15 15 / .25);
  border-radius: 6px;
  box-shadow: 0 2px 4px rgb(0 0 0 / .14), 0 20px 42px -16px rgb(0 0 0 / .45);
}
.article-body .wp-block-gallery img { max-width: 100%; width: 100%; margin: 0; }
.article-body figcaption { font-size: 0.85rem; color: var(--text-light); margin-top: 8px; text-align: center; }
.article-body blockquote {
  border-left: 4px solid var(--accent);
  margin: 0 0 22px;
  padding: 4px 0 4px 20px;
  color: var(--text-light);
  font-style: italic;
}
.article-body ul.wp-block-gallery, .article-body .wp-block-gallery {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
  padding: 0;
}
.embed-video { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; margin-bottom: 10px; border-radius: 6px; }
.embed-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-link {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 10px;
  word-break: break-word;
}
.embed-caption { font-size: 0.85rem; color: var(--text-light); margin-top: -8px; margin-bottom: 22px; }
.back-link { display: inline-block; margin-top: 10px; font-weight: 700; }

/* ---------- Static pages (om.php) ---------- */
.page { max-width: 760px; margin: 20px auto 40px; padding: 28px 20px 32px; }
.page figure.aligncenter { margin: 0 0 22px; }
.page :is(p, ul, ol, h2, h3, h4) { margin: 0 0 22px; }
.page > :last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.site-footer { background: var(--dark); color: #bbb; margin-top: 40px; }
.site-footer__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 36px 20px;
  text-align: center;
}
.footer-logo { height: 28px; margin: 0 auto 14px; }
.site-footer p { margin: 0; font-size: 0.85rem; }
.site-footer .footer-rss { margin-bottom: 8px; }
.site-footer .footer-rss a { color: #ddd; }
.site-footer .footer-rss a:hover { color: #fff; }

/* ---------- Scroll reveal (progressive enhancement: visible without JS) ---------- */
.reveal { --reveal-y: 26px; }
.js .reveal {
  opacity: 0;
  translate: var(--reveal-x, 0) var(--reveal-y, 0);
  transition: opacity .9s ease var(--reveal-delay, 0s),
              translate 1s cubic-bezier(.2,.7,.2,1) var(--reveal-delay, 0s);
}
.js .reveal.is-visible { opacity: 1; translate: 0 0; }
@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; translate: 0 0; transition: none; }
}

/* ---------- Gold shine frame (article thumbnails, search results) ---------- */
@property --shine-angle { syntax: '<angle>'; inherits: false; initial-value: 0deg; }
.shine {
  position: relative;
  border-radius: 6px;
  animation: card-glow 8s ease-in-out infinite;
}
.shine::after {
  content: "";
  position: absolute; inset: 0; z-index: 2; pointer-events: none;
  border-radius: inherit; padding: 2px;
  background: conic-gradient(from var(--shine-angle),
    rgb(219 138 0 / .2) 0deg, var(--accent-bright) 40deg, rgb(219 138 0 / .6) 80deg, rgb(219 138 0 / .2) 130deg,
    rgb(219 138 0 / .2) 180deg, #ffe6ad 220deg, rgb(219 138 0 / .2) 280deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  animation: shine-spin 14s linear infinite, shine-pulse 8s ease-in-out infinite;
}
.card:nth-child(3n+2) .shine, .card:nth-child(3n+2).shine { animation-duration: 10s; animation-delay: -3s; }
.card:nth-child(3n+2) .shine::after, .card:nth-child(3n+2).shine::after { animation-duration: 17s, 10s; animation-delay: -5s, -3s; }
.card:nth-child(3n+3) .shine, .card:nth-child(3n+3).shine { animation-duration: 11.4s; animation-delay: -6s; }
.card:nth-child(3n+3) .shine::after, .card:nth-child(3n+3).shine::after { animation-duration: 13s, 11.4s; animation-delay: -9s, -6s; }
@keyframes shine-spin { to { --shine-angle: 360deg; } }
@keyframes shine-pulse { 0%, 100% { opacity: .2; } 40% { opacity: 1; } 65% { opacity: .55; } }
@keyframes card-glow {
  0%, 100% { box-shadow: 0 0 0 0 rgb(219 138 0 / 0); }
  40% { box-shadow: 0 0 26px -4px rgb(219 138 0 / .45); }
  65% { box-shadow: 0 0 14px -4px rgb(219 138 0 / .22); }
}
@media (prefers-reduced-motion: reduce) {
  .shine, .shine::after { animation: none; }
}

/* ---------- Reading progress (article pages) ---------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; pointer-events: none; background: rgb(255 255 255 / .08); }
.reading-progress span { display: block; height: 100%; width: 100%; transform-origin: 0 50%; transform: scaleX(var(--progress, 0)); background: linear-gradient(90deg, var(--accent), var(--accent-bright)); }

/* ---------- Search ---------- */
.search-form { display: flex; gap: 0; }
.search-form input[type="search"] {
  border: 1px solid var(--border);
  border-radius: 20px 0 0 20px;
  padding: 7px 14px;
  font-family: inherit;
  font-size: 0.9rem;
  outline: none;
}
.search-form button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 0 20px 20px 0;
  padding: 7px 16px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
}
.search-form button:hover { background: var(--accent-bright); border-color: var(--accent-bright); }
.search-form--header input[type="search"] {
  width: 112px;
  padding: 3px 12px;
  font-size: 0.82rem;
  background: rgb(255 255 255 / .08);
  border-color: rgb(255 255 255 / .2);
  color: #fff;
}
.search-form--header button { padding: 3px 11px; font-size: 0.78rem; }
.search-form--header input[type="search"]::placeholder { color: rgb(255 255 255 / .5); }
.search-form--header input[type="search"]:focus { width: 160px; background: rgb(255 255 255 / .14); }
.search-page .search-form--page { max-width: 420px; margin: 0 auto 10px; }
.search-page .search-form--page input[type="search"] { flex: 1; background: var(--input-bg); color: var(--text); }
mark { background: var(--accent-soft); color: inherit; border-radius: 3px; padding: 0 2px; }

/* ---------- Nyheter på förstasidan: datumlinje + de tre senaste ---------- */
/* Datumlinjen täcker de senaste 30 dagarna (idag längst till höger); varje nyhet är en punkt på sitt datum.
   På smala skärmar skrollas linjen i sidled och startar längst till höger (site.js). */
.news-timeline {
  overflow-x: auto;
  overflow-y: hidden;
  margin: 0 -20px 16px;
  padding: 0 20px;
  scrollbar-width: thin;
  scrollbar-color: rgb(219 138 0 / .5) transparent;
}
.news-timeline__track {
  position: relative;
  min-width: 640px;
  height: 76px;
  margin: 0 24px;
}
.news-timeline__line {
  position: absolute;
  left: 0; right: 0; bottom: 40px;
  height: 2px;
  background: linear-gradient(90deg, rgb(255 255 255 / .08), rgb(255 255 255 / .35) 60%, var(--accent));
  border-radius: 2px;
}
.news-timeline__tick {
  position: absolute;
  left: var(--pos);
  bottom: 36px;
  width: 1px;
  height: 10px;
  background: rgb(255 255 255 / .25);
}
.news-timeline__tick--label { height: 14px; bottom: 34px; background: rgb(255 255 255 / .5); }
.news-timeline__tick span {
  position: absolute;
  top: 22px;
  left: 50%;
  translate: -50% 0;
  white-space: nowrap;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  color: rgb(255 255 255 / .55);
}
.news-timeline__tick:last-of-type span { color: var(--accent-bright); }
.news-timeline__dot {
  position: absolute;
  left: var(--pos);
  bottom: calc(34px + var(--stack, 0) * 18px);
  width: 14px;
  height: 14px;
  translate: -50% 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe6ad, var(--accent));
  box-shadow: 0 0 0 3px rgb(10 10 10 / .6), 0 0 16px 2px rgb(219 138 0 / .55);
  z-index: 1;
  transition: box-shadow .2s;
  animation: news-dot-pulse 3s ease-in-out infinite;
}
.news-timeline__dot:hover, .news-timeline__dot:focus-visible {
  z-index: 3;
  animation: none;
  box-shadow: 0 0 0 3px rgb(10 10 10 / .6), 0 0 0 5px var(--accent-bright), 0 0 24px 6px rgb(245 185 66 / .8);
  text-decoration: none;
  outline: none;
}
.news-timeline__label {
  position: absolute;
  bottom: calc(100% + 12px);
  left: 50%;
  translate: -50% 4px;
  width: max-content;
  max-width: 260px;
  padding: 8px 12px;
  border-radius: 6px;
  background: rgb(10 10 10 / .92);
  border: 1px solid rgb(219 138 0 / .5);
  color: #f1f1f1;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, translate .2s;
}
.news-timeline__label strong { color: var(--accent-bright); margin-right: 4px; }
.news-timeline__dot.is-left .news-timeline__label { left: -6px; translate: 0 4px; }
.news-timeline__dot.is-right .news-timeline__label { left: auto; right: -6px; translate: 0 4px; }
.news-timeline__dot:hover .news-timeline__label,
.news-timeline__dot:focus-visible .news-timeline__label { opacity: 1; translate: -50% 0; }
.news-timeline__dot.is-left:hover .news-timeline__label, .news-timeline__dot.is-left:focus-visible .news-timeline__label,
.news-timeline__dot.is-right:hover .news-timeline__label, .news-timeline__dot.is-right:focus-visible .news-timeline__label { translate: 0 0; }
.news-timeline__empty { text-align: center; color: rgb(255 255 255 / .6); margin: -8px 0 16px; }
/* Breda skärmar: linjen behöver ingen sidoskroll, så etiketterna får sticka upp över linjen utan att klippas. */
@media (min-width: 761px) {
  .news-timeline { overflow: visible; }
}
@keyframes news-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgb(10 10 10 / .6), 0 0 12px 1px rgb(219 138 0 / .4); }
  50% { box-shadow: 0 0 0 3px rgb(10 10 10 / .6), 0 0 20px 4px rgb(245 185 66 / .7); }
}

/* De tre senaste nyheterna: stort datum i guld och rubriken under (som årsrutorna på kognitionskyrkan.nu).
   På mobil blir raden en slider som man sveper i sidled. */
.news-strip {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.news-strip li { display: flex; border-radius: 6px; box-shadow: var(--card-shadow); transition: box-shadow .25s, transform .25s; }
.news-strip li:hover { box-shadow: var(--card-shadow-hover); transform: translateY(-3px); }
.news-strip__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 210px;
  padding: 22px 22px 20px;
  border-radius: 6px;
  background: linear-gradient(160deg, rgb(255 255 255 / .07), rgb(255 255 255 / .02)), rgb(10 10 10 / .55);
  color: #f1f1f1;
  transition: transform .25s;
}
.news-strip__card:hover, .news-strip__card:focus-visible { text-decoration: none; color: #fff; }
/* Med bild: bilden som bakgrund, mörkad nedåt så att texten går att läsa. */
.news-strip__card.has-image { justify-content: flex-end; }
.news-strip__card.has-image::before {
  content: "";
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to bottom, rgb(10 10 10 / .15) 15%, rgb(10 10 10 / .9) 100%), var(--news-image) center / cover no-repeat;
  transition: transform .6s ease;
}
.news-strip__card.has-image:hover::before { transform: scale(1.05); }
.news-strip__date {
  font-family: 'Cormorant Garamond', 'Mulish', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 2.8rem;
  line-height: 1;
  margin-bottom: 14px;
  background: linear-gradient(100deg, #caa454 0%, #f8e6ac 50%, #caa454 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  filter: drop-shadow(0 1px 8px rgb(0 0 0 / .5));
}
.news-strip__title { font-weight: 800; font-size: 1.08rem; line-height: 1.3; flex: 1; }
.news-strip__more { margin-top: 16px; font-weight: 700; font-size: 0.85rem; color: var(--accent-bright); }
.news-strip li:nth-child(2) .shine { animation-duration: 10s; animation-delay: -3s; }
.news-strip li:nth-child(2) .shine::after { animation-duration: 17s, 10s; animation-delay: -5s, -3s; }
.news-strip li:nth-child(3) .shine { animation-duration: 11.4s; animation-delay: -6s; }
.news-strip li:nth-child(3) .shine::after { animation-duration: 13s, 11.4s; animation-delay: -9s, -6s; }

/* Egen glansfas för varje kort med sibling-index(). nth-child-reglerna ovan ger bara tre
   grupper, så kort i samma kolumn glimmar i takt. Indexet räknas ut på kortet/li-elementet
   (registrerad egenskap) och ärvs ner till .shine och ::after. Udda steglängder sprider
   faserna jämnt. Äldre webbläsare behåller tregruppsindelningen. */
@property --shine-i { syntax: '<integer>'; inherits: true; initial-value: 1; }
@supports (order: sibling-index()) {
  .card, .news-strip > li { --shine-i: sibling-index(); }
  .card:nth-child(n) .shine, .card:nth-child(n).shine, .news-strip li:nth-child(n) .shine {
    animation-duration: 9s;
    animation-delay: calc(var(--shine-i) * -3.7s);
  }
  .card:nth-child(n) .shine::after, .card:nth-child(n).shine::after, .news-strip li:nth-child(n) .shine::after {
    animation-duration: 14s, 9s;
    animation-delay: calc(var(--shine-i) * -5.3s), calc(var(--shine-i) * -3.7s);
  }
}

@media (max-width: 760px) {
  .news-strip {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 80%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    margin: -16px -20px 0;
    padding: 16px 20px 14px;
    scroll-padding-inline: 20px;
    scrollbar-width: thin;
    scrollbar-color: rgb(219 138 0 / .5) transparent;
  }
  .news-strip li { scroll-snap-align: start; }
}
@media (prefers-reduced-motion: reduce) {
  .news-timeline__dot { animation: none; }
  .news-strip__card.has-image::before { transition: none; }
}

/* Centrerade block från WordPress-innehållet (t.ex. logotypen och rubriker på Om-sidan) */
.has-text-align-center { text-align: center; }
:is(.page, .article-body) figure.aligncenter img { margin-inline: auto; }

/* ---------- Om-sidan: "A.i. Native..." med citat och principer ---------- */
.ai-native { margin-top: 48px; padding-top: 36px; border-top: 1px solid var(--line); }
.ai-native h3 { font-size: 1.5rem; letter-spacing: .02em; margin-bottom: 18px; }
.page .pull-quote {
  position: relative;
  margin: 40px auto;
  max-width: 580px;
  padding: 8px 12px 0;
  text-align: center;
  border: 0;
}
.page .pull-quote::before {
  content: "\201D";
  display: block;
  font-family: 'Cormorant Garamond', serif;
  font-size: 5rem;
  line-height: .6;
  height: 34px;
  color: var(--accent);
  opacity: .55;
}
.page .pull-quote p {
  margin: 0 0 14px;
  font-family: 'Cormorant Garamond', 'Mulish', serif;
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.45rem, 3.4vw, 1.8rem);
  line-height: 1.35;
  color: var(--text-strong);
}
.page .pull-quote cite {
  display: block;
  font-style: normal;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
}
.page .pull-quote cite::before { content: "— "; }
.page .pull-quote--small { margin: 36px auto 8px; }
.page .pull-quote--small::before { display: none; }
.page .pull-quote--small p {
  font-size: clamp(1.25rem, 2.8vw, 1.45rem);
  padding: 14px 0;
  border-top: 1px solid rgb(219 138 0 / .35);
  border-bottom: 1px solid rgb(219 138 0 / .35);
  display: inline-block;
}
.ai-native__intro { text-align: center; font-weight: 700; margin-bottom: 18px; }
.page .principles {
  list-style: none;
  padding: 0;
  max-width: 600px;
  margin: 0 auto 22px;
  display: grid;
  gap: 12px;
}
.page .principles li {
  position: relative;
  padding: 14px 18px 14px 46px;
  background: var(--card-bg);
  border: 1px solid rgb(219 138 0 / .18);
  border-radius: 8px;
  box-shadow: var(--card-shadow);
}
.page .principles li::before {
  content: "";
  position: absolute;
  left: 18px; top: 22px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ffe6ad, var(--accent));
  box-shadow: 0 0 10px rgb(219 138 0 / .45);
}
.page .principles strong { color: var(--text-strong); }

/* Mobil: panelerna går inte ända ut i kanten, så att bakgrunden syns runt dem. */
@media (max-width: 760px) {
  .section, .page, .article, .is-home .section { margin-left: 12px; margin-right: 12px; }
  /* Förstasidans rutor glider in växelvis från vänster och höger i stället för underifrån. */
  .is-home :is(.article-grid > .card, .news-strip > li):nth-child(odd) { --reveal-x: -70px; --reveal-y: 0; }
  .is-home :is(.article-grid > .card, .news-strip > li):nth-child(even) { --reveal-x: 70px; --reveal-y: 0; }
}

/* Om-sidan: delrubrikerna "1 Nyheterna" och "2 Hemsidan" */
.ai-native__part {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 16px;
  font-size: 1.25rem;
  color: var(--text-strong);
}
.ai-native__part span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-family: 'Cormorant Garamond', 'Mulish', serif;
  font-style: italic;
  font-size: 1.3rem;
  color: #fff;
  background: radial-gradient(circle at 35% 35%, var(--accent-bright), var(--accent));
  box-shadow: 0 4px 12px -3px rgb(219 138 0 / .6);
}

/* Om-sidan: uppdateringslogg (skrivs av nyhetsboten och webbdesignern) */
.update-log { margin: 48px 0 32px; padding-top: 36px; border-top: 1px solid var(--line); }
.update-log h3 { font-size: 1.5rem; letter-spacing: .02em; margin-bottom: 8px; }
.page .update-log__intro { text-align: center; color: var(--text-light); font-size: 0.92rem; margin-bottom: 24px; }
.page .update-log__lastrun {
  text-align: center;
  margin-bottom: 12px;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  color: var(--text-light);
}
.update-log__lastrun time { color: var(--text-strong); font-weight: 600; }
.page .update-log__list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
  line-height: 1.55;
}
.update-log__item {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.update-log__item:last-child { border-bottom: 0; }
.update-log__item time { font-weight: 600; color: var(--text-strong); }
.update-log__item time span { display: block; font-weight: 600; color: var(--text-light); }
.update-log__kind {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 9px;
  border-radius: 20px;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: 2px;
  color: #fff;
  background: var(--accent);
}
.update-log__item--design .update-log__kind { background: #3c4858; }
.update-log__item--proposal .update-log__kind { background: #3c4858; }
/* Hemsidan: grön bock = ändrad, rött kryss = ingen ändring men förslag */
.update-log__mark {
  display: inline-grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  margin-right: 8px;
  border-radius: 50%;
  font-family: 'Mulish', sans-serif;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: 1px;
  color: #fff;
}
.update-log__mark.is-changed { background: #2e9e5b; }
.update-log__mark.is-proposal { background: #d0453a; }
.update-log__title { color: var(--text-strong); font-weight: 600; }
.page .update-log__item p { margin: 3px 0 0; font-size: inherit; color: var(--text-light); }
@media (max-width: 760px) {
  .update-log__item { grid-template-columns: 1fr; gap: 4px; }
  .update-log__item time span { display: inline; margin-left: 6px; }
}

/* ---------- Språkmeny (översättning med Google Translate, jordgloben i menyn) ---------- */
.main-nav > ul { align-items: center; }
.lang { position: relative; }
.lang__toggle {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f1f1f1;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.lang__toggle:hover, .lang__toggle[aria-expanded="true"] { color: var(--accent-bright); background: rgb(255 255 255 / .08); }
.lang__toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.lang__code {
  position: absolute;
  right: -8px;
  bottom: -4px;
  padding: 0 4px;
  border-radius: 6px;
  border: 2px solid var(--dark);
  background: var(--accent-bright);
  color: var(--dark);
  font: 800 0.6rem/1.35 'Mulish', sans-serif;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.main-nav .lang__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 14px);
  z-index: 60;
  width: min(21rem, calc(100vw - 32px));
  padding: 14px 14px 12px;
  border-radius: 10px;
  background: rgb(10 10 10 / .96);
  border: 1px solid rgb(219 138 0 / .45);
  box-shadow: var(--card-shadow), 0 0 30px -8px rgb(219 138 0 / .35);
  animation: lang-in .25s ease both;
}
.main-nav .lang__menu[hidden] { display: none; }
@keyframes lang-in { from { opacity: 0; translate: 0 -6px; } }
.lang__title { margin: 0 0 8px 6px; font-size: 0.7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--accent-bright); }
.main-nav .lang__menu ul {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px 8px;
  position: static;
  margin: 0;
  padding: 0;
  background: none;
  max-height: none;
}
.lang__menu button {
  width: 100%;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: none;
  text-align: start;
  color: rgb(255 255 255 / .78);
  font: 600 0.88rem/1.3 'Mulish', sans-serif;
  cursor: pointer;
}
.lang__menu button:hover, .lang__menu button:focus-visible { background: rgb(255 255 255 / .08); color: #fff; outline: none; }
.lang__menu button[aria-current="true"] { color: var(--accent-bright); font-weight: 800; }
.lang__menu button[aria-current="true"]::after { content: " ✓"; }
.lang__note { margin: 10px 0 0 6px; font-size: 0.7rem; color: rgb(255 255 255 / .45); }
@media (max-width: 760px) {
  /* I mobilmenyn fälls språklistan ut direkt i menyn i stället för som en flytande ruta. */
  .main-nav .lang__menu { position: static; width: auto; margin-top: 8px; box-shadow: none; }
  .main-nav .lang__menu ul { display: grid; }
}
@media (prefers-reduced-motion: reduce) {
  .main-nav .lang__menu { animation: none; }
}

/* Googles översättning: dölj deras list, markeringar och popup-rutor så att designen förblir orörd */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
body > .skiptranslate, iframe.skiptranslate, .goog-te-banner-frame, #goog-gt-tt, .goog-te-balloon-frame,
.goog-tooltip, .goog-tooltip:hover, [class^="VIpgJd-"][class*="-OEVmcd"], #google-translate { display: none !important; }
html.translated-ltr body, html.translated-rtl body, body { top: 0 !important; }
.goog-text-highlight, font[style] { background: none !important; box-shadow: none !important; }
font { color: inherit !important; }

@media (max-width: 760px) {
  .main-nav .nav-item + .nav-item::before { display: none; }
}

/* Menyraden: menyval, jordglob och sökfält får samma höjd och ligger på samma mittlinje. */
.site-header { --nav-h: 22px; }
.main-nav .nav-item > a { display: inline-flex; align-items: center; height: var(--nav-h); line-height: 1; }
.main-nav .lang { display: flex; align-items: center; height: var(--nav-h); }
.main-nav .lang__toggle { width: var(--nav-h); height: var(--nav-h); }
.main-nav .lang__toggle svg { width: 17px; height: 17px; }
.search-form--header { align-items: stretch; height: var(--nav-h); }
.search-form--header input[type="search"],
.search-form--header button { height: var(--nav-h); padding-top: 0; padding-bottom: 0; line-height: 1; }
.search-form--header button { display: inline-grid; place-items: center; font-size: 0.7rem; }
.search-form--header input[type="search"] { font-size: 0.78rem; }
@media (max-width: 760px) {
  .main-nav .nav-item > a { height: auto; line-height: inherit; }
}
/* Sökfältet i menyn växer med texten man skriver (field-sizing), så att längre sökningar syns
   i sin helhet i stället för att rulla undan. Stannar vid 260px. Bara på bred skärm – i mobilmenyn
   är fältet fullbrett. Äldre webbläsare behåller de fasta bredderna ovan. */
@supports (field-sizing: content) {
  @media (min-width: 761px) {
    .search-form--header input[type="search"] {
      field-sizing: content;
      width: auto;
      min-width: 112px;
      max-width: 260px;
      transition: min-width .2s ease;
    }
    .search-form--header input[type="search"]:focus { width: auto; min-width: 160px; }
  }
  @media (min-width: 761px) and (prefers-reduced-motion: reduce) {
    .search-form--header input[type="search"] { transition: none; }
  }
}
@media (max-width: 760px) {
  .main-nav .lang { height: auto; flex-direction: column; align-items: flex-start; }
}

/* Nyheter: källa för illustrationsbilden (Pixabay) längst ned i artikeln */
.article-body .image-credit { font-size: 0.8rem; color: var(--text-light); font-style: italic; }
.article-body .image-credit a { color: inherit; text-decoration: underline; text-decoration-color: rgb(107 119 133 / .4); }

/* ---------- Fällbara avsnitt (<details>) ---------- */
details > summary { list-style: none; cursor: pointer; }
details > summary::-webkit-details-marker { display: none; }
/* Liten pil som vrids när avsnittet är öppet */
:is(.filter, .sources) > summary::after,
.main-nav .submenu > summary::after {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-left: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  rotate: 45deg;
  translate: 0 -3px;
  opacity: .6;
  transition: rotate .2s, translate .2s;
}
:is(.filter, .sources)[open] > summary::after,
.main-nav .submenu[open] > summary::after { rotate: 225deg; translate: 0 1px; }
@media (prefers-reduced-motion: reduce) {
  details > summary::after { transition: none; }
}

/* Skrivet: Årtal och Tags. Valet syns i rubriken när filtret är hopfällt. */
.filter > summary.list-label { width: fit-content; margin-inline: auto; }
.filter__current { display: none; font-weight: 600; letter-spacing: .04em; color: var(--accent); text-transform: none; }
.filter:not([open]) .filter__current { display: inline; }
.filter:not([open]) > summary.list-label { margin-bottom: 20px; }

/* Menyn: på dator ser Årtal/Tags ut som förut (flyouts, ingen pil); i mobilmenyn fälls de ut */
.main-nav .submenu > summary.dropdown__label { cursor: default; }
@media (min-width: 761px) {
  .main-nav .submenu > summary::after { display: none; }
}
@media (max-width: 760px) {
  .main-nav .submenu > summary.dropdown__label { cursor: pointer; padding-left: 0; }
}

/* Nyheter: källorna längst ned, hopfällda tills man klickar */
.article-body details.sources {
  margin: 0 0 22px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card-bg);
}
.article-body details.sources > summary { font-weight: 800; color: var(--text-strong); }
.article-body details.sources ul { margin: 12px 0 0; }
.article-body details.sources li + li { margin-top: 4px; }

/* ---------- Ljust/mörkt tema: knappen och detaljer som inte styrs av färgvariablerna ---------- */
/* --is-dark är 1 när det mörka temat gäller (systemets val eller besökarens), annars 0. */
:root { --is-dark: 0; }
@supports (color: light-dark(#000, #fff)) {
  @media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --is-dark: 1; } }
  :root[data-theme="dark"] { --is-dark: 1; }
}
/* OathMountain-logotypen på Om-sidan är svart på genomskinlig botten: vit i mörkt tema */
.page--om figure img { filter: invert(var(--is-dark)); }

.main-nav .theme { display: flex; align-items: center; height: var(--nav-h); }
.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: var(--nav-h);
  height: var(--nav-h);
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #f1f1f1;
  cursor: pointer;
  transition: color .2s, background-color .2s;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--accent-bright); background: rgb(255 255 255 / .08); outline: none; }
.theme-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
/* Månen i ljust tema (byt till mörkt), solen i mörkt tema (byt till ljust) */
.theme-toggle__sun { display: none; }
@supports (color: light-dark(#000, #fff)) {
  @media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .theme-toggle__sun { display: block; }
    :root:not([data-theme="light"]) .theme-toggle__moon { display: none; }
  }
  :root[data-theme="dark"] .theme-toggle__sun { display: block; }
  :root[data-theme="dark"] .theme-toggle__moon { display: none; }
}
/* Utan JavaScript eller utan stöd för light-dark() går temat inte att byta: dölj knappen */
html:not(.js) .main-nav .theme { display: none; }
@supports not (color: light-dark(#000, #fff)) {
  .main-nav .theme { display: none; }
}

/* ---------- Mobilmenyn ---------- */
@media (max-width: 760px) {
  .site-header { --nav-h: 40px; }               /* tryckytor för fingrar */
  html.menu-open, html.menu-open body { overflow: hidden; }

  /* Menyknappen: tre streck som blir ett kryss när menyn är öppen */
  .nav-toggle { position: relative; width: 40px; height: 40px; padding: 0; font-size: 0; }
  .nav-toggle span {
    position: absolute; left: 10px; right: 10px; height: 2px; border-radius: 2px;
    background: currentColor; transition: top .25s, rotate .25s, opacity .2s;
  }
  .nav-toggle span:nth-child(1) { top: 13px; }
  .nav-toggle span:nth-child(2) { top: 19px; }
  .nav-toggle span:nth-child(3) { top: 25px; }
  .nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 19px; rotate: 45deg; }
  .nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 19px; rotate: -45deg; }

  /* Panelen: menyval på egna rader, verktygen (jordglob, tema, sök) tillsammans på en rad */
  .main-nav > ul.is-open {
    display: grid;
    grid-template-columns: auto auto 1fr;
    align-items: center;
    gap: 0 10px;
    top: 100%;
    padding: 4px 20px 20px;
    max-height: calc(100dvh - 68px);
    background: rgb(10 10 10 / .97);
    border-top: 1px solid rgb(219 138 0 / .3);
    box-shadow: 0 24px 40px -12px rgb(0 0 0 / .7);
    animation: menu-in .25s ease both;
  }
  .main-nav > ul > li { grid-column: 1 / -1; }
  .main-nav > ul > li:is(.lang, .theme, .nav-search) { grid-column: auto; margin-top: 16px; }

  .main-nav .nav-item > a {
    display: flex; align-items: center; height: auto; min-height: 52px;
    font-size: 1rem; border-bottom: 1px solid rgb(255 255 255 / .08);
  }
  /* Skrivet: Årtal och Tags som fällbara rader, åren och taggarna i ett rutnät */
  .main-nav .has-dropdown .dropdown { padding: 4px 0 8px 14px; background: none; }
  .main-nav .submenu > summary.dropdown__label { display: flex; align-items: center; min-height: 44px; font-size: 0.85rem; }
  .main-nav .submenu[open] .dropdown--sub {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 0 8px; padding: 0 0 8px;
  }
  .main-nav .dropdown--sub li a { display: flex; align-items: center; min-height: 40px; padding: 0 4px; }

  /* Verktygsraden */
  .main-nav .lang { height: var(--nav-h); flex-direction: row; align-items: center; }
  .main-nav .lang__toggle svg, .theme-toggle svg { width: 21px; height: 21px; }
  .main-nav .nav-search .search-form--header { width: 100%; }
  .main-nav .search-form--header input[type="search"],
  .main-nav .search-form--header input[type="search"]:focus { width: 100%; font-size: 1rem; }  /* 16px: iOS zoomar inte */
  .main-nav .search-form--header button { padding: 0 16px; font-size: 1rem; }

  /* Språkmenyn öppnas som ett eget kort under sidhuvudet i stället för inne i raden */
  .main-nav .lang__menu {
    position: fixed; left: 12px; right: 12px; top: 76px; width: auto; margin: 0;
    max-height: calc(100dvh - 96px); overflow-y: auto; z-index: 70;
    box-shadow: var(--card-shadow), 0 0 30px -8px rgb(219 138 0 / .35);
  }
  .lang__menu button { min-height: 40px; }
}
@keyframes menu-in { from { opacity: 0; translate: 0 -8px; } }
@media (prefers-reduced-motion: reduce) {
  .main-nav > ul.is-open { animation: none; }
  .nav-toggle span { transition: none; }
}

/* Skrivet i mobilmenyn: länken och en pil på samma rad; pilen fäller ut Årtal och Tags. */
.subnav-toggle { display: none; }
@media (max-width: 760px) {
  .main-nav .has-dropdown { display: grid; grid-template-columns: 1fr auto; align-items: center; }
  .main-nav .has-dropdown > .dropdown { grid-column: 1 / -1; }
  .subnav-toggle {
    display: inline-grid; place-items: center; width: 52px; height: 52px; margin-right: -12px;
    padding: 0; border: 0; background: none; color: #f1f1f1; cursor: pointer;
    border-bottom: 1px solid rgb(255 255 255 / .08);
  }
  .subnav-toggle::before {
    content: ""; width: 8px; height: 8px;
    border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
    rotate: 45deg; translate: 0 -2px; transition: rotate .2s, translate .2s;
  }
  .subnav-toggle[aria-expanded="true"] { color: var(--accent-bright); }
  .subnav-toggle[aria-expanded="true"]::before { rotate: 225deg; translate: 0 2px; }
  /* Med JS är listan dold tills pilen trycks; utan JS syns den som förut. */
  .js .main-nav .has-dropdown:not(.is-expanded) > .dropdown { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .subnav-toggle::before { transition: none; }
}

/* ---------- Rörelseparallax på mobil (telefonens lutning, se site.js) ----------
   --tilt-x/--tilt-y går från -1 till 1. Bakgrunden bakom rutorna och bilden högst upp
   förskjuts åt motsatta håll för en känsla av djup; båda är förstorade så att kanterna inte syns. */
.site-bg { translate: calc(var(--tilt-x, 0) * -14px) calc(var(--tilt-y, 0) * -14px); }
.hero-bg { inset: -24px; translate: calc(var(--tilt-x, 0) * 20px) calc(var(--tilt-y, 0) * 20px); }
.tilt-active :is(.site-bg, .hero-bg) { will-change: translate; }
