:root {
  --bg: #0f1113;
  --panel: #171a1d;
  --border: #2a2f33;
  --text: #e6e0d4;
  --text-soft: #d8d2c7;
  --text-muted: #888;
  --caption: #a7a094;
  --meta: #8a8478;
  --accent: #c8a75a;
  --accent-hover: #e0c878;
  --active: #a88b52;
  --side-active-bg: #2a2f33;
  --button-bg: #2a2f33;
  --button-text: #e6e0d4;
  --font-main: Georgia, serif;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
}


.site-header {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  min-height: 84px;
  padding: 0 16px;
  position: relative;
  overflow: hidden;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(0,0,0,0.10)
  );
}

.header-left,
.header-right {
  width: 160px;
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1;
}

.header-left {
  justify-content: flex-start;
}

.header-right {
  justify-content: flex-end;
}

.header-inner {
  flex: 1;
/*  text-align: center;*/
  position: relative;
  z-index: 1;

  text-align: left;
  padding-left: 20px;
}

.branding h1 {
  margin: 0;
}

.branding .tagline {
  margin: 0;
}

.back-home {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  border: none;
  border-bottom: none;
  box-shadow: none;
  outline: none;
  background: transparent;
}


.back-home:hover,
.back-home:focus,
.back-home:active,
.back-home:visited {
  text-decoration: none;
  border: none;
  border-bottom: none;
  box-shadow: none;
  outline: none;
  background: transparent;
}

.back-home img {
  display: block;
  height: 30px;
  width: auto;
/*  opacity: 0.85;*/
  transition: opacity 0.2s ease, transform 0.2s ease;

  filter: saturate(0.7) brightness(0.95);
  opacity: 0.7;
}

.back-home img:hover {
  opacity: 1;
  transform: translateX(-2px);
}

h1 {
  margin: 0;

  font-weight: 500;
  letter-spacing: 0.02em;
}

h2 {
  margin-top: 0;
  margin-bottom: 16px;
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
}

a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

.tagline {
  font-size: 0.9em;
  color: var(--text-muted);
}

