/* --- info.css --- */

/* 1. GRUNDLAYOUT (Desktop Standard) */
.grid-container-startseite {
    display: grid;
    grid-template-areas:
        'Logo Logo'
        'Menu Menu'
        'Content Sidebar'
        'Footer Footer';

    /* HIER IST DIE STANDARD-AUFTEILUNG */
    /* 1fr (Rest) für Inhalt, 30% für Sidebar */
    grid-template-columns: 1fr 30%;

    grid-template-rows: 130px auto auto auto;
    gap: 0;
    padding: 1px;
    transition: grid-template-columns 0.4s ease-in-out;
}

/* 2. ZUSTAND: EINGEKLAPPT (Desktop) */
.grid-container-startseite.sidebar-collapsed {
    /* Wenn zu: Inhalt bekommt alles, Rechts nur 40px für den Griff */
    grid-template-columns: 1fr 40px;
}

/* --- STYLING DER BEREICHE --- */

.content-body {
    grid-area: Content;
    padding: 10px;
    background-color: rgba(255, 255, 255, 0.5);
    min-width: 0;
    overflow: hidden;
}

.info-sidebar {
    grid-area: Sidebar;
    /* Hintergrundfarbe wie Content */
    background-color: rgba(255, 255, 255, 0.5);
    border-left: none;
    position: relative;
    overflow: visible;
    display: flex;
}

/* Der Griff-Balken (Transparent & Zentriert) */
.sidebar-handle {
    /* Breite beibehalten */
    flex: 0 0 36px;
    background-color: transparent;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    height: auto;
    position: -webkit-sticky; /* Für Safari */
    position: sticky;
    top: 50vh;
    transform: translateY(-50%);
    align-self: flex-start;
    z-index: 10;
}

/* Die blauen Kästchen (Social Media & Pfeil) */
.handle-box {
    /* Kästchengröße etwas verkleinert auf 28px */
    width: 28px;
    height: 28px;
    background-color: #0000FF; /* Vereins-Blau */
    color: white !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.2s, background-color 0.2s;
}

.handle-box:hover {
    background-color: #0000cc;
    transform: scale(1.05);
}

.handle-box i,
.handle-box span {
    color: white !important;
    font-size: 14px;
}

#handleIcon {
    font-size: 18px;
    line-height: 1;
    font-weight: bold;
    transition: transform 0.4s;
}

/* Pfeil drehen wenn zu */
.grid-container-startseite.sidebar-collapsed #handleIcon {
    transform: rotate(180deg);
}

/* Inhalt der Sidebar */
.sidebar-inner-content {
    flex: 1;
    padding: 10px;
    min-width: 0;
    word-wrap: break-word;
    hyphens: auto;
    background-color: transparent;
    /* Verhindert horizontales Scrollen */
    overflow-x: hidden;
}

/* Vererbung der Schriftstile */
.sidebar-inner-content h4,
.sidebar-inner-content p,
.sidebar-inner-content ul {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

.info-block {
    background: white;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Listen-Optimierung (Linksbündig) */
.sidebar-inner-content ul,
.sidebar-inner-content ol {
    padding-left: 0;
    margin-left: 0;
    list-style-position: inside;
}

.sidebar-inner-content ul li {
    padding-left: 5px;
}

/* Text ausblenden wenn zu */
.grid-container-startseite.sidebar-collapsed .sidebar-inner-content {
    display: none;
}


/* --- MOBILE FIX (Handy Ansicht) --- */
@media screen and (max-width: 768px) {

    .grid-container-startseite {
        grid-template-areas:
            'Logo Logo'
            'Menu Menu'
            'Content Sidebar'
            'Footer Footer';

        /* STANDARD MOBIL: Eingeklappt (Inhalt + 40px Griff) */
        grid-template-columns: 1fr 40px;
    }

    /* WICHTIG: Wenn Sidebar OFFEN ist (nicht collapsed) */
    .grid-container-startseite:not(.sidebar-collapsed) {
        /* Hier kannst du die Breite steuern (z.B. 40% oder 45%) */
        grid-template-columns: 1fr 40%;
    }

    /* --- ABSTANDS-OPTIMIERUNG (Nur Mobil) --- */

    /* 1. Haupttext näher an den Rand */
    .content-body {
        padding: 5px; /* Vorher 10px -> Mehr Platz für Text */
        min-width: 0;
    }

    /* 2. Der Griff (Handle): Buttons näher zusammenrücken */
    .sidebar-handle {
        flex: 0 0 36px; /* Griffbreite */
        gap: 8px; /* Vorher 12px -> Buttons kleben näher aneinander */
        padding-top: 5px; /* Weniger Abstand oben */
    }

    /* 3. Der Inhalt der Sidebar: Näher an den Griff */
    .sidebar-inner-content {
        padding: 5px; /* Vorher 10px -> Text rückt näher an den blauen Balken */
    }

    /* 4. Die einzelnen News-Boxen kompakter machen */
    .info-block {
        padding: 8px; /* Vorher 10px */
        margin-bottom: 8px; /* Vorher 15px -> Weniger Luft zwischen den News */
    }

    /* 5. Überschriften in den News enger */
    .sidebar-inner-content h4 {
        margin-bottom: 2px; /* Titel klebt näher am Text */
    }

    /* Sicherstellen, dass die Sidebar immer angezeigt wird */
    .info-sidebar {
        display: flex !important;
        font-size: 0.85em; /* Schrift minimal kleiner auf Handy */
    }
}
