/* ===== Grundlayout ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

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

/* ===== Sidebar / Topbar ===== */
.sidebar {
  background-color: #004d40;
  color: #fff;
  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-Menü ===== */
#menu-toggle { display: none; }

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

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

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.25s 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; }

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

header { text-align: center; color: #004d40; margin-bottom: 24px; }
header h1 { font-size: 2.2rem; }

/* ===== Willkommen ===== */
.welcome-section {
  max-width: 900px;
  margin: 0 auto 32px auto;
  padding: 30px;
  background-color: #fff;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}
.welcome-section h2 {
  color: #004d40;
  border-bottom: 2px solid #004d40;
  padding-bottom: 10px;
  margin-bottom: 16px;
}
.welcome-section p {
  font-size: 1.1rem;
  color: #555;
  line-height: 1.6;
}

/* ===== Galerie ===== */
.gallery {
  max-width: 1100px;
  margin: 0 auto;
  background-color: #fff;
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0,0,0,0.1);
}

.gallery h3 {
  color: #004d40;
  border-bottom: 2px solid #004d40;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.image-grid a {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.image-grid a:hover {
  transform: scale(1.03);
  box-shadow: 0 12px 24px rgba(0,0,0,0.18);
}

.image-grid img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
  border-radius: 12px;
  transition: filter 0.25s ease;
}
.image-grid a:hover img { filter: brightness(1.05); }

/* ===== Footer ===== */
footer {
  text-align: center;
  color: #555;
  font-size: 0.9rem;
  padding: 20px 0 6px 0;
  margin-top: 28px;
}

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

/* ===== Responsive ===== */
@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; }
  nav { width: 100%; }
  nav ul {
    width: 100%;
    background-color: #004d40;
    border-top: 1px solid rgba(255,255,255,0.15);
    margin-top: 10px;
  }
  .page-content {
    margin-left: 0 !important;
    padding: 24px 14px;
    padding-top: 88px;
  }
  nav ul li a { padding: 12px 16px; font-size: 1.05rem; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
  .image-grid img { height: 160px; }
}

@media (max-width: 600px) {
  .sidebar .logo img { width: 84px; }
  .page-content { padding-top: 92px; }
  .welcome-section, .gallery { padding: 22px 16px; }
  .image-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
  .image-grid img { height: 140px; }
}

@media (max-width: 420px) {
  .menu-icon { font-size: 1.8rem; }
  nav ul li a { padding: 11px 14px; font-size: 1rem; }
  .page-content { padding: 20px 12px; padding-top: 96px; }
  .image-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .image-grid img { height: 128px; }
}

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

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


/* ==== Fix: Überschrift wird oben abgeschnitten (Mobile Topbar höher) ==== */
@media (max-width: 900px) {
  .sidebar {
    padding: 8px 12px;                 /* etwas kompakter */
  }
  .sidebar .logo img {
    width: 88px;                       /* Logo minimal kleiner */
  }
  .page-content {
    padding-top: 112px !important;     /* mehr Platz unter der Topbar */
  }
}

@media (max-width: 600px) {
  .sidebar .logo img { width: 80px; }
  .page-content { padding-top: 126px !important; }
}

@media (max-width: 420px) {
  .page-content { padding-top: 136px !important; }
}

/* Notch-safe: auf iPhones wird zusätzlich der Notch-Abstand addiert */
@supports (padding: max(0px)) {
  .page-content {
    padding-top: calc( var(--topbar-base, 0px) + env(safe-area-inset-top) );
  }
}
