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

@font-face {
  font-family: "Inter";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/inter/Inter-Italic.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/inter/Inter-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/inter/Inter-Bold.woff2") format("woff2");
}

/* --- Ende Inter-Definitionen --- */

/*  CSS-basiertes Layout mit Burger-Menü  */
:root {
  --brand: #1e90ff;
  --brand-outer: #0e80ef;
  --brand-700: #1877cc;
  --brand-nav: #2b74c7;
  --brand-nav-outer: #1b64b7;
  --text: #00003f;
  --bg: #ffffff;
  --footer-h: 56px; /* Sticky-Footer-Höhe */
}

/* Reset/utility */
* {
  box-sizing: border-box;
}

html {
  padding: 0;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.8;
  color: var(--text);
  background: #f7f8fb;
}

/* Typografie */
h1,
h2,
h3,
h4,
h5,
h6,
p,
td,
th {
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
}

h1,
h2,
h3,
h4,
h5,
h6,
th {
  color: var(--brand);
  text-transform: uppercase;
}

h1 {
  font-size: 1.4em;
}

h2 {
  font-size: 1.1em;
  /*font-weight: bold;*/
}

a {
  color: var(--brand);
  font-weight: normal;
  text-underline-offset: 0.15em;
}

a:hover {
  color: #5ec0ff;
}

span.small {
  font-size: 0.8em;
}

em {
  font-weight: bold;
  font-style: normal;
}

/* Layout-Container */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: var(--footer-h); /* Platz für fixen Footer */
  background: transparent;
}

.wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 10px;
  width: 100%;
}

/* Header */
.site-header {
  background: var(--brand-outer);
  color: #fff;
  position: relative;
  z-index: 10; /* über dem Content-Schatten */
}

.header-inner {
  background: var(--brand);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px 10px;
}

.brand img {
  display: block;
  height: 64px;
  width: auto;
}

.titles h1,
.titles h2 {
  margin: 0;
  color: #fff;
  font-weight: normal;
}

.titles h1 {
  font-size: 2rem;
  line-height: 1.1;
}

.titles h2 {
  font-size: 1.1rem;
  opacity: 0.95;
}

.lang-switch .flag {
  display: inline-block;
  margin-left: 8px;
}

.lang-switch img {
  border: 0;
  display: block;
}

/* Navigation */
.site-nav {
  background: var(--brand-nav);
  min-height: 52px;
}

.site-nav .wrap {
  padding-top: 2px;
  padding-bottom: 2px;
  background: var(--brand-nav-outer);
}

.site-nav .nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 10px;
}

/* Menu list (Basis) */
.site-nav .menu {
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 12px 20px;
}

.site-nav .menu li {
  margin: 0;
  padding: 0;
}

.site-nav a {
  text-decoration: none;
  text-transform: uppercase;  
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #ffffff;
  font-size: 1.1em;
}

.site-nav a:hover {
  color: #e6f3ff;
}

/* Burger-Button */
.nav-toggle {
  display: none; /* Desktop: verstecken */
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  min-width: 44px; /* gutes Touch-Ziel */
  gap: 10px;
}

.nav-toggle:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.nav-toggle span {
  margin-right: 8px;
}

/* --- Burger-Icon zeichnen (3 Linien) --- */
.nav-toggle .bars {
  width: 22px;
  height: 2px;
  background: currentColor; /* nimmt die Textfarbe des Buttons (#fff) */
  position: relative;
  display: inline-block;
}

.nav-toggle .bars::before,
.nav-toggle .bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: currentColor;
}

.nav-toggle .bars::before {
  top: -6px;
}

.nav-toggle .bars::after {
  top: 6px;
}

/* Desktop */
@media (min-width: 1000px) {
  .nav-toggle {
    display: none !important; /* erzwingt Ausblenden auf Desktop */
  }

  .site-nav .menu {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 0 6px;
  }

  .site-nav .menu a {
    display: flex;
    align-items: center;
    padding: 5px 7px;
    text-decoration: none;
    color: #ffffff;
  }
  .site-nav .menu a:hover{
    background: rgba(255,255,255,.12);
    color: #ffffff;
    text-decoration: none;
    transform: scale(1.1);
  }  
}

