:root {
    /* Light theme variables */
    --primary-color: #3490dc;
    --secondary-color: #2779bd;
    --text-color: #333;
    --light-text-color: #666;
    --lightest-text-color: #999;
    --background-color: #fff;
    --light-background: #f8f9fa;
    --border-color: #eaeaea;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

[data-theme="dark"] {
    /* Dark theme variables */
    --primary-color: #58a6e6;
    --secondary-color: #79b8e8;
    --text-color: #e4e4e4;
    --light-text-color: #b0b0b0;
    --lightest-text-color: #888888;
    --background-color: #121212;
    --light-background: #1e1e1e;
    --border-color: #333333;
}

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

html {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease;
}

body {
    font-family: var(--font-sans);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
    font-size: 22px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

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

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

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

code {
    font-family: var(--font-mono);
    background-color: var(--light-background);
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}

pre {
    background-color: var(--light-background);
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin: 1.5rem 0;
}

pre code {
    background-color: transparent;
    padding: 0;
}

blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0;
    color: var(--light-text-color);
}

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

.content {
    padding: 1rem 0 2rem 0;
}

/* Header */
.site-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

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

.site-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.nav-link {
    color: var(--text-color);
    font-weight: 500;
}

.nav-link.active {
    color: var(--primary-color);
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--text-color);
    margin: 5px 0;
    border-radius: 3px;
}

/* Post List */
.list-header {
    margin-bottom: 2rem;
}

.list-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.list-description {
    color: var(--light-text-color);
}

.post-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.post-item {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background-color: var(--light-background);
    margin: 0 auto;
    width: 100%;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    border-color: var(--primary-color);
}

.post-item-header {
    padding: 2rem 2.5rem 1rem;
}

.post-item-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.post-item-meta {
    font-size: 1.0rem;
    color: var(--light-text-color);
    margin-bottom: 0.25rem;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.post-item-meta time,
.post-item-meta .reading-time {
    display: inline-block;
}

.post-item-summary {
    padding: 0.25rem 2.5rem 1.5rem;
    flex-grow: 1;
    line-height: 1.7;
    font-size: 1.2rem;
}

.post-item-footer {
    padding: 1rem 2.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

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

.post-item-tags .tag {
    font-size: 0.8rem;
    color: var(--primary-color);
    background-color: rgba(52, 144, 220, 0.1);
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    transition: all 0.2s ease;
}

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

/* Single Post */
.post {
    max-width: 100%;
    width: 100%;
    margin: 2rem auto 0 auto;
    background-color: var(--light-background);
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

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

.post-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.post-meta {
    font-size: 1.05rem;
    color: var(--light-text-color);
    margin-bottom: 1rem;
}

.post-meta span {
    margin-right: 1rem;
}

.post-meta span:last-child {
    margin-right: 0;
}

.view-count {
    display: inline-flex;
    align-items: center;
    color: var(--light-text-color);
}

.view-count-icon {
    margin-right: 0.25rem;
    font-size: 0.9em;
}

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin: 1rem 0;
}

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

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
}

.post-content p,
.post-content ul,
.post-content ol {
    margin-bottom: 2rem;
}

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

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

.post-content ul li {
    list-style-type: disc;
}

.post-content ol li {
    list-style-type: decimal;
}

/* Nested lists */
.post-content ul ul,
.post-content ol ul {
    list-style-type: circle;
    margin-top: 0.75rem;
}

.post-content ul ol,
.post-content.ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.75rem;
}

.post-content img {
    max-width: 100%;
    display: block;
    margin: 2rem auto;
    border-radius: 5px;
}

.post-content a {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.post-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem 2rem 1.5rem 2rem;
    background-color: var(--background-color);
    border-left: 5px solid var(--primary-color);
    font-style: italic;
}

.post-footer {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    justify-content: space-between;
}

.post-nav-next,
.post-nav-prev {
    flex: 0 0 45%;
    background-color: var(--background-color);
    padding: 1.5rem;
    border-radius: 5px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-nav-next:hover,
.post-nav-prev:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Footer */
.site-footer {
    margin-top: 2rem;
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
    color: var(--light-text-color);
    font-size: 0.875rem;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-social {
    display: flex;
    gap: 1rem;
}

.footer-social a {
    color: var(--light-text-color);
}

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

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

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin: 2rem 0;
}

.page-item {
    display: inline-block;
}

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background-color: var(--background-color);
    color: var(--text-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
}

.page-item.disabled .page-link {
    color: var(--lightest-text-color);
    cursor: not-allowed;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    padding: 0;
    margin: 0;
    transition: background-color 0.2s ease;
    position: relative;
}

.theme-toggle:hover {
    background-color: var(--light-background);
}

.theme-toggle .sun-icon {
    display: none;
    transition: opacity 0.2s ease;
}

.theme-toggle .moon-icon {
    display: block;
    transition: opacity 0.2s ease;
}

[data-theme="dark"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="dark"] .theme-toggle .moon-icon {
    display: none;
}

/* Add transition properties to elements that change with theme */
pre, code, blockquote, .site-header, .site-footer, .post-card, 
.post-meta, .tag, .pagination a, .site-nav, button {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Featured Posts Styling */
.featured-posts {
    margin-bottom: 3rem;
}

/* Homepage Sections */
.home-page .featured-posts,
.home-page .recent-posts,
.home-page .categories-section {
    margin-bottom: 4rem;
    width: 100%;
}

.featured-posts h2, 
.recent-posts h2,
.categories-section h2 {
    margin-bottom: 2rem;
}

/* No Posts Message */
.no-posts-message {
    text-align: center;
    padding: 2rem;
    background-color: var(--light-background);
    border-radius: 8px;
    color: var(--light-text-color);
    font-style: italic;
    width: 100%;
}

/* Media Queries for Responsive Design */
@media (max-width: 768px) {
    .site-header {
        flex-wrap: wrap;
    }
    
    .site-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 1rem;
        margin-top: 1rem;
        padding: 1rem 0;
        border-top: 1px solid var(--border-color);
    }
    
    .site-nav.active {
        display: flex;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    /* Mobile padding adjustments */
    .post {
        padding: 2rem 1.5rem;
    }
    
    .post-item-header {
        padding: 1.5rem 1.5rem 0.5rem;
    }
    
    .post-item-summary {
        padding: 0.25rem 1.5rem;
        line-height: 1.6;
    }
    
    .post-item-footer {
        padding: 0.75rem 1.5rem 1.5rem;
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .theme-toggle {
        margin-top: 0.5rem;
    }
}