/* ===== Layout / Grundwerte ===== */
* { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background-color: #f5f5f5;
  color: #333;
  display: flex;
  animation: fadeIn 0.8s ease-in-out;
}

/* ===== Sidebar (Desktop) ===== */
.sidebar {
  background-color: #004d40;
  color: white;
  width: 250px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.sidebar .logo img {
  width: 120px;
  border-radius: 10px;
  margin-bottom: 20px;
}

/* Burger */
#menu-toggle { display: none; }

.menu-icon {
  display: block;
  font-size: 2rem;
  cursor: pointer;
  color: #fdf5c0;
  margin-bottom: 10px;
  transition: transform 0.3s ease;
  user-select: none;
  line-height: 1;
}

#menu-toggle:checked + .menu-icon { transform: rotate(90deg); }

/* Navigation (collapsible) */
nav { width: 100%; }

nav ul {
  list-style: none;
  padding: 0; margin: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0.9);
  transform-origin: top;
  transition: all 0.3s ease-in-out;
}

#menu-toggle:checked + .menu-icon + nav ul {
  max-height: 500px;
  opacity: 1;
  transform: scaleY(1);
}

nav ul li { text-align: center; margin: 10px 0; }

nav ul li a {
  color: #fdf5c0;
  text-decoration: none;
  display: block;
  padding: 10px 20px;
  font-size: 1.1rem;
  transition: background-color 0.25s ease;
}

