/* Layout CSS - Grundlegende Layout-Styles */

/* Container */
.layout-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header Layout - Dark Mode */
/* Gemäß Regel 011-ui-widget-navigation.mdc Regel 008: Navigation darf nicht sticky sein */
.layout-header {
    background: var(--color-surface-primary);
    border-bottom: 1px solid var(--color-border-secondary);
    position: relative;
    z-index: 100;
    backdrop-filter: blur(20px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    box-sizing: border-box;
}

/* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
.layout-header #header-container {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem 1.5rem;
    min-height: 120px;
    gap: 1rem;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* Logo Layout */
.layout-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
    min-width: 350px;
    justify-self: start;
    grid-column: 1;
}

.layout-logo .logo-astro-app {
    max-height: 80px;
    width: auto;
    object-fit: contain;
}

/* Navigation Layout */
.layout-navigation {
    display: flex;
    align-items: center;
    gap: 1rem;
    position: relative;
    flex-wrap: wrap;
    justify-content: center;
    grid-column: 2;
    justify-self: center;
}

/* Hamburger Menu Position - Gemäß Regel 011-ui-mobile: Position oben rechts */
.layout-navigation .widget-mobile-menu-toggle {
    position: relative; /* Geändert von absolute zu relative für bessere Kontrolle */
    order: 2; /* Kommt nach der Sprachauswahl */
    z-index: 1001;
    flex-shrink: 0; /* Verhindert Schrumpfen */
}

/* Main Content Layout - Dark Mode */
.layout-main {
    min-height: calc(100vh - 64px);
    padding: 0;
    background: var(--color-background-primary);
    color: var(--color-text-primary);
}

/* Footer Layout - Dark Mode */
.layout-footer {
    background: var(--color-surface-primary);
    border-top: 1px solid var(--color-border-secondary);
    margin-top: auto;
    padding: 2rem 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    width: 100%;
    box-sizing: border-box;
}

/* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
.layout-footer #footer-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    box-sizing: border-box;
}

.layout-footer-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
}

.layout-footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.layout-footer-copyright {
    padding-top: 1rem;
    border-top: 1px solid var(--color-border-secondary);
}

/* Grid Layouts */
/* Gemäß Regel 011-ui-widget-tile: Tiles müssen immer die gleiche Höhe und Breite haben */
.layout-grid {
    display: grid;
    gap: 1.5rem;
    align-items: stretch; /* Gemäß Regel 011: Gleiche Höhe für alle Tiles */
}

.layout-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.layout-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.layout-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/* Flex Layouts */
.layout-flex {
    display: flex;
}

.layout-flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.layout-flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.layout-flex-column {
    display: flex;
    flex-direction: column;
}

/* Spacing */
.layout-section {
    padding: 4rem 0;
}

.layout-section-sm {
    padding: 2rem 0;
}

.layout-section-lg {
    padding: 6rem 0;
}

/* Responsive Breakpoints */
/* Großer Desktop/Widescreen (min-width: 1440px) */
@media (min-width: 1440px) {
    .layout-container {
        max-width: 1400px;
    }
    
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        max-width: 1400px;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 1400px;
    }
}

/* Kleiner Desktop/13-Zoll (1024px–1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .layout-container {
        max-width: 1200px;
    }
    
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        max-width: 1200px;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 1200px;
    }
}

/* Tablet/iPad (600px–768px) */
@media (min-width: 600px) and (max-width: 768px) {
    .layout-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .layout-navigation {
        gap: 1rem;
    }
}

@media (max-width: 1200px) {
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        grid-template-columns: auto 1fr auto;
        max-width: 1200px;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 1200px;
    }
    
    .layout-logo {
        min-width: 300px;
        grid-column: 1;
        justify-self: start;
    }
    
    .layout-logo .logo-astro-app {
        max-height: 70px;
    }
    
    .layout-navigation {
        grid-column: 2;
        justify-self: center;
    }
}

@media (max-width: 1024px) {
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        grid-template-columns: auto 1fr auto;
        max-width: 100%;
        padding: 0 1rem;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 100%;
        padding: 0 1rem;
    }
    
    .layout-logo {
        min-width: 250px;
        grid-column: 1;
        justify-self: start;
    }
    
    .layout-logo .logo-astro-app {
        max-height: 60px;
    }
    
    .layout-navigation {
        grid-column: 2;
        justify-self: center;
    }
}

@media (max-width: 768px) {
    .layout-container {
        padding: 0 0.75rem;
    }
    
    /* Gemäß Regel 011-ui-header.mdc Regel 002: Header-Breite muss genauso breit sein wie Content darunter */
    .layout-header #header-container {
        padding: 0.75rem;
        min-height: 64px;
        grid-template-columns: auto 1fr auto;
        max-width: 100%;
    }
    
    /* Gemäß Regel 011-ui-footer.mdc Regel 003: Footer-Breite muss genauso breit sein wie Content darunter */
    .layout-footer #footer-container {
        max-width: 100%;
        padding: 0 0.75rem;
    }
    
    .layout-logo {
        min-width: 220px;
        grid-column: 1;
        justify-self: start;
    }
    
    .layout-logo .logo-astro-app {
        max-height: 50px;
    }
    
    .layout-navigation {
        flex-direction: row;
        gap: 0.75rem; /* Mehr Abstand zwischen Elementen */
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        grid-column: 2;
        justify-self: center;
    }
    
    /* Sicherstellen, dass Sprachauswahl und Hamburger-Menü nicht überlappen */
    .layout-navigation .widget-language-selector {
        margin-right: 0.75rem; /* Abstand zum Hamburger-Menü */
        flex-shrink: 0;
    }
    
    .layout-navigation .widget-mobile-menu-toggle {
        flex-shrink: 0;
    }
    
    .layout-footer-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .layout-section {
        padding: 3rem 0;
    }
}

@media (max-width: 576px) {
    .layout-container {
        padding: 0 0.5rem;
    }
    
    .layout-header #header-container {
        padding: 0.5rem;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .layout-section {
        padding: 2rem 0;
    }
    
    .layout-grid-2,
    .layout-grid-3,
    .layout-grid-4 {
        grid-template-columns: 1fr;
    }
}