/* ==========================================================================
   1. VARIABLES & RESET
   ========================================================================= */
:root {
    --bg-color: #f8f9fa;         /* Reizarmes Hellgrau */
    --card-bg: #ffffff;          /* Reines Weiß */
    --border-color: #e2e5e9;     /* Sanfte Trennlinien */
    
    /* Deine Markenfarben */
    --brand-dark: #37404e;       /* Dein Haupt-Schiefergrau */
    --brand-light: #727e8e;      /* Dein helles Grau (z.B. für Beschreibungen/Quotes) */
    --brand-blue: #4169e1;       /* Königsblau (Fokus, Buttons) */
    --brand-blue-hover: #2e54c7; 
    
    --font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-color);
    color: var(--brand-dark);
    font-family: var(--font-family);
    line-height: 1.75;
    font-size: 18px;
    -webkit-font-smoothing: antialiased;
}

/* Die neue Gesamtbreite der Website */
.container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ==========================================================================
   2. GLOBAL HELPER CLASSES (Textfarben & Ausrichtung)
   ========================================================================= */

/* Textfarben */
.text-brand-dark { color: var(--brand-dark) !important; }
.text-brand-light { color: var(--brand-light) !important; }
.text-brand-blue { color: var(--brand-blue) !important; }
.text-white { color: #ffffff !important; }

/* Textausrichtung */
.text-left { text-align: left !important; }
.text-center { text-align: center !important; }

/* ==========================================================================
   3. RESPONSIVE HEADER
   ========================================================================= */
.main-header {
    background-color: var(--card-bg);
    border-bottom: 2px solid var(--border-color);
    padding: 18px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-img {
    height: 55px;
    width: auto;
    display: block;
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 32px;
}

.main-nav a {
    color: var(--brand-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    padding: 8px 0;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
}

.main-nav a:hover, .main-nav a.active {
    border-bottom-color: var(--brand-blue);
    color: var(--brand-blue);
}

@media (max-width: 768px) {
    .header-grid { flex-direction: column; gap: 16px; }
    .main-nav ul { gap: 16px; flex-wrap: wrap; justify-content: center; }
}

/* ==========================================================================
   4. HERO-BEREICH (Besserer Umgang mit der Bildgröße)
   ========================================================================= */
.hero {
    padding: 80px 0;
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
}

.hero-grid {
    display: flex;
    align-items: center;
    gap: 64px;
}

.hero-text {
    flex: 1.6; /* Gibt dem Text links deutlich mehr Raum */
}

.hero-text h1 {
    font-size: 40px;
    line-height: 1.25;
    margin-bottom: 24px;
    font-weight: 700;
}

.hero-text .lead {
    font-size: 21px;
    margin-bottom: 36px;
}

.btn {
    display: inline-block;
    background-color: var(--brand-blue);
    color: white;
    text-decoration: none;
    padding: 16px 32px;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 4px 0 #2b4cad;
    transition: all 0.1s ease;
}

.btn:hover { background-color: var(--brand-blue-hover); color: white; }
.btn:active {
    transform: translateY(4px);
    box-shadow: 0 0 0 transparent;
}

/* Der Container für das quadratische Bild */
.hero-visual {
    flex: 0.9; 
    background-color: var(--bg-color);
    border: 2px solid var(--border-color);
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    max-width: 380px;  /* Von 480px auf 380px reduziert, damit es den Text nicht erdrückt */
    margin-left: auto; /* Schiebt das Bild elegant nach rechts außen */
}

.responsive-hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@media (max-width: 900px) {
    .hero-grid {
        flex-direction: column-reverse; /* Mobil rutscht das Bild unter den Text */
        text-align: center;
    }
    .hero-visual {
        margin: 0 auto;
        width: 100%;
        max-width: 320px;
    }
}

/* ==========================================================================
   5. INHALTS-BOXEN / GRID
   ========================================================================= */
.section-padding {
    padding: 90px 0;
}

.section-title {
    font-size: 32px;
    margin-bottom: 16px;
}

.section-subtitle {
    max-width: 700px;
    margin-bottom: 56px;
    align-items: center;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 32px;
}

.card {
    background-color: var(--card-bg);
    padding: 40px 28px;
    border: 1px solid var(--border-color);
    border-top: 4px solid var(--brand-dark);
}

.card:hover { border-top-color: var(--brand-blue); }
.card-icon {
    font-size: 32px;
    margin-bottom: 24px;
    background-color: var(--bg-color);
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-icon svg {
    width: 28px;
    height: 28px;
    display: block;
}

.card h3 { font-size: 20px; margin-bottom: 12px; }
.card p { font-size: 16px; }

/* ==========================================================================
   6. FOOTER
   ========================================================================= */
.main-footer {
    background-color: var(--brand-dark);
    color: #ced5df;
    padding: 48px 0;
    border-top: 4px solid var(--brand-blue);
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links a {
    color: #a2adb9;
    text-decoration: none;
    margin-left: 28px;
    font-weight: 600;
}

.footer-links a:hover { color: white; }

@media (max-width: 768px) {
    .footer-grid { flex-direction: column; gap: 20px; text-align: center; }
    .footer-links a { margin: 0 10px; display: inline-block; }
}

/* ==========================================================================
   7. NEU: VISUELLE STRUKTUR- & LESE-KLASSEN
   ========================================================================= */

/* Der optimierte, visuell eingerahmte Lese-Block (Text-Insel für Sektion 2) */
.text-read-block {
    max-width: 900px;      
    margin: 0 auto;        
    background-color: var(--card-bg); 
    padding: 56px 48px;    
    border: 1px solid var(--border-color);
    border-radius: 8px;    
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); 
}

.text-read-block p {
    margin-bottom: 20px;
}

/* Hervorgehobene Zeilen (wie das "Ihr Kind ist anders...") */
.highlight-lead {
    font-size: 20px;
    margin-bottom: 24px;
    font-weight: 600;
}

/* Die Jugendamt-Infobox innerhalb des Lese-Blocks */
.info-blockquote {
    background-color: var(--bg-color);
    padding: 24px;
    border-left: 4px solid var(--brand-blue);
    text-align: left;
    font-size: 17px;
    margin-top: 32px;
    color: var(--brand-dark);
}

/* Farbige Sektions-Hintergründe für den Wechsel-Rhythmus */
.bg-white { background-color: #ffffff; }
.bg-dark { background-color: var(--brand-dark); color: #ffffff; }
.bg-dark .section-title { color: #ffffff; }

/* Heller Alternativ-Button für dunkle Sektionen (Soforthilfe) */
.btn-light {
    background-color: #ffffff;
    color: var(--brand-dark);
    box-shadow: 0 4px 0 #b0b8c3;
}
.btn-light:hover { background-color: #f1f3f5; color: var(--brand-dark); }

/* Zusätzliche Spezial-Karten-Klassen */
.section-divider { border: 0; border-top: 1px solid var(--border-color); }
.card-plain { border-top: none; padding: 24px; }
.card-review { border: 1px solid var(--border-color); padding: 24px; }
.review-stars { color: #ffc107; margin-bottom: 10px; }
.review-text { font-style: italic; font-size: 16px; }

/* Erzwingt auf Desktop-Bildschirmen exakt 3 gleichmäßige Spalten */
@media (min-width: 900px) {
    .card-grid-3-columns {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}


@media (max-width: 768px) {
    .text-read-block {
        padding: 32px 24px; 
        border-radius: 0;   
        border-left: none;
        border-right: none;
    }
}
/* ==========================================================================
   ZUSATZ: STATEMENT-BLOCK (Schutzschild gegen algorithmische Fehlclusterung)
   ========================================================================= */
.statement-block {
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.statement-block:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.04);
}

.statement-icon-wrapper {
    width: 64px;
    height: 64px;
    background-color: var(--bg-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.statement-content p:last-child {
    margin-bottom: 0; /* Verhindert unschönen Abstand nach unten innerhalb des Blocks */
}

/* Mobile Optimierung für kleinere Bildschirme */
@media (max-width: 768px) {
    .statement-block {
        border-left: none !important;
        border-top: 4px solid var(--brand-blue) !important; /* Mobil wirkt eine obere Linie stabiler */
        margin-top: 0 !important;
        margin-bottom: 40px !important;
    }
    
    .statement-title {
        font-size: 21px !important;
    }
}
/* ==========================================================================
   8. DETAILSEITEN & FLEXIBLE HERO-BOXEN (Mobiloptimiert & Spaltenbegrenzt)
   ========================================================================= */
/* Erzwingt eine saubere Aufteilung auf dem Desktop und neutralisiert Flex-Fehler */
@media (min-width: 901px) {
    body .hero .hero-grid {
        display: grid !important;
        grid-template-columns: 1.6fr 1.1fr !important; /* 60% Text, 40% Box */
        align-items: flex-start !important;
        gap: 64px !important;
    }
}

/* Der schützende Wrapper – Erhebt Exklusivitätsanspruch im Theme */
body .hero .hero-grid .hero-visual-wrapper {
    padding: 16px !important;
    overflow: visible !important; /* Hebt jegliches Abschneiden auf */
    width: 100% !important;
    max-width: 440px !important; /* Verhindert das unkontrollierte Ausdehnen */
    margin-left: auto !important;
}

/* Die flexible Box selbst – Hebelt die alten Kapitel-4-Werte komplett aus */
body .hero .hero-grid .hero-visual-flexible {
    background-color: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.03) !important;
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    height: auto !important; /* Verhindert Höhen-Kollaps */
    aspect-ratio: auto !important; /* Löscht das zwingende Quadrat aus Kapitel 4 */
    overflow: visible !important; /* Garantiert, dass kein Rahmen geköpft wird */
}

/* Mobile Ansicht: Absolut bruchsicher für Smartphones */
@media (max-width: 900px) {
    body .hero .hero-grid {
        display: flex !important;
        flex-direction: column-reverse !important; /* Box wandert unter den Text */
        align-items: center !important;
        text-align: center !important;
        gap: 40px !important;
    }
    
    body .hero .hero-grid .hero-text {
        text-align: center !important;
        width: 100% !important;
    }
    
    body .hero .hero-grid .hero-text .btn {
        margin: 0 auto !important;
        display: inline-block !important;
    }
    
    body .hero .hero-grid .hero-visual-wrapper {
        margin: 0 auto !important; /* Zentriert die Box mobil */
        max-width: 100% !important;
    }
}
    
    details summary::-webkit-details-marker { display: none; }
    details[open] summary .icon { transform: rotate(45deg); color: var(--brand-dark) !important; }
    details summary .icon { transition: transform 0.2s ease; }

 /* 1. Aktiviert das sanfte, flüssige Scrollen für die gesamte Website */
html {
    scroll-behavior: smooth;
}

/* 2. Verhindert, dass der Header die Überschriften nach dem Sprung überlagert */
section[id] {
    scroll-margin-top: 90px; /* Wert anpassen, falls dein Header höher/niedriger ist */
}   
/* Globale Definition für das sanfte Scrollen bei Ankern */
html {
    scroll-behavior: smooth;
}

/* Verhindert das Überlagern von Überschriften durch den fixierten Header */
section[id] {
    scroll-margin-top: 90px;
}

/* Zentraler Back-to-Top Button */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--brand-blue);
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 999;
    transition: all 0.3s ease;
    
    /* Standardmäßig unsichtbar */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
}

.back-to-top:hover {
    background-color: var(--brand-dark);
    transform: translateY(-2px);
}

/* Wird über das zentrale JS im Header getriggert */
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}   

@media (max-width: 768px) {
    .back-to-top {
        bottom: 105px !important; /* Mobil noch ein Stück höher, da die Sticky-Bar dort zweizeilig wird */
        right: 16px !important;
    }
}

 /* Angedockte Leiste am Bildschirmboden */
.bottom-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-bg, #ffffff);
    border-top: 1px solid var(--border-color, #ced5df);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    z-index: 998; /* Ein Level unter dem Back-to-Top Button */
    padding: 12px 0;
}

.sticky-bar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.sticky-bar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--brand-dark, #1a202c);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sticky-bar-links {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.sticky-link {
    background-color: var(--bg-color, #f8fafc);
    color: var(--brand-dark, #1a202c);
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid var(--border-color, #ced5df);
    transition: all 0.2s ease;
}

.sticky-link:hover {
    background-color: var(--brand-blue, #4169e1);
    color: white !important;
    border-color: var(--brand-blue, #4169e1);
}

/* WICHTIG: Damit die Leiste auf langen Seiten den echten Footer-Inhalt nicht verdeckt */
body {
    padding-bottom: 70px; 
}

/* Mobile Optimierung: Text ausblenden, Links zentrieren */
@media (max-width: 768px) {
    .sticky-bar-container {
        flex-direction: column;
        gap: 8px;
        padding: 0 12px;
    }
    .sticky-bar-title {
        display: none; /* Spart wertvollen Platz auf dem Smartphone */
    }
    .sticky-bar-links {
        justify-content: center;
        width: 100%;
        gap: 6px;
    }
    .sticky-link {
        font-size: 12.5px;
        padding: 6px 10px;
    }
    body {
        padding-bottom: 90px;
    }
}
.hero-bg-image {
                position: absolute; 
                top: 0; 
                left: 0; 
                width: 100%; 
                height: 100%; 
                background-image: url('<?php echo $base_url; ?>/img/minecraft-programmieren-kinder-hintergrund.webp'); 
                background-size: cover; 
                background-position: right center; 
                background-repeat: no-repeat; 
                filter: grayscale(100%); 
                opacity: 0.07; 
                pointer-events: none; 
                z-index: 1;
                display: block;
            }

            /* „WENN MOBIL“ (Bildschirm kleiner als 768px): Hintergrundbild komplett ausblenden */
            @media (max-width: 768px) {
                .hero-bg-image {
                    display: none !important;
                }
                /* Optional: Verringert den Abstand im Hero auf Smartphones für bessere Usability */
                .hero {
                    padding-top: 24px !important;
                    padding-bottom: 24px !important;
                }
            }