/* Inter regular (400) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/raspi/assets/fonts/inter-v20-latin-regular.woff2') format('woff2');
}
/* Inter semi-bold (600) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/raspi/assets/fonts/inter-v20-latin-600.woff2') format('woff2');
}
/* Inter bold (700) */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/raspi/assets/fonts/inter-v20-latin-700.woff2') format('woff2');
}

/* ==========================================================================
   GLOBALE RESETS & VARS
========================================================================== */
:root {
  --primary-color: #0056b3;
  --accent-color: #28a745;
  --bg-main: #f4f6f9;
  --bg-card: #ffffff;
  --text-color: #2c3e50;
  --text-muted: #6c757d;
  --border-color: #e2e8f0;
  --sidebar-width: 340px;  /* VERBREITERT von 240px auf 340px */
  --header-height: 60px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;  /* WICHTIG für unabhängiges Scrollen */
  overflow: hidden;  /* Verhindert globales Scrollen */
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-color);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* Weiches Scrollen für die gesamte Seite aktivieren */
html {
  scroll-behavior: smooth;
}

a {
  color: var(--primary-color);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   TOP-BAR (Kopfzeile) - bleibt oben fixiert
========================================================================== */
.top-header {
  height: var(--header-height);
  background: #ffffff;
  border-bottom: 2px solid var(--primary-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  flex-shrink: 0;  /* Verhindert, dass der Header schrumpft */
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.site-title {
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: #1e293b;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  flex: 1;
  max-width: 450px;
  margin: 0 20px;
  position: relative;
}

.search-box input {
  width: 100%;
  padding: 8px 35px 8px 15px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: #f8fafc;
  font-size: 0.9rem;
  outline: none;
  transition: all 0.2s;
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

.search-box button {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 15px;
}

.lang-switch img {
  width: 22px;
  height: 15px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lang-switch a:hover img,
.lang-switch a.active img {
  opacity: 1.0;
  transform: scale(1.1);
}

/* ==========================================================================
   HAUPTLAYOUT - MIT UNABHÄNGIGEM SCROLLEN
========================================================================== */
.layout-container {
  display: flex;
  flex: 1;  /* Füllt den verbleibenden Raum unter dem Header */
  overflow: hidden;  /* Verhindert globales Scrollen */
  height: calc(100vh - var(--header-height));  /* Höhe = Bildschirm minus Header */
}

/* Sidebar - unabhängig scrollbar */
.sidebar {
  width: var(--sidebar-width);
  padding: 20px 15px;
  flex-shrink: 0;
  overflow-y: auto;  /* UNABHÄNGIGES SCROLLEN */
  background: var(--bg-main);
  border-right: 1px solid var(--border-color);
}

/* Custom Scrollbar für Sidebar (optional, für schöneres Aussehen) */
.sidebar::-webkit-scrollbar {
  width: 6px;
}
.sidebar::-webkit-scrollbar-track {
  background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.sidebar-logo {
  text-align: center;
  margin-bottom: 25px;
}

.sidebar-logo img {
  max-width: 120px;
  height: auto;
  border-radius: 8px;
}

.sidebar-group {
  background: #ffffff;
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 15px;
  border: 1px solid var(--border-color);
}

.sidebar-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu li {
  margin-bottom: 2px;
}

.sidebar-menu a {
  color: var(--text-color);
  font-size: 0.95rem;
  display: block;
  padding: 3px 10px;  /* Etwas mehr Padding für bessere Klickbarkeit */
  border-radius: 4px;
  transition: background 0.2s;
  line-height: 1.4;
}

.sidebar-menu a:hover {
  background: #f1f5f9;
  color: var(--primary-color);
  text-decoration: none;
}

/* Badge für veraltete Themen in der Sidebar */
.outdated-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: bold;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 4px;
  vertical-align: middle;
}

.sidebar-menu a.outdated-link {
  color: #666;
}

/* Haupt-Inhalt - unabhängig scrollbar */
.main-content {
  flex: 1;
  padding: 25px;
  overflow-y: auto;  /* UNABHÄNGIGES SCROLLEN */
  min-width: 0;
}

/* Custom Scrollbar für Main-Content */
.main-content::-webkit-scrollbar {
  width: 8px;
}
.main-content::-webkit-scrollbar-track {
  background: transparent;
}
.main-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
.main-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.article-body h2,
.article-body h3 {
  scroll-margin-top: 80px;
}

.article-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 35px;
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  /*max-width: 1200px;   Begrenzt die Breite für bessere Lesbarkeit */
  margin: 0 auto;  /* Zentriert den Content */
}

.article-title {
  font-size: 2rem;
  color: #1a202c;
  margin-bottom: 15px;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 10px;
}

/* ==========================================================================
   ÜBERSCHRIFTEN MIT UNTERSTRICH
========================================================================== */
.article-body h1,
.article-body h2,
.article-body h3 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    margin-top: 1.5em;
    margin-bottom: 0.7em;
    color: #1a202c;
}

/* Die erste h1 im Artikel braucht keinen großen Abstand nach oben */
.article-body > h1:first-child {
    margin-top: 0;
}

/* h1 etwas größer und markanter */
.article-body h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

/* h2 etwas kleiner */
.article-body h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* h3 noch kleiner */
.article-body h3 {
    font-size: 1.25rem;
    font-weight: 600;
}

.article-body p {
    margin-bottom: 0.7em;
}

/* ==========================================================================
   LISTEN-STYLING IM ARTIKEL (Optimiert für sauberen Umbruch)
========================================================================== */
.article-body ul,
.article-body ol {
    padding-left: 1.5em;       /* Platz für den Bullet-Point + kleiner Abstand zum Text */
    margin-left: 0;
    list-style-position: outside; /* Bullet liegt außerhalb des Textflusses */
}

.article-body li {
    margin-bottom: 0.25em;     /* Etwas Luft zwischen den Punkten verbessert die Lesbarkeit (statt 0px) */
    line-height: 1.6;
    padding-left: 0;           /* WICHTIG: Kein extra Padding hier, damit der Umbruch bündig ist! */
}

/* Unterpunkte (verschachtelte Listen) stärker einrücken */
.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul {
    padding-left: 1.5em;       /* Addiert sich zum Padding der Eltern-Liste (insgesamt 3.0em) */
    margin-top: 0;
    margin-bottom: 0.25em;
}

/* Bullet-Typen für verschiedene Verschachtelungstiefen */
.article-body ul {
    list-style-type: disc;
}
.article-body ul ul {
    list-style-type: circle;
}
.article-body ul ul ul {
    list-style-type: square;
}
.list-indent {
    padding-left: 1.5em;       /* Platz für den Bullet-Point + kleiner Abstand zum Text */
    margin-left: 0;
    list-style-position: outside; /* Bullet liegt außerhalb des Textflusses */
}

/* ==========================================================================
   INLINE CODE (Befehle, Dateinamen, Variablen im Fließtext)
========================================================================== */
.article-body code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.88em;
    background-color: #f1f5f9;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    white-space: nowrap;
    word-break: break-all;
}

/* Optional: Etwas dunklerer Hintergrund bei Hover für bessere Interaktivität */
.article-body code:hover {
    background-color: #e2e8f0;
}

/* Frontend Edit Button */
.btn-edit-frontend {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.4em;
    background-color: #007bff;
    color: #ffffff;
    padding: 5px 5px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 400;
    transition: all 0.2s ease;
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.btn-edit-frontend:hover {
    background-color: #0056b3;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

/* ==========================================================================
   INHALTSVERZEICHNIS (TOC)
========================================================================== */
.toc-box {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-left: 4px solid #0056b3;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 25px;
  display: inline-block;
  min-width: 300px;
}

.toc-title {
  font-weight: bold;
  font-size: 0.95rem;
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 10px 0 0 0;
}

.toc-list li {
  margin-bottom: 1px;
  font-size: 0.95rem;
}

.toc-list a {
  color: #0056b3;
  text-decoration: none;
}

.toc-list a:hover {
  text-decoration: underline;
}

.toc-number {
  font-weight: bold;
  color: #64748b;
  margin-right: 8px;
}
/* =====================================================================
   Navigation
========================================================================= */

/* Kapitel-Navigation im Fußbereich */
.chapter-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    margin-top: 40px;
    padding-top: 25px;
    border-top: 2px solid #e2e8f0;
}

.nav-item {
    flex: 1;
}

.nav-item.nav-home {
    flex: 0 0 auto; /* Verhindert das Verzerren des Mittel-Buttons */
    text-align: center;
}

.nav-item.nav-next {
    text-align: right;
}

/* Links als schicke Karten stylen */
.nav-prev a, 
.nav-next a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    background-color: #f8fafc;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    color: #1e293b;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
}

.nav-prev a:hover, 
.nav-next a:hover {
    background-color: #ffffff;
    border-color: #007bff;
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.12);
    transform: translateY(-2px);
}

/* Pfeile und Textanordnung */
.nav-arrow {
    font-size: 1.4rem;
    font-weight: bold;
    color: #007bff;
}

.nav-text {
    display: flex;
    flex-direction: column;
}

.nav-text small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    font-weight: 600;
}