.lang-switch button {
  margin-left: 5px;
  background: var(--button-bg);
  color: var(--button-text);
  border: 1px solid transparent;
  padding: 5px 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.lang-switch button.active {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
}

.top-menu {
  display: flex;
  flex-wrap: wrap;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.top-menu-item {
  padding: 10px 15px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.top-menu-item:hover {
  background: color-mix(in srgb, var(--panel) 88%, var(--accent) 12%);
}

.top-menu-item.active {
  color: var(--active);
}

.layout {
  display: flex;
}

aside {
  width: 220px;
  background: var(--panel);
  min-height: 100vh;
  border-right: 1px solid var(--border);
}

.side-menu-item {
  padding: 10px;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.side-menu-item:hover {
  background: color-mix(in srgb, var(--panel) 85%, var(--accent) 15%);
}

.side-menu-item.active {
  background: var(--side-active-bg);
}

main {
  flex: 1;
/*  padding: 20px;*/
  padding: 40px 40px 60px;
  max-width: 1000px;
}

.content-area p {
  margin-top: 0;
  max-width: 900px;
  color: var(--text-soft);
  white-space: pre-line;
  line-height: 1.65;
}

.text-block {
  max-width: 900px;
  margin-bottom: 24px;
  color: var(--text-soft);
  line-height: 1.65;
  white-space: pre-line;
}

.meta-text {
  display: block;
  color: var(--meta);
  font-size: 0.8rem;
  margin-top: 4px;
}

.image-gallery {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.image-gallery img {
  max-width: 300px;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.image-block {
  margin: 28px 0;
}

.image-block img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
}

.image-full {
  max-width: 900px;
}

.image-medium {
  max-width: 600px;
}

.image-small {
  max-width: 360px;
}

.image-tiny {
  max-width: 200px;
}

.image-block figcaption {
  margin-top: 8px;
  color: var(--caption);
  font-size: 0.95rem;
  font-style: italic;
}

.placeholder-box {
  max-width: 900px;
  padding: 14px 16px;
  margin-top: 24px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  color: var(--text-muted);
  line-height: 1.6;
}

/* =========================
   Projekt-teman
   ========================= */

/* Nattlorden – neutral mörk */
body[data-theme="nattlorden"] {
  --bg: #0f1113;
  --panel: #171a1d;
  --border: #2a2f33;
  --text: #e6e0d4;
  --text-soft: #d8d2c7;
  --text-muted: #888;
  --caption: #a7a094;
  --meta: #8a8478;
  --accent: #c8a75a;
  --accent-hover: #e0c878;
  --active: #a88b52;
  --side-active-bg: #2a2f33;
  --button-bg: #2a2f33;
  --button-text: #e6e0d4;
}

/* Croonlius – svartvitt jazz/blues */
body[data-theme="croonlius"] {
  --bg: #111111;
  --panel: #1c1c1c;
  --border: #363636;
  --text: #e8e8e8;
  --text-soft: #d7d7d7;
  --text-muted: #a3a3a3;
  --caption: #bebebe;
  --meta: #9a9a9a;
  --accent: #bfbfbf;
  --accent-hover: #ffffff;
  --active: #ffffff;
  --side-active-bg: #2a2a2a;
  --button-bg: #2b2b2b;
  --button-text: #ededed;
  --font-main: "Playfair Display", serif;
}

/* Echæon – svart med neon */
body[data-theme="echaon"] {
  --bg: #0a0a0f;
  --panel: #14141c;
  --border: #25253a;
  --text: #e0def0;
  --text-soft: #d0cde0;
  --text-muted: #8b8aa3;
  --caption: #b3b1c7;
  --meta: #8e8cab;
  --accent: #3aa0ff;
  --accent-hover: #ff4da6;
  --active: #ff4da6;
  --side-active-bg: #1d1d29;
  --button-bg: #202031;
  --button-text: #ece9ff;
  --font-main: "Orbitron", sans-serif;
}

/* Khellendros – retrospel/blockfärg */
body[data-theme="khellendros"] {
  --bg: #101610;
  --panel: #1a231a;
  --border: #304330;
  --text: #d8e0d4;
  --text-soft: #ccd7c7;
  --text-muted: #8da08a;
  --caption: #a8b8a4;
  --meta: #83927f;
  --accent: #40e85a;
  --accent-hover: #4d8dff;
  --active: #ff5a5a;
  --side-active-bg: #243024;
  --button-bg: #243024;
  --button-text: #e6f0e2;
}

/* Threshold Canticle – svart och silver */
body[data-theme="threshold"] {
  --bg: #0b0b0b;
  --panel: #151515;
  --border: #3a3a3a;
  --text: #d7d7d7;
  --text-soft: #c9c9c9;
  --text-muted: #8f8f8f;
  --caption: #b5b5b5;
  --meta: #8d8d8d;
  --accent: #a8a8a8;
  --accent-hover: #ffffff;
  --active: #f0f0f0;
  --side-active-bg: #202020;
  --button-bg: #232323;
  --button-text: #e8e8e8;
}

/* About – varm editoriell grund */
body[data-theme="about"] {
  --bg: #f4f1ec;
  --panel: #ebe5dc;
  --border: #d2c8bb;
  --text: #2b2b2b;
  --text-soft: #3a3835;
  --text-muted: #746d64;
  --caption: #666057;
  --meta: #7a7268;
  --accent: #8a5a44;
  --accent-hover: #6f4735;
  --active: #8a5a44;
  --side-active-bg: #e2d9cd;
  --button-bg: #e3dbd0;
  --button-text: #2b2b2b;
  --font-main: Georgia, serif;
}

/* Övrigt – neutral */
body[data-theme="other"] {
  --bg: #121315;
  --panel: #1a1c20;
  --border: #2d3137;
  --text: #e5dfd4;
  --text-soft: #d7d1c6;
  --text-muted: #8d877c;
  --caption: #a9a295;
  --meta: #878174;
  --accent: #c8a75a;
  --accent-hover: #e0c878;
  --active: #a88b52;
  --side-active-bg: #262a30;
  --button-bg: #2a2f33;
  --button-text: #e6e0d4;
}

/* =========================
   Header-stilar per projekt
   ========================= */

/* Nattlorden */
.site-header.header-nattlorden::before {
  background-image:
    linear-gradient(90deg, rgba(200,167,90,0.05), transparent 25%, transparent 75%, rgba(200,167,90,0.05)),
    repeating-linear-gradient(
      90deg,
      transparent 0 24px,
      rgba(255,255,255,0.015) 24px 25px
    );
}

/* Croonlius */
.site-header.header-croonlius::before {
  background-image:
    radial-gradient(circle at center, rgba(255,255,255,0.08), transparent 55%),
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.02) 0 2px,
      transparent 2px 18px
    );
  opacity: 0.14;
}

/* Echæon */
.site-header.header-echaon::before {
  background-image: url("../assets/headers/echaon-header.png");
  background-size: cover;
  background-position: center;
  opacity: 0.22;
}

body[data-theme="echaon"] .top-menu-item.active {
  color: #00f0ff;
}

/* Khellendros */
.site-header.header-khellendros::before {
  background-image: url("../assets/headers/khellendros-header.png");
  background-size: cover;
  background-position: center;
  opacity: 0.50;
}

/* Threshold Canticle */
.site-header.header-threshold::before {
  background-image: url("../assets/headers/tc-header.png");
  background-size: cover;
  background-position: center;
  opacity: 0.26;
}

body[data-theme="threshold"] .top-menu-item.active {
  color: #c0c0c0;
}

/* About */
.site-header.header-about::before {
  background-image:
    linear-gradient(
      90deg,
      rgba(138, 90, 68, 0.08),
      transparent 16%,
      transparent 84%,
      rgba(138, 90, 68, 0.08)
    ),
    repeating-linear-gradient(
      90deg,
      rgba(70, 56, 44, 0.025) 0 1px,
      transparent 1px 32px
    );
  opacity: 0.22;
}

/* Övrigt */
.site-header.header-other::before {
  background-image:
    linear-gradient(90deg, rgba(200,167,90,0.04), transparent 30%, transparent 70%, rgba(200,167,90,0.04));
}

/* =========================
   Tema-specifika finjusteringar
   ========================= */

/* About specialjusteringar */
body[data-theme="about"] .tagline {
  color: #6b645b;
}

body[data-theme="about"] .lang-switch button {
  background: #e3dbd0;
  color: #2b2b2b;
  border: 1px solid transparent;
}

body[data-theme="about"] .lang-switch button:hover {
  background: #d9d0c4;
}

body[data-theme="about"] .lang-switch button.active {
  border-color: #8a5a44;
  color: #8a5a44;
}

body[data-theme="about"] .top-menu-item:hover,
body[data-theme="about"] .side-menu-item:hover {
  background: #efe8de;
}

body[data-theme="about"] .top-menu-item.active {
  color: #8a5a44;
}

body[data-theme="about"] .side-menu-item.active {
  background: #e2d9cd;
}

body[data-theme="about"] a {
  color: var(--accent);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

body[data-theme="about"] a:hover {
  color: var(--accent-hover);
  border-bottom-color: var(--accent-hover);
}

body[data-theme="about"] .placeholder-box {
  background: color-mix(in srgb, var(--panel) 92%, white 8%);
  color: var(--text-muted);
}

body[data-theme="about"] .back-home img {
  filter: none;
}

body:not([data-theme="about"]) .back-home img {
  filter: brightness(0.9);
}