:root {
    --bg-color: #f4f4f9;
    --text-color: #333;
    --header-bg: #fff;
    --card-bg: #fff;
    --primary-color: #007bff;
    --accent-color: #ff4757;
    --border-color: #ddd;
    --ad-bg: #e0e0e0;
    --nav-text: #555;
    --nav-active: #007bff;
}

body.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --primary-color: #4dabf7;
    --accent-color: #ff6b6b;
    --border-color: #333;
    --ad-bg: #333;
    --nav-text: #ccc;
    --nav-active: #4dabf7;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Header */
.site-header {
    background-color: var(--header-bg);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
    margin-left: 1.5rem; /* Indent logo and text */
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.main-nav {
    display: flex;
}

.main-nav ul {
    list-style: none;
    display: flex;
    align-items: center;
}

.main-nav li {
    padding: 0 1rem;
    border-right: 1px solid var(--border-color);
    line-height: 1; /* Helps center the divider vertically relative to text */
}

.main-nav li:last-child {
    border-right: none;
    padding-right: 0;
}

.main-nav li:first-child {
    padding-left: 0;
}

.main-nav a {
    text-decoration: none;
    color: var(--nav-text);
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.main-nav a:hover,
.main-nav a.active {
    color: var(--nav-active);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background-color 0.2s;
}

.theme-toggle:hover {
    background-color: var(--ad-bg);
}

/* Layout */
.layout-wrapper {
    display: flex;
    justify-content: center;
    max-width: 100%;
    margin-top: 2rem;
    padding: 0 1rem; /* minimal padding on small screens */
}

.main-content {
    flex: 0 1 800px; /* Grow 0, Shrink 1, Basis 800px */
    margin: 0 1rem;
    max-width: 800px;
    width: 100%;
}

.ad-space {
    flex: 0 0 200px; /* Fixed width for ads */
    display: none; /* Hidden on mobile by default */
}

.ad-placeholder {
    background-color: var(--ad-bg);
    color: var(--nav-text);
    height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border-radius: 8px;
    position: sticky;
    top: 100px;
}

@media (min-width: 1250px) {
    .ad-space {
        display: block;
    }
}

/* Articles */
.article-card {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.article-card:hover {
    transform: translateY(-2px);
}

.article-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: inline-block;
}

.article-title {
    font-family: 'Merriweather', serif;
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    color: var(--text-color);
}

.article-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--nav-text);
    margin-bottom: 1rem;
}

.read-more {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.9rem;
}

.article-image {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.article-source {
    font-size: 0.85rem;
    color: var(--nav-text);
    margin-top: 1rem;
}

.article-source a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-container {
        padding: 0.75rem 1rem;
        justify-content: flex-start; /* Align items to start, we push logo left */
    }

    .logo {
        margin-right: auto; /* Pushes other items (toggle, menu) to the right */
    }

    .theme-toggle {
        margin-right: 0.5rem; /* Space between toggle and burger */
    }

    .mobile-menu-btn {
        display: block;
    }


    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: var(--header-bg);
        border-top: 1px solid var(--border-color);
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    .main-nav.open {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
    }

    .main-nav li {
        padding: 0;
        border-right: none;
    }

    .layout-wrapper {
        margin-top: 1rem;
    }
    
    .article-title {
        font-size: 1.25rem;
    }
}

/* Footer */
.site-footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2rem 1rem;
    width: 100%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--nav-text);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--nav-active);
}

.footer-copyright {
    color: var(--nav-text);
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Text Page Formatting (Privacy, Imprint, Terms) */
.text-page {
    line-height: 1.6;
}

.text-page h1 {
    font-size: 2.2rem;
    margin-bottom: 2rem;
    color: var(--text-color);
}

.text-page h2 {
    font-size: 1.75rem;
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
}

.text-page h3 {
    font-size: 1.4rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.text-page h4 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: var(--text-color);
}

.text-page p {
    margin-bottom: 1rem;
    color: var(--text-color);
}

.text-page ul {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.text-page li {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.text-page a {
    color: var(--primary-color);
    text-decoration: underline;
}

.text-page a:hover {
    text-decoration: none;
}

/* Cookie Banner */
#cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 2000;
    display: none; /* Hidden by default */
    border: 1px solid var(--border-color);
    flex-direction: column;
    gap: 1rem;
}

#cookie-banner.show {
    display: flex;
}

.cookie-content h3 {
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.cookie-content p {
    font-size: 0.9rem;
    color: var(--nav-text);
    line-height: 1.5;
}

.cookie-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    justify-content: flex-end;
}

.cookie-btn {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: opacity 0.2s;
}

.cookie-btn.accept {
    background-color: var(--primary-color);
    color: #fff;
}

.cookie-btn.reject {
    background-color: transparent;
    border: 1px solid var(--border-color);
    color: var(--nav-text);
}

.cookie-btn:hover {
    opacity: 0.9;
}

#cookie-settings-link {
    cursor: pointer;
}