/**
 * T26 Core Theme - WBCE CMS
 * @author      Thodde26 (Thorsten)
 * @Version     1.0.0
 * @link        https://www.thodde26.de
 * @file        layout.css
 * @license     http://www.gnu.org/licenses/gpl.html GNU General Public License v3.0
 */

/* ==========================================================================
   RESET & GRUNDLAGEN
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--t26-font-family, 'Inter', system-ui, -apple-system, sans-serif);
    background-color: var(--t26-bg-body, #f4f7f9);
    color: var(--t26-text-main, #0f172a);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Flex-Layout: Footer bleibt immer ganz unten */
}

.t26-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ==========================================================================
   HEADER BEREICH (Logo & Titel)
   ========================================================================== */
.t26-site-header {
    background-color: var(--t26-bg-surface, #ffffff);
    border-bottom: 1px solid var(--t26-border-color, #cbd5e1);
    padding: 20px 0;
    height: 120px;
}

.t26-logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 15px;
}

.t26-logo-img {
    max-height: 60px;
    width: auto;
}

.t26-site-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--t26-primary-base, #0f2a4a);
}

/* ==========================================================================
   3. HAUPTNAVIGATION (Sticky)
   ========================================================================== */
.t26-main-nav {
    background-color: var(--t26-primary-base, #0f2a4a);
    box-shadow: 0 2px 10px var(--t26-shadow-color, rgba(10, 17, 40, 0.08));
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    /* max-height: 80px; <- GELÖSCHT! Das hat das Layout gesprengt beim Umbruch */
}
.t26-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    gap: 2px; /* <-- Fast kein Abstand mehr zwischen den Buttons */
    flex-wrap: wrap; /* Zwingend für Handys, aber auf Desktop bleibt es jetzt einzeilig */
}

