@import url(fontawesome-all.min.css);
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;600&family=Inter:wght@300;400;600&display=swap");

/* ==========================================================
   Grundvariablen
   ----------------------------------------------------------
   Zentrale Werte fuer Farben, Abstaende, mobile Navigation
   und Ebenen. Aenderungen hier wirken sich auf das ganze
   Layout aus.
   ========================================================== */

:root {
  --bg-dark: #05080c;
  --bg-dark-2: #0b1016;
  --text-light: #e8ecef;
  --paper: #f7f5ef;

  --sidebar-bg: #38404f;
  --sidebar-width: 200px;
  --sidebar-panel-width: min(380px, 88vw);

  --mobile-header-height: 58px;
  --nav-indent: 18px;

  --z-backdrop: 20;
  --z-panel: 30;
  --z-mobile-header: 40;
}

/* ==========================================================
   Basis
   ========================================================== */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", Roboto, Arial, sans-serif;
  background: #000;
  color: var(--text-light);
}

/* ==========================================================
   Hauptlayout
   ----------------------------------------------------------
   Desktop: linke Navigation + rechter Inhaltsbereich.
   Rechts wird eine Inhaltsseite per iframe geladen.
   ========================================================== */

.layout {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  height: 100vh;
  overflow: hidden;
}

.left {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;

  background:
    linear-gradient(180deg, #ffffff18 0%, #00000030 100%),
    var(--sidebar-bg) url("../img/bg01.png") repeat;
}

.right {
  min-width: 0;
  height: 100vh;
  background: var(--paper);
}

iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

/* ==========================================================
   Profilkopf links
   ----------------------------------------------------------
   Enthält das Avatar-/Profilbild. Der Link bekommt line-height:0,
   damit unter dem Bild keine ungewollte Luecke entsteht.
   ========================================================== */

.profile-header {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 18px 2px;
  background: transparent;
}

.profile-header a {
  display: block;
  max-width: 100%;
  line-height: 0;
}

.profile-avatar {
  display: block;
  width: 190px;
  max-width: 100%;
  height: auto;
}

.start-link {
  display: inline-block;
  font-size: 0.28rem;
  color: rgba(255, 255, 255, 0.45);
  text-decoration: none;
  border-bottom: 1px dotted rgba(255, 255, 255, 0.22);
}

.start-link:hover {
  color: rgba(255, 255, 255, 0.92);
}

/* ==========================================================
   Baum-Navigation
   ----------------------------------------------------------
   Die Navigation ist scrollbar, die Scrollbar wird aber
   visuell ausgeblendet.
   ========================================================== */

.tree,
.tree ul {
  margin: 0;
  padding-left: var(--nav-indent);
  list-style: none;
}

.tree {
  flex: 1;
  padding: 0 18px 6px;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.tree::-webkit-scrollbar {
  display: none;
}

.tree li {
  margin: 5px 0;
}

.tree a {
  text-decoration: none;
}

.node {
  display: inline;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  border: 0;
}

.node:hover {
  text-decoration: underline;
}

.node.root,
.node.category {
  font-weight: 700;
}

.node.leaf {
  font-weight: 400;
}

/* ==========================================================
   Navigations-Footer
   ========================================================== */

.nav-footer {
  margin: 0 18px 10px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.nav-footer button {
  padding: 2px 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

/* ==========================================================
   Mobile Navigation
   ----------------------------------------------------------
   Unter 900px wird die linke Navigation zu einem seitlichen
   Panel. body.nav-open schiebt das Panel ein und aktiviert
   den halbtransparenten Hintergrund.
   ========================================================== */

.mobile-header,
.backdrop {
  display: none;
}

@media (max-width: 900px) {
  .layout {
    display: block;
  }

  .left {
    position: fixed;
    top: var(--mobile-header-height);
    bottom: 0;
    left: 0;
    z-index: var(--z-panel);
    width: var(--sidebar-panel-width);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(0, 0, 0, 0.45);
  }

  body.nav-open .left {
    transform: translateX(0);
  }

  .right {
    padding-top: var(--mobile-header-height);
  }

  iframe {
    height: calc(100vh - var(--mobile-header-height));
  }

  .mobile-header {
    display: flex;
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    z-index: var(--z-mobile-header);
    align-items: center;
    gap: 10px;
    height: var(--mobile-header-height);
    padding: 10px 12px;
    background: linear-gradient(180deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  }

  .mobile-title {
    font-size: 16px;
    font-weight: 700;
  }

  .menu-toggle {
    padding: 7px 10px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 8px;
  }

  .backdrop {
    display: block;
    position: fixed;
    inset: var(--mobile-header-height) 0 0;
    z-index: var(--z-backdrop);
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
  }

  body.nav-open .backdrop {
    opacity: 1;
    pointer-events: auto;
  }
}
