/* ═══════════════════════════════════════════════════════════
   HyponaTrack — UKE Corporate Design
   Basierend auf uke.de/forschung Subpage-Layout
   ═══════════════════════════════════════════════════════════ */

:root {
  --uke-navy: #004B87;
  --uke-blue: #0065BD;
  --uke-blue-light: #e8f0f8;
  --uke-bg: #fff;
  --uke-border: #ddd;
  --uke-text: #333;
  --uke-text-light: #666;
  --uke-white: #fff;

  /* Ampelfarben */
  --ampel-green: #34C759;
  --ampel-yellow: #FF9500;
  --ampel-red: #FF3B30;

  /* Risikoklassen */
  --risk-low: #4A90D9;
  --risk-mid: #F5A623;
  --risk-high: #D0021B;
}

/* ── Globaler Hintergrund: weiß wie uke.de ─────────────── */
body {
  background-color: var(--uke-bg) !important;
  color: var(--uke-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.65;
}

.page-columns .content {
  background-color: var(--uke-white);
  padding: 0 2rem 2rem;
  border-radius: 0;
  border: none;
}

/* ── Obere Navbar: UKE dunkelblau ──────────────────────── */
.navbar {
  background-color: var(--uke-navy) !important;
  background-image: none !important;
  border-bottom: none !important;
  box-shadow: none !important;
  padding: 0;
  min-height: 44px;
}
.navbar .navbar-brand {
  color: var(--uke-white) !important;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
}
.navbar .nav-link {
  color: var(--uke-white) !important;
  font-size: 0.82rem;
  padding: 0.7rem 0.9rem !important;
  border-bottom: 3px solid transparent;
}
.navbar .nav-link:hover {
  background-color: rgba(255,255,255,0.1) !important;
  color: var(--uke-white) !important;
  text-decoration: none !important;
}
.navbar .nav-link.active {
  font-weight: 600;
  background-color: rgba(255,255,255,0.15) !important;
  border-bottom: 3px solid var(--uke-white) !important;
  color: var(--uke-white) !important;
  text-decoration: none !important;
}
.navbar-logo {
  max-height: 32px !important;
}
/* ── Suchfunktion + Navbar-Tools sichtbarer ─────────────── */
.navbar .quarto-navigation-tool {
  background-color: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.4) !important;
  border-radius: 4px;
  padding: 0.35rem 0.65rem !important;
  margin-left: 0.4rem;
}
.navbar .quarto-navigation-tool:hover {
  background-color: rgba(255,255,255,0.35) !important;
  border-color: rgba(255,255,255,0.6) !important;
}
.navbar .quarto-navigation-tool .bi {
  color: var(--uke-white) !important;
  font-size: 1.15rem;
}
/* Search-Icon speziell: Quarto generiert SVG im #quarto-search */
#quarto-search {
  background-color: rgba(255,255,255,0.2) !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  border-radius: 4px;
  padding: 0.3rem 0.5rem !important;
}
#quarto-search:hover {
  background-color: rgba(255,255,255,0.35) !important;
}
#quarto-search .aa-SubmitIcon,
#quarto-search svg {
  color: var(--uke-white) !important;
  fill: var(--uke-white) !important;
  stroke: var(--uke-white) !important;
  width: 18px !important;
  height: 18px !important;
}
/* Algolia/Quarto Search-Input Button */
.aa-DetachedSearchButton {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}
.aa-DetachedSearchButtonIcon svg {
  color: var(--uke-white) !important;
  fill: var(--uke-white) !important;
  width: 18px !important;
  height: 18px !important;
}
.aa-DetachedSearchButtonPlaceholder {
  display: none !important;
}

/* ── Sekundäre Navbar / Breadcrumb ─────────────────────── */
.quarto-title-block {
  border-bottom: 1px solid var(--uke-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1.5rem;
}

/* ── Sidebar: UKE-Forschungs-Stil ──────────────────────── */
.sidebar {
  background-color: var(--uke-white) !important;
  border-right: none !important;
  padding-top: 0.5rem;
  width: 320px !important;
  min-width: 320px !important;
}
/* Content neben breiter Sidebar: genug Platz */
@media (min-width: 992px) {
  #quarto-content {
    margin-left: 320px !important;
  }
  #quarto-sidebar {
    position: fixed;
    top: 44px;
    left: 0;
    height: calc(100vh - 44px);
    overflow-y: auto;
    z-index: 100;
  }
}
/* Logo kleiner */
.sidebar .sidebar-logo {
  max-width: 80px !important;
  padding: 0.5rem 0;
}
.sidebar-title {
  color: var(--uke-blue) !important;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}
/* Alle Items: dünne Trennlinien */
.sidebar .sidebar-item {
  border-bottom: 1px solid #eee;
}
/* ALLE Sidebar-Links: dunkel, normal-weight (wie UKE Sub-Items) */
.sidebar a.sidebar-link,
.sidebar a.sidebar-item-text,
.sidebar .sidebar-item a.sidebar-link,
.sidebar .sidebar-item-section .sidebar-item a.sidebar-link {
  color: var(--uke-text) !important;
  font-size: 0.88rem;
  padding: 0.5rem 0.8rem;
  background-color: transparent !important;
  font-weight: 400;
  transition: color 0.15s ease;
  text-decoration: none !important;
}
/* Sub-Items eingerückt */
.sidebar .sidebar-item-section .sidebar-section > .sidebar-item > a {
  padding-left: 1.5rem;
}
/* Sektions-Header: schwarz, fett, größer */
.sidebar .sidebar-item-section > .sidebar-item-container > a.sidebar-item-text {
  color: var(--uke-text) !important;
  font-weight: 700;
  font-size: 1.05rem;
  padding-left: 0.8rem;
}
/* Aktives Item: UKE-blauer Hintergrund, weiße Schrift */
.sidebar a.sidebar-link.active,
.sidebar .sidebar-item a.sidebar-link.active {
  color: var(--uke-white) !important;
  border-left: none !important;
  font-weight: 600;
  background-color: var(--uke-blue) !important;
  border-radius: 2px;
}
/* Aktives Item: Chevron weiß */
.sidebar a.sidebar-link.active::after {
  content: "\203A";
  color: var(--uke-white);
  font-weight: 700;
  float: right;
  font-size: 1.1em;
}
/* Hover: hellblauer Hintergrund */
.sidebar a.sidebar-link:hover,
.sidebar .sidebar-item a:hover {
  color: var(--uke-blue) !important;
  background-color: var(--uke-blue-light) !important;
  text-decoration: none !important;
}
/* Chevron-Toggle für Sektionen: UKE-Blau */
.sidebar .sidebar-item-toggle .bi {
  color: var(--uke-blue) !important;
  font-size: 0.75rem;
}