nav ul li a:hover,
nav ul li a.active { background-color: #00695c; }

/* ===== Page Content ===== */
.page-content {
  margin-left: 250px;
  padding: 40px 20px;
  flex-grow: 1;
  opacity: 0;
  transform: translateY(10px);
  animation: contentFadeIn 0.8s ease forwards;
  animation-delay: 0.3s;
}

header { text-align: center; color: #004d40; margin-bottom: 40px; }
header h1 { font-size: 2.2em; margin-bottom: 5px; }
header p { font-size: 1.1em; color: #555; }

/* ===== Kontakt-Inhalt ===== */
.contact-sections {
  display: flex;
  flex-direction: column;
  gap: 40px;
  max-width: 800px;
  margin: 0 auto;
}

.contact-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
  padding: 30px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.contact-card:hover { transform: translateY(-3px); box-shadow: 0 5px 12px rgba(0,0,0,0.15); }

.contact-card h2 {
  color: #004d40;
  border-bottom: 2px solid #004d40;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.contact-info p { margin: 6px 0; line-height: 1.6; }

/* Formular */
form { display: flex; flex-direction: column; }
label { font-weight: bold; margin-top: 10px; margin-bottom: 5px; }
input, textarea {
  padding: 10px;
  border: 1px solid #b2dfdb;
  border-radius: 6px;
  font-size: 1rem;
  background-color: #fafafa;
  transition: border-color 0.3s, background-color 0.3s;
}
input:focus, textarea:focus { outline: none; border-color: #004d40; background-color: #ffffff; }

.submit-button {
  display: inline-block;
  margin-top: 20px;
  padding: 12px 20px;
  text-align: center;
  background-color: #004d40;
  color: #fdf5c0;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1rem;
  transition: background-color 0.3s;
}
.submit-button:hover { background-color: #00695c; }

/* Footer */
footer { margin-top: 50px; text-align: center; color: #555; font-size: 0.9rem; }

/* ===== Hilfen / Medien ===== */
img { max-width: 100%; height: auto; display: block; }

/* ===== Breakpoints / Responsive (wie Impressum) ===== */

/* Tablet: etwas schmalere Sidebar */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .page-content { margin-left: 220px; padding: 32px 16px; }
}

/* Mobile: Sidebar -> Topbar mit Dropdown */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    min-height: auto;
    height: auto;
    padding: 10px 12px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }

  .sidebar .logo img { width: 96px; margin: 0; }
  .menu-icon { display: block; font-size: 1.9rem; margin: 0; }

  .sidebar nav { width: 100%; }
  .sidebar nav ul {
    width: 100%;
    background-color: #004d40;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transform: scaleY(0.95);
    transform-origin: top;
    transition: max-height .25s ease, opacity .25s ease, transform .25s ease;
  }
  #menu-toggle:checked + .menu-icon + nav ul {
    max-height: 480px;
    opacity: 1;
    transform: scaleY(1);
  }

  .sidebar nav ul li a { padding: 12px 16px; font-size: 1.05rem; }

  .page-content {
    margin-left: 0 !important;
    padding: 24px 14px;
    padding-top: 100px; /* Platz für Topbar */
  }
}

/* Typische Smartphones */
@media (max-width: 600px) {
  .sidebar .logo img { width: 84px; }
  .menu-icon { font-size: 1.8rem; }
  .page-content { padding-top: 110px; }
  header { margin-bottom: 28px; }

  .contact-card { padding: 22px 16px; }
  input, textarea { font-size: 16px; } /* verhindert iOS-Zoom */
  .submit-button { width: 100%; }
}

/* Mini-Phones */
@media (max-width: 420px) {
  .menu-icon { font-size: 1.7rem; }
  .sidebar nav ul li a { padding: 11px 14px; font-size: 1rem; }
  .page-content { padding: 20px 12px; padding-top: 116px; }
}

/* Notch-safe (iOS) */
@supports (padding: max(0px)) {
  .sidebar { padding-top: max(10px, env(safe-area-inset-top)); }
  .page-content { padding-top: calc(100px + env(safe-area-inset-top)); }
}

/* Animationen */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes contentFadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Bewegungsreduzierung */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ======= APPEND-ONLY: Mobile Topbar erzwingen wie Impressum ======= */

/* Tablet: Sidebar etwas schmaler (falls noch nicht vorhanden) */
@media (max-width: 1024px) {
  body .sidebar { width: 220px; }
  body .page-content { margin-left: 220px; padding: 32px 16px; }
}

/* Mobile: Sidebar -> Topbar mit Dropdown, identisch zu Impressum */
@media (max-width: 900px) {
  body .sidebar {
    position: fixed !important;
    top: 0; left: 0; right: 0;
    width: 100% !important;
    min-height: auto !important;
    height: auto !important;
    padding: 10px 12px !important;
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    z-index: 1000 !important;
  }

  body .sidebar .logo img {
    width: 96px !important;
    margin: 0 !important;
  }

  body .menu-icon {
    display: block !important;
    font-size: 1.9rem !important;
    margin: 0 !important;
    line-height: 1 !important;
    color: #fdf5c0 !important;
  }

  body .sidebar nav { width: 100% !important; }
  body .sidebar nav ul {
    width: 100% !important;
    background-color: #004d40 !important;
    border-top: 1px solid rgba(255,255,255,0.15) !important;
    margin-top: 10px !important;
    max-height: 0 !important;
    overflow: hidden !important;
    opacity: 0 !important;
    transform: scaleY(0.95) !important;
    transform-origin: top !important;
    transition: max-height .25s ease, opacity .25s ease, transform .25s ease !important;
  }

  body #menu-toggle:checked + .menu-icon + nav ul {
    max-height: 480px !important;
    opacity: 1 !important;
    transform: scaleY(1) !important;
  }

  body .sidebar nav ul li a {
    padding: 12px 16px !important;
    font-size: 1.05rem !important;
  }

  body .page-content {
    margin-left: 0 !important;
    padding: 24px 14px !important;
    padding-top: 100px !important;  /* Platz für Topbar */
  }
}

/* Typische Smartphones */
@media (max-width: 600px) {
  body .sidebar .logo img { width: 84px !important; }
  body .menu-icon { font-size: 1.8rem !important; }
  body .page-content { padding-top: 110px !important; }
  body header { margin-bottom: 28px !important; }

  /* Formkomfort */
  body .contact-card { padding: 22px 16px !important; }
  body input, body textarea { font-size: 16px !important; } /* iOS-Zoom verhindern */
  body .submit-button { width: 100% !important; }
}

/* Mini-Phones */
@media (max-width: 420px) {
  body .menu-icon { font-size: 1.7rem !important; }
  body .sidebar nav ul li a { padding: 11px 14px !important; font-size: 1rem !important; }
  body .page-content { padding: 20px 12px !important; padding-top: 116px !important; }
}

/* Notch-safe (iOS) */
@supports (padding: max(0px)) {
  body .sidebar { padding-top: max(10px, env(safe-area-inset-top)) !important; }
  body .page-content { padding-top: calc(100px + env(safe-area-inset-top)) !important; }
}