.nav-text strong {
    font-size: 0.95rem;
    color: #0f172a;
}

/* Hauptmenü-Button in der Mitte */
.btn-home-nav {
    display: inline-block;
    padding: 10px 20px;
    background-color: #e2e8f0;
    color: #334155;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 20px;
    transition: background-color 0.2s ease;
}

.btn-home-nav:hover {
    background-color: #cbd5e1;
    color: #0f172a;
}

/* Responsiv für Smartphones (untereinander stapeln) */
@media (max-width: 600px) {
    .chapter-navigation {
        flex-direction: column;
        align-items: stretch;
    }
    
    .nav-item.nav-home {
        order: -1; /* Hauptmenü auf dem Handy ganz oben anzeigen */
        margin-bottom: 10px;
    }

    .nav-prev a, .nav-next a {
        width: 100%;
        box-sizing: border-box;
    }
}

/* ==========================================================================
   FOOTER
========================================================================== */
.site-footer {
  background: #2d3748;
  color: #a0aec0;
  padding: 25px 20px;
  font-size: 0.85rem;
  flex-shrink: 0;  /* Verhindert, dass der Footer schrumpft */
}

.footer-content {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.footer-links a {
  color: #cbd5e0;
  margin-right: 15px;
}

.footer-links a:hover {
  color: #ffffff;
}

/* ==========================================================================
   Sidebar (fehlende Übersetzung)
========================================================================== */
.sidebar-menu a.untranslated-link {
  opacity: 0.85;
}

.lang-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: bold;
  background-color: #e0e0e0;
  color: #555;
  padding: 1px 4px;
  border-radius: 3px;
  margin-left: 6px;
  vertical-align: middle;
}

/* ==========================================================================
   MOBILE RESPONSIVENESS
========================================================================== */
@media (max-width: 768px) {
  html, body {
    height: auto;
    overflow: auto;  /* Auf Mobile wieder normales Scrollen */
  }
  
  .layout-container {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  
  .sidebar {
    width: 100%;
    overflow-y: visible;  /* Auf Mobile kein separates Scrollen */
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
  
  .main-content {
    overflow-y: visible;  /* Auf Mobile kein separates Scrollen */
  }
  
  .top-header {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 15px;
    gap: 10px;
  }
  
  .search-box {
    order: 3;
    max-width: 100%;
    margin: 5px 0;
  }
  
  .article-card {
    padding: 20px;
  }
}