/* ==========================================================================
   HEADER CONTAINER
   ========================================================================== */
.header-container {
  display: grid;
  /* Links Logo (214px = 170px Logo + 44px Abstand), rechts Menüleiste */
  grid-template-columns: 214px auto; 
  align-items: end; /* Richtet Unterkante Logo und Unterkante Leiste perfekt aus */
  max-width: fit-content; /* Zieht den Kasten exakt auf Elementbreite zusammen */
  margin: 0 auto; /* Zentriert den gesamten Block auf der Seite */
  position: sticky;
  top: -130px; /* Bringt den oberen Logo-Überhang (100px) aus dem Bild */
  z-index: 9999;
}

/* ==========================================================================
   LOGO STYLING
   ========================================================================== */
.logo-wrapper {
  width: 214px;  
  height: 160px; 
  box-sizing: border-box;
  padding: 0 0 0 44px; /* 44px Abstand, um das Logo weiter nach links zu rücken */
  background-color: transparent; 
  display: flex;
  align-items: flex-end; /* Drückt das Logo bündig auf die Unterkante */
}

.demo-logo {
  width: 170px;
  height: 160px;
  display: block;
}

/* ==========================================================================
   DIE MENÜLEISTE
   ========================================================================== */
.main-nav {
  /* Basis-Hintergrund #eee, 45% Deckkraft */
  background-color: rgba(238, 238, 238, 0.45); 
  /* Verwischeffekt blockiert unruhige Hintergründe – macht Schrift perfekt lesbar */
  backdrop-filter: blur(8px); 
  -webkit-backdrop-filter: blur(8px);
  
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  border-radius: 0px;
  padding-right: 14px; /* Symmetrischer Abschlussabstand rechts */
}

.menu-level-1 {
  display: flex;
  justify-content: start;
  align-items: stretch; /* Erzwingt identische Höhe für alle Felder */
  list-style: none;
  margin: 0;
  padding: 2px 0; /* Vertikaler Abstand der Schaltflächen im Balken */
}

/* ==========================================================================
   MENÜ-ELEMENTE
   ========================================================================== */
.nav-item {
  margin: 0 4px; /* Horizontaler Randabstand zwischen den Feldern */
  position: relative;
}

/* STANDARD-STYLING FÜR DIE FELDER 1 BIS 5 */
.nav-link {
  display: flex;
  align-items: center;
  gap: 4px; /* Abstand zwischen Bild-Icon und Text */
  padding: 0px 8px; /* padding oben & unten zum Rahmen */
  height: 100%; /* Füllt die Höhe des Menübandes komplett aus */
  background-color: #eee; /* Basis-Farbe der Hauptreiter */
  border: 1px solid #000000; /* RAHMEN */
  border-radius: 0px; /* eckig */
  text-decoration: none;
  color: #0f172a;   /* col ebenfalls am Ende der css wg. -visited- */
  font-family: Arial, Helvetica, sans-serif !important;
  font-style: normal !important;
  font-weight: 600;
  font-size: 11pt;
  white-space: nowrap; /* Verhindert Textumbruch */
  cursor: pointer;
  transition: all 0.15s ease-in-out;
  box-sizing: border-box;
}

/* HOVER-EFFEKT & GEÖFFNET-ZUSTAND FÜR HAUPTLEISTE */
.nav-link:hover, 
.nav-item.is-open > .nav-link {
  background-color: #ffffff; /* bei Hover ODER wenn das Pull-Down offen ist */
  color: #000080;            /* Schriftfarbe wechselt bei Hover/Öffnung auf Navy */
  border-color: #000000;     
}

/* Pfeil-Symbole für Dropdowns */
.arrow, .arrow-right {
  font-size: 10px;
  margin-left: 6px;
}

/* --------------------------------------------------------------------------
   STYLING FÜR EIGENE BILD-ICONS IN DER HAUPTLEISTE
   -------------------------------------------------------------------------- */
.nav-icon {
  width: 32px;          /* Maximale Breite des Icons */
  height: 14px;         /* Maximale Höhe des Icons */
  object-fit: contain;  /* Behält das Seitenverhältnis der Grafik bei */
  display: inline-block;
  vertical-align: middle; /* Richtet das Icon mittig zur Schrifthöhe aus */
}

/* ==========================================================================
   PULL-DOWN-MENÜS (2., 3. & 4. EBENE)
   ========================================================================== */
.menu-level-2, .menu-level-3, .menu-level-4 {
  display: none;
  position: absolute;
  background-color: #eee; /* Dropdown-Kasten */
  min-width: 180px; 
  list-style: none;
  margin: 0;
  padding: 0; 
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  border: none; 
  border-radius: 0px; 
  z-index: 10000;
}

/* Die Listenelemente der Untermenüs werden zum Bezugspunkt für das nächste Level */
.menu-level-2 li, .menu-level-3 li {
  position: relative;
}

/* Ebene 2 klappt nach wie vor unter die Hauptleiste */
.menu-level-2 {
  top: calc(100% + 5px);
  left: 0;
}

/* Ebene 3 und 4 docken direkt oben rechts an die jeweilige Zeile an */
.menu-level-3, .menu-level-4 {
  top: 0;
  left: 100%;
  margin-left: 2px;
  margin-top: 1px; /* Verhindert feine Versätze durch den -1px Margin der Links */
}

