:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --accent-color: #007bff;
    --header-bg: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #eeeeee;
    --secondary-text: #666666;
    --ad-bg: #f0f0f0;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --accent-color: #375a7f;
    --header-bg: #1e1e1e;
    --card-bg: #1e1e1e;
    --border-color: #333333;
    --secondary-text: #aaaaaa;
    --ad-bg: #2a2a2a;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s, color 0.3s;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-color);
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
}

nav a.active {
    color: var(--accent-color);
}

/* Ad Slots */
.ad-slot {
    margin: 2rem 0;
    background-color: var(--ad-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed var(--secondary-text);
    border-radius: 4px;
}

.ad-placeholder {
    padding: 2rem;
    color: var(--secondary-text);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.top-ad { height: 100px; }
.mid-ad { height: 250px; }
.sidebar-ad { height: 600px; width: 100%; }

/* Main Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 2rem;
    margin-top: 2rem;
}

/* Post Cards */
.post-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 2rem;
    overflow: hidden;
    transition: transform 0.2s;
}

.post-card:hover {
    transform: translateY(-5px);
}

.post-img {
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--secondary-text);
}

.post-content {
    padding: 1.5rem;
}

.category {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.8rem;
    margin-bottom: 0.8rem;
}

.post-content h2 {
    margin-bottom: 1rem;
    font-size: 1.8rem;
}

.post-content p {
    color: var(--secondary-text);
    margin-bottom: 1.2rem;
}

.read-more {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: bold;
}

/* Sidebar */
.sidebar-widget {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.sidebar-widget h3 {
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--accent-color);
    display: inline-block;
}

.popular-list {
    list-style: none;
}

.popular-list li {
    margin-bottom: 0.8rem;
}

.popular-list a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.95rem;
}

.popular-list a:hover {
    color: var(--accent-color);
}

#newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

#newsletter-form input {
    padding: 0.6rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
}

#newsletter-form button {
    padding: 0.6rem;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Footer */
footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    margin-top: 4rem;
    text-align: center;
}

.footer-content p {
    margin-bottom: 1rem;
    color: var(--secondary-text);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    text-decoration: none;
    color: var(--secondary-text);
    font-size: 0.9rem;
}

/* Theme Switch */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}

.theme-switch {
    display: inline-block;
    height: 24px;
    position: relative;
    width: 48px;
}

.theme-switch input { display: none; }

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    background-color: #fff;
    bottom: 3px;
    content: "";
    height: 18px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 18px;
    border-radius: 50%;
}

input:checked + .slider { background-color: var(--accent-color); }
input:checked + .slider:before { transform: translateX(22px); }

/* Responsive */
@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .sidebar {
        order: 2;
    }
    
    .posts-section {
        order: 1;
    }

    .top-ad { height: 60px; }
}
