/* ===================== */
/* === WIKI LAYOUT    === */
/* ===================== */
/* Oben sitzt nur der gemeinsame Seiten-Header (/Header/header.php, ~66px).
   Keine eigene Wiki-Leiste, kein Theme-Umschalter – das Wiki ist dunkel. */

/* Sticky-Footer wie im Support-Panel: Body als Spalte, die Shell füllt den
   Rest, der gemeinsame Footer sitzt immer unten – auch bei kurzen Seiten.
   (wiki.css wird nur auf Wiki-Seiten geladen, daher hier body-global ok.) */
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wiki-shell {
  display: flex;
  flex: 1 0 auto;
}

.wiki-sidebar {
  width: 252px;
  min-width: 252px;
  flex-shrink: 0;
  background: #0d0d0d;
  border-right: 1px solid #1a1a1a;
  position: sticky;
  /* nur der gemeinsame Header (~66px) steht darüber */
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  transition: background 0.2s, border-color 0.2s;
}

.wiki-nav { padding: 10px 0 24px; flex: 1; }

.wiki-nav-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #333;
  padding: 10px 18px 6px;
  transition: color 0.2s;
}

.wiki-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 18px;
  color: #555;
  text-decoration: none;
  font-size: 0.875rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.18s, background 0.18s, border-color 0.18s;
}

.wiki-nav-item i {
  width: 14px;
  text-align: center;
  font-size: 0.8rem;
  flex-shrink: 0;
  opacity: 0.6;
}

.wiki-nav-item:hover {
  color: #aaa;
  background: rgba(255,255,255,0.02);
  text-decoration: none;
}

.wiki-nav-item.active {
  color: #eee;
  border-left-color: #d32f2f;
  background: rgba(211, 47, 47, 0.06);
  font-weight: 500;
}

.wiki-nav-item.active i { opacity: 1; }

.wiki-nav-divider {
  height: 1px;
  background: #1e1e1e;
  margin: 8px 10px;
}
.wiki-nav-sup {
  font-size: 0.58em;
  font-weight: 700;
  vertical-align: super;
  letter-spacing: 0.02em;
}