/* Sichtbarkeits-Steuerung via JavaScript-Klasse */
.nav-item.is-open .menu-level-2,
.has-sub-dropdown.is-open > .menu-level-3,
.has-sub-dropdown.is-open > .menu-level-4 {
  display: block;
}

/* KOMTAKTE LINKS IN ALLEN UNTERMENÜS (Ebene 2, 3 und 4) */
.menu-level-2 a, .menu-level-3 a, .menu-level-4 a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 16px; /* Vertikales Padding auf 1px verringert für ultra-kompakte Zellenhöhe */
  background-color: #eee; /* Alle Unterpunkte */
  color: #0f172a;
  text-decoration: none;
  font-family: Arial, Helvetica, sans-serif !important;
  font-weight: normal !important;
  font-style: normal !important;

  font-size: 11pt; /* Schriftgröße Untermenüs */
  white-space: nowrap; /* Verhindert auch in Untermenüs mehrzeilige Textumbrüche */
  cursor: pointer;
  border: 1px solid #000000; 
  margin-top: -1px; 
  transition: all 0.15s ease-in-out;
  box-sizing: border-box;
}

/* HOVER-EFFEKT NUR BEI ECHTEM HOVER IM UNTERMENÜ */
.menu-level-2 a:hover,
.menu-level-3 a:hover,
.menu-level-4 a:hover {
  background-color: #ffffff; /* Erst bei aktivem Hover wird der Unterpunkt weiß (#fff) */
  color: #000080;            /* Textfarbe schaltet bei Hover im Untermenü ebenfalls auf Navy */
}

/* Sonderregel: Wenn ein Untermenü geöffnet ist, bleibt der aktive Pfad-Trigger optisch weiß */
.has-sub-dropdown.is-open > .sub-trigger {
  background-color: #ffffff;
  color: #000080; /* Bleibt im offenen Pfad auch Navy */
}

/* ==========================================================================
   ZUSÄTZLICHE STYLES
   ========================================================================== */
/* entspricht class=wanderer */
.nav-wanderer {
  font-weight: bold !important;
  color: #800000 !important;
  font-style: italic !important;
}

/* ==========================================================================
   8. DYNAMISCHES LIGHTBOX-OVERLAY (MITTELGRAU #888, DECKENDE RAHMEN & COMPACT)
   ========================================================================== */
#overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background-color: rgba(0, 0, 0, 0.4) !important; 
  z-index: 100000 !important; 
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

#overlay.hidden {
  display: none !important;
}

/* DER HAUPT-CONTAINER ERHÄLT DEN DECKENDEN #888-RAHMEN */
.image-container {
  position: relative !important;
  max-width: 94% !important;
  max-height: 94% !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  /* deckender, 2px starker Rahmen in reinem #888 */
  border: 2px solid #888888 !important; 
  background-color: #888888 !important; /* Füllt alle eventuellen Lücken deckend in #888 aus */
  padding: 0 !important; /* Verhindert, dass alte Abstände die Transparenz durchschimmern lassen */
  box-sizing: border-box !important;
}

#largeImage {
  max-width: 100% !important;
  max-height: 88vh !important; 
  object-fit: contain !important;
  display: block !important;
  /* Bild dockt ohne transparenten Rand direkt im Container an */
  border: none !important;
  margin: 0 !important;
}

/* TEXTFELD */
.caption {
  width: 100% !important;
  box-sizing: border-box !important;
  background-color: #888888 !important;    /* Mittelgrau */
  color: #ffffff !important;               /* Weiß */
  padding: 1px 12px !important;            /* Hauchdünn am Text */
  font-size: 13pt !important;              /* Große Schriftgröße */
  font-weight: normal !important;
  line-height: 1.2 !important;             
  text-align: center !important;
  /* HIER GEÄNDERT: Kein schwarzer Rahmen mehr, sondern bündig in #888 abgeschlossen */
  border: none !important; 
  border-top: 2px solid #888888 !important; /* Trennung zum Bild in gleicher Rahmenfarbe */
  margin: 0 !important;                       
}

/* ==========================================================================
   9. ABSOLUTER SCHUTZ GEGEN GLOBALE LINK-FARBEN (AUS DEF5-8.CSS)
   ========================================================================== */
.main-nav a,
.main-nav a:link,
.main-nav a:visited,
.menu-level-2 a,
.menu-level-2 a:visited,
.menu-level-3 a,
.menu-level-3 a:visited,
.menu-level-4 a,
.menu-level-4 a:visited {
color: #0f172a !important; /* Erzwingt Anthrazit */
text-decoration: none !important;
}
/* ==========================================================================
10. SONDERROLLE FÜR DAS LETZTE FELD: REINER BILD-BUTTON (RAHMEN- & BG-FREI)
========================================================================== */
.nav-image-btn {
display: flex !important;
align-items: center !important;
justify-content: center !important; / Zentriert das Bild horizontal /
height: 60% !important;            / Zwingt auch diesen Button auf die volle Leistenhöhe /
padding: 0 !important;               / Kein innerer Abstand, der das Bild verschiebt /
background-color: transparent !important; / Absolut kein Hintergrund /
border: none !important;             / Absolut kein Rahmen */
cursor: pointer !important;
box-sizing: border-box !important;
}
/* Verhindert, dass das Bild die Leiste nach oben oder unten aufbläht */
.nav-image-btn img {
display: block !important;
width: auto !important;
height: 22px !important;            / Höhe - dockt bündig in der Leiste an /
object-fit: contain !important;
}