/* --- GRUNDLEGENDE EINSTELLUNGEN --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    /* Nutzung von Systemschriften (keine externen Aufrufe) */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- LAYOUT CONTAINER (GRID) --- */
.container {
    display: grid;
    /* Neue Definition der Bereiche: Alles untereinander in einer Spalte */
    grid-template-areas:
        "header"
        "nav"
        "main"
        "footer";
    /* Nur eine Spalte, die gesamte Breite einnimmt */
    grid-template-columns: 1fr;
    /* Zeilenhöhe: Header/Nav/Footer Auto, Main (Inhalt) füllt den Rest (1fr) */
    grid-template-rows: auto auto 1fr auto; 
    min-height: 100vh;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* --- HEADER BEREICH --- */
header {
    grid-area: header;
    width: 100%;
    height: 250px;
    background-color: #ddd; 
    background-image: url('/assets/img/leogang.jpg');
    background-size: cover;
    background-position: center;
}

/* --- NAVIGATION (HORIZONTAL) --- */
nav {
    grid-area: nav;
    background-color: #ecf0f1; /* Leichter Hintergrund, um Menü abzuheben */
    border-bottom: 2px solid #ddd;
    padding: 0;
}

/* Die eigentliche Liste (ul#main-menu) */
nav ul {
    list-style-type: none;
    display: flex; /* Flexbox für horizontale Anordnung */
    justify-content: flex-start; /* Links beginnen */
    flex-wrap: wrap; /* Wichtig für Responsiveness auf kleinen Screens */
    margin: 0;
    padding: 0;
}

nav li {
    /* Entfernt vertikalen Abstand aus dem alten Sidebar-Design */
    margin: 0;
    /* Um Untermenü-Anzeige zu ermöglichen, muss Position relativ sein */
    position: relative; 
}

nav a {
    color: #2c3e50;
    text-decoration: none;
    display: block;
    padding: 15px 20px; /* Mehr vertikaler Platz */
    transition: background 0.3s;
    font-weight: 500;
    white-space: nowrap; /* Verhindert Zeilenumbruch im Linktext */
}

nav a:hover {
    background-color: #dcdde1;
    color: #000;
}

/* Untermenü-Styling (für "Archiv") */
nav ul ul {
    display: none; /* Standardmäßig versteckt */
    position: absolute;
    top: 100%; /* Unter dem Hauptlink */
    left: 0;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
    min-width: 180px;
    z-index: 10;
    flex-direction: column; /* Vertikale Anordnung der Unterpunkte */
}

/* Zeige Untermenü beim Hover über dem LI-Element */
nav li:hover > ul {
    display: flex;
}

/* Styling für Links im Untermenü */
nav ul ul a {
    padding: 10px 15px;
    border-bottom: 1px solid #eee;
}

/* --- HAUPTINHALT --- */
main {
    grid-area: main;
    padding: 40px;
    /* Kein padding-left mehr notwendig, da Nav weg ist */
    background-color: #ffffff;
}

h1 {
    margin-bottom: 20px;
    color: #2c3e50;
}

p {
    margin-bottom: 15px;
}

table { border:0px solid #000; }
.participantProf { color: #000; font-weight: bold; }

/* --- FOOTER --- */
footer {
    grid-area: footer;
    background-color: #333;
    color: #fff;
    padding: 20px;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    margin-right: 15px;
}

.footer-links a:hover {
    text-decoration: underline;
}

/* --- RESPONSIVE DESIGN (Handy) --- */
@media (max-width: 768px) {
    header {
        height: 150px; 
    }
    
    nav ul {
        justify-content: center; /* Menüpunkte auf dem Handy zentrieren */
    }

    nav li {
        /* Auf Mobilgeräten kann das Untermenü schwierig sein, hier nur einfaches Styling */
        width: 100%; /* Menüpunkte nehmen volle Breite ein */
        text-align: center;
        border-bottom: 1px solid #ddd;
    }
    
    nav ul ul {
        position: static; /* Untermenüs werden unter den Hauptpunkt geschoben */
        box-shadow: none;
        border: none;
        width: 100%;
    }

    footer {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .footer-links a {
        margin: 0 10px;
    }
}
