/* ==========================================================================
   1. GRUNDSTRUKTUR & LAYOUT
   ========================================================================== */

.layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Die gesamte App ist mindestens so hoch wie das Display */
  background: var(--bg-main);
}

.main-content {
  flex: 1; /* Füllt den Platz zwischen Topbar und Footer aus */
  padding-top: 2rem;
  padding-bottom: 4rem; /* Reduziert von 25vh auf einen sauberen Abstand */
  display: flex;
  flex-direction: column;
  /* overflow-x: hidden und min-height: 100vh hier ENTFERNT */
}


/* ==========================================================================
   2. BASIS-EINSTELLUNGEN (MOBILE FIRST)
   ========================================================================== */

/* Diese Werte gelten standardmässig für Smartphones */
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative; /* Basis für absolute Mitte */
  height: 60px;
  width: calc(100% - 4rem); 
  max-width: 1800px;
  margin: 0 auto;
  
  /* 🔑 Reduziert auf 1.5rem, damit das Logo weiter nach links rückt */
  padding: 0 1.5rem; 
  
  background-color: #37434B;
  border-radius: 20px;

  /* Ein sehr dezenter, tiefer Schatten */
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.page-content {
  /* Bündig mit der Topbar */
  width: calc(100% - 4rem);
  max-width: 1100px;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 20px;
  z-index: 3000;
  margin-bottom: 1rem; /* Abstand Content zu Topbar-Navigation */
  background: transparent;
}

.topbar::before {
  content: "";
  position: absolute;
  /* Wir schieben den Schild nach oben aus der Bar heraus */
  bottom: 100%; 
  left: -50vw;
  right: -50vw;
  /* Er ist so hoch wie der Abstand zum Rand (20px) plus Puffer */
  height: 40px; 
  /* Hier nutzen wir deinen exakten Gradienten */
  background: var(--bg-main);
  background-attachment: fixed;
  z-index: -1;
  pointer-events: none;
}

.topbar-left {
  position: relative;
  z-index: 2;


}

.topbar-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  
  /* 🔑 Unveränderte Zentrierung zur gesamten Bar */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

.topbar-right {
  position: relative;
  z-index: 2;
  /* 🔑 Schiebt die Icons rechts ebenfalls weiter nach außen */
  margin-right: -0.5rem; 
}

.topbar .logo-img {
  width: 100px;
  height: auto;
  display: block;
}

/* ==========================================================================
   3. NAVIGATION KOMPONENTEN (DESKTOP)
   ========================================================================== */

.topbar-nav .nav-link {
  font-family: "Lato", sans-serif;
  font-size: 0.775rem;
  font-weight: 500;
  color: #d1d8df;
  text-decoration: none;
  padding: 0.25rem 0;
  transition: color 0.15s ease;
  align-items: center;
  line-height: 1;
  display: flex;
  gap: 6px;

  white-space: nowrap;
}

.topbar-nav .nav-link:hover,
.topbar-nav .nav-link.active {
  color: #f2f4f7;
}

.nav-item {
  position: relative;
}

.logo-link {
  display: flex;
  align-items: center;
}

/* Subnavigation (Dropdown) */
.subnav {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fafafa;
  padding: 0.5rem;
  border-radius: 6px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.nav-item.has-sub:hover .subnav {
  opacity: 1;
  pointer-events: auto;
}

.subnav-link {
  display: block;
  font-size: 0.8rem;
  color: #37434b;
  text-decoration: none;
  padding: 0.25rem 0.5rem;
}

.nav-dot {
  position: absolute;
  width: 6px;
  height: 6px;
  background: #4A90E2;
  border-radius: 50%;
}

.nav-dot-desktop {
  position: absolute;
  width: 10px;
  height: 10px;
  background: #4A90E2;
  border-radius: 50%;
}

/* ==========================================================================
   4. MOBILE NAVIGATION (PANEL & OVERLAY)
   ========================================================================== */

.mnav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1500;
}

.mnav-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;

  -webkit-overflow-scrolling: touch;
  background: #37434B;
  border-radius: 20px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 2000;
}

/* Menu Open States */
body.menu-open .mnav-panel,
body.menu-open .mnav-overlay {
  opacity: 1;
  pointer-events: auto;
}
body.menu-open .mnav-panel {
  transform: translateY(0);
}

.mnav-links { padding: 8px 16px 16px; }

.mnav-link, .mnav-parent {
  display: block;
  width: 100%;
  padding: 10px;
  border-radius: 20px;
  font-family: "Lato", sans-serif;
  font-size: 0.8rem;
  color: #F2F4F7;
  text-decoration: none;
  border: none;
  background: transparent;
  text-align: left;
}

.mnav-link:active, .mnav-parent:active { 
  background: rgba(242, 244, 247, 0.08); 
}

.mnav-chevron {
  width: 18px;
  height: 18px;
  opacity: 0.75;
  transition: transform 0.15s ease;
}

.mnav-sub { display: none; padding: 0 0 6px 12px; }

.mnav-sublink {
  display: block;
  padding: 6px;
  border-radius: 20px;
  font-size: 0.75rem;
  color: #F2F4F7;
  text-decoration: none;
  opacity: 0.8;
}