/* Mobile */
@media (max-width: 999px) {
  .nav-toggle {
    display: inline-flex !important; /* erzwingt Anzeigen auf Mobil */
    align-items: center;
  }

  .site-nav .menu {
    display: none; /* eingeklappt */
    flex-direction: column;
    width: 100%;
    gap: 0;
    margin-top: 8px;
  }

  .site-nav .menu li {
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }

  .site-nav .menu li:first-child {
    border-top: none;
  }

  .site-nav .menu a {
    display: block;
    padding: 10px 4px;
  }

  .site-nav[data-open="true"] .menu {
    display: flex; /* aufgeklappt */
  }
}

/* Nav-Button kompakter + aktueller Menüeintrag (bis 1199px) */
@media (max-width: 1199px) {
  .nav-toggle {
    padding: 6px 8px; /* weniger horizontaler Rand */
    min-width: 36px;  /* statt 44px */
    min-height: 36px; /* bleibt gut klickbar */
    gap: 0;
    border-width: 3px;
    margin: 4px;
  }

  .nav-toggle span {
    margin-right: 0; /* kein Extra-Abstand */
  }

  .nav-toggle .bars {
    width: 18px; /* schmaleres Icon */
  }

  .site-nav .nav-current {
    display: inline-block;
    margin-left: 10px;
    margin-top: 5px;
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #fff;
    font-size: 1.5rem;
    vertical-align: middle;
  }

  /* Wenn Menü aufgeklappt ist, den Label-Text ausblenden */
  .site-nav[data-open="true"] .nav-current {
    display: none;
  }
}

/* Navi höher - Desktop */
@media (min-width: 761px) {
  .site-nav .nav-inner {
    padding: 14px 0; /* vorher 8px 0 10px etwas mehr Luft */
  }

  .site-nav .menu a {
    line-height: 2.1; /* etwas höhere Zeilenbox für mehr Höhe */
  }
}

/* Navi höher Mobil */
@media (max-width: 760px) {
  .site-nav .menu a {
    padding: 14px 6px; /* vorher 10px 4px komfortabler tippen */
  }
}

/* Auf Desktop ausblenden */
@media (min-width: 1000px) {
  .site-nav .nav-current {
    display: none;
  }
}

/* Hauptbereich */
.content {
  background: var(--bg);
  padding: 24px 20px;
  flex: 1 0 auto;
}

/* Footer */
.site-footer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  margin-top: 0;
  background: #fff;
  border-top: 3px solid var(--brand);
}

.site-footer .wrap {
  max-width: 1000px;
  margin: 0 auto;
  padding: 10px;
  color: #333;
}

/* Bestehende Hilfsklassen aus der alten Seite (beibehalten) */
div.figure {
  float: right;
  clear: right;
  text-align: center;
  padding: 0;
  margin: 5px 5px 25px 5px;
  width: 300px;
  font-style: italic;
}

div.fine-print {
  font-size: 0.9em;
  color: #aaaaaa;
  clear: both;
}

p.screenshot {
  text-align: center;
  padding: 10px;
}

p.screenshot img {
  margin: 5px auto;
  display: block;
}

img.floater {
  clear: right;
  float: right;
  margin: 5px 5px 5px 15px;
}

img.floater-inverse {
  clear: left;
  float: left;
  margin: 5px 25px 5px 5px;
}

div.screenshot {
  float: left;
  clear: none;
  text-align: left;
  width: 250px;
  height: 240px;
  font-style: italic;
  padding: 0;
  margin: 5px 5px 25px 5px;
}

div.screenshot img {
  margin: 5px;
}

/* Tabellen, falls irgendwo im Content verwendet */
table {
  border-collapse: collapse;
}

td,
th {
  vertical-align: top;
  padding: 2px;
}

