/* === Lokale Webfonts === */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter/inter.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Merriweather";
  src: url("fonts/merriweather/merriweather.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* Farbvariablen fuer Dark- und Light-Mode */
:root {
  --bg-color: #000;
  --text-color: #fff;
  --button-bg: #fff;
  --button-text: #000;
  --button-hover-bg: #e0e0e0;
}

html {
  background-color: var(--bg-color);
  color: var(--text-color);
}

/* Globale Link-Stile (ausser Sidebar) */
body a {
  text-decoration: none;
}
body a:hover {
  text-decoration: underline;
}

/* Links im Corporate Design schon beim Laden rot darstellen */
body a:not(.blue-button):not(.more-button):not(.lang-link),
body a:not(.blue-button):not(.more-button):not(.lang-link):visited {
  color: red;
}

/* Links in der Sprachauswahl bleiben stets weiss */
.lang-link:link,
.lang-link:visited {
  color: #ffffff !important;
}

/* Skip-Link für Tastaturnavigation */
.skip-link {
  position: absolute;
  left: -999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  background-color: #0032ff;
  /*
   * Textfarbe richtet sich nach dem gewählten Designmodus.
   * So bleibt der Skip-Link im Light- und Dark-Mode gut lesbar.
   */
  color: var(--text-color);
  padding: 8px;
  z-index: 100;
}
.skip-link:focus {
  left: 0;
  top: 0;
  width: auto;
  height: auto;
}

/* Tastaturfokus deutlicher anzeigen */
a:focus,
button:focus {
  outline: 2px dashed #0032ff;
  outline-offset: 2px;
}

/* Sidebar-spezifische Link-Stile */
.sidebar a {
  text-decoration: none !important;
}
.sidebar a:hover {
  text-decoration: underline !important;
}

/* Allgemeine Stile */
body {
  margin: 0;
  font-family: "Inter", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  display: grid;
  grid-template-areas:
    "hero header"
    "hero content"
    "sidebar content"
    "footer footer";
  grid-template-columns: 400px 1fr;
  grid-template-rows: 60px 340px auto 60px;
  grid-gap: 0;
  min-height: 100vh;
  box-sizing: border-box;
}
/* Einheitliche Zeilenhöhe und Abstände */
body {
  line-height: 1.5;
}

/* Hintergrund- und Schriftfarbe fuer alle Grid-Bereiche.
 * Ohne diese Angaben bleibt der Theme-Wechsel in hero,
 * Sidebar, Content und Footer unsichtbar. */
.hero,
.sidebar,
header.header,
main.content,
.content,
#footer-include,
footer {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}

.generic-container {
  margin: 40px auto;
  padding: 20px;
  font-size: 1.2rem;
}

.generic-container p {
  margin-bottom: 20px;
}
.content-divider {
  border: 0;
  height: 3px;
  background-color: #0032ff;
  margin: 40px 0;
}

/* Futuristischer Stil für "mehr..."-Buttons in Rot */
.more-button {
  display: inline-block;
  background: linear-gradient(135deg, #8b0000 0%, #ff3434 100%);
  color: #ffffff;
  /*
   * Zeilenhöhe richtet sich nach der Schrifthöhe
   * und ergänzt sie um 2 px für einen minimalen Rand
   */
  line-height: calc(1em + 2px);
  /* nur horizontaler Abstand, damit der Kasten möglichst schmal bleibt */
  padding: 0 12px;
  margin-left: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: inherit;
  box-shadow: 0 0 8px rgba(255, 52, 52, 0.6);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.more-button:visited {
  color: #ffffff;
}
.more-button:hover {
  box-shadow: 0 0 12px rgba(255, 102, 102, 0.9);
  text-decoration: none;
  background: linear-gradient(135deg, #ff3434 0%, #8b0000 100%);
}

/* Blauer Button im Stil der "mehr..."-Buttons */
.blue-button {
  display: inline-block;
  background: linear-gradient(135deg, #0032ff 0%, #005bff 100%);
  color: #ffffff;
  line-height: calc(1em + 2px);
  padding: 0 12px;
  margin-left: 10px;
  border-radius: 6px;
  text-decoration: none;
  font-size: inherit;
  box-shadow: 0 0 8px rgba(0, 91, 255, 0.6);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.blue-button:visited {
  color: #ffffff;
}
.blue-button:hover {
  box-shadow: 0 0 12px rgba(0, 91, 255, 0.9);
  text-decoration: none;
  background: linear-gradient(135deg, #005bff 0%, #0032ff 100%);
}

/* Überschrift und Mehr-Button in einer Zeile */
h2.heading-inline {
  display: flex;
  align-items: baseline;
}

/* FAQ-Layout */
.faq-container {
  max-width: 800px;
  margin: 40px auto;
}

.faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  background: #ffb000;
  color: #000;
  border: none;
  padding: 10px 15px;
  margin-bottom: 5px;
  cursor: pointer;
  font-size: 1.2rem;
}
.faq-question .arrow {
  transition: transform 0.3s;
}
.faq-question.open .arrow {
  transform: rotate(180deg);
}
.faq-answer {
  display: none;
  padding: 10px 15px;
  background: #111;
  margin-bottom: 20px;
  border-left: 3px solid #0032ff;
}

/* Einheitliche Schriftgrössen */
h1 {
  font-size: 2.5rem !important;
}
h2 {
  font-size: 1.7rem !important;
}
h3 {
  font-size: 1.3rem !important;
  color: #0032ff;
}
h4 {
  font-size: 1.25rem !important;
  color: #0032ff;
}

p {
  font-size: 1.2rem !important;
  margin-bottom: 1.25em;
}
/* Links erben standardmässig die Schriftgrösse des umgebenden Elements */
a {
  font-size: inherit;
}
/* Links in Absätzen und Listen orientieren sich ebenfalls am Elternelement */
p a,
li a {
  font-size: inherit;
}
/* Links in Überschriften erben deren Schriftgrösse */
h1 a,
h2 a,
h3 a,
h4 a,
h5 a,
h6 a {
  font-size: inherit !important;
}
li {
  font-size: 1.1rem !important;
}

/* Standardfarbe für Hauptüberschriften (h1, h2) */
h1,
h2 {
  color: #0032ff;
}

/* Hero-Bereich */
.hero {
  grid-area: hero;
  background-color: var(--bg-color);
  padding: 0;
  box-sizing: border-box;
  position: relative;
  line-height: 0;
}
.hero::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background-color: #0032ff;
}
.hero-content {
  margin: 0;
  padding: 0;
  line-height: 0;
}
.hero img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0;
}

/* Header */
header.header {
  grid-area: header;
  background-color: var(--bg-color);
  padding: 10px;
  position: relative;
  height: 60px;
  align-self: start;
  box-sizing: border-box;
}
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  margin-right: 10px;
}

/* Container für Sprachwahl und Modus-Umschaltung */
.header-actions {
  position: absolute;
  top: 10px;
  right: 50px;
  display: flex;
  gap: 10px;
  align-items: center;
}


/* Button zum Wechsel zwischen Dark- und Light-Mode */
.mode-button {
  display: inline-block;
  background: var(--button-bg);
  color: var(--button-text);
  line-height: calc(1em + 2px);
  padding: 0 12px;
  border-radius: 6px;
  font-size: inherit;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.6);
  transition:
    background 0.3s,
    box-shadow 0.3s,
    color 0.3s;
}
.mode-button:hover {
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.9);
  background: var(--button-hover-bg);
}

/* Sprach-Dropdown im Header */
.language-dropdown {
  position: relative; /* Dropdown richtet sich nach dem Flex-Container aus */
  background-color: transparent;
  padding: 0;
  color: var(--text-color);
  z-index: 1000;
}

.language-dropdown .lang-button {
  display: inline-block;
  background: linear-gradient(135deg, #8b0000 0%, #ff3434 100%);
  color: #ffffff;
  line-height: calc(1em + 2px);
  padding: 0 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: inherit;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(255, 52, 52, 0.6);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}

.language-dropdown .lang-button:hover {
  box-shadow: 0 0 12px rgba(255, 102, 102, 0.9);
  background: linear-gradient(135deg, #ff3434 0%, #8b0000 100%);
}

/* Dropdown-Menü (versteckt) */
.language-dropdown ul {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: transparent;
  list-style: none;
  padding: 0;
  margin: 0;
  border-radius: 5px;
  z-index: inherit;
}

.language-dropdown ul li {
  margin: 5px 0;
  text-align: center;
}

/* Dropdown-Menü anzeigen, wenn die Maus über das Element fährt */
.language-dropdown.open ul {
  display: block;
}

/* Links in der Liste */
.language-dropdown ul li a {
  display: inline-block;
  background: linear-gradient(135deg, #8b0000 0%, #ff3434 100%);
  color: #ffffff;
  line-height: calc(1em + 2px);
  padding: 0 12px;
  border-radius: 6px;
  text-decoration: none;
  font-size: 1.5rem;
  box-shadow: 0 0 8px rgba(255, 52, 52, 0.6);
  transition:
    background 0.3s,
    box-shadow 0.3s;
}
.language-dropdown ul li a.active {
  background: linear-gradient(135deg, #0032ff 0%, #005bff 100%);
}
.language-dropdown ul li a:hover {
  box-shadow: 0 0 12px rgba(255, 102, 102, 0.9);
  background: linear-gradient(135deg, #ff3434 0%, #8b0000 100%);
}

/* Sidebar */
.sidebar {
  grid-area: sidebar;
  background-color: var(--bg-color);
  padding: 20px;
  position: relative;
  box-sizing: border-box;
  z-index: 0;
}
.sidebar-inner {
  position: relative;
  width: 100%;
  height: 100%;
}
/* Blaue Linien in der Sidebar */
.sidebar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  width: 3px;
  height: 100%;
  background-color: #0032ff;
  z-index: -1;
}
.sidebar::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background-color: #0032ff;
  z-index: -1;
}

/* Navigation */
nav {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 10px;
  position: relative;
}
.nav-item {
  position: relative;
  display: inline-block;
  margin: 0;
  padding: 0;
}

/* Zusätzlicher Abstand oberhalb bestimmter Navigationspunkte */
.nav-gap {
  margin-top: 0.75em; /* entspricht etwa einer halben Zeilenhöhe */
}
nav a {
  /* Navigationslinks etwas kleiner als die restlichen Links */
  font-size: 1.14rem;
  text-align: left;
  display: inline-block;
  padding: 5px 10px;
  margin-bottom: 10px;
  position: relative;
  z-index: 5;
  text-decoration: none;
  /* Die globale Farbe für Links wird durch die oben definierten Regeln gesetzt */
}

/* Submenüs (Sub-Links) - Desktop */
/* Dynamische Werte (left/width) werden per JS gesetzt */
.sub-links {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 0;
  background-color: var(--bg-color);
  padding: 10px;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  white-space: normal; /* Umbrüche an Leerzeichen erlauben */
  word-break: normal;
  overflow-wrap: break-word; /* bei sehr langem Wort notfalls Break */
  hyphens: auto; /* nur wenn du Silbentrennung für z.B. Deutsch möchtest */
  line-height: 1.2;
  vertical-align: top;
  /* 
     Font-Grösse erst mal fix lassen, 
     wir passen sie ggf. per JS dynamisch an.
  */
}
.sub-links a {
  display: inline-block;
  white-space: normal;
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: auto;
  line-height: 1.2;
  width: 100%; /* ← das ist entscheidend! */
  box-sizing: border-box;
}

/* KI/AI Sonderstil */
.highlight-ai {
  font-family: "Merriweather", serif;
  font-weight: 400;
}

.nav-item.hovered > .sub-links {
  opacity: 1;
  pointer-events: auto;
}

/* Content-Bereich */
.content {
  grid-area: content;
  padding: 20px;
  box-sizing: border-box;
}

/* Zentrierte Überschriften für alle Unterseiten */
.page-title {
  text-align: center;
  font-size: 2.5rem;
  margin-bottom: 20px;
  color: #0032ff;
}

/* Footer-Container */
#footer-include {
  grid-area: footer;
  /* Blaue Trennlinie am oberen Rand */
  border-top: 3px solid #0032ff;
}

/* Fussbereich */
footer {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  background-color: var(--bg-color);
  color: var(--text-color);
  box-sizing: border-box;
  flex-wrap: wrap;
}

/* Linkliste im Footer zentriert auf voller Breite */
.footer-links {
  flex-basis: 100%;
  text-align: center;
  margin-bottom: 5px;
}

/* Disclaimer mittig */
#footer-disclaimer {
  flex-basis: 100%;
  text-align: center;
  font-size: 14px;
  display: none;
}

/* Copyright rechtsbündig */
.footer-right {
  flex-basis: 100%;
  text-align: center;
  margin-top: 5px;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}
/* Matrix-Grün für Datumsangaben im Format yyyy-mm-dd (nur Farbe, Schrift bleibt unverändert) */
.date-ymd {
  color: #00ff41 !important; /* Matrix-Grün */
}
/* Responsive: Tablet / Mobile */
@media (max-width: 1024px) {
  body {
    display: block;
  }
  header.header {
    width: 100%;
    height: auto;
  }
  .hero,
  .sidebar {
    display: none;
  }
  /* Im mobilen Modus: Ausgeklapptes Menü-Design */
  body.mobile-menu-open .sidebar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: var(--bg-color);
    z-index: 1000;
    overflow-y: auto;
    padding: 20px;
    box-sizing: border-box;
  }
  body.mobile-menu-open .sidebar::before,
  body.mobile-menu-open .sidebar::after {
    display: none;
  }

  nav {
    position: static;
    align-items: flex-start;
  }

  /* Mobile: Sub-Links immer ausgeklappt, in voller Breite */
  body.mobile-menu-open .sub-links {
    position: static !important;
    width: auto !important;
    max-width: none !important;
    margin-left: 0;
    display: block;
    flex-direction: column !important;
    opacity: 1;
    transition: none;
    pointer-events: auto;
  }
  body.mobile-menu-open .sub-links a {
    display: block;
    padding: 5px 10px;
  }
  body.mobile-menu-open .sub-links a::before {
    content: "- ";
    color: inherit;
  }

  body.mobile-menu-open .nav-item.hovered > .sub-links {
    display: block;
  }

  .mobile-menu-toggle {
    display: inline-block;
  }

  .content {
    margin-top: 60px;
  }

  @media (max-width: 700px) {
    .chronik-box {
      flex-direction: column;
      align-items: flex-start;
      text-align: left;
      gap: 6px;
    }
    .chronik-box > * {
      padding: 0;
      width: 100%;
    }
    .chronik-box .date,
    .chronik-box .link,
    .chronik-box .summary {
      display: block;
      width: 100%;
      margin-bottom: 2px;
    }
  }
}

/* ==== Light Mode ==== */
html.light-mode {
  --bg-color: #fff;
  --text-color: #000;
  --button-bg: #000;
  --button-text: #fff;
  --button-hover-bg: #333;
}


html.light-mode .faq-answer {
  background: #eee;
  color: var(--text-color);
}

html.light-mode.mobile-menu-open .sidebar {
  background-color: var(--bg-color);
}

/* Einheitliche Darstellung von Markdown-Inhalten */
.markdown-content {
  font-family: "Inter", sans-serif;
  font-size: 1.1rem;
  line-height: 1.5;
  padding: 20px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3 {
  color: #0032ff;
  margin-top: 1.5em;
}

.markdown-content blockquote {
  border-left: 4px solid #0032ff;
  padding-left: 15px;
  color: #ccc;
  font-style: italic;
}

.markdown-content hr {
  border: 0;
  height: 3px;
  background-color: #0032ff;
  margin: 40px 0;
}

/* Sicherstellen, dass Theme-Farben alle sichtbaren Bereiche erreichen */
body,
.hero,
.sidebar,
header.header,
main.content,
.content,
#footer-include,
footer {
  background-color: var(--bg-color) !important;
  color: var(--text-color) !important;
}