/* ── Seitentitel: groß, leicht, wie uke.de ─────────────── */
h1, .title {
  color: var(--uke-text) !important;
  font-weight: 300;
  font-size: 2rem;
  margin-bottom: 1rem;
}

/* ── Abschnittstitel: UKE-Blau ─────────────────────────── */
h2 {
  color: var(--uke-blue) !important;
  font-weight: 700;
  font-size: 1.3rem;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: 2.5rem;
  margin-bottom: 0.8rem;
}
h3 {
  color: var(--uke-text) !important;
  font-weight: 700;
  font-size: 1.05rem;
  margin-top: 1.5rem;
}

/* ── Links ─────────────────────────────────────────────── */
a {
  color: var(--uke-blue);
  text-decoration: none;
}
a:hover {
  color: var(--uke-blue);
  text-decoration: underline;
}

/* ── Callouts ──────────────────────────────────────────── */
.callout-note {
  border-left-color: var(--uke-blue) !important;
  background-color: var(--uke-blue-light) !important;
}
.callout-note .callout-header {
  background-color: transparent !important;
  color: var(--uke-blue) !important;
}
.callout-warning {
  border-left-color: var(--ampel-yellow) !important;
}

/* ── Tabellen: UKE-Stil mit Header-Hintergrund + Mokka-Hover ── */
table {
  table-layout: auto !important;
  width: 100% !important;
  border-collapse: collapse;
  margin: 1rem 0;
  border: none;
  border-radius: 0;
}
table thead {
  background-color: #f0f2f5 !important;
  border-bottom: 1px solid var(--uke-border);
}
table thead th {
  color: var(--uke-text) !important;
  text-align: left;
  padding: 0.6rem 0.8rem;
  font-weight: 700;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--uke-border);
  background-color: #f0f2f5 !important;
}
table td {
  text-align: left;
  padding: 0.5rem 0.8rem;
  border-bottom: 1px solid #eee;
  font-size: 0.9rem;
}
table tbody tr:hover {
  background-color: #f5f0e8 !important;
}
/* Bootstrap/Quarto table overrides */
.table > :not(caption) > * > * {
  box-shadow: none !important;
}

/* ── TOC (rechte Seite "Auf dieser Seite") ──────────────── */
#TOC .active {
  border-left: 3px solid var(--uke-blue) !important;
}
#TOC a {
  color: var(--uke-text) !important;
  font-size: 0.85rem;
}
#TOC a.active {
  color: var(--uke-blue) !important;
}
#TOC .nav-link:hover {
  color: var(--uke-blue) !important;
}
#quarto-margin-sidebar .toc-title,
.quarto-margin-sidebar .toc-title {
  color: var(--uke-blue) !important;
  font-weight: 700;
}

/* ── Page Footer ───────────────────────────────────────── */
.nav-footer {
  background-color: var(--uke-navy) !important;
  color: rgba(255,255,255,0.7) !important;
  font-size: 0.85rem;
  margin-top: 3rem;
}
.nav-footer a {
  color: var(--uke-white) !important;
}

/* ── Bilder / Diagramme ────────────────────────────────── */
.cell-output-display img,
.cell-output-display svg {
  max-width: 100%;
  height: auto;
}
/* Graphviz SVGs: responsive ohne Clipping */
.cell-output-display svg[viewBox] {
  display: block;
  margin: 0 auto;
  overflow: visible;
}
/* Diagramm-Container: kein overflow hidden */
.cell-output-display {
  overflow: visible !important;
}

/* ── Diagram Zoom Overlay ──────────────────────────────── */
#diagram-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  cursor: zoom-out;
}
#diagram-overlay.active {
  display: flex;
}
#diagram-overlay-content {
  background: white;
  border-radius: 4px;
  padding: 2rem;
  width: 90vw;
  max-height: 92vh;
  overflow: auto;
}
#diagram-overlay-content svg {
  width: 100% !important;
  height: auto !important;
  max-height: 85vh;
}

/* ── Screenshot-Galerie ────────────────────────────────── */
.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.screenshot-gallery figure { margin: 0; text-align: center; }
.screenshot-gallery img {
  width: 100%;
  max-width: 280px;
  border-radius: 16px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid var(--uke-border);
}
.screenshot-gallery img:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.15); }
.screenshot-gallery figcaption { margin-top: 0.5rem; font-size: 0.85em; color: var(--uke-navy); }
.screenshot-placeholder {
  width: 100%; max-width: 280px; aspect-ratio: 9/19.5; border-radius: 16px;
  background: #f8f8f8; border: 2px dashed var(--uke-border);
  display: flex; align-items: center; justify-content: center;
  color: var(--uke-text-light); font-size: 0.9em; margin: 0 auto;
}
