/* ============================================
   Professional Programming Blog Styles
   ============================================ */

/* ===== CSS Variables ===== */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --primary-light: #eff6ff;
    --secondary-color: #10b981;
    --text-primary: #111827;
    --text-secondary: #4b5563;
    --text-light: #9ca3af;
    --bg-primary: #ffffff;
    --bg-secondary: #f3f4f6;
    --bg-tertiary: #e5e7eb;
    --border-color: #e5e7eb;
    --code-bg: #1e293b;
    --code-text: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 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);
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===== AdSense Containers ===== */
.adsense-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow: hidden;
    min-height: 100px;
    border: 1px dashed var(--border-color);
}

.adsense-header { margin: 1rem 0; }
.adsense-footer { margin: 2rem 0 0; }
.adsense-sidebar { margin-bottom: 2rem; }
.adsense-in_article { margin: 2.5rem 0; }

/* ===== Breadcrumbs ===== */
.breadcrumbs {
    margin-bottom: 2rem;
    font-size: 0.875rem;
}

.breadcrumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0;
    margin: 0;
    color: var(--text-light);
}

.breadcrumbs li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.breadcrumbs li:not(:last-child)::after {
    content: '/';
    color: var(--text-light);
}

.breadcrumbs a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}

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

.breadcrumbs li[aria-current="page"] {
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Footer Extensions ===== */
.footer-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: flex-start;
    }
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
}

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

/* ===== Static Pages ===== */
.page-article {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    width: 100%;
    margin: 0 auto;
}

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

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--bg-secondary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ===== Navigation ===== */
.main-nav {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

.main-nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
}

.nav-brand .site-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    position: relative;
    width: 40px;
    height: 40px;
    z-index: 1001;
}

.hamburger {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    left: 0;
    transition: var(--transition);
}

.hamburger::before { top: -8px; }
.hamburger::after { bottom: -8px; }

.nav-toggle.open .hamburger {
    background: transparent;
}

.nav-toggle.open .hamburger::before {
    top: 0;
    transform: rotate(45deg);
}

.nav-toggle.open .hamburger::after {
    top: 0;
    transform: rotate(-45deg);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.nav-links a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}

.rss-link svg {
    width: 16px;
    height: 16px;
}

/* ===== Site Header ===== */
.site-header {
    margin-bottom: 2rem;
}

