/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --bg-color: #f3f4f6;
    --card-bg: #ffffff;
    --border-color: #e5e7eb;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --radius: 8px;
}

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

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.2s;
}

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

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

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.site-branding {
    display: flex;
    flex-direction: column;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-color);
}

.site-title:hover {
    color: var(--primary-color);
}

.site-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.nav-menu li a {
    display: block;
    padding: 0.5rem 1rem;
    border-radius: var(--radius);
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.2s;
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: var(--primary-color);
    color: white;
}

/* Main Layout */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2rem;
}

.content-area {
    min-width: 0;
}

/* Page Headers */
.page-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.page-description {
    color: var(--text-muted);
}

/* Post Cards */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.post-card-content {
    padding: 1.5rem;
}

.post-header {
    margin-bottom: 1rem;
}

.post-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.post-title a {
    color: var(--text-color);
}

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

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.meta-icon {
    margin-right: 0.25rem;
}

.post-excerpt {
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.7;
}

.post-footer {
    margin-bottom: 1rem;
}

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

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-color);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: all 0.2s;
}

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

.read-more {
    display: inline-block;
    font-weight: 500;
    font-size: 0.875rem;
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sidebar-widget {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.widget-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.widget-icon {
    font-size: 1.1rem;
}

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

.category-list li {
    border-bottom: 1px solid var(--border-color);
}

.category-list li:last-child {
    border-bottom: none;
}

.category-list a {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: var(--text-color);
    transition: all 0.2s;
}

.category-list a:hover {
    color: var(--primary-color);
    padding-left: 0.5rem;
}

.category-list .count {
    color: var(--text-muted);
    font-size: 0.875rem;
}

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

/* Single Post */
.single-post {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.single-post .post-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.single-post .post-title {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.post-content {
    font-size: 1.0625rem;
    line-height: 1.8;
}

.post-content h2 {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
}

.post-content h3 {
    font-size: 1.25rem;
    margin: 1.5rem 0 0.75rem;
}

.post-content p {
    margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

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

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

.post-content code {
    background: var(--bg-color);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.post-content pre {
    background: #1f2937;
    color: #f9fafb;
    padding: 1rem;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.post-tags-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-tags-footer h4 {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    color: var(--text-muted);
}

.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.post-navigation a {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: var(--radius);
    color: var(--text-color);
    transition: all 0.2s;
}

.post-navigation a:hover {
    background: var(--primary-color);
    color: white;
}

.post-navigation .nav-next {
    text-align: right;
}

.post-navigation span {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.post-navigation a:hover span {
    color: rgba(255, 255, 255, 0.8);
}

/* Taxonomy Pages */
.taxonomy-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.taxonomy-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--text-color);
    transition: all 0.2s;
}

.taxonomy-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    background: var(--primary-color);
    color: white;
}

.taxonomy-count {
    background: var(--bg-color);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
}

.taxonomy-item:hover .taxonomy-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.pagination a {
    padding: 0.75rem 1.25rem;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination-info {
    color: var(--text-muted);
}

/* Footer */
.site-footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: 3rem;
    padding: 2rem;
    text-align: center;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.footer-container p {
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 900px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .sidebar {
        order: -1;
    }

    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .nav-menu {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .main-container {
        padding: 1rem;
    }

    .post-card-content {
        padding: 1rem;
    }

    .single-post {
        padding: 1rem;
    }

    .post-navigation {
        grid-template-columns: 1fr;
    }

    .taxonomy-list {
        grid-template-columns: 1fr;
    }
}
