/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #ffffff;
    --text: #1a1a1a;
    --text-light: #666666;
    --accent: #0066cc;
    --border: #e0e0e0;
    --code-bg: #f5f5f5;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
}

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

/* Header */
header {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    margin-bottom: 40px;
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 30px;
}

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

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

/* Home page */
.intro {
    margin-bottom: 50px;
}

.intro h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    line-height: 1.2;
}

.intro p {
    font-size: 1.25rem;
    color: var(--text-light);
}

/* Article previews */
.articles {
    display: flex;
    flex-direction: column;
    gap: 40px;
    margin-bottom: 50px;
}

.article-preview {
    border-bottom: 1px solid var(--border);
    padding-bottom: 40px;
}

.article-preview time {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 10px;
}

.article-preview h2 {
    font-size: 1.75rem;
    margin-bottom: 10px;
    line-height: 1.3;
}

.article-preview h2 a {
    color: var(--text);
    text-decoration: none;
}

.article-preview h2 a:hover {
    color: var(--accent);
}

.article-preview .excerpt {
    color: var(--text-light);
    margin-bottom: 15px;
    line-height: 1.7;
}

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

.read-more:hover {
    text-decoration: underline;
}

/* Article page */
.article {
    margin-bottom: 80px;
}

.article-header {
    margin-bottom: 40px;
}

.article-header time {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
    margin-bottom: 15px;
}

.article-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
}

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

.article-content h2 {
    font-size: 1.8rem;
    margin-top: 50px;
    margin-bottom: 20px;
    line-height: 1.3;
}

.article-content h3 {
    font-size: 1.4rem;
    margin-top: 40px;
    margin-bottom: 15px;
}

.article-content h4 {
    font-size: 1.2rem;
    margin-top: 30px;
    margin-bottom: 10px;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content ul,
.article-content ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.article-content li {
    margin-bottom: 8px;
}

.article-content strong {
    font-weight: 600;
}

.article-content em {
    font-style: italic;
}

.article-content a {
    color: var(--accent);
    text-decoration: none;
}

.article-content a:hover {
    text-decoration: underline;
}

.article-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 3px;
    font-family: "SF Mono", Monaco, Consolas, monospace;
    font-size: 0.9em;
}

.article-content pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 20px;
}

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

.article-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 20px;
    margin: 30px 0;
    color: var(--text-light);
    font-style: italic;
}

.article-content hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 50px 0;
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95rem;
}

.article-content table th,
.article-content table td {
    border: 1px solid var(--border);
    padding: 12px;
    text-align: left;
}

.article-content table th {
    background: var(--code-bg);
    font-weight: 600;
}

.article-footer {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid var(--border);
}

.back-link {
    color: var(--text-light);
    text-decoration: none;
}

.back-link:hover {
    color: var(--accent);
}

/* Ad placeholders */
.ad-placeholder {
    background: var(--code-bg);
    border: 2px dashed var(--border);
    padding: 40px;
    text-align: center;
    margin: 40px 0;
    color: var(--text-light);
    font-size: 0.9rem;
    border-radius: 5px;
}

.ad-placeholder[data-ad="leaderboard-top"],
.ad-placeholder[data-ad="leaderboard-bottom"] {
    min-height: 90px;
}

.ad-placeholder[data-ad="article-top"],
.ad-placeholder[data-ad="article-bottom"] {
    min-height: 250px;
}

/* Footer */
footer {
    border-top: 1px solid var(--border);
    padding: 40px 0;
    margin-top: 80px;
    text-align: center;
    color: var(--text-light);
    font-size: 0.9rem;
}

footer p {
    margin-bottom: 5px;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .intro h1 {
        font-size: 2rem;
    }
    
    .intro p {
        font-size: 1.1rem;
    }
    
    .article-header h1 {
        font-size: 2rem;
    }
    
    .article-content h2 {
        font-size: 1.5rem;
    }
    
    .article-content {
        font-size: 1rem;
    }
    
    .nav-links {
        gap: 20px;
    }
    
    .article-content table {
        font-size: 0.85rem;
    }
    
    .article-content table th,
    .article-content table td {
        padding: 8px;
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem;
    }
    
    .nav-links {
        gap: 15px;
        font-size: 0.9rem;
    }
    
    .intro h1 {
        font-size: 1.75rem;
    }
    
    .article-content table {
        display: block;
        overflow-x: auto;
    }
}