.wiki-nav-badge-alpha {
  font-size: 0.6rem;
  font-weight: 700;
  color: #f59e0b;
  background: rgba(245,158,11,0.12);
  border: 1px solid rgba(245,158,11,0.4);
  border-radius: 3px;
  padding: 1px 5px;
  margin-left: 6px;
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.wiki-nav-sub {
  margin: 2px 0 6px 14px;
  padding-left: 12px;
  border-left: 1px solid #2a2a2a;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.wiki-nav-sub-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  font-size: 0.78rem;
  color: #555;
  text-decoration: none;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
}

.wiki-nav-sub-item i {
  width: 12px;
  text-align: center;
  font-size: 0.7rem;
  opacity: 0.7;
}

.wiki-nav-sub-item:hover {
  color: #bbb;
  background: rgba(255,255,255,0.03);
}
.wiki-main { flex: 1; min-width: 0; display: flex; }

.wiki-content {
  flex: 1;
  min-width: 0;
  padding: 44px 52px 90px;
  transition: background 0.2s;
}

.wiki-page-title {
  font-size: 1.85rem;
  font-weight: 700;
  color: #fff;
  margin: 0 0 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #1e1e1e;
  line-height: 1.2;
  transition: color 0.2s, border-color 0.2s;
}

/* Prose */
.wiki-prose h2 {
  font-size: 1.2rem;
  font-weight: 600;
  color: #fff;
  margin: 36px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid #1a1a1a;
  transition: color 0.2s, border-color 0.2s;
}

.wiki-prose h3 { font-size: 1rem; font-weight: 600; color: #ddd; margin: 22px 0 8px; transition: color 0.2s; }
.wiki-prose p { color: #888; line-height: 1.75; margin: 0 0 14px; font-size: 0.92rem; transition: color 0.2s; }
.wiki-prose a { color: #d32f2f; }
.wiki-prose a:hover { text-decoration: underline; }
.wiki-prose ul, .wiki-prose ol { color: #888; font-size: 0.92rem; line-height: 1.75; padding-left: 22px; margin: 0 0 14px; transition: color 0.2s; }
.wiki-prose li { margin-bottom: 5px; }
.wiki-prose strong { color: #bbb; font-weight: 600; transition: color 0.2s; }

.wiki-info-box {
  background: rgba(255,255,255,0.04);
  border-left: 3px solid #888;
  border-radius: 0 8px 8px 0;
  padding: 13px 16px;
  margin-bottom: 22px;
  color: #999;
  font-size: 0.88rem;
  line-height: 1.6;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: color 0.2s, background 0.2s;
}

.wiki-info-box i { color: #aaa; flex-shrink: 0; margin-top: 2px; }
.wiki-info-box a { color: #bbb; }

/* Farbige Info-Box Varianten */
.wiki-info-discord {
  border-color: #7c3aed !important;
  background: rgba(60,20,120,0.45) !important;
}
.wiki-info-discord i  { color: #b57bff !important; }
.wiki-info-discord a  { color: #c4a0ff !important; }

.wiki-info-warning {
  border-color: #d32f2f !important;
  background: rgba(211,47,47,0.12) !important;
}
.wiki-info-warning i  { color: #ef4444 !important; }

/* === Such-Modal (Header) === */
.wiki-search-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 9100;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 80px 20px 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.wiki-search-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.wiki-search-modal {
  background: #191919;
  border: 1px solid #2a2a2a;
  border-radius: 12px;
  width: 100%;
  max-width: 580px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,0.6);
  transform: translateY(-8px);
  transition: transform 0.18s;
}
.wiki-search-modal-overlay.open .wiki-search-modal { transform: translateY(0); }
.wiki-search-modal-top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid #222;
}
.wiki-search-modal-top i { color: #555; font-size: 0.9rem; flex-shrink: 0; }
.wiki-search-modal-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 0.97rem;
  color: #eee;
  font-family: inherit;
}
.wiki-search-modal-input::placeholder { color: #3a3a3a; }
.wiki-search-modal-esc {
  font-size: 0.68rem;
  color: #3a3a3a;
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  padding: 2px 6px;
  background: #111;
  flex-shrink: 0;
  cursor: pointer;
}
.wiki-search-modal-results { max-height: 380px; overflow-y: auto; }
.wiki-search-modal-result {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 20px;
  font-size: 0.88rem;
  color: #888;
  text-decoration: none;
  border-bottom: 1px solid #1c1c1c;
  transition: background 0.1s, color 0.1s;
}
.wiki-search-modal-result:last-child { border-bottom: none; }
.wiki-search-modal-result:hover {
  background: rgba(255,255,255,0.04);
  color: #eee;
}
.wiki-search-modal-result i { width: 16px; text-align: center; font-size: 0.8rem; color: #444; flex-shrink: 0; }
.wiki-search-modal-result:hover i { color: #d32f2f; }
.wiki-search-modal-result-title { flex: 1; }
.wiki-search-modal-result-hint { font-size: 0.72rem; color: #3a3a3a; }
.wiki-search-modal-empty { padding: 24px 20px; text-align: center; color: #3a3a3a; font-size: 0.85rem; }
.wiki-search-modal-hint {
  padding: 10px 20px;
  border-top: 1px solid #1e1e1e;
  font-size: 0.72rem;
  color: #555;
  display: flex;
  gap: 14px;
}
.wiki-search-modal-hint kbd {
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  padding: 2px 6px;
  background: #1a1a1a;
  color: #555;
  font-size: 0.67rem;
  font-family: inherit;
  margin-right: 3px;
  line-height: 1.4;
}

/* Versions-Badge neben Überschriften */
.wiki-version {
  font-size: 0.63rem;
  font-weight: 700;
  color: #e879f9;
  background: rgba(168,85,247,0.12);
  border: 1px solid rgba(232,121,249,0.4);
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.03em;
}
.wiki-badge-popular {
  font-size: 0.63rem;
  font-weight: 700;
  color: #f5c518;
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.45);
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 8px;
  letter-spacing: 0.03em;
}

.wiki-badge-new {
  font-size: 0.63rem;
  font-weight: 700;
  color: #4ade80;
  background: rgba(74,222,128,0.12);
  border: 1px solid rgba(74,222,128,0.45);
  border-radius: 4px;
  padding: 2px 7px;
  vertical-align: middle;
  margin-left: 6px;
  letter-spacing: 0.03em;
}

.wiki-content .ranks-page { max-width: none; margin: 0; padding: 0; }
.wiki-content .ranks-page-header { display: none; }

/* TOC-Spalte (rechts) – trägt jetzt oben die Suche, darunter das Inhaltsverzeichnis */
.wiki-toc-wrap {
  width: 210px;
  min-width: 210px;
  flex-shrink: 0;
  padding: 44px 20px 40px;
  position: sticky;
  /* nur der gemeinsame Header (~66px) steht darüber */
  top: 66px;
  height: calc(100vh - 66px);
  overflow-y: auto;
}

/* Such-Trigger über dem Inhaltsverzeichnis (öffnet das Such-Modal / Ctrl+K) */
.wiki-toc-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: #141414;
  border: 1px solid #242424;
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.82rem;
  color: #666;
  transition: border-color 0.18s, color 0.18s, background 0.18s;
}
.wiki-toc-search:hover { border-color: #2e2e2e; color: #999; }
.wiki-toc-search i { font-size: 0.8rem; color: #4a4a4a; }
.wiki-toc-search span { flex: 1; text-align: left; }
.wiki-toc-search kbd {
  background: #1e1e1e;
  border: 1px solid #2e2e2e;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.68rem;
  color: #555;
  font-family: inherit;
  white-space: nowrap;
}

.wiki-toc-label {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #333;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.wiki-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid #1a1a1a;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s;
}

.wiki-toc-list a {
  display: block;
  padding: 5px 12px;
  color: #444;
  text-decoration: none;
  font-size: 0.79rem;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.18s, border-color 0.18s;
  line-height: 1.4;
}

.wiki-toc-list a:hover { color: #888; }
.wiki-toc-list a.toc-active { color: #ddd; border-left-color: #d32f2f; }

/* === Responsive === */
@media (max-width: 1100px) {
  /* Kein Platz mehr für eine eigene Spalte: die rechte Spalte rutscht als
     volle Breite über den Artikel, sichtbar bleibt davon nur die Suche –
     das Inhaltsverzeichnis wird ausgeblendet. */
  .wiki-main { flex-direction: column; }
  .wiki-content { flex: none; }
  .wiki-toc-wrap {
    order: -1;
    position: static;
    width: auto;
    min-width: 0;
    height: auto;
    padding: 24px 52px 0;
  }
  .wiki-toc-label,
  .wiki-toc-list { display: none; }
  .wiki-toc-search { margin-bottom: 0; }
}

@media (max-width: 800px) {
  .wiki-sidebar { display: none; }
  .wiki-content { padding: 24px 22px 60px; }
  .wiki-toc-wrap { padding: 20px 22px 0; }
}