/* Der Link wird optisch zum Button */
.t26-nav-link {
    display: block;
    padding: 5px 6px; /* <-- Millimeterarbeit: Nur noch 6px links/rechts (vorher 8px) */
    font-size: 0.85rem; /* <-- Minimal kleiner (ca. 13.5px) */
    color: var(--t26-text-invert, #ffffff);
    background-color: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap; /* Verhindert Zeilenumbrüche im Button selbst */
    transition: all 0.3s ease;
    font-family: var(--t26-font-family);
}
/* Hover & Aktiver Menüpunkt (Button-Style) */
.t26-nav-link:hover,
.t26-nav-list li.menu-current .t26-nav-link {
    background-color: var(--t26-accent-color, #378ADD); /* T26 Electric Azure */
    color: var(--t26-text-invert, #ffffff);
    box-shadow: 0 4px 10px rgba(10, 17, 40, 0.25);
}
/* ==========================================================================
   MAIN CONTENT & SIDEBAR (GRID AUTO-PILOT)
   ========================================================================== */
.t26-main-content {
    flex: 1; /* Nimmt den restlichen vertikalen Platz ein */
    padding: 40px 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.t26-layout-grid {
    display: grid;
    grid-template-columns: 1fr; /* Mobile First: Alle untereinander */
    gap: 30px;
    align-items: start;
}

@media (min-width: 992px) {
    .t26-layout-grid {
        /* Auto-Pilot: Spalten passen sich automatisch an (Left | Main | Right) */
        grid-template-columns: auto 1fr auto;
    }

    .t26-sidebar {
        width: 280px; /* Feste Breite für Sidebars auf Desktop */
        background-color: var(--t26-bg-surface, #ffffff);
        padding: 20px;
        border: 1px solid var(--t26-border-color, #cbd5e1);
        border-radius: 4px;
        box-shadow: 0 2px 10px var(--t26-shadow-color, rgba(10, 17, 40, 0.05));
    }

    /* Der Magische Auto-Pilot: Leere Sidebars verschwinden komplett */
    .t26-sidebar:empty {
        display: none;
    }
}

/* ==========================================================================
   MOBILE NAVIGATION (OFF-CANVAS SLIDER)
   ========================================================================== */

/* 1. Body Scroll-Lock (wird vom JS gesetzt) */
.t26-no-scroll {
    overflow: hidden;
}

/* 2. Der Hamburger-Button */
.t26-mobile-toggle {
    display: block; /* Mobile First: Auf Handys sichtbar */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    z-index: 9999; /* Bleibt immer über dem Menü */
    position: relative;
}

.t26-hamburger-box {
    display: inline-block;
    width: 30px;
    height: 24px;
    position: relative;
}

.t26-hamburger-inner,
.t26-hamburger-inner::before,
.t26-hamburger-inner::after {
    background-color: var(--t26-text-invert, #ffffff);
    width: 100%;
    height: 3px;
    border-radius: 4px;
    position: absolute;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.t26-hamburger-inner { top: 50%; transform: translateY(-50%); }
.t26-hamburger-inner::before { content: ""; top: -10px; left: 0; }
.t26-hamburger-inner::after { content: ""; top: 10px; left: 0; }

/* Hamburger wird zum "X" wenn geöffnet */
.t26-mobile-toggle.is-active .t26-hamburger-inner { background: transparent; }
.t26-mobile-toggle.is-active .t26-hamburger-inner::before { transform: translateY(10px) rotate(45deg); }
.t26-mobile-toggle.is-active .t26-hamburger-inner::after { transform: translateY(-10px) rotate(-45deg); }

/* 3. Der Off-Canvas Container (Mobile) */
.t26-offcanvas-container {
    position: fixed;
    top: 0;
    right: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--t26-primary-base, #0f2a4a);
    box-shadow: -5px 0 15px var(--t26-shadow-color, rgba(10, 17, 40, 0.15));
    padding: 80px 30px 30px 30px;
    overflow-y: auto;
    z-index: 9998;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.t26-offcanvas-container.is-open {
    transform: translateX(0);
}

.t26-offcanvas-container .t26-nav-list {
    flex-direction: column;
    gap: 10px;
}

.t26-offcanvas-container .t26-nav-link {
    font-size: 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================================================
   DESKTOP NAVIGATION (ab 992px)
   ========================================================================== */
@media (min-width: 992px) {
    .t26-mobile-toggle {
        display: none;
    }

    .t26-offcanvas-container {
        position: static;
        width: auto;
        max-width: none;
        height: auto;
        background-color: transparent;
        box-shadow: none;
        padding: 0;
        overflow-y: visible;
        transform: none;
        transition: none;
    }

    .t26-offcanvas-container .t26-nav-list {
        flex-direction: row;
        gap: 20px;
    }

    .t26-offcanvas-container .t26-nav-link {
        font-size: 1rem;
        border-bottom: none;
    }
}

/* ==========================================================================
   FOOTER & COPYRIGHT BEREICH
   ========================================================================== */
.t26-site-footer {
    background-color: var(--t26-bg-footer, #e2e8f0);
    padding: 40px 0;
    border-top: 1px solid var(--t26-border-color, #cbd5e1);
    margin-top: auto;
}

.t26-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.t26-footer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.t26-footer-link {
    color: var(--t26-text-muted, #475569);
    text-decoration: none;
    transition: color 0.2s;
}

.t26-footer-link:hover {
    color: var(--t26-primary-base, #0f2a4a);
}

.t26-copyright-bar {
    background-color: var(--t26-primary-base, #0f2a4a);
    color: var(--t26-text-invert, #ffffff);
    padding: 15px 0;
    text-align: center;
    font-size: 0.9rem;
    position: sticky;
    bottom: 0;
    z-index: 900;
}

.t26-copyright-link {
    color: var(--t26-highlight-bg, #85B7EB);
    text-decoration: none;
    margin: 0 5px;
    transition: color 0.2s ease;
}

.t26-copyright-link:hover {
    color: var(--t26-text-invert, #ffffff);
}

/* ==========================================================================
   BARRIEREFREIHEIT (Accessibility)
   ========================================================================== */
.t26-skip-link {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Wird sichtbar, sobald ein Tastaturnutzer per Tab dorthin navigiert */
.t26-skip-link:focus {
    position: absolute;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background-color: var(--t26-accent-color, #378ADD);
    color: var(--t26-text-invert, #ffffff);
    padding: 10px 15px;
    border-radius: 4px;
    z-index: 10000;
    text-decoration: none;
    font-weight: bold;
}
