/* ─── Kein horizontales Scrollen, egal was die Ursache wäre ─── */
/* "clip" statt "hidden": verhindert horizontales Scrollen genauso, erzeugt
   aber KEINEN neuen Scroll-Kontext – "hidden" auf html/body kann sonst
   position:sticky (Header) kaputt machen, besonders auf Mobile-Browsern. */
html, body {
  overflow-x: clip;
  max-width: 100%;
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
}
/* Überschreibt Tailwinds eigene .font-mono-Utility-Klasse zuverlässig mit
   unserer selbst gehosteten Schrift, unabhängig von Ladereihenfolge/
   Spezifität der von Tailwind zur Laufzeit generierten Styles. */
.font-mono {
  font-family: 'JetBrains Mono', ui-monospace, 'SF Mono', Consolas, monospace !important;
}

/* ─── Header / Navigation ─── */
.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot.online {
  background: #22c55e;
}
.status-dot.offline {
  background: #ef4444;
}
.status-dot.idle {
  background: #eab308;
}
#adminStatus {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #475569;
  background: #f1f5f9;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  white-space: nowrap;
}
#adminStatus.visible {
  display: flex;
}
#adminStatus .username {
  color: #0f172a;
  font-weight: 600;
}
.notification-badge {
  background: #ef4444;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 9999px;
  margin-left: 0.2rem;
  min-width: 1.2rem;
  text-align: center;
}
.admin-link {
  display: none;
}
.admin-link.visible {
  display: inline-block;
}
.fade-in {
  animation: fadeIn 0.5s ease-out both;
}
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 37%, #f1f5f9 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .fade-in {
    animation: none;
  }
  .skeleton {
    animation: none;
    background: #eef2f7;
  }
}
#contactForm input,
#contactForm textarea {
  transition: border-color 0.2s;
}
#contactForm input:focus,
#contactForm textarea:focus {
  border-color: #2563eb;
  outline: none;
}
.honeypot {
  position: absolute;
  left: -9999px;
  top: -9999px;
}
.footer-link {
  color: #94a3b8;
  text-decoration: none;
}
.footer-link:hover {
  color: #e2e8f0;
  text-decoration: underline;
}
.captcha-box {
  background: #f1f5f9;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  display: inline-block;
  font-weight: 600;
}
.thank-you-message {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  padding: 2rem;
  border-radius: 1rem;
  text-align: center;
}
.thank-you-message h3 {
  color: #166534;
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.thank-you-message p {
  color: #15803d;
}
.back-to-home {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #0f172a;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  font-family: monospace;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: background 0.2s;
  z-index: 100;
  cursor: pointer;
}
.back-to-home:hover {
  background: #1e293b;
}
/* Header-Links: alle in einer Zeile, bei Bedarf umbrechend */
.header-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.header-nav a {
  white-space: nowrap;
}

/* ─── Mobile Hamburger-Navigation ─── */
/* #navLinks ist selbst kein Layout-Container mehr – die einzelnen
   Unterseiten-Links werden direkt zu Flex-Items von .header-nav (bzw.
   von Zeilen im mobilen Panel), egal ob Desktop oder Mobile. */
#navLinks {
  display: contents;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.nav-toggle-bar {
  display: block;
  width: 22px;
  height: 2px;
  background: #0f172a;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}
/* Hamburger -> Kreuz, sobald der Button als geöffnet markiert ist */
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) {
  opacity: 0;
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

@media (max-width: 767px) {
  .nav-toggle {
    display: flex;
  }

  /* .header-nav wird zum ausklappbaren Panel unter dem Header */
  .header-nav {
    position: fixed;
    top: 64px; /* Header-Höhe (h-16) */
    left: 0;
    right: 0;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 12px 24px -12px rgba(15, 23, 42, 0.15);
    transition: max-height 0.3s ease;
  }
  .header-nav.nav-open {
    max-height: calc(100vh - 64px);
    overflow-y: auto;
  }
  .header-nav > a,
  .header-nav #navLinks > a {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
  }
  .header-nav #adminStatus {
    width: 100%;
    margin: 0.5rem 1.5rem 1rem;
    justify-content: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .header-nav,
  .nav-toggle-bar {
    transition: none;
  }
}

/* ─── "Module"-Dropdown (Sprung-Navigation zu den Sektionen) ─── */
#moduleDropdownWrap {
  position: relative;
}
#moduleDropdownToggle {
  background: none;
  border: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
  padding: 0;
}
#moduleDropdownLabel {
  display: inline-block;
  max-width: 6.5rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}
@media (min-width: 1024px) {
  #moduleDropdownLabel {
    max-width: 9rem;
  }
}
#moduleDropdownToggle[aria-expanded="true"] #moduleDropdownChevron {
  transform: rotate(180deg);
}
.module-dropdown-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  min-width: 20rem;
  max-height: 24rem;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 12px 24px -8px rgba(15, 23, 42, 0.18);
  padding: 0.5rem 0;
  z-index: 60;
}
.module-dropdown-menu.hidden {
  display: none;
}
.module-dropdown-menu a.active-section {
  background: #eff6ff;
  border-left: 3px solid #2563eb;
  padding-left: calc(1rem - 3px);
}
.module-dropdown-menu a.active-section span:first-child {
  color: #1d4ed8;
}