/* ===== Hero Section ===== */
.hero-section {
    text-align: center;
    padding: 5rem 2rem;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
    color: white;
    border-radius: var(--border-radius);
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.hero-tagline {
    font-size: 1.25rem;
    opacity: 0.95;
    font-weight: 400;
}

/* ===== Main Content ===== */
.main-content {
    min-height: 70vh;
    padding: 2rem 0 4rem;
}

/* ===== Post Cards (Home Page) ===== */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.post-card {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.post-card-content {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.post-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.post-card-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

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

.meta-separator {
    color: var(--text-light);
}

.post-card-excerpt {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    flex-grow: 1;
    line-height: 1.6;
}

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

.tag-pill, .category-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

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

.tag-pill.active, .category-pill.active {
    background: var(--primary-color);
    color: white;
}

.read-more-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.read-more-link:hover {
    gap: 0.75rem;
}

.read-more-link svg {
    width: 16px;
    height: 16px;
}

/* ===== Single Post ===== */
.content-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1rem;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    align-items: start;
}

.post-article {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 3rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

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

.post-title {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.post-meta svg {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 0.25rem;
}

.post-date, .reading-time {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-taxonomy {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.taxonomy-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.taxonomy-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.category-badge, .tag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.875rem;
    border-radius: 999px;
    font-size: 0.875rem;
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
}

.category-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.category-badge:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.tag-badge {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

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

/* ===== Post Content ===== */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

.post-content h2 {
    font-size: 2rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

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

.post-content a {
    color: var(--primary-color);
    text-decoration: underline;
    transition: var(--transition);
}

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

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

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

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
}

.post-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    display: block;
    overflow-x: auto;
}

.post-content th,
.post-content td {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    text-align: left;
}

/* Code Blocks */
.post-content pre {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--code-bg);
    border-radius: var(--border-radius);
    overflow-x: auto;
    max-width: 100%;
    word-wrap: normal;
    white-space: pre;
    box-shadow: var(--shadow-md);
}

.post-content code {
    font-family: 'Fira Code', 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    word-break: normal;
    white-space: inherit;
}

.post-content pre code {
    color: var(--code-text);
    background: transparent;
    padding: 0;
}

.post-content p code,
.post-content li code {
    background: var(--bg-tertiary);
    color: var(--primary-color);
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-size: 0.9em;
    word-break: break-word;
    white-space: normal;
}

/* ===== Post Footer ===== */
.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.share-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.share-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.9rem;
}

.share-btn.twitter {
    background: #1da1f2;
    color: white;
}

.share-btn.linkedin {
    background: #0077b5;
    color: white;
}

.share-btn.facebook {
    background: #1877f2;
    color: white;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.sidebar-widget {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.sidebar-widget p {
    color: var(--text-secondary);
    line-height: 1.6;
}

.topic-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.topic-item {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
}

/* ===== Archive Pages ===== */
.archive-header {
    text-align: center;
    padding: 3rem 0;
    margin-bottom: 3rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.archive-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    margin-bottom: 1rem;
    color: white;
}

.archive-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.archive-count {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Post List (Archive) ===== */
.posts-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.post-list-item {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.post-list-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.post-list-title {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.post-list-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.post-list-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.post-list-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

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

/* ===== Footer ===== */
.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 3rem 0;
    margin-top: 4rem;
}

.footer-content {
    text-align: center;
}

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

/* ===== Home Layout & Sidebar ===== */
.home-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 3rem;
    width: 100%;
    margin: 0 auto;
    align-items: start;
}

@media (max-width: 992px) {
    .home-layout {
        grid-template-columns: 1fr;
    }
}

.featured-post {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 3rem;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.featured-post::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.featured-label {
    display: inline-block;
    background: var(--primary-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.featured-title {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.featured-title a {
    color: var(--text-primary);
    text-decoration: none;
}

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

.featured-excerpt {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.read-more-btn {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
}

.read-more-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.home-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
}

.sidebar-widget h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--bg-secondary);
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.category-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    padding: 0.5rem 0.75rem;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.category-item:hover {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.category-item .count {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}


.footer-tagline {
    font-size: 0.875rem;
}

/* ===== AdSense ===== */
.adsense-container {
    margin: 2rem 0;
    text-align: center;
}

.adsense-header,
.adsense-footer {
    padding: 1rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
}

.adsense-sidebar {
    position: sticky;
    top: 100px;
}

/* ===== Latest Posts Widget ===== */
.latest-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.latest-posts-list li {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.latest-posts-list a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    line-height: 1.4;
    transition: var(--transition);
}

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

.latest-posts-list time {
    font-size: 0.75rem;
    color: var(--text-light);
}

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

    .sidebar {
        order: -1;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 1.5rem;
    }

    .hero-section {
        padding: 3rem 1.5rem;
    }

    .nav-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 5rem 2rem;
        box-shadow: var(--shadow-lg);
        transition: 0.3s ease-in-out;
        z-index: 1000;
        gap: 1.5rem;
        align-items: flex-start;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        font-size: 1.125rem;
        width: 100%;
    }

    .nav-links a.active {
        border-bottom: none;
        border-left: 3px solid var(--primary-color);
        padding-left: 0.75rem;
    }

    .share-buttons {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.75rem;
    }

    .pagination-list {
        gap: 0.25rem;
    }

    .pagination-link {
        min-width: 35px;
        height: 35px;
        padding: 0 0.5rem;
        font-size: 0.875rem;
    }
}

/* ===== Accessibility ===== */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .main-nav,
    .sidebar,
    .share-buttons,
    .adsense-container {
        display: none;
    }

    .post-article {
        box-shadow: none;
        border: none;
    }
}

/* ===== Pagination ===== */
.pagination {
    margin: 3rem 0;
    display: flex;
    justify-content: center;
}

.pagination-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

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

.pagination-link.current {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    cursor: default;
}

.pagination-link.prev,
.pagination-link.next {
    padding: 0 1.5rem;
}

.pagination-ellipsis {
    display: inline-flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--text-light);
}

/* ===== Post Content Styling ===== */
.post-content {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-primary);
}

.post-content h1, .post-content h2, .post-content h3, .post-content h4 {
    margin: 2.5rem 0 1.25rem;
    line-height: 1.3;
}

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

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

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

.post-content pre {
    background: var(--code-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    overflow-x: auto;
    max-width: 100%;
    word-wrap: normal;
    white-space: pre;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.post-content code {
    font-family: 'Fira Code', 'JetBrains Mono', monospace;
    font-size: 0.9em;
    word-break: normal;
    white-space: inherit;
}

.post-content :not(pre) > code {
    background: var(--bg-tertiary);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--primary-dark);
    word-break: break-word;
    white-space: normal;
}

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

.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

/* ===== Related Posts ===== */
.related-posts-section {
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 2px solid var(--border-color);
}

.related-posts-section h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.related-post-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.related-post-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.related-post-card h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
}

.related-post-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

.related-post-card h3 a:hover {
    color: var(--primary-color);
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.related-post-excerpt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Archive Timeline ===== */
.archive-timeline {
    max-width: 900px;
    margin: 0 auto;
}

.archive-year {
    margin-bottom: 3rem;
}

.year-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid var(--primary-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.year-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.year-count,
.month-count {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.archive-month {
    margin-bottom: 2rem;
    margin-left: 2rem;
}

.month-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.month-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
}

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

.archive-post-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.archive-post-list li {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.archive-post-list li:hover {
    background: var(--bg-tertiary);
}

.archive-post-list time {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
    min-width: 50px;
    font-variant-numeric: tabular-nums;
}

.archive-post-list a {
    color: var(--text-primary);
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
}

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

/* ===== Search (for future implementation) ===== */
.search-container {
    max-width: 600px;
    margin: 2rem auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.search-results {
    margin-top: 2rem;
}

.search-result-item {
    padding: 1.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.search-result-item:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* ===== Responsive Updates ===== */
@media (max-width: 768px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }

    .archive-month {
        margin-left: 1rem;
    }

    .pagination-list {
        justify-content: center;
    }

    .pagination-link.prev,
    .pagination-link.next {
        padding: 0 1rem;
        font-size: 0.875rem;
    }
}

@media (max-width: 480px) {
    .year-title,
    .month-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .archive-post-list li {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }
}
