/*
Theme Name: Bündnis Mitte Starnberg Blog
Author: Robert Fischer
Description: Ein minimalistisches, seriöses Theme für Wählergemeinschaften.
Version: 1.1
*/

:root {
    --color-primary: #2d3436;
    --color-secondary: #636e72;
    --color-accent: #0984e3;
    --color-bg: #fdfdfd;
    --color-text: #4a4a4a;
    --font-display: 'Arial', serif;
    --font-body: 'Inter', sans-serif;
    --border-radius: 8px;
}
/* --- DEBUGGING STYLES (Löschen wenn es klappt) --- */

@media screen and (max-width: 768px) {
    /* Sicherstellen, dass der Container Platz hat */
    .header-inner {
        flex-direction: column !important; /* Erzwingt Umbruch */
        align-items: stretch !important;
    }

    .main-navigation {
        width: 100% !important;
        background: yellow; /* Nur zum Testen: Gelber Hintergrund */
        min-height: 50px;
    }

    /* Den Button mit Gewalt sichtbar machen */
    button.menu-toggle {
        display: block !important;
        background-color: lightgray !important; /* Roter Button */
        color: black !important;
        width: 100%;
        padding: 15px;
        border: 0px solid black;
        cursor: pointer;
        z-index: 10000;
        position: relative;
    }
    
    .menu-toggle span {
        display: inline-block; /* Text sichtbar machen */
    }
}

/* --- Basis (Button verstecken auf Desktop) --- */
.menu-toggle {
    display: none; /* Auf Desktop nicht anzeigen */
    background: none;
    border: 1px solid #ccc;
    padding: 10px;
    font-size: 1.2rem;
    cursor: pointer;
}

/* --- MOBILE ANSICHT (z.B. unter 768px) --- */
@media screen and (max-width: 768px) {
/* In deinen Mobile-Block (@media ...) einfügen */

.main-navigation {
    width: 100%; /* Zwingt den Container, volle Breite zu nutzen */
    margin-top: 1rem; /* Ein bisschen Abstand zum Logo */
}

.menu-toggle {
    /* ... deine existierenden Styles ... */
    display: block;
    width: 100%;
    
    /* Füge das hier hinzu, damit man ihn GARANTIERT sieht: */
    color: #333; 
    background-color: #f0f0f0; /* Hellgrauer Hintergrund zum Testen */
    text-align: center; /* Text mittig */
    padding: 15px;
    z-index: 9999; /* Damit er über allem liegt */
}
    /* 1. Button sichtbar machen */
    .menu-toggle {
        display: block;
        width: 100%; /* Volle Breite für einfachen Klick */
        text-align: left;
    }

    /* 2. Menü standardmäßig verstecken */
    .main-navigation ul {
        display: none; /* Weg damit, bis Button geklickt wird */
        flex-direction: column; /* Untereinander statt nebeneinander */
        width: 100%;
        background-color: #f9f9f9; /* Heller Hintergrund fürs Handy-Menü */
    }

    /* 3. Menü anzeigen, wenn Klasse .toggled aktiv ist (durch JS) */
    .main-navigation.toggled ul {
        display: flex;
    }

    /* 4. Links styling für Mobile (größere Klickflächen) */
    .main-navigation ul li {
        width: 100%;
        border-bottom: 1px solid #ddd;
    }
    
    .main-navigation ul li a {
        display: block;
        padding: 15px; /* Dicke Finger brauchen Platz! */
    }

    /* --- WICHTIG: DAS UNTERMENÜ-PROBLEM LÖSEN --- */
    /* Auf dem Handy wollen wir kein Hover. Wir zeigen Untermenüs
       einfach immer an, aber eingerückt, wenn das Menü offen ist. */
       
    .main-navigation ul ul {
        display: block;      /* Immer anzeigen (innerhalb des offenen Menüs) */
        position: static;    /* Kein schwebendes Dropdown mehr */
        box-shadow: none;    /* Schatten weg */
        padding-left: 20px;  /* Einrücken, damit man sieht, dass es Unterpunkte sind */
        background-color: #eee; /* Etwas dunklerer Hintergrund */
    }
    
    /* Hover-Effekte auf Handy deaktivieren oder anpassen */
    .main-navigation ul ul {
        opacity: 1;
        visibility: visible;
    }
}


/* GRUNDLAGEN */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font-body); background: var(--color-bg); color: var(--color-text); line-height: 1.6; font-size: 1.05rem; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

/* HEADER NEU */
header.site-header { padding: 3rem 0 2rem; border-bottom: 1px solid #eee; margin-bottom: 3rem; }
.header-inner { display: flex; align-items: center; gap: 2rem; }
.site-branding { flex: 1; }
.site-logo img { max-height: 80px; width: auto; }
.logo-placeholder { font-size: 3rem; background: #eee; width: 80px; height: 80px; display: flex; align-items: center; justify-content: center; border-radius: 50%; }

h1.site-title { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 3rem); color: var(--color-primary); line-height: 1.1; margin: 0; }
h1.site-title a { text-decoration: none; color: inherit; }
.site-description { font-family: var(--font-body); font-size: 1.1rem; color: #888; font-weight: 300; margin-bottom: 0.2rem; text-transform: uppercase; letter-spacing: 1px; }

@media (max-width: 768px) {
    .header-inner { flex-direction: column; text-align: center; }
}

/* GRID & KARTEN */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2rem; }
.card { background: white; border: 1px solid #e1e4e8; border-radius: var(--border-radius); padding: 2rem; transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.card:hover { border-color: #bbb; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.05); }
.carousel-container_sta {position: relative; width: 100%; height: 100%; min-height: 150px; overflow: hidden; border-radius: var(--border-radius); }
.c-carousel_sta { grid-column: span 8; padding: 10; background: #f8f6ec; border:none; }
.card_sta { background: #bbb; border: 1px solid #e1e4e8; border-radius: var(--border-radius); padding: 2rem; transition: all 0.2s ease; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.card_sta:hover { border-color: #bbb; transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.05); }

/* WETTER WIDGET */
.c-weather { grid-column: span 4; background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%); color: white; border: none; }
.weather-content { display: flex; flex-direction: column; height: 100%; justify-content: space-between; }
.weather-temp { font-size: 3.5rem; font-weight: bold; font-family: var(--font-body); margin: 0.5rem 0; }
.weather-desc { font-size: 1.2rem; opacity: 0.9; }
.weather-loc { font-size: 0.9rem; text-transform: uppercase; letter-spacing: 1px; opacity: 0.8; margin-top: auto; }
.weather-icon { font-size: 3rem; margin-bottom: 0.5rem; }

/* KARUSSELL / SLIDESHOW */
/* --- BASIS EINSTELLUNGEN (Desktop) --- */

.c-carousel { 
    grid-column: span 8; 
    padding: 0; 
    background: #f9f9f9; 
    border: none; 
    height: 100%;
}

.carousel-container { 
    display: flex;
    flex-wrap: wrap; 
    gap: 20px; 
    position: relative; 
    width: 100%; 
    height: 100%; 
    min-height: 300px; 
    overflow: hidden; /* Schneidet alles ab, was zu groß ist */
    border-radius: var(--border-radius); 
}

.carousel-slide { 
    position: absolute; /* Standard: Slides schweben übereinander */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; /* Auf Desktop füllen sie den Container */
    opacity: 0; 
    transition: opacity 0.8s ease-in-out; 
    display: flex; 
    justify-content: center; 
    align-items: center; 
    background: white; 
    padding: 2rem;
    /* Tippfehler behoben: align-contenttop gab es nicht */
}

.carousel-slide.active { 
    opacity: 1; 
    z-index: 2; 
}

.slide-content { 
    display: flex; 
    align-items: center; 
    gap: 2rem; 
    width: 100%; 
}

.slide-img {
    width: 250px;
    height: 250px;
    border-radius: 20%;
    object-fit: cover;
    object-position: center 10%;
    border: 4px solid #f0f0f0;
    flex-shrink: 0;
}

.slide-text h3 { 
    font-family: var(--font-display); 
    font-size: 1.6rem; 
    color: var(--color-primary); 
    margin-bottom: 0.5rem; 
}

.slide-text p { 
    color: #555; 
    font-size: 1.1rem; 
    font-style: italic; 
}


/* --- MOBILE FIX (Hier liegt die Magie) --- */

@media (max-width: 900px) {
    .c-weather, .c-carousel { 
        grid-column: span 12; 
    }

    .slide-content { 
        flex-direction: column; 
        text-align: center; 
        gap: 20px;
    }

    .carousel-container {
        /* WICHTIG: Container muss sich der Höhe des Inhalts anpassen */
        height: auto !important; 
        min-height: auto; 
    }

    /* 1. Alle Slides dürfen so hoch sein wie ihr Inhalt */
    .carousel-slide {
        height: auto !important; /* Nicht mehr 100% erzwingen */
        min-height: 400px; /* Mindesthöhe, damit es nicht springt */
        align-items: flex-start; /* Inhalt beginnt oben */
        padding-top: 3rem; /* Etwas Luft nach oben */
    }

    /* 2. Der inaktive Slide bleibt absolut (versteckt im Hintergrund) */
    .carousel-slide {
        position: absolute;
        top: 0;
        left: 0;
    }

    /* 3. DER TRICK: Der aktive Slide wird "relative".
       Das zwingt den Container dazu, so groß zu werden wie dieser Slide. */
    .carousel-slide.active {
        position: relative; 
    }
    
    /* Optional: Bild auf Handy etwas kleiner machen, falls es zu wuchtig ist */
    .slide-img {
        width: 180px;
        height: 180px;
    }
}
/* BESTEHENDE STYLES */
.c-news { grid-column: span 12; border: none; background: transparent; padding: 0; box-shadow: none; }
.c-news:hover { transform: none; box-shadow: none; }
.c-secondary { grid-column: span 4; }
@media (max-width: 900px) { .c-secondary { grid-column: span 12; } }

.section-title { font-family: var(--font-display); font-size: 1.8rem; margin-bottom: 1.5rem; border-bottom: 2px solid #333; padding-bottom: 0.5rem; display: inline-block; }
.news-grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.news-card-home { background: white; border: 1px solid #eee; padding: 1.5rem; border-radius: var(--border-radius); transition: 0.2s; }
.news-card-home:hover { border-color: #999; }
.news-date { font-size: 0.75rem; color: #999; text-transform: uppercase; letter-spacing: 1px; display: block; margin-bottom: 4px; }
.news-excerpt { font-size: 0.9rem; color: #666; margin-top: 0.5rem; }
.card h2 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 0.8rem; color: var(--color-primary); display: flex; align-items: center; gap: 10px; }
.card-icon { font-size: 1rem; color: #999; background: #f5f5f5; padding: 6px; border-radius: 50%; width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.card-link { color: var(--color-accent); font-weight: 600; text-decoration: none; font-size: 0.9rem; margin-top: auto; text-transform: uppercase; letter-spacing: 0.5px; }

.back-btn {
    display: inline-block;
    text-decoration: none;
    
    /* 1. Normalzustand: Blau (B) */
    background-color: #2d7ebc; 
    color: #ffffff;
    
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 5px;
    border: none;
    
    /* Animation für alle Farbwechsel */
    transition: all 0.2s ease;
}

/* 2. Hover-Zustand: Grün (M) */
.back-btn:hover {
    background-color: #85b92a; 
    color: #ffffff;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    transform: translateY(-2px); /* Button kommt hoch */
}

/* 3. Klick-Zustand (Active): Orange (S) */
.back-btn:active {
    background-color: #e37f1c; 
    color: #ffffff;
    box-shadow: 0 2px 3px rgba(0,0,0,0.2); /* Schatten wird kleiner */
    transform: translateY(-1px); /* Button wird leicht eingedrückt */
}

