/* --- 1. Grundlegendes & Variablen --- */
:root {
  --sidebar-color: #e6f0ff;
  --accent-color: #003b7a;
  --sidebar-width: 180px;
  --topbar-height: 60px; /* Neue Variable für die Höhe */
}
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Open Sans", sans-serif;
  background-color: #f7f9fc;
  color: #333;
  min-width: 320px;
}

/* --- 2. Topbar (Sticky oben) --- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar-height);
  line-height: var(--topbar-height);  z-index: 100;
  background-color: var(--sidebar-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 1rem;
  border-bottom: 1px solid var(--accent-color);
  white-space: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  
  /* Versteckt Scrollbalken für ein saubereres Design */
  -ms-overflow-style: none;  /* IE und Edge */
  scrollbar-width: none;     /* Firefox */
}
.topbar h1, 
.topbar nav, 
.topbar .lang-switch-pill {
  flex-shrink: 0;
}

/* Versteckt Scrollbalken für Chrome, Safari und Opera */
.topbar::-webkit-scrollbar {
  display: none;
}

.topbar h1 {
  font-size: 1.4rem;
  color: var(--accent-color);
}

/* Topbar-Links: Identisch zur Sidebar formatiert */
.topbar a {
  display: inline-flex;
  align-items: center;
  margin: 0 0.3rem;
  padding: 0.4rem 0.8rem;
  color: var(--accent-color);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none; /* Keine Unterstreichung */
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s;
  vertical-align: middle;
}

.topbar a:hover {
  background-color: #cce0ff; /* Gleicher Hover wie Sidebar */
  color: var(--accent-color);
}

/* Speziell für die Logos in der Topbar */
.topbar a img {
  height: 18px; /* Kleine, dezente Logos */
  width: auto;
  vertical-align: middle;
  margin-right: 5px;
  position: relative;
  top: -1px; /* Feinjustierung der Höhe zum Text */
}

/* --- 3. Sidebar (Bis zum Boden) --- */
.sidebar {
  position: fixed;
  top: var(--topbar-height);
  left: 0;
  width: var(--sidebar-width);
  height: 200vh;
  bottom: 0; /* Zwingt die Farbe bis ganz nach unten */
  background-color: var(--sidebar-color);
  padding: 1rem;
  border-right: 1px solid var(--accent-color);
  overflow-y: auto;
  z-index: 90;
  overscroll-behavior: none;
  box-shadow: 0 1000px 0 0 var(--sidebar-color);
}

.sidebar a {
  top: var(--topbar-height);
  display: block;
  margin: 0.5rem 0;
  padding: 0.4rem 0.8rem;
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  border-radius: 5px;
  transition: 0.3s;
}

.sidebar a:hover {
  background-color: #cce0ff;
}

/* --- 4. Content Bereich --- */
.content {
  margin-left: var(--sidebar-width);
  padding: 2rem;
  padding-top: calc(2rem + 60px);
  max-width: 1200px;
  min-width: 0;
}

/* --- 5. Karten & Listen --- */
.card {
  background-color: #ffffff;
  border-radius: 8px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  width: 100%;
  scroll-margin-top: 80px;
}

.card h2 {
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  color: var(--accent-color);
  border-bottom: 1px solid #cddbf0;
}

.card-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.5rem 1.5rem;
  margin-top: 1rem;
}

.card-list dt {
  font-weight: bold;
  color: var(--accent-color);
  white-space: nowrap;
}

.card-list dd {
  margin-bottom: 0.5rem;
  line-height: 1.4;
}

/* --- 6. Kontaktkarte (Bild & Text) --- */
.contact-card {
  display: flex;
  flex-direction: row;
  align-items: stretch; /* Bild passt sich der Texthöhe an */
}

.contact-card .contact-text {
  flex: 1;
  min-width: 0;
  margin-right: 1.5rem; /* Das gewünschte Padding zwischen Text und Bild */
}

.contact-card .contact-image {
  flex: 0 0 200px;
}

.contact-card .contact-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #cddbf0;
}

/* --- 7. Mobile Anpassungen (Media Queries) --- */
@media (max-width: 850px) {
  :root {
    --topbar-height: 70px;
  }
  .sidebar {
    display: none; /* Sidebar verschwindet bei wenig Platz */
  }
.topbar {
    height: 70px; /* Reduziert die Gesamthöhe der Leiste */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Zentriert die Gruppe aus Name + Nav perfekt vertikal */
    align-items: center;
    padding: 0; /* Wir lassen die Zentrierung die Arbeit machen */
    gap: 0; 
    line-height: 1.2;
  }

  .topbar h1 {
    width: 100%;
    line-height: 1.1; /* Bestimmt den Raum direkt um den Namen */
    display: flex;
    justify-content: center;
    margin: 0;
    font-size: 1.1rem;
  }

  .topbar nav {
    width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 8px; /* Kontrolliert den horizontalen Abstand der Links */
    margin-top: 2px; /* FEINJUSTIERUNG: Erhöhe/Verringere diesen Wert für den Abstand zum Namen */
  }

  .topbar a {
    padding: 6px 12px !important; /* Macht den Hover-Kasten vertikal flach */
    line-height: 1.1 !important;
    border-radius: 4px;
  }
  /* Optional: Icons in der Topbar auf Handy minimal kleiner für kompakten Look */
  .topbar a img {
    height: 16px; 
  }

  /* Die Pille braucht auf dem Handy etwas weniger Wumms */
  .lang-switch-pill {
    height: 28px;
    margin-left: 0;
  }
  
  .lang-switch-pill .lang-link {
    height: 22px;
    padding: 0 8px !important;
  }
  .content {
    margin-left: 0;
    padding: 0.5rem; /* Von 1.5rem auf 1rem reduziert (mehr Platz für Text) */
    padding-top: calc(var(--topbar-height) + 1rem); /* Puffer zur Topbar beibehalten */
  }

  .card {
    padding: 1rem; /* Innenabstand der Karten reduziert */
    margin-bottom: 1rem; /* Abstand zwischen den Karten verringert */
    border-radius: 6px; /* Etwas kantiger für den mobilen Look */
  }

  .card h2 {
    font-size: 1.25rem; /* Überschriften leicht verkleinern, damit sie nicht umbrechen */
    margin-bottom: 0.8rem;
  }
  .contact-card {
    flex-direction: column; /* Bild unter Text */
  }

  .contact-card .contact-text {
    margin-right: 0;
    margin-bottom: 1.5rem;
  }

  .contact-card .contact-image {
    margin-top: 1rem; /* Zusätzlicher Abstand zum Text oben */
  }

  .card-list {
    grid-template-columns: 1fr; /* Datum über Text */
    gap: 0.2rem;
  }
}

/* --- 8. Querformat-Optimierung mit Sidebar --- */
@media (max-width: 950px) and (orientation: landscape) {
  :root {
    --topbar-height: 50px; /* Alles passt sich jetzt diesem Wert an */
    --sidebar-width: 130px;
  }  
  /* Sidebar wieder einblenden und schmaler machen */
  .sidebar {
    display: block !important;
    width: var(--sidebar-width); /* Kompakter für Handys */
    /*top: 50px;    /* Direkt unter der flacheren Topbar */
    padding: 0.5rem 0.3rem;
  }

  .sidebar a {
    font-size: 0.8rem;
    padding: 0.3rem 0.4rem;
    margin: 0.1rem 0;
    border-radius: 4px;
    /* Verhindert, dass langer Text die Sidebar aufbläht */
    overflow: hidden;
    text-overflow: ellipsis; 
    white-space: nowrap;  
  }

  .topbar {
    height: 50px; 
    flex-direction: row; 
    justify-content: space-between;
    padding: 0 1rem;
    line-height: var(--topbar-height); /* Sicherstellen, dass sie über der Sidebar bleibt */
  }

  .topbar h1 {
    width: auto;
    font-size: 1.1rem;
    /*line-height: 50px;*/
    margin: 0;
  }

  .topbar nav {
    width: auto;
    margin-top: 0 !important;
    /*height: 50px;
    gap: 8px;*/
  }

  .topbar a {
    padding: 4px 8px !important;
    font-size: 0.85rem;
  }

  .content {
    margin-left: var(--sidebar-width);
    padding-top: calc(var(--topbar-height) + 1rem);
  }

.contact-card {
    display: flex;
    flex-direction: row;
    align-items: stretch; /* WICHTIG: Zwingt Bild-Container und Text auf gleiche Höhe */
    overflow: hidden;
  }

  .contact-card .contact-text {
    flex: 1;
    margin-right: 1.5rem;
    /* Hier kein margin-bottom, damit die Karte stramm bleibt */
    margin-bottom: 0; 
  }

  .contact-card .contact-image {
    /* Wir definieren eine feste Breite, die Höhe kommt vom 'stretch' der Card */
    flex: 0 0 150px; 
    height: auto; 
    min-height: 100%; /* Füllt die vertikale Höhe der Textbox komplett aus */
  }

  .contact-card .contact-image img {
    width: 100%;
    height: 100%;
    /* Das ist der Zaubertrick: Das Bild füllt den Platz, 
       Proportionen bleiben, Überhang wird weggeschnitten */
    object-fit: cover; 
    /* Falls dein Gesicht zu weit links/rechts ist, hier justieren (z.B. 'top' oder 'center') */
    object-position: center; 
    border-radius: 5px;
  }
}

.lang-switch-pill {
  display: inline-flex;
  align-items: center;
  background-color: #d1e3ff; /* Ein Ton dunkler als die Topbar */
  border: 1px solid var(--accent-color);
  border-radius: 20px;
  padding: 2px;
  margin-left: 15px;
  height: 32px;
}

.lang-switch-pill .lang-link {
  display: flex;
  align-items: center;
  padding: 0 10px !important;
  margin: 0 !important;
  font-size: 0.8rem !important;
  font-weight: 600;
  color: var(--accent-color) !important;
  text-decoration: none;
  border-radius: 16px;
  height: 26px;
  transition: all 0.2s ease;
  background: none !important; /* Entfernt Standard-Hover */
}

/* Die aktive Sprache erhält den weißen Pillen-Hintergrund */
.lang-switch-pill .lang-link.active {
  background-color: #ffffff !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Hover-Effekt für die nicht-aktive Sprache */
.lang-switch-pill .lang-link:not(.active):hover {
  background-color: #cce0ff !important;
}

.lang-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  /* ... deine anderen Styles ... */
}

.lang-link img {
  width: 18px; /* oder deine gewünschte Größe */
  height: auto;
  margin-left: 6px; /* Das erzeugt den perfekten Abstand zum Text */
  border-radius: 2px; /* Optional: leicht abgerundete Ecken für die Flagge */
  display: inline-block;
  vertical-align: middle;
}