/* --------------------------------------------------------------------------
   1. Grundlegendes Setup & Box-Sizing
   -------------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Bild sanft mit weißem Schleier abtönen (85% Deckweiß drübergelegt): */
    background: 
        linear-gradient(rgba(238, 242, 245, 0.7), rgba(238, 242, 245, 0.7)),
        url("https://grundschule-am-eichenhain.de/images/grundschuleFront2018-1024-2.jpg") no-repeat center top fixed;
    background-size: cover;
    color: #2d3748;
    line-height: 1.5;
}

.site-wrapper {
    max-width: 1300px;
    margin: 20px auto;
    padding: 0 15px;
}

/* --------------------------------------------------------------------------
   2. Header & Rote Laufschrift
   -------------------------------------------------------------------------- */
.site-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.5rem 1.25rem 1.25rem 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    margin-bottom: 20px;
    position: relative;
    text-align: center;
}

.header-main {
    text-align: center;
    width: 100%;
}

.header-titles {
    text-align: center;
}

.site-subtitle {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    color: #718096;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.site-title {
    margin: 0.25rem 0 0.75rem 0;
    font-size: 1.85rem;
    font-weight: 800;
    color: #1a202c;
    letter-spacing: -0.5px;
}

/* Mobiler Menü-Button (am Desktop verborgen) */
.mobile-menu-btn {
    display: none;
}

/* Rote Laufschrift-Leiste */
.news-ticker-container {
    display: flex;
    align-items: center;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-left: 4px solid #e53e3e;
    border-radius: 6px;
    margin-top: 1rem;
    overflow: hidden;
    height: 38px;
}