.mnav-item.is-open .mnav-sub { display: block; }
.mnav-item.is-open .mnav-chevron { transform: rotate(180deg); }

/* Hamburger Button Logic */
.nav-toggle { display: none; }
.nav-icon { display: block; width: 28px; height: 28px; }
.nav-icon--close { display: none; }
body.menu-open .nav-icon--hamburger { display: none; }
body.menu-open .nav-icon--close { display: block; }

/* ==========================================================================
   5. RESPONSIVE ANPASSUNGEN (UPWARDS / MIN-WIDTH)
   ========================================================================== */

/* Ab Tablet Breite (iPad Hochformat etc.) */
@media (min-width: 768px) {
  .topbar-inner,
  .page-content {
    width: calc(100% - 6rem);
    padding: 0 1.5rem;
  }
}

/* 📱 MOBILE OPTIMIERUNG (Höhe & Logo) */
@media (max-width: 900px) {
  .nav-toggle {
    display: inline-flex;
    width: 44px;
    height: 44px;
    background: transparent;
    border: none;
    cursor: pointer;
    align-items: center;
    justify-content: center;
  }
  .topbar-nav { display: none; }

  /* Navbar kompakter machen */
  .topbar-inner {
    height: 55px; /* Reduziert von 60px */
    width: calc(100% - 5rem); /* Etwas breiter auf Mobile für mehr Platz innen */
  }

  .topbar {
    margin: 1rem 0; /* Weniger Abstand nach oben/unten */
    margin-bottom: 0;
  }

  /* Logo auf Mobile leicht verkleinern */
  .topbar .logo-img {
    width: 90px; 
  }
  .topbar-left {
    margin-left: -0.7rem; /* Wert anpassen, bis es perfekt über dem Content sitzt */
  }
}

/* Desktop Modus (Ab Laptop / iPad Querformat) */
@media (min-width: 1024px) {
  /* 1. Die Bar und der Content behalten die gleiche Grundbreite */
  .topbar-inner,
  .page-content {
    width: calc(100% - 12rem);
    padding: 0 3rem;
  }

  /* 2. HARD-FIX: Das Logo innerhalb der Bar nach links schieben */
  /* Der negative Margin zieht das Logo über das Padding hinaus an den Rand */
  .topbar-left {
    margin-left: -2.1rem; /* Wert anpassen, bis es perfekt über dem Content sitzt */
  }

  /* 3. Optische Korrektur für Rechts (Hamburger/Profil), falls nötig */
  .topbar-right {
    margin-right: -0.5rem;
  }

  .mnav-overlay, 
  .mnav-panel { 
    display: none !important; 
  }
}

/* ==========================================================================
   6. MISC
   ========================================================================== */

.section-divider { margin: 0; }
.section-divider svg { width: 100%; height: auto; display: block; }





/* NEU - muss noch zugewiesen werden */

/* NEU - Zentrierung für Picture & Img */
.footer-divider-clean {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 4rem;
  background: transparent !important;
  border: none !important;
}

/* WICHTIG: Das picture-Tag muss die Zentrierung weitergeben */
.footer-divider-clean picture {
  display: flex;
  justify-content: center;
  width: 100%;
}

.footer-divider-clean img {
  width: 75%;
  max-width: 800px;
  height: auto;
  max-height: 30px; 
  object-fit: contain;
  opacity: 0.925;
  transition: all 0.3s ease;
  display: block; /* Entfernt Inline-Abstände */
}

.footer-divider-clean-2 img {
  width: 100%;
  max-width: 800px;
  height: auto;
  max-height: 30px; 
  object-fit: contain;
  opacity: 0.925;
  transition: all 0.3s ease;
  display: block; /* Entfernt Inline-Abstände */
}

/* Mobile Optimierung */
@media (max-width: 600px) {
  .footer-divider-clean img {
    /* Nutze 'vw' (Viewport Width) um sicherzugehen, dass es nie breiter als das Handy ist */
    width: auto; 
    max-width: 80vw;    /* 80% der Bildschirmbreite - das passt meist perfekt zum Content */
    max-height: 50px;   /* Etwas mehr Höhe für die Flagge */
    opacity: 1;
    margin: 0 auto;
  }
}

/* Zusammengefasster Footer */
.site-footer {
  border: none !important;
  background: transparent !important;
  padding: 2rem 1rem 4rem 1rem; /* Oben 2, Seite 1, Unten 4 */
  text-align: center;
  margin-bottom: 0rem;
}
.footer-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 1rem; /* Abstand zum Copyright */
}

/* Spezifische Anpassung für Footer-Buttons */
.footer-btn {
  text-decoration: none;
  opacity: 1; /* Dezenter Startzustand */
  padding: 0.25rem 0.6rem !important; /* Etwas flacher als Standard-Buttons */
  font-size: 0.65rem !important; /* Kleiner als Dashboard-Buttons */
  border-width: 1.5px !important; /* Feinere Linie */
}

.footer-btn:hover {
  opacity: 1; /* Volle Sichtbarkeit beim Hover */
  /* Der Background-Change kommt automatisch durch deine button-outline.grey:hover */
}

.site-footer p {
  font-size: 0.75rem;
  opacity: 0.4;
  margin: 0;
  font-weight: 300;
}