@media (max-width: 767px) {
  /* Im mobilen Panel füllt das Dropdown die Breite und sitzt direkt
     unter dem Trigger statt absolut positioniert zu schweben. */
  #moduleDropdownWrap {
    width: 100%;
  }
  #moduleDropdownToggle {
    width: 100%;
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid #f1f5f9;
    justify-content: space-between;
  }
  .module-dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    background: #f8fafc;
  }
}

/* ─── Punkte-Navigation am rechten Rand (immer sichtbar, Desktop) ─── */
#sideDotsNav {
  position: fixed;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  z-index: 30;
}
.side-dot {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
  transition: all 0.25s ease;
}
.side-dot:hover {
  background: #94a3b8;
  transform: scale(1.3);
}
.side-dot.active-section {
  background: #2563eb;
  width: 10px;
  height: 24px;
  border-radius: 5px;
}
@media (min-width: 1024px) {
  #sideDotsNav {
    display: flex;
  }
}
@media (prefers-reduced-motion: reduce) {
  .side-dot {
    transition: none;
  }
}

/* ─── Aktuell sichtbare Sektion deutlich hervorheben ─── */
main section[data-track-section] {
  transition: background-color 0.35s ease;
}
main section[data-track-section].current-section {
  background-color: #eff6ff !important;
}

/* Nummer + Balken links NEBEN der Inhaltsspalte (nicht am Textrand selbst) –
   nur ab sehr breiten Bildschirmen sichtbar, wo links genug Platz ist. */
.module-num-marker {
  display: none;
  position: absolute;
  left: calc(50% - 32rem - 3.5rem);
  top: 2.75rem;
  align-items: center;
  gap: 0.75rem;
}
@media (min-width: 1536px) {
  .module-num-marker {
    display: flex;
  }
}
.module-num-marker .module-num {
  font-family: monospace;
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
  transition: color 0.35s ease;
}
.module-num-marker .module-bar {
  display: block;
  width: 2px;
  height: 2rem;
  background: #e2e8f0;
  border-radius: 999px;
  transition: background-color 0.35s ease;
}
main section[data-track-section].current-section .module-num {
  color: #2563eb;
}
main section[data-track-section].current-section .module-bar {
  background: #2563eb;
}
@media (prefers-reduced-motion: reduce) {
  main section[data-track-section] {
    transition: none;
  }
}

/* ─── Rich-Text-Inhalte (Seiten wie Impressum/Datenschutz/AGB) ─── */
/* Ersetzt Tailwinds "prose"-Klasse, die im schlanken Browser-Runtime
   (ohne @tailwindcss/typography-Plugin) nichts bewirkt – hier von Hand
   nachgebaut, für vernünftige Lesbarkeit von HTML-Inhalten aus dem
   Seiten-Editor (Impressum, Datenschutz, AGB, Wiki-artige Inhalte). */
.prose {
  color: #334155;
  font-size: 0.95rem;
  line-height: 1.75;
}
.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  color: #0f172a;
  font-weight: 700;
  margin-top: 1.75em;
  margin-bottom: 0.6em;
  line-height: 1.3;
}
.prose h1 {
  font-size: 1.5rem;
}
.prose h2 {
  font-size: 1.25rem;
}
.prose h3 {
  font-size: 1.1rem;
}
.prose h2:first-child,
.prose h3:first-child {
  margin-top: 0;
}
.prose p {
  margin-top: 0;
  margin-bottom: 1.1em;
}
.prose ul,
.prose ol {
  margin-top: 0;
  margin-bottom: 1.1em;
  padding-left: 1.5em;
}
.prose ul {
  list-style: disc;
}
.prose ol {
  list-style: decimal;
}
.prose li {
  margin-bottom: 0.4em;
}
.prose li > ul,
.prose li > ol {
  margin-top: 0.4em;
  margin-bottom: 0.4em;
}
.prose strong {
  font-weight: 700;
  color: #0f172a;
}
.prose em {
  font-style: italic;
}
.prose a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover {
  color: #1d4ed8;
}
.prose blockquote {
  border-left: 3px solid #e2e8f0;
  padding-left: 1em;
  margin: 1.1em 0;
  color: #64748b;
  font-style: italic;
}
.prose hr {
  border: none;
  border-top: 1px solid #e2e8f0;
  margin: 2em 0;
}
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.1em;
  font-size: 0.9em;
}
.prose th,
.prose td {
  border: 1px solid #e2e8f0;
  padding: 0.5em 0.75em;
  text-align: left;
}
.prose th {
  background: #f8fafc;
  font-weight: 600;
}