/* Grundlegende Stile */
body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f8f5f1;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.site-header {
    background-color: #6f4e37;
    color: white;
    padding: 25px 20px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.site-title {
    font-family: 'Merriweather', serif;
    margin: 0;
    font-size: 2.8em;
    font-weight: 700;
    letter-spacing: 1px;
}

.site-subtitle {
    margin-top: 8px;
    font-size: 1.3em;
    font-weight: 400;
    opacity: 0.9;
}

/* Hauptinhaltsbereich (Wrapper für Karte und Legende) */
.main-content-wrapper {
    flex-grow: 1;
    padding: 20px;
    
    /* 1. MUSS flexibel sein */
    display: flex;
    /* 2. KRITISCH: Elemente (Karte und Legende) untereinander anordnen */
    flex-direction: column;
    
    justify-content: flex-start; 
    /* 3. KRITISCH: Horizontal zentrieren */
    align-items: center; 
    
    min-height: 50vh; 
}

/* Karten-Container mit Rahmen */
.map-frame {
    width: 90%;
    max-width: 900px;
    /* 4. KRITISCH: Feste Höhe, damit Leaflet die Karte zeichnen kann */
    height: 600px; 
    min-height: 500px; 
    
    border: 8px solid #d3b48d;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

/* Der Leaflet div muss die volle Größe des map-frame Containers annehmen */
#map-container {
    width: 100%;
    height: 100%; /* DIES IST KRITISCH! */
}


/* Legende stylen (unter der Karte) */
.map-legend {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    
    /* Legende soll die gleiche Breite wie die Karte haben, um zentriert zu wirken */
    width: 90%; 
    max-width: 900px;
    
    /* Innere Elemente der Legende horizontal anordnen */
    display: flex; 
    justify-content: space-around; 
    align-items: center;
    
    margin: 20px 0; /* Abstand zur Karte */
    border: 1px solid #ddd;
}

.map-legend h4 {
    margin: 0;
    font-family: 'Merriweather', serif;
    color: #6f4e37;
    font-size: 1.2em;
    padding-right: 15px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin: 0 15px;
    font-size: 0.95em;
}

.legend-color-box {
    width: 15px;
    height: 15px;
    margin-right: 10px;
    border-radius: 50%;
    border: 1px solid #333;
}

/* Farben der Legende definieren */
.legend-color-box.visited {
    background-color: #f7931e; /* Orange/Kaffeebraun */
    border-color: #d87d19;
}

.legend-color-box.recommended {
    background-color: #3d88ff; /* Blau */
    border-color: #357ae8;
}

/* Footer */
.site-footer {
    background-color: #4a2c2a;
    color: #e0d8d0;
    padding: 20px;
    text-align: center;
    font-size: 0.9em;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.site-footer a {
    color: #f8f5f1;
    text-decoration: none;
    margin: 0 5px;
}

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

/* Responsive Anpassungen */
@media (max-width: 768px) {
    .main-content-wrapper {
        padding: 10px;
    }
    .map-frame {
        width: 100%;
        height: 400px; 
        border-radius: 0; 
        border: none;
        min-height: 300px;
    }
    .map-legend {
        width: 100%;
        max-width: none;
        margin: 10px 0;
        padding: 10px;
        flex-direction: column; 
        align-items: flex-start;
    }
    .legend-item {
        margin: 5px 0;
    }
}