/* Kleinere Bildschirme */
@media (max-width: 520px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    grid-auto-rows: auto;
  }

  .brand {
    order: 1;
  }

  .titles {
    order: 2;
  }

  .lang-switch {
    order: 3;
  }

  .brand img {
    height: 40px;
  }
}

/*  Verbesserte Einzüge & mobile Komponenten  */

/* Bullets/Nummern im Content: sauberer Einzug und Abstand */
.content ul,
.content ol {
  margin: 0 0 1rem 1.25rem; /* Einzug links */
  padding-left: 0.75rem;    /* zusätzlicher Platz für Marker */
}

.content li {
  margin: 0.3rem 0;
}

.content h2 + ul,
.content h2 + ol {
  /* Verhindert, dass Listen neben vorherigen Floats "kleben" */
  margin-top: 0.25rem;
}

/* Fallback, falls CSS Grid nicht unterstützt wird */
@supports not (display: grid) {
  @media (min-width: 620px) {
    .grid-2 > * {
      width: 50%;
    }
  }
}

/*  Screenshots: zwei explizite Spalten (DOM: links zuerst, dann rechts)  */
.screenshots-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.screenshots-columns .column h2 {
  text-align: center;
  margin: 0 0 8px 0;
}

.screenshots-columns .shot {
  text-align: center;
  margin: 0 0 12px 0;
}

.screenshots-columns figure {
  margin: 0;
}

.screenshots-columns figcaption {
  margin-top: 6px;
  font-style: italic;
}

@media (max-width: 760px) {
  .screenshots-columns {
    grid-template-columns: 1fr;
  }
}

/* --- Größere Textareas auf der Beispiele-Seite --- */
.examples .list textarea {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 20vh;
  box-sizing: border-box;
  padding: 12px;
  font: 14px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  white-space: pre; /* Zeilen wie in der Datei beibehalten */
  overflow: auto;
  resize: vertical;
}

/* --- Beispiele: Gleich hohe Spalten je Beispielzeile --- */
.examples .example {
  display: grid;
  grid-template-columns: 1fr 1fr; /* links: Textblock, rechts: Textarea */
  gap: 12px 20px;
  align-items: stretch;           /* beide Spalten auf gleiche Zeilenhöhe */
  margin-bottom: 16px;
}

/* Linke Spalte: Textblock soll die volle Zeilenhöhe ausfüllen */
.examples .example .details {
  display: flex;
  align-items: stretch;
}

.examples .example .details > * {
  margin: 0; /* erlaubt Innenabstand */
}

.examples .example .list {
  display: flex;
}

.examples .example .list form {
  display: flex;
  flex: 1 1 auto;
}

.examples .example .list textarea {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 14em;
  resize: vertical;
}

/* Mobil: untereinander stapeln + größere Textareas */
@media (max-width: 760px) {
  .examples .list textarea {
    min-height: 20vh;
  }

  .examples .example {
    grid-template-columns: 1fr;
  }
}

/* --- Responsive Images im Content (global) --- */
.content img {
  max-width: 100%;
  height: auto;
}

/* Aktiver Menüeintrag: dunkelblau hinterlegt */
.site-nav .menu a[aria-current="page"],
.site-nav .menu a.is-active {
  background: #1857a6; /* dunkles Blau */
  color: #ffffff;
  border-radius: 4px;
}

/* Hover-Effekt: Links hellgrau hinterlegen */
.site-nav .menu a:hover {
  background: #355595; /* helles / mittleres Grau */
  color: #ffffff;
  border-radius: 4px; /* passend zum aktiven Link */
}

/* Seite leicht „card“-artig */
.site-header,
.content,
.site-footer .wrap {
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

/* Titel mit leichtem Schatten */
.header-inner h1 {
  font-size: 2.0rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  margin: 0;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

.header-inner h2 {
  font-size: 1.5rem;
  font-weight: 400;
  opacity: 0.9;
  margin: 2px 0 0;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
