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

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

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

.sidebar 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;
}

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

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

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

/* ===== Burger Menü ===== */
.menu-icon {
    display: block;
    font-size: 2rem;
    cursor: pointer;
    color: #fdf5c0;
    margin-bottom: 10px;
    transition: transform 0.3s ease;
}

#menu-toggle {
    display: none;
}

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

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

/* ===== Hauptinhalt ===== */
.page-content {
    margin-left: 250px;
    padding: 40px 20px;
    flex-grow: 1;
    opacity: 0;
    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;
}

/* ===== Impressum Sektion mit Bild ===== */
.impressum-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.impressum-content {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.impressum-text {
    flex: 1;
}

.impressum-image img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #004d40;
    transition: transform 0.3s ease;
}

.impressum-image img:hover {
    transform: scale(1.05);
}

/* Überschriften und Text */
.impressum-card h2 {
    color: #004d40;
    border-bottom: 2px solid #004d40;
    padding-bottom: 10px;
    margin-bottom: 20px;
}

.impressum-card p {
    margin: 6px 0;
    line-height: 1.6;
}

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

/* ===== 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: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
    }

    .sidebar nav ul {
        width: 100%;
        background-color: #004d40;
    }

    .page-content {
        margin-left: 0;
    }

    .impressum-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .impressum-image img {
        margin-top: 20px;
    }
}


/* ===== Responsive-Overrides: nur anhängen, nichts löschen ===== */

/* Bilder/Mediendateien sicher skalieren */
img { max-width: 100%; height: auto; display: block; }

/* Bessere Tap-Ziele fürs Burger-Icon */
.menu-icon { line-height: 1; padding: 6px 10px; user-select: none; }

/* Tablet: Sidebar etwas schmaler, Content rückt nach */
@media (max-width: 1024px) {
  .sidebar { width: 220px; }
  .page-content { margin-left: 220px; padding: 32px 16px; }
}

/* Mobile-Layout: Sidebar wird Topbar mit Burger-Menü */
@media (max-width: 900px) {
  /* Sidebar als fixe Topbar */
  .sidebar {
    position: fixed;
    top: 0; left: 0; right: 0;
    width: 100%;
    min-height: auto;
    height: auto;
    z-index: 1000;
    padding: 10px 12px;
    flex-direction: row;                 /* Logo links, Burger rechts */
    justify-content: space-between;
    align-items: center;
  }

  /* Logo kleiner */
  .sidebar .logo img { width: 96px; margin: 0; }

  /* Burger sichtbar */
  .menu-icon { display: block; font-size: 1.9rem; margin: 0; }

  /* Navigation als Dropdown unter der Topbar */
  .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;
  }
  /* Öffnen via Checkbox-Hack (Reihenfolge: #menu-toggle + .menu-icon + nav ul) */
  #menu-toggle:checked + .menu-icon + nav ul {
    max-height: 480px;
    opacity: 1;
    transform: scaleY(1);
  }

  /* Links komfortabler antippbar */
  .sidebar nav ul li a { padding: 12px 16px; font-size: 1.05rem; }

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

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

  .impressum-card { padding: 22px 16px; }
  .impressum-content { gap: 16px; }
  .impressum-image img { width: 110px; height: 110px; }
}

/* 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: 96px; }
  .impressum-image img { width: 100px; height: 100px; }
}

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

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

/* ======== Zusätze ab hier: nur Ergänzungen, nichts entfernt ======== */

/* Mehr Platz unter der Topbar, damit Überschriften nie abgeschnitten werden */
@media (max-width: 900px) {
  .page-content { padding-top: 112px !important; }
  .sidebar .logo img { width: 92px; } /* minimal kompakter */
}
@media (max-width: 600px) {
  .page-content { padding-top: 124px !important; }
  .sidebar .logo img { width: 84px; }
}
@media (max-width: 420px) {
  .page-content { padding-top: 136px !important; }
}

/* iOS Notch zusätzlich berücksichtigen */
@supports (padding: max(0px)) {
  .page-content {
    /* Basiswert + Safe-Area (bleibt Override durch !important oben gültig) */
    --imp-topbar: 112px;
    padding-top: calc(var(--imp-topbar) + env(safe-area-inset-top));
  }
}
