/*
Theme Name: Zelx-fresh
Version: 1.2.9
*/

/* --- 1. BASIS & GENERAL LAYOUT --- */
html {
    scroll-behavior: smooth !important;
}

body {
    font-family: Arial, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--page-bg, #f4f6f9) !important;
    color: var(--text-color, #333333);
    margin: 0;
    padding: 0;
}

/* Globale dynamische Medien-Skalierung */
img, video, iframe {
    max-width: 100%;
    height: auto;
}

.post-thumbnail {
    text-align: center;
    margin-bottom: 20px;
    width: 100%;
}

.post-thumbnail img,
.main-content img,
.attachment-large,
.attachment-medium,
.attachment-full {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.container {
    max-width: 1450px;
    margin: 0 auto;
    padding: 20px;
}

a {
    color: var(--accent-color, #3498db);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* --- 2. HEADER & BRANDING --- */
header.site-header {
    background: linear-gradient(135deg, var(--header-bg, #2c3e50) 0%, #1a252f 100%) !important;
    color: #fff;
    padding: 15px 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    border-bottom: 3px solid var(--accent-color, #3498db);
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    gap: 15px;
}

.site-branding {
    flex-shrink: 0;
}

.site-branding h1 {
    margin: 0;
    font-size: 22px;
}

.site-branding p {
    margin: 3px 0 0 0;
    font-size: 12px;
    opacity: 0.8;
}

.site-branding a {
    color: #fff !important;
    text-decoration: none;
}

.site-branding img,
.custom-logo {
    max-height: 55px;
    width: auto;
    display: inline-block;
    vertical-align: middle;
}

/* --- 3. MAIN NAVIGATION & DROPDOWNS --- */
.main-navigation {
    position: relative;
    flex-grow: 1;
}

.main-navigation div > ul,
.main-navigation > ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.main-navigation ul li {
    position: relative;
    white-space: nowrap;
}

.main-navigation ul li a {
    color: #fff !important;
    text-decoration: none !important;
    font-weight: bold;
    font-size: 0.85rem;
    padding: 6px 8px;
    display: block;
    transition: color 0.2s ease;
}

.main-navigation ul li a:hover {
    color: var(--accent-color, #3498db) !important;
}

.main-navigation ul li ul {
    display: none; 
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--header-bg, #2c3e50);
    padding: 10px 0;
    margin: 0;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    z-index: 999;
    min-width: 220px;
    list-style: none;
}

.main-navigation ul li ul li {
    width: 100%;
    display: block;
}

.main-navigation ul li ul li a {
    padding: 8px 15px;
    font-size: 0.85rem;
    font-weight: normal;
    display: block;
    color: #bdc3c7 !important;
    white-space: nowrap;
}

.main-navigation ul li ul li a:hover {
    background-color: #34495e;
    color: #fff !important;
}

.main-navigation ul li:hover > ul {
    display: block;
}

/* --- 4. ZENTRALES LAYOUT-SYSTEM --- */
.site-content-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    max-width: 1450px;
    width: 95%;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box;
}

.main-content {
    flex: 1 1 auto;
    max-width: calc(100% - 350px);
    min-width: 320px;
    box-sizing: border-box;
}

.main-content article {
    background: #ffffff;
    padding: 25px;
    margin-bottom: 25px;
    border: 1px solid #e2e8f0;
    border-radius: 12px !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
    width: 100%;
    box-sizing: border-box;
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.main-content article:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.main-content h1, 
.main-content h2, 
.main-content h3 {
    color: #1e293b;
    letter-spacing: -0.02em;
}

.main-content h2 a {
    color: #1e293b !important;
    text-decoration: none;
    transition: color 0.2s;
}

.main-content h2 a:hover {
    color: var(--accent-color, #3498db) !important;
}

.entry-meta, .post-date, .byline {
    font-size: 0.85rem;
    color: #64748b;
    margin-bottom: 12px;
    display: inline-block;
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 20px;
}

/* Sidebar & Widgets */
#main-sidebar,
.main-sidebar,
.sidebar,
.site-content-layout > aside {
    width: 300px;
    flex: 0 0 300px;
    box-sizing: border-box;
    margin-left: auto;
    background: transparent;
    padding: 0;
    box-shadow: none;
}

.widget {
    background: #ffffff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px !important;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}

.widget h3,
.widget .widget-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #1e293b;
    border-bottom: 2px solid var(--accent-color, #3498db);
    padding-bottom: 10px;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    color: #475569 !important;
    font-weight: 500;
    transition: color 0.2s ease, padding-left 0.2s ease;
}

.widget ul li a:hover {
    color: var(--accent-color, #3498db) !important;
    padding-left: 5px;
    text-decoration: underline !important;
}

/* --- 5. BUTTONS & PAGINATION --- */
.entry-content p a.more-link,
.main-content .more-link,
a.more-link {
    display: inline-block;
    background-color: var(--accent-color, #3498db) !important;
    color: #ffffff !important;
    border: none !important;
    padding: 10px 20px !important;
    margin-top: 15px;
    border-radius: 8px !important;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none !important;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
    transition: all 0.2s ease;
}

.entry-content p a.more-link:hover,
.main-content .more-link:hover,
a.more-link:hover {
    background-color: var(--accent-hover-color, #2980b9) !important;
    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(52, 152, 219, 0.4);
}

a.more-link:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.pagination, .navigation.posts-navigation {
    margin-top: 30px;
    text-align: center;
}

.page-numbers {
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 8px 14px;
    margin: 0 3px;
    border-radius: 6px;
    color: #1e293b !important;
    font-weight: 600;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

a.page-numbers:hover, 
.page-numbers.current {
    background-color: var(--accent-color, #3498db) !important;
    color: #ffffff !important;
    border-color: var(--accent-color, #3498db);
    border-radius: 3px;
}

/* --- 6. LIGHTHOUSE KONTRAST-OPTIMIERUNG --- */
.entry-content a, 
.main-content a {
    color: var(--accent-color, #3498db);
    text-decoration: underline;
}

.entry-content a:hover, 
.main-content a:hover {
    color: var(--accent-hover-color, #2980b9);
    text-decoration: none;
}

/* --- 7. BACK TO TOP BUTTON --- */
#backToTopBtn {
    position: fixed !important;
    bottom: 30px !important;
    right: 30px !important;
    z-index: 2147483647 !important;
    background-color: var(--accent-color, #3498db) !important;
    color: #ffffff !important;
    width: 48px !important;
    height: 48px !important;
    border-radius: 50% !important;
    border: none !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    text-decoration: none !important;
    font-size: 22px !important;
    font-weight: bold !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
    cursor: pointer !important;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

#backToTopBtn:hover {
    background-color: #ffffff !important;
    color: #000000 !important;
    transform: translateY(-4px) !important;
}

/* Feedback-Box Anpassungen */
.zelx-feedback-box button {
    font-size: 16px !important;
}
.zelx-feedback-box img, 
.zelx-feedback-box svg {
    max-width: 24px !important;
    max-height: 24px !important;
}

/* --- 8. RESPONSIVE DESIGN & MEDIA QUERIES --- */
@media (max-width: 1024px) {
    .site-content-layout {
        flex-direction: column;
        margin: 20px auto;
    }
    .main-content {
        max-width: 100%;
        width: 100%;
        margin-bottom: 40px;
    }
    #main-sidebar,
    .sidebar,
    .site-content-layout > aside {
        width: 100%;
        flex: none;
    }
}

@media (max-width: 900px) {
    header .container {
        flex-direction: column;
        gap: 15px;
        align-items: center;
    }
    .main-navigation {
        max-width: 100%;
        width: 100%;
    }
    .main-navigation ul {
        justify-content: center;
        flex-wrap: wrap;
    }
}

@media (max-width: 768px) {
    .main-navigation ul li ul {
        position: static;
        transform: none;
        min-width: 100%;
    }
}

/* Mobiles Burger-Menü (max-width: 1150px) */
@media screen and (max-width: 1150px) {
    .main-navigation, .desktop-menu {
        display: none !important;
    }

    header {
        padding: 5px 0 !important;
        margin-bottom: 15px !important;
    }

    .site-header .container,
    .site-header .header-container {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        position: relative;
        padding: 5px 10px !important;
    }

    .site-branding {
        margin-right: auto !important;
    }

    .site-branding img,
    .custom-logo {
        max-height: 35px !important;
        width: auto !important;
        display: block;
    }

    .zelx-burger-btn {
        background: #1e293b;
        border: 1px solid #334155;
        color: #ffcc00;
        padding: 6px 10px;
        border-radius: 8px;
        font-size: 16px;
        line-height: 1;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-left: auto;
    }

    .zelx-mobile-menu {
        display: none;
        background: #0f172a;
        border: 3px solid #ffcc00;
        border-radius: 12px;
        padding: 15px;
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        width: auto;
        z-index: 2147483647;
        box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.6);
        max-height: 70vh;
        overflow-y: auto;
    }

    .zelx-mobile-menu.is-open {
        display: block;
    }

    .zelx-mobile-menu ul {
        list-style: none;
        margin: 0;
        padding: 0;
        background: #0f172a !important;
    }

    .zelx-mobile-menu ul li {
        border-bottom: 1px solid #1e293b;
        background: #0f172a !important;
    }

    .zelx-mobile-menu ul li:last-child {
        border-bottom: none;
    }

    .zelx-mobile-menu ul li a {
        display: block;
        padding: 12px 15px;
        color: #ffffff !important;
        background: transparent !important;
        text-decoration: none;
        font-size: 14px;
        font-weight: 600;
        transition: background 0.2s, color 0.2s;
    }

    .zelx-mobile-menu ul li a:hover {
        background: #1e293b;
        color: #ffcc00 !important;
    }

    .zelx-mobile-menu ul.sub-menu {
        display: none;
        padding-left: 15px;
        background: rgba(15, 23, 42, 0.9) !important;
        border-left: 2px solid #ffcc00;
        margin-top: 5px;
    }

    .zelx-mobile-menu ul.sub-menu li a {
        font-size: 13px;
        color: #94a3b8 !important;
        padding: 10px 12px;
    }

    .zelx-mobile-menu ul.sub-menu li a:hover {
        color: #ffcc00 !important;
        background: #1e293b;
    }

    .zelx-mobile-menu .menu-item-has-children > a::after {
        content: " ▼";
        font-size: 10px;
        float: right;
        transition: transform 0.2s;
        color: #ffcc00;
    }

    .zelx-mobile-menu .menu-item-has-children.sub-menu-open > a::after {
        transform: rotate(180deg);
    }
}

@media screen and (min-width: 1151px) {
    .zelx-burger-btn, .zelx-mobile-menu {
        display: none !important;
    }

    .post-thumbnail img,
    .main-content img,
    .attachment-large,
    .attachment-medium,
    .attachment-full {
        max-width: 70% !important;
        height: auto !important;
        display: block;
        margin: 20px auto;
    }
}