/* ==========================================================================
   1. GRUNDDESIGN & SMARTPHONE-FIRST (Standard-Styles für alle Geräte)
   ========================================================================== */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f7;
    color: #333;
    line-height: 1.6;
}

/* Header & obere Navigation */
header {
    background-color: #0071e3;
    color: white;
    padding: 15px;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.3rem;
}

/* Burger Button (Standardmäßig auf Smartphones sichtbar) */
.burger-menu {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 101;
}

.burger-menu span {
    width: 30px;
    height: 3px;
    background-color: white;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Navigationslinks mobil (ausgeklappt) */
.nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background-color: #0071e3;
    padding: 10px 0;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.nav-links a {
    color: white;
    padding: 15px 20px;
    text-decoration: none;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    transition: background-color 0.2s;
}

.nav-links a:hover {
    background-color: rgba(255,255,255,0.1);
}

.nav-links.active {
    display: flex;
}

/* Burger-Animation zum "X" */
.burger-menu.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.burger-menu.open span:nth-child(2) { opacity: 0; }
.burger-menu.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Hauptinhalt & Grid-System (Mobil: einspaltig) */
main {
    padding: 15px;
    box-sizing: border-box;
}

.grid-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Inhalts-Karten (Cards) */
.card {
    background: white;
    padding: 0; /* Auf 0 gesetzt, damit Bilder bündig abschließen */
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    overflow: hidden; /* Schneidet die abgerundeten Bildecken sauber ab */
}

/* Textbereich innerhalb einer Karte mit Bild */
.card-content {
    padding: 20px;
}

.card h2 {
    margin-top: 0;
    color: #0071e3;
}

/* Bilder in Karten */
.card-img {
    width: 100%;
    height: auto;
    display: block;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Interaktions-Effekt für anklickbare Bilder */
.zoomable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.zoomable:hover {
    opacity: 0.9;
}

/* Fußzeile */
footer {
    text-align: center;
    padding: 20px;
    font-size: 0.85rem;
    color: #666;
}

/* ==========================================================================
   2. VOLLBILD-BILD (LIGHTBOX) – Sicherer Mobile-Modus
   ========================================================================== */
.lightbox {
    display: none; /* Absolut unsichtbar auf Smartphones, blockiert keine Klicks */
    position: fixed;
    z-index: 1000; /* Liegt über allen Elementen */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* Aktivierter Zustand per JavaScript */
.lightbox.active {
    display: flex;
    opacity: 1;
}

/* Das geöffnete Vollbild-Bild */
.lightbox img {
    max-width: 90%;
    max-height: 85%;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.5);
}

/* Schließen-Button (X) oben rechts */
.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
}

/* ==========================================================================
   3. DESKTOP-OPTIMIERUNG (Aktiv ab 768px Bildschirmbreite)
   ========================================================================== */
@media (min-width: 768px) {
    header {
        padding: 15px 10%;
    }

    /* Burger-Button auf Desktop ausblenden */
    .burger-menu {
        display: none;
    }

    /* Navigation horizontal nebeneinander anzeigen */
    .nav-links {
        display: flex !important; /* Erzwingt Anzeige auf Desktop */
        flex-direction: row;
        position: static;
        width: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
    }

    .nav-links a {
        padding: 10px 15px;
        font-size: 1rem;
        border-bottom: none;
        border-radius: 6px;
    }

    /* Layout zentrieren und zweispaltig anzeigen */
    main {
        max-width: 1200px;
        margin: 30px auto;
        padding: 0 10%;
    }

    .grid-container {
        flex-direction: row;
    }

    .card {
        flex: 1; /* Karten teilen sich den Platz gleichmäßig auf */
    }
}
