:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --text: #1f2937;
    --text-light: #6b7280;
    --bg: #ffffff;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* Header */
.header {
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: -0.025em;
    transition: color 0.2s ease;
}

.logo:hover {
    color: var(--primary-dark);
}

/* Main Layout */
.main-layout {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    padding: 2rem 0;
    min-height: calc(100vh - 120px);
}

/* Sidebar */
.sidebar {
    background: var(--bg-light);
    border-radius: 12px;
    padding: 1.5rem;
    height: fit-content;
    position: sticky;
    top: 120px;
    box-shadow: var(--shadow);
}

.sidebar h3 {
    color: var(--primary);
    margin-bottom: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.ad-placeholder {
    background: #f3f4f6;
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    color: var(--text-light);
    margin-bottom: 2rem;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: border-color 0.2s ease;
}

.ad-placeholder:hover {
    border-color: #9ca3af;
}

/* Widgets */
.widget {
    margin-bottom: 2rem;
}

.recent-posts {
    list-style: none;
}

.recent-posts li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.recent-posts li:last-child {
    border-bottom: none;
}

.recent-posts a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    flex: 1;
    margin-right: 0.5rem;
}

.recent-posts a:hover {
    color: var(--primary);
}

.recent-posts small {
    color: var(--text-light);
    font-size: 0.8rem;
    white-space: nowrap;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: var(--primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.tag:hover {
    background: var(--primary-dark);
}

/* Content Area */
.content {
    background: var(--bg);
}

.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.1;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto;
}

/* Articles */
.articles-grid {
    display: grid;
    gap: 2rem;
}

.article-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
}

.article-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px 0 rgba(0, 0, 0, 0.1);
}

.article-card-title {
    margin-bottom: 0.5rem;
}

.article-card-title a {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
    font-size: 1.5rem;
    line-height: 1.3;
}

.article-card-title a:hover {
    color: var(--primary);
}

.article-card-meta {
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.article-card-excerpt {
    color: var(--text-light);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.article-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.article-card-tags .tag {
    background: var(--bg-light);
    color: var(--primary);
    border: 1px solid var(--border);
}

/* Single Article */
.article {
    max-width: 800px;
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.article-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.article-meta {
    display: flex;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    align-items: center;
}

.article-excerpt {
    font-size: 1.2rem;
    color: var(--text-light);
    font-weight: 400;
    line-height: 1.5;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h2 {
    font-size: 1.8rem;
    margin: 2.5rem 0 1rem 0;
    color: var(--text);
    font-weight: 700;
}

.article-content h3 {
    font-size: 1.4rem;
    margin: 2rem 0 1rem 0;
    color: var(--text);
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.article-content ul, .article-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.article-content li {
    margin-bottom: 0.5rem;
}

.article-content a {
    color: var(--primary);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
}

.article-content a:hover {
    color: var(--primary-dark);
}

.article-content code {
    background: var(--bg-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    border: 1px solid var(--border);
}

.article-content pre {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--border);
}

.article-content pre code {
    background: none;
    padding: 0;
    border: none;
}

.article-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--text-light);
}

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

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

/* Responsive Design */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem 0;
    }
    
    .sidebar {
        order: 2;
        position: static;
        top: auto;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .article-title {
        font-size: 2rem;
    }
    
    .container {
        padding: 0 0.5rem;
    }
}

/* Performance optimizations */
img {
    max-width: 100%;
    height: auto;
    loading: lazy;
}

.ad-space {
    min-height: 250px;
    background: transparent;
    contain: layout style paint;
}

/* Core Web Vitals optimizations */
.header {
    will-change: transform;
    contain: layout style paint;
}

.article-card {
    contain: layout style paint;
}