body {
    margin: 0;
    font-family: Arial, sans-serif;
    background-color: #eeeeee;
}

.grid-container {
    display: grid;
    grid-template-areas:
        "header"
        "content"
        "footer";
    grid-template-rows: 100px 1fr 60px; /* Kopfzeile 12.5% , Inhalt 75% der Höhe, Kopfzeile */
    height: 100vh;
    overflow: hidden;
}

/* Kopfzeile */
.header {
    grid-area: header;
    height: 100px; /* feste Headerhöhe */
    width: auto;

    background-image: url("/images/Background8_190.png");
    background-size: 400px auto;
    background-position: 20px center;
    background-repeat: repeat;
    background-color: #005f99;    /* Fallback, falls Bild nicht geladen wird */

    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 0;
    margin: 0;

    position: relative;        /* wichtig für ::after */
    z-index: 1000;
}

/* Weicher Übergang zum Header */
.header::after {
    content: "";
    position: absolute;
    top: 100%;             /* leicht darunter, verhindert Spalt */
    left: 0;
    width: 100%;
    height: 5px;              /* Höhe des Fade-Effekts */
    background: linear-gradient(
        to bottom,
        rgba(0, 95, 153, 1) 0%,   /* Header-Farbe oben */
        rgba(0, 95, 153, 0) 100%  /* weich zu transparent */
    );
    pointer-events: none;
    z-index: 2;
}

.logo {
    height:200px;                   /* skaliert flexibel */
    width:auto;
    aspect-ratio:auto;  
}

.title {
  font-size: 1.5rem;
  color: white;
}
.mobile-title {
  display: none;  /* ausgeblendet auf großen Bildschirmen */
}

/* Fußzeile */
.footer {
    grid-area: footer;
    background-color: #222;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9em;
    gap: 20px;
}
.footer-logo {
  height: 50px;
  width: auto;
  opacity: 0.9;
}

/* Mittelbereich Boxen*/
.content {
    grid-area: content;
    display: flex;
    align-items: stretch;
    background-color: #eeeeee;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    min-height: 0;
}

.content-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    width: 100%;
    height: 100%;
}

/* Sidebar-Navigation */
.sidebar {
    background-color: #222831;
    padding: 50px 20px 20px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sidebar a {
    text-decoration: none;
    color: #ffffff;
    padding: 10px;
    background-color: #393E46;
    transition: background 0.3s;
    border: 1px solid #ccc;
}

.sidebar a:hover {
    background-color: #0078D7;
    color: white;
}

/* Hauptinhalt */
.main {
    position: relative;
    overflow-y: auto;  /* vertikal scrollbar */
    overflow-x: hidden;
    padding: 20px;
    background-color: #eeeeee;
    overflow-y: auto;
    color: #222;
    z-index: 1;
}

details summary {
    cursor: pointer;
    margin-top: 1em;
}

button:hover {
    background-color: #0060b3;
}

.site-title{ font-size:2rem; font-weight:700; letter-spacing:.5px; }

h1 {
  margin: 0;
  font-size: 1.8rem;
  line-height: 1;
}

h2 {
  color: #222831;
  border-left: 6px solid #0078D7;
  padding-left: 15px;
  margin-bottom: 25px;
  font-size: 1.5rem;
}

/* Responsives Design */
@media (max-width: 768px) {
    .grid-container {
        display: grid;
        grid-template-areas:
            "header"
            "content";
        grid-template-rows: 12.5vh 1fr;  /* Footer nicht mehr im Grid, da fixiert */
        min-height: 100vh;
    }

    .site-title{ font-size:1.5rem; }
    .logo{ display:none }

    .mobile-title {
    display: block;
    font-size: 1.5rem;
    font-weight: 600;
  }

    .header h1 {
        font-size: 1.5em;   /* kleiner, aber noch gut lesbar */
        padding: 0px 0px 0px 0px;     /* weniger Rand auf kleinen Displays */
        text-align: center; /* sichert, dass Text schön mittig bleibt */
    }
    .content {
        align-items: stretch;
        overflow-y: auto;
        min-height: 0;            /* WICHTIG: erlaubt Kindern zu schrumpfen/scrollen */
        padding-bottom: 6.25vh;
    }

    .content-grid {
        display: grid;
        grid-template-columns: 120px 1fr; /* Sidebar links, Inhalt rechts */
        min-height: 0;
        width: 100%;
        height: 100%;
    }

    .footer {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 6.25vh;             /* halb so hoch wie Header */
        background-color: #222;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.9em;
        z-index: 100;               /* immer über dem restlichen Inhalt */
    }

    .sidebar {
          /* linksbündig und scrollbar statt gequetscht */
        display: block;
        padding: 30px 10px 10px 10px;
        overflow: auto;
        background-color: #222831;
        border-right: 1px solid #ccc;   /* optische Trennung (statt unten) */
        border-bottom: none;
    }

    .sidebar a {
        display: block;
        text-align: left;               /* linksbündig */
        margin: 0 0 8px 0;
        white-space: normal;            /* darf umbrechen */
    }

    .main {
        border-left: none;
        border-top: 1px solid #ccc;
        min-height: 0;            /* damit .main scrollen darf */
        overflow-y: auto;         /* Inhalt scrollt statt Sidebar zu quetschen */
        padding: 8px;
    }
}