.news-ticker-label {
    background: #e53e3e;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0 14px;
    height: 100%;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.news-ticker-track {
    flex-grow: 1;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.news-ticker-content {
    display: inline-block;
    padding-left: 100%;
    white-space: nowrap;
    animation: newsLaufschrift 24s linear infinite;
}

/* Stoppt bei Maus-Hover oder Fingerberührung */
.news-ticker-content:hover,
.news-ticker-content:active {
    animation-play-state: paused;
}

.news-ticker-item {
    font-size: 0.95rem;
    font-weight: 600;
    color: #c53030; /* Kräftiges Rot */
    padding-right: 60px;
    text-decoration: none;
}

.news-ticker-meta {
    font-size: 0.82rem;
    font-weight: 400;
    color: #e53e3e;
    opacity: 0.85;
    margin-left: 6px;
}

@keyframes newsLaufschrift {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* --------------------------------------------------------------------------
   3. Dashboard Grid: 3 Spalten auf gleicher Gesamthöhe
   -------------------------------------------------------------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 280px 1fr 280px;
    gap: 20px;
    align-items: stretch;
    width: 100%;
}

.col-left, .col-main, .col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100%;
}

/* Linke Spalte: Projekte schließt Freiraum bündig ab */
.col-left .widget-projekte {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.col-left .widget-projekte .widget-body {
    flex-grow: 1;
}

/* Mittlere Spalte: Downloads schließt Freiraum bündig ab */
.col-main .widget-downloads {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.col-main .widget-downloads .widget-body {
    flex-grow: 1;
}

/* Rechte Spalte: Partner/DigitalPakt sitzt bündig unten */
.col-right .widget-partner {
    margin-top: auto;
}

/* --------------------------------------------------------------------------
   4. Universelle Card-Struktur
   -------------------------------------------------------------------------- */
.card {
    background: #ffffff;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
}

.widget-header {
    margin-bottom: 0.75rem;
    border-bottom: 2px solid #edf2f7;
    padding-bottom: 0.5rem;
}

.widget-header-flex {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.widget-title {
    margin: 0;
    font-size: 1.15rem;
    color: #2d3748;
}

.widget-title-link {
    color: inherit;
    text-decoration: none;
}

.widget-title-link:hover {
    color: #3182ce;
    text-decoration: underline;
}

.link-muted {
    font-size: 0.8rem;
    color: #a0aec0;
    text-decoration: none;
}
.link-muted:hover { 
    text-decoration: underline; 
}

.widget-footer {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #edf2f7;
    font-size: 0.85rem;
    text-align: right;
}

.widget-more-link {
    color: #3182ce;
    text-decoration: none;
    font-weight: 500;
}
.widget-more-link:hover { 
    text-decoration: underline; 
}

/* --------------------------------------------------------------------------
   5. Navigation & Listen
   -------------------------------------------------------------------------- */
.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list li a {
    display: block;
    padding: 0.4rem 0.6rem;
    color: #2b6cb0;
    text-decoration: none;
    border-radius: 6px;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.nav-list li a:hover {
    background: #ebf8ff;
    color: #2c5282;
}

.nav-divider {
    height: 1px;
    background: #edf2f7;
    border: none;
    margin: 0.6rem 0;
}

.standard-list, .termine-liste {
    list-style: none;
    padding: 0;
    margin: 0;
}

.standard-list li, .termin-item {
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
}

.standard-list li a {
    color: #2d3748;
    text-decoration: none;
}
.standard-list li a:hover { 
    color: #3182ce; 
}

.termin-datum {
    display: inline-block;
    font-weight: 700;
    color: #3182ce;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.termin-text {
    margin: 0.1rem 0 0 0;
    color: #4a5568;
}

/* Downloads-Liste */
.download-liste {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.download-item {
    padding: 0.35rem 0;
    border-bottom: 1px solid #edf2f7;
}

.download-item:last-child {
    border-bottom: none;
}

.download-datum {
    display: inline-block;
    font-weight: 700;
    color: #3182ce;
    font-size: 0.85rem;
    margin-bottom: 0.15rem;
}

.download-link {
    color: #2b6cb0;
    text-decoration: none;
    word-break: break-word;
}
.download-link:hover {
    text-decoration: underline;
}

/* --------------------------------------------------------------------------
   6. Slider: 3:2 Seitenverhältnis & Blur-Balken
   -------------------------------------------------------------------------- */
.widget-slider-card {
    padding: 0 !important;
    overflow: hidden !important;
    background: #ffffff !important;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
}

.slider-block {
    width: 100% !important;
    margin: 0 !important;
    padding: 12px !important;
    position: relative;
    display: block;
    box-sizing: border-box !important;
}

.slider-wrapper {
    width: 100% !important;
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.slider-container {
    position: relative;
    width: 100% !important;
    aspect-ratio: 3 / 2 !important;
    height: auto !important;
    display: block;
    overflow: hidden;
    background-color: #f7fafc;
}

#img1, #img2,
.slider-container img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
    opacity: 0;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 8px;
}

#img1.active, #img2.active,
.slider-container img.active {
    opacity: 1 !important;
}

#filename-bar,
.filename-bar {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
    background: rgba(0, 0, 0, 0.45) !important;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
    text-align: center !important;
    padding: 8px 14px 10px 14px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    line-height: 1.3 !important;
    z-index: 10 !important;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

.slider-wrapper:hover {
    transform: none !important;
    top: 0 !important;
}

/* --------------------------------------------------------------------------
   7. Zufallsbild
   -------------------------------------------------------------------------- */
.widget-zufallsbild {
    padding: 1rem;
}

.zufallsbild-container {
    width: 100%;
    min-height: 240px;
    max-height: 340px;
    border-radius: 8px;
    background-color: #f7fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.zufallsbild-container img {
    max-width: 100%;
    max-height: 340px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* --------------------------------------------------------------------------
   8. Tagesmenü: Hauptbild (nur Desktop-Hover) & Salatbadge (8x Zoom)
   -------------------------------------------------------------------------- */
.gericht-text {
    font-size: 0.95rem;
    margin: 0 0 0.75rem 0;
    color: #2d3748;
}

.essen-bild-wrapper {
    position: relative;
    width: 100%;
    max-width: 220px;
    margin: 0 auto 0.75rem auto;
    overflow: visible !important;
}

/* Hauptgericht: Zoomt ausschließlich am Mac/PC mit Maus */
.essen-hauptbild {
    width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    transform-origin: center center;
    position: relative;
    z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
    .essen-hauptbild:hover {
        transform: scale(3);
        z-index: 100;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
        cursor: pointer;
    }
}

/* Runde Salatminiatur oben links */
.essen-salatbadge {
    position: absolute;
    top: -8px;
    left: -8px;
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 10;
    /* Übergang auf Breite, Höhe und Position statt transform */
    transition: width 0.25s ease, height 0.25s ease, border-radius 0.2s ease, box-shadow 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

/* Mac / PC mit Maus: Echtes Neuberechnen auf 260px Breite */
@media (hover: hover) and (pointer: fine) {
    .essen-salatbadge:hover {
        width: 400px;
        height: 400px;
        border-radius: 8px;
        z-index: 250;
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
    }
}

/* iPhone / Touch: Ebenfalls echte Pixelgröße anfordern */
.essen-salatbadge.is-zoomed {
    width: 400px !important;
    height: 400px !important;
    border-radius: 8px !important;
    z-index: 250 !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55) !important;
}

.allergene-info {
    font-size: 0.75rem;
    color: #718096;
    border-top: 1px dashed #e2e8f0;
    padding-top: 0.5rem;
}

/* --------------------------------------------------------------------------
   9. Footer & Hilfsklassen
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: 30px;
    padding: 1.5rem 2rem;
    font-size: 0.88rem;
    color: #4a5568;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    text-align: center;
}

.footer-block h4 {
    margin: 0 0 0.4rem 0;
    font-size: 0.95rem;
    color: #1a202c;
    font-weight: 700;
}

.footer-block p {
    margin: 0;
    line-height: 1.5;
}

.footer-block a {
    color: #2b6cb0;
    text-decoration: none;
}
.footer-block a:hover { 
    text-decoration: underline; 
}

.responsive-img {
    max-width: 100%;
    height: auto;
    display: block;
}

.partner-logo {
    margin: 0 auto;
    max-width: 160px;
}

.text-center { text-align: center; }
.keine-eintraege { font-size: 0.85rem; color: #a0aec0; font-style: italic; margin: 0; }

/* --------------------------------------------------------------------------
   10. Responsive Breakpoints & Mobiles Burger-Menü
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: 240px 1fr;
    }
    .col-right {
        grid-column: span 2;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    /* Header mobil zentriert, Burger-Knopf oben rechts verankert */
    .site-header {
        padding-top: 1.25rem;
    }

    .header-main {
        position: relative;
        text-align: center;
    }

    .header-titles {
        text-align: center;
        padding: 0 40px; /* Platz für den Burger-Button lassen */
    }

    .site-title {
        font-size: 1.4rem;
        margin-bottom: 0.5rem;
    }

    .site-subtitle {
        font-size: 0.85rem;
    }

    .mobile-menu-btn {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        position: absolute;
        top: 0;
        right: 0;
        background: #3182ce;
        color: #ffffff;
        border: none;
        border-radius: 8px;
        padding: 6px 11px;
        font-size: 0.88rem;
        font-weight: 600;
        cursor: pointer;
        box-shadow: 0 2px 6px rgba(49, 130, 206, 0.3);
    }

    .mobile-menu-btn:active {
        background: #2b6cb0;
    }

    .mobile-menu-btn .menu-icon {
        font-size: 1.15rem;
        line-height: 1;
    }

    /* Dashboard als flexible Spalte */
    .dashboard-grid {
        display: flex;
        flex-direction: column;
    }

    .col-left, .col-main, .col-right {
        display: contents;
    }

    /* Navigation mobil ausklappbar */
    #main-navigation {
        display: none;
        order: 1;
        margin-bottom: 10px;
    }

    #main-navigation.is-open {
        display: block !important;
        animation: slideDown 0.25s ease-out;
    }

    /* Reihenfolge für alle Widgets auf dem Smartphone */
    .widget-slider-card { order: 2; }
    .widget-zufallsbild  { order: 3; }
    .widget-termine      { order: 4; }
    .widget-tagesmenue   { order: 5; }
    .widget-projekte     { order: 6; }
    .widget-downloads    { order: 7; }
    .widget-partner      { order: 8; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}