/* Grundlegendes Reset für einheitliche Darstellung */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background-color: #fafafa;
  color: #333;
  line-height: 1.6;
  /* Platz für den fixierten Header auf dem Desktop */
  padding-top: 190px; 
}

/* Header-Bereich */
header {
  background-color: #6b2e2e;
  color: white;
  text-align: center;
  padding: 1rem;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  height: 130px; /* Feste Höhe für den Desktop */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.3rem;
  color: white;
}

header h2 {
  font-size: 1.2rem;
  font-weight: 400;
  color: white;
}

/* Navigation */
nav {
  background-color: #8b3a3a;
  position: fixed;
  top: 130px; /* Direkt unter dem Header */
  left: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

nav ul {
  list-style: none;
  display: flex;
  justify-content: center;
  flex-wrap: wrap; /* Erlaubt das Umbrechen der Links, wenn der Platz knapp wird */
}

nav ul li a {
  display: block;
  padding: 0.8rem 1.2rem;
  color: #fff;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

nav ul li a:hover {
  background-color: #6b2e2e;
}

/* Hauptinhalt */
main {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

h1, h2 {
  color: #6b2e2e;
  margin-bottom: 1rem;
}

p, ul {
  margin-bottom: 1rem;
}

ul {
  padding-left: 20px;
}

img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin-top: 1rem;
  display: block;
}

/* Tabellen (Sprechzeiten) */
table {
  width: 100%;
  border-collapse: collapse;
  background-color: #f5f5f5;
  margin-bottom: 2rem;
}

table td {
  padding: 0.8rem;
  border-bottom: 1px solid #ddd;
  vertical-align: top;
}

table tr td:first-child {
  font-weight: bold;
  width: 35%;
}

/* Karte (Kontakt) */
iframe {
  width: 100%;
  border-radius: 8px;
}

/* Footer */
footer {
  background-color: #6b2e2e;
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  margin-top: 3rem;
}

footer a {
  color: #fff;
  margin: 0 0.5rem;
  text-decoration: underline;
}

/* --- HAMBURGER MENÜ (Desktop: versteckt) --- */
#menu-toggle {
  display: none; /* Die eigentliche Checkbox wird immer versteckt */
}

.hamburger {
  display: none; /* Das Wort "Menü" und das Icon auf dem PC verstecken */
  cursor: pointer;
}

/* =========================================
   MOBILE OPTIMIERUNG (Smartphones & Tablets)
   ========================================= */
@media (max-width: 768px) {
  /* Fixierung aufheben, damit bei langen Texten nichts überlappt */
  body {
    padding-top: 0; 
  }
  
  header {
    position: relative;
    height: auto; /* Höhe passt sich dem Text an */
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 1.4rem; /* Etwas kleiner für Smartphones */
  }

  nav {
    position: relative;
    top: 0;
  }

  /* --- HAMBURGER MENÜ (Mobile: aktiv) --- */
  .hamburger {
    display: block;
    padding: 1rem 1.5rem;
    color: white;
    font-size: 1.5rem;
    text-align: right;
    background-color: #8b3a3a;
    font-weight: bold;
  }

  nav ul {
    display: flex; 
    flex-direction: column;
    width: 100%;
    background-color: #6b2e2e;
    
    /* --- DIE NEUE ANIMATION --- */
    max-height: 0; /* Das Menü ist anfangs 0 Pixel hoch */
    overflow: hidden; /* Alles, was über die Höhe hinausgeht, bleibt unsichtbar */
    transition: max-height 0.4s ease-in-out; /* Weiches Ausklappen in 0,4 Sekunden */
  }

  /* Wenn die unsichtbare Checkbox aktiv ist, wird das Menü nach unten "aufgezogen" */
  #menu-toggle:checked ~ ul {
    max-height: 500px; /* Ein Wert, der groß genug ist, um alle deine Links zu fassen */
  }

  /*nav ul li a {
    text-align: center;
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }*/

  nav ul li a {
    text-align: center;
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Zarte Trennlinie */
  }

  main {
    margin: 1rem;
    padding: 1.5rem;
  }

  /* Tabellen für Mobile optimieren (Zellen untereinander statt nebeneinander) */
  table, tbody, tr, td {
    display: block;
    width: 100% !important; /* Überschreibt deine HTML-Breitenangaben */
  }

  table tr {
    margin-bottom: 1rem;
    background-color: #fff;
    border: 1px solid #ddd;
  }

  table td {
    border-bottom: none;
    padding: 0.5rem 1rem;
  }

  table tr td:first-child {
    background-color: #e9e9e9;
    border-bottom: 1px solid #ccc;
  }
}