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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    color: #e2e8f0;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Ensure visited links don't change color globally */
a:visited {
    color: inherit;
}

/* ===================================
   Header
   =================================== */

header {
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo-text h1 {
    font-size: 1.25rem;
    margin: 0;
}

.logo-text h1 a {
    color: #e2e8f0;
    text-decoration: none;
}

.logo-text p {
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
}

/* Mobile hamburger menu */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-bar {
    display: block;
    width: 24px;
    height: 2px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: all 0.3s;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(2) {
    opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-bar:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

nav ul {
    display: flex;
    gap: 2rem;
    list-style: none;
}

nav a {
    color: #cbd5e1;
    text-decoration: none;
    transition: color 0.3s;
}

nav a:hover {
    color: #60a5fa;
}

/* ===================================
   Hero Section
   =================================== */

.hero {
    text-align: center;
    padding: 4rem 0;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero p {
    font-size: 1.125rem;
    color: #94a3b8;
    max-width: 600px;
    margin: 0 auto 2rem;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-decoration: none;
    color: #cbd5e1;
}

.social-links a:hover {
    background: rgba(71, 85, 105, 0.7);
    transform: translateY(-2px);
}

/* ===================================
   Category Filter
   =================================== */

.category-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
}

.category-btn {
    padding: 0.5rem 1rem;
    background: rgba(51, 65, 85, 0.5);
    border: none;
    border-radius: 9999px;
    color: #cbd5e1;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.875rem;
}

.category-btn:hover,
.category-btn.active {
    background: #3b82f6;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===================================
   Shared Card Styles
   =================================== */

.post-card,
.blog-list-item {
    background: rgba(51, 65, 85, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(71, 85, 105, 0.7);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
}

.post-card:hover,
.blog-list-item:hover {
    border-color: rgba(59, 130, 246, 0.5);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Blog posts grid (homepage) */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.post-card.featured {
    grid-column: span 2;
    background: rgba(59, 130, 246, 0.1);
}

.featured-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    margin-bottom: 0.75rem;
}

.post-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.post-title a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s;
}

.post-title a:hover {
    color: #60a5fa;
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1rem;
}

.post-excerpt {
    color: #cbd5e1;
    margin-bottom: 1rem;
    line-height: 1.6;
}

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

.tag {
    padding: 0.25rem 0.75rem;
    background: rgba(71, 85, 105, 0.5);
    color: #60a5fa;
    font-size: 0.75rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
}

.tag:hover {
    background: rgba(71, 85, 105, 0.7);
    transform: translateY(-1px);
}

/* Read more link with arrow */
.read-more,
.read-more-link {
    color: #60a5fa;
    font-weight: 500;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.read-more:hover,
.read-more-link:hover {
    color: #93c5fd;
    gap: 10px;
}

.read-more::after {
    content: "\2192";
    transition: transform 0.2s ease;
}

.read-more:hover::after {
    transform: translateX(2px);
}

/* ===================================
   Blog List Page (blog.md)
   =================================== */

.posts-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.posts-wrapper .post-card {
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.blog-page-title {
    font-size: 3rem;
    font-weight: 700;
    text-align: center;
    margin: 3rem 0 1rem;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Post card header */
.post-card-header {
    margin-bottom: 0.75rem;
}

/* Date metadata */
.post-meta-date {
    color: #94a3b8;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.post-meta-date::before {
    content: "\1F4C5";
}

/* Post card title */
.post-card-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.post-card-title a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s;
}

.post-card-title a:hover {
    color: #60a5fa;
}

/* Post excerpt */
.post-card-excerpt {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* Blog list layout (vertical) */
.blog-list {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 20px;
}

.blog-list-item {
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.blog-list-item .post-date {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-list-item .post-date::before {
    content: "\1F4C5";
}

.blog-list-item h2 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
}

.blog-list-item h2 a {
    color: #e2e8f0;
    text-decoration: none;
    transition: color 0.3s;
}

.blog-list-item h2 a:hover {
    color: #60a5fa;
}

.blog-list-item .post-description {
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 1rem;
}

/* ===================================
   Post Content (individual post page)
   =================================== */

.post-content {
    max-width: 800px;
    margin: 2rem auto;
}

.post-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.5);
}

.post-header h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #e2e8f0;
}

.post-body {
    font-size: 1.125rem;
    line-height: 1.8;
    color: #cbd5e1;
}

.post-body h2 {
    font-size: 1.875rem;
    margin: 2rem 0 1rem;
    color: #e2e8f0;
}

.post-body h3 {
    font-size: 1.5rem;
    margin: 1.5rem 0 0.75rem;
    color: #e2e8f0;
}

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

.post-body ul, .post-body ol {
    margin-left: 2rem;
    margin-bottom: 1rem;
}

.post-body code {
    background: rgba(51, 65, 85, 0.7);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #60a5fa;
}

.post-body pre {
    background: rgba(15, 23, 42, 0.9);
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
}

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

.post-body blockquote {
    border-left: 4px solid #3b82f6;
    padding-left: 1rem;
    margin: 1rem 0;
    color: #94a3b8;
    font-style: italic;
}

.post-body a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.3s;
}

.post-body a:hover {
    color: #93c5fd;
}

.post-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(71, 85, 105, 0.5);
}

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.post-navigation a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s;
}

.post-navigation a:hover {
    color: #93c5fd;
}

.back-to-home {
    text-align: center;
}

.back-to-home a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s;
}

.back-to-home a:hover {
    color: #93c5fd;
}

/* ===================================
   Breadcrumb Navigation
   =================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: #94a3b8;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(71, 85, 105, 0.3);
}

.breadcrumb a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #93c5fd;
}

.breadcrumb-separator {
    color: #475569;
}

/* ===================================
   Category Badges
   =================================== */

.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.category-badge {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: #3b82f6;
    color: white;
    font-size: 0.813rem;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.2);
}

.category-badge:hover {
    background: #2563eb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* ===================================
   Categories Archive Page
   =================================== */

.categories-archive {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 0;
}

.category-section {
    margin-bottom: 3rem;
}

.category-section-title {
    font-size: 1.875rem;
    color: #e2e8f0;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #3b82f6;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.post-count {
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: normal;
    background: rgba(71, 85, 105, 0.5);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
}

.category-posts {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.category-posts .post-card {
    padding: 1.5rem;
}

.category-posts .post-title {
    font-size: 1.25rem;
}

/* ===================================
   Footer
   =================================== */

footer {
    border-top: 1px solid rgba(71, 85, 105, 0.5);
    margin-top: 5rem;
    padding: 2rem 0;
    text-align: center;
    color: #94a3b8;
    font-size: 0.875rem;
}

footer p + p {
    margin-top: 0.5rem;
}

/* ===================================
   Responsive
   =================================== */

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    #main-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(15, 23, 42, 0.98);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border-bottom: 1px solid rgba(71, 85, 105, 0.5);
        padding: 1rem 20px;
    }

    #main-nav.open {
        display: block;
    }

    #main-nav ul {
        flex-direction: column;
        gap: 1rem;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .blog-page-title {
        font-size: 2rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .post-card.featured {
        grid-column: span 1;
    }

    .post-header h1 {
        font-size: 2rem;
    }

    .post-body {
        font-size: 1rem;
    }

    .blog-list-item {
        padding: 1.5rem;
    }

    .blog-list-item h2 {
        font-size: 1.25rem;
    }
}
