* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
    font-family: 'Inter', Arial, sans-serif;
    background: #fff;
    color: #222;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #e0e0e0;
    z-index: 1000;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 5%;
    height: 80px;
}

.logo a {
    font-weight: bold;
    font-size: 1.5rem;
    text-decoration: none;
    color: #1a1a1a;
}

.nav-links a, .social-links a {
    margin: 0 15px;
    text-decoration: none;
    color: #1a1a1a;
    font-size: 1rem;
    transition: color 0.3s ease;
}

.nav-links a:hover, .social-links a:hover {
    color: #888888;
}

main {
    flex-grow: 1; /* Pushes footer down */
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
    box-sizing: border-box; /* Important for padding */
}

/* Override for blog posts with TOC */
.blog-wrapper {
    margin: 0 auto 40px auto;
}

article h1 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

article p {
    line-height: 1.6;
    font-size: 1.1rem;
}

article a {
    color: #007bff;
    text-decoration: none;
}

article a:hover {
    text-decoration: underline;
}

/* Blog List Styling */
.blog-list h1 {
    text-align: center;
    margin-bottom: 40px;
}

.blog-list ul {
    list-style: none;
    padding: 0;
}

.blog-list li {
    margin-bottom: 6px;
    border-bottom: 1px solid #eee;
    padding-bottom: 6px;
}

.blog-list li a {
    text-decoration: none;
    color: #1a1a1a;
    display: block;
    transition: all 0.3s ease;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.blog-list li a:hover {
    background-color: transparent;
    border-color: transparent;
    transform: none;
    box-shadow: none;
}

.blog-list li h2 {
    margin: 0 0 10px 0;
    font-size: 1rem;
    color: #000000;
    transition: color 0.3s ease;
    font-weight: normal;
}

.blog-list li a:hover h2 {
    color: #000000;
    text-decoration: none;
}

.blog-list li p {
    margin: 0;
    color: #666;
    font-size: 0.9rem;
}

/* --- Footer Alignment --- */
footer {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    z-index: 1000; /* Ensures it stays on top */
    background-color: #ffffff; /* Prevents content from showing through */
    
    display: flex;
    justify-content: space-between; /* Creates space between the three divs */
    align-items: center;
    padding: 20px 5%;
    border-top: 1px solid #e0e0e0;
    color: #666;
    font-size: 0.9rem;
    box-sizing: border-box;
}
.footer-spacer, .footer-links, .copyright {
    flex: 1;
}

.footer-links {
    text-align: center; /* Center the links within their div */
}

.copyright {
   text-align: right; /* Right-align the text within its div */
}

.copyright p {
    margin: 0; /* Remove default paragraph margin */
}

.footer-links a {
    color: #666;
    text-decoration: none;
    margin: 0 15px;
}

/* --- Hero Section Styling --- */
.hero {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 40px;
}

.hero-text h1 {
    font-size: 3.5rem; /* Large, impactful text */
    font-weight: bold;
    margin-bottom: 20px;
}

.hero-text p {
    font-size: 1.2rem;
    color: #555;
    max-width: 800px;
    margin: 0 auto; /* Center the paragraph text */
    line-height: 1.6;
}


/* --- Latest Posts Section --- */
.latest-posts h2 {
    text-align: left;
    font-size: 1.8rem;
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
}

/* --- View All Button --- */
.view-all-container {
    text-align: center;
    margin-top: 40px;
}

.view-all-button {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.view-all-button:hover {
    background-color: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.blog-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 16px rgba(60,60,60,0.08);
    padding: 2rem 2.5rem;
    margin: 2rem auto;
    max-width: 1000px;
}

h1, .blog-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.5px;
}

.blog-meta {
    color: #888;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

blockquote {
    border-left: 4px solid #00b170;
    background: #f6f8fa;
    color: #222;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    font-style: italic;
}

img {
    display: block;
    margin: 1.5rem auto;
    border-radius: 10px;
    max-width: 100%;
}

h2, .section-title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.button, .icon-btn {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 999px;
    padding: 0.5rem 1.2rem;
    box-shadow: 0 1px 4px rgba(60,60,60,0.06);
    font-weight: 500;
    color: #222;
    margin-right: 0.5rem;
    cursor: pointer;
    transition: background 0.2s;
}

.button:hover {
    background: #f6f8fa;
}

a {
    color: #00b170;
    text-decoration: none;
    font-weight: 500;
}

a:hover {
    text-decoration: underline;
}

p {
    line-height: 1.7;
    margin-bottom: 1.2rem;
}

/* Table of Contents Styling */
.blog-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 98px auto 40px auto; /* 80px header + 18px (0.25 inch) spacing */
    padding: 0 20px;
    gap: 0; /* Remove gap, we'll handle spacing internally */
    align-items: flex-start;
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    overflow: hidden;
}

/* Fixed left sidebar for the index on wide screens. It stays static while the
   blog content scrolls. On narrower screens (<=1200px) the media query below
   switches the TOC back to normal flow. */
.table-of-contents {
    position: fixed;
    /* place below the fixed header and above the fixed footer */
    top: 98px; /* 80px header + 18px (0.25 inch) spacing - matching blog content */
    left: calc(50% - 700px + 20px); /* aligns with the left of the centered wrapper */
    width: 320px;
    max-width: 28%;
    min-width: 250px;
    background: #ffffff; /* Match blog content background */
    padding: 0; /* Remove all padding to start from exact position */
    flex-shrink: 0;
    height: calc(100vh - 138px); /* Adjust height to account for positioning */
    overflow-y: auto;
    z-index: 900;
    font-family: 'Inter', Arial, sans-serif; /* Match main content font */
}

.table-of-contents ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.table-of-contents li {
    margin-bottom: 0;
}

.table-of-contents a {
    color: #475569;
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.2;
    display: block;
    padding: 0 0 0 1rem; /* Add minimal left padding for readability */
    border-radius: 6px;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-weight: 400;
}

/* Hierarchy indentation for TOC */
.table-of-contents li.level-1 {
    margin-left: 0;
}

.table-of-contents li.level-1 a {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
}

.table-of-contents li.level-2 {
    margin-left: 1rem;
}

.table-of-contents li.level-3 {
    margin-left: 1.5rem;
}

.table-of-contents li.level-4 {
    margin-left: 2rem;
}

.table-of-contents li.level-5 {
    margin-left: 2.5rem;
}

.table-of-contents li.level-6 {
    margin-left: 3rem;
}

.table-of-contents a.active {
    color: #1e40af;
    background-color: rgba(59, 130, 246, 0.15);
    border-left: 3px solid #3b82f6;
    font-weight: 600;
}

.blog-content {
    flex: 1;
    min-width: 0;
    /* leave space for the fixed sidebar so content doesn't sit under it */
    margin-left: 340px;
    max-width: calc(100% - 360px);
    padding: 0 3rem 3rem 3rem; /* Remove top padding to match TOC */
    background: #ffffff;
}

.blog-content .post-header {
    margin-top: 0; /* Remove extra top margin since wrapper now handles spacing */
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
}

.blog-content .post-header h1 {
    margin-bottom: 0.75rem;
    color: #1e293b;
    font-weight: 700;
    font-size: 2.5rem;
    line-height: 1.2;
}

.blog-content .post-header p {
    color: #64748b;
    font-size: 1rem;
    margin: 0;
    font-style: italic;
    font-weight: 400;
}

.blog-content h1,
.blog-content h2,
.blog-content h3,
.blog-content h4,
.blog-content h5,
.blog-content h6 {
    scroll-margin-top: 120px;
    position: relative;
    color: #1e293b;
    font-weight: 600;
    line-height: 1.3;
}

.blog-content h1 {
    color: #1e293b;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    margin-top: 0.75rem;
}

.blog-content h2 {
    color: #334155;
    border-bottom: 1px solid #f1f5f9;
    padding-bottom: 0.25rem;
    margin-top: 0.75rem;
    margin-bottom: 0.375rem;
    font-size: 1.875rem;
}

.blog-content h3 {
    color: #475569;
    margin-top: 0.625rem;
    margin-bottom: 0.25rem;
    font-size: 1.5rem;
}

.blog-content h4 {
    color: #64748b;
    margin-top: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 1.25rem;
}

.blog-content p {
    line-height: 1.35;
    margin-bottom: 0.375rem;
    color: #374151;
    font-size: 1.05rem;
}

.blog-content ul, .blog-content ol {
    margin-bottom: 0.375rem;
    padding-left: 1.5rem;
    color: #374151;
}

.blog-content li {
    margin-bottom: 0.125rem;
    line-height: 1.3;
}

.blog-content strong {
    font-weight: 600;
    color: #1f2937;
}

.blog-content a {
    color: #2563eb;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.2s ease;
}

.blog-content a:hover {
    color: #1d4ed8;
    border-bottom-color: #2563eb;
}

.blog-content code {
    background-color: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
    color: #e83e8c;
}

.blog-content pre {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1.2rem;
}

.blog-content blockquote {
    border-left: 4px solid #007bff;
    padding-left: 1rem;
    margin: 1.5rem 0;
    color: #666;
    font-style: italic;
}

/* Responsive design for tablets */
@media (max-width: 1200px) {
    .blog-wrapper {
        flex-direction: column;
        max-width: 800px;
        padding: 0 20px;
    }
    
    .table-of-contents {
        position: static;
        width: 100%;
        margin-bottom: 2rem;
        order: -1;
        max-height: 300px;
        overflow-y: auto;
        padding: 1rem;
    }
    
    /* Reset hierarchy indentation for mobile TOC */
    .table-of-contents li.level-1,
    .table-of-contents li.level-2,
    .table-of-contents li.level-3,
    .table-of-contents li.level-4,
    .table-of-contents li.level-5,
    .table-of-contents li.level-6 {
        margin-left: 0;
    }
    
    .table-of-contents li.level-2 {
        margin-left: 0.5rem;
    }
    
    .table-of-contents li.level-3 {
        margin-left: 1rem;
    }
    
    .table-of-contents li.level-4 {
        margin-left: 1.5rem;
    }
    
    .blog-content {
        max-width: 100%;
    }
}

/* Responsive design for mobile */
@media (max-width: 768px) {
    .blog-wrapper {
        padding: 0 1rem;
    }
    
    .table-of-contents {
        padding: 0.75rem;
        font-size: 0.9rem;
        max-height: 250px;
        overflow-y: auto;
    }
    
    .table-of-contents a {
        font-size: 0.8rem;
        padding: 0.3rem 0.4rem;
    }
}

/* Add some subtle animations and modern touches */
.blog-content {
    animation: fadeInUp 0.6s ease-out;
}

.table-of-contents {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}