/* === Farbvariablen ===
   Werte identisch zur Portfolioseite, damit beide Auftritte zusammengehören. */
:root {
  --bg: #ffffff;
  --text: #1c2128;
  --muted: #5a626d;
  --border-color: #dfe3e8;
  --card-bg: #f6f8fa;
  --accent-color: #2d4a63;
}

:root[data-theme="dark"] {
  --bg: #0d1117;
  --text: #e6edf3;
  --muted: #8b949e;
  --border-color: #30363d;
  --card-bg: #161b22;
  --accent-color: #8ab4f8;
}

/* === Grundlayout === */
html, body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.65;
  transition: background 0.35s ease, color 0.35s ease;
}

:root[data-theme="dark"] body {
  background-image: radial-gradient(rgba(155, 189, 215, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { text-decoration: underline; }

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

/* === Typografie im Inhaltsbereich === */
.content h1 { font-size: 1.9rem; line-height: 1.25; margin-bottom: 1rem; }
.content h2 { font-size: 1.35rem; margin-top: 2.5rem; }
.content h3 { font-size: 1.1rem; margin-top: 2rem; }

/* Zeilenlänge begrenzen – lange Zeilen ermüden beim Lesen */
.content p,
.content li,
.content blockquote {
  max-width: 68ch;
}

.content hr {
  border: 0;
  border-top: 1px solid var(--border-color);
  margin: 2.5rem 0;
}

.content blockquote {
  margin: 1.5rem 0;
  padding: 0.25rem 0 0.25rem 1rem;
  border-left: 3px solid var(--border-color);
  color: var(--muted);
}

/* === Code === */
.content code {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
  font-size: 0.88em;
}

.content pre {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  line-height: 1.5;
}

.content pre code {
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.85rem;
}

/* === Tabellen === */
.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 1.5rem 0;
  font-size: 0.95rem;
}
.content th, .content td {
  border: 1px solid var(--border-color);
  padding: 0.5rem 0.7rem;
  text-align: left;
}
.content th { background: var(--card-bg); }

/* === Karten-Grid === */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.2rem;
  margin-top: 1.5rem;
}

.card {
  background: var(--card-bg);
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border-color);
  border-left: 3px solid var(--accent-color);
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-color);
}

/* === Section Headers === */
.section-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 2.5rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  font-weight: 700;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.35rem;
}

/* === Dark-Mode-Button === */
.theme-toggle {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 999;
  border: 1px solid var(--border-color);
  background: var(--card-bg);
  color: var(--muted);
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
}
.theme-toggle:hover {
  color: var(--accent-color);
  border-color: var(--accent-color);
}

/* === Sidebar === */
.sidebar ul { list-style: none; margin: 0; padding-left: 0; }
.sidebar li { margin: .3rem 0; }
.sidebar a { text-decoration: none; color: var(--text); }
.sidebar a:hover { color: var(--accent-color); }

.sidebar h3 {
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

/* Rubriküberschriften zurücknehmen, Einträge hervorheben */
.sidebar li > strong {
  display: block;
  margin-top: 1.1rem;
  margin-bottom: 0.2rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
}

.sidebar li > ul {
  border-left: 1px solid var(--border-color);
  padding-left: 0.75rem;
}

.sidebar a.active {
  color: var(--accent-color);
  font-weight: 600;
}

.sidebar-external {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.95rem;
}
.sidebar-external a { font-weight: 600; }
.sidebar-external a:hover { text-decoration: underline; }

/* === Container-Breite & Spalten === */
.container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 2.5rem;
  align-items: start;
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}
@media (max-width: 860px) {
  .container { grid-template-columns: 1fr; gap: 1.5rem; }
  .sidebar { order: 2; }
  .content { order: 1; }
}

/* === Fußzeile === */
footer {
  max-width: 1100px;
  margin: 3rem auto 2rem;
  padding: 1.25rem;
  border-top: 1px solid var(--border-color);
  color: var(--muted);
  font-size: 0.9rem;
}

/* === Sanfte Seiten-Transition === */
html, body, .sidebar, .content, .page-nav, .card, .theme-toggle, .section-head, a, hr {
  transition: background-color 0.35s ease, color 0.35s ease, border-color 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  html, body, .sidebar, .content, .page-nav, .card, .theme-toggle, .section-head, a, hr {
    transition: none !important;
  }
  .card:hover { transform: none; }
}

/* === Druckansicht === */
@media print {
  .theme-toggle, .sidebar { display: none !important; }
  .container { display: block; max-width: none; }
  html, body { background: #fff !important; color: #000 !important; }
}

/* === Einstiegspunkt vom Inhaltsverzeichnis abtrennen === */
.sidebar > ul > li:first-child {
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar > ul > li:first-child a {
  font-weight: 600;
}
