/* The Pragmatic Engineer - Blog Clone Styles */
:root {
    --bg: #ffffff;
    --text: #15171a;
    --text-secondary: #6b7280;
    --border: #e5e7eb;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --surface: #f9fafb;
    --code-bg: #f3f4f6;
}

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

html { scroll-behavior: smooth; }

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; height: auto; }

/* Header */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.site-logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav a {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.site-nav a:hover { color: var(--text); }

.nav-subscribe {
    background: var(--text);
    color: var(--bg) !important;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

.nav-subscribe:hover { opacity: 0.9; }

/* Hero */
.hero {
    padding: 80px 24px 60px;
    text-align: center;
    border-bottom: 1px solid var(--border);
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto 24px;
}

.hero-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
}

.hero-links a {
    color: var(--text-secondary);
    font-size: 14px;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px;
}

/* Featured Article */
.featured-article {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
    padding-bottom: 60px;
    border-bottom: 1px solid var(--border);
}

.featured-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 8px;
    background: var(--surface);
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.featured-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.featured-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 12px;
}

.featured-content h2 {
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.featured-content h2 a { color: var(--text); }
.featured-content h2 a:hover { color: var(--accent); }

.featured-content p {
    color: var(--text-secondary);
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 16px;
}

.featured-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Article Grid */
.articles-section h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.01em;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
    margin-bottom: 40px;
}

.article-card {
    display: flex;
    flex-direction: column;
}

.article-card-image {
    aspect-ratio: 16/10;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 12px;
    background: var(--surface);
}

.article-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-card h3 {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

.article-card h3 a { color: var(--text); }
.article-card h3 a:hover { color: var(--accent); }

.article-card p {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.article-card-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Article List */
.article-list {
    border-top: 1px solid var(--border);
}

.article-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 0;
    border-bottom: 1px solid var(--border);
}

.article-list-item h3 {
    font-size: 16px;
    font-weight: 500;
    flex: 1;
}

.article-list-item h3 a { color: var(--text); }
.article-list-item h3 a:hover { color: var(--accent); }

.article-list-meta {
    font-size: 13px;
    color: var(--text-secondary);
    white-space: nowrap;
    margin-left: 24px;
}

/* Article Page */
.article-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 24px;
}

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

.article-header h1 {
    font-size: 40px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: -0.02em;
    margin-bottom: 16px;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.article-meta img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.article-feature-image {
    width: calc(100% + 120px);
    margin-left: -60px;
    margin-bottom: 40px;
    border-radius: 8px;
    overflow: hidden;
}

.article-feature-image img {
    width: 100%;
    display: block;
}

/* Article Content */
.article-content {
    font-size: 18px;
    line-height: 1.8;
    color: #374151;
}

.article-content h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 48px 0 16px;
    letter-spacing: -0.01em;
}

.article-content h3 {
    font-size: 22px;
    font-weight: 600;
    margin: 36px 0 12px;
}

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

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

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

.article-content img {
    border-radius: 6px;
    margin: 24px 0;
}

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

.article-content pre {
    background: var(--code-bg);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
    font-size: 14px;
    line-height: 1.5;
}

.article-content code {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

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

.article-content ul, .article-content ol {
    margin: 24px 0;
    padding-left: 24px;
}

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

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

.article-content figure {
    margin: 32px 0;
}

.article-content figcaption {
    text-align: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 8px;
}

/* Tags */
.article-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.tag {
    display: inline-block;
    padding: 4px 12px;
    background: var(--surface);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 40px 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 16px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
}

.pagination a, .pagination span {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
}

.pagination a {
    background: var(--surface);
    color: var(--text);
}

.pagination a:hover { background: var(--border); }

.pagination .current {
    background: var(--text);
    color: var(--bg);
}

/* Mobile */
@media (max-width: 768px) {
    .hero h1 { font-size: 32px; }
    .featured-article { grid-template-columns: 1fr; gap: 24px; }
    .articles-grid { grid-template-columns: 1fr; }
    .article-header h1 { font-size: 28px; }
    .article-feature-image {
        width: 100%;
        margin-left: 0;
    }
    .site-nav { gap: 12px; }
    .site-nav a { font-size: 12px; }
}
