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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: scroll; /* Force vertical scrollbar to always appear */
}

/* Custom Scrollbar (Black & White) */
::-webkit-scrollbar {
    width: 12px;
}

::-webkit-scrollbar-track {
    background: #ffffff;
}

::-webkit-scrollbar-thumb {
    background: #000000;
    border: 2px solid #ffffff;
    border-radius: 20px;
}

/* Firefox Scrollbar Support */
* {
    scrollbar-width: thin;
    scrollbar-color: #000000 #ffffff;
}

a {
    text-decoration: none;
    color: inherit;
}

/* Navigation Bar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    
    /* Initial state: hidden */
    opacity: 0;
    transform: translateY(-100%);
    transition: opacity 0.5s ease, transform 0.5s ease;
    pointer-events: none; /* Prevent clicks when hidden */
}

.navbar.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

.navbar .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.navbar .nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
}

.navbar .nav-links li a {
    font-size: 1rem;
    font-weight: 500;
    color: #555;
    transition: color 0.3s ease;
}

.navbar .nav-links li a:hover {
    color: #007bff;
}

/* Banner / Hero Section */
.banner {
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    padding: 0 20px;
    padding-top: 60px; /* Compensate for fixed navbar */
    position: relative;
    
    /* Add transition for fade effect */
    transition: opacity 0.8s ease-in-out;
    opacity: 1;
}

.banner.fade-out {
    opacity: 0;
    pointer-events: none;
}

/* Utility class to hide elements */
.hidden {
    display: none !important;
}

.banner h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.banner p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    max-width: 600px;
    opacity: 0.9;
}

/* Main Content Anchor Area */
#content-start {
    /* min-height: 100vh;  Removed min-height to allow content to dictate height, 
                           but kept padding to look good. 
                           If user wants it to fill screen, content will grow. */
    min-height: calc(100vh - 60px); /* Fill remaining space at least */
    padding: 80px 40px 40px; /* Top padding > navbar height, increased side padding */
    background-color: #fff;
    width: 100%; /* Full width */
    max-width: none; /* Remove max-width constraint */
    margin: 0; /* Remove auto margin */
    
    /* Add Fade In for content */
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
}

#content-start.visible {
    opacity: 1;
}

/* Blog Layout & Sidebar */
.blog-layout {
    display: flex;
    gap: 60px; /* Increased gap for better separation */
}

.sidebar {
    width: 300px;
    flex-shrink: 0;
    border-right: 1px solid #eee;
    padding-right: 20px;
    
    /* Sticky Sidebar */
    position: sticky;
    top: 90px; /* Below navbar */
    height: calc(100vh - 120px); /* Full height minus top/bottom padding */
    overflow-y: auto; /* Scroll internally if list is long */
}

.sidebar h3 {
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #333;
}

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

.post-list li {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.post-list li:hover {
    background-color: #f9f9f9;
}

.post-list li.active {
    background-color: #f0f7ff;
    border-color: #007bff;
}

.post-date {
    display: block;
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 4px;
}

.post-title {
    display: block;
    font-weight: 600;
    color: #333;
}

.post-content {
    flex-grow: 1;
    min-width: 0; /* Prevent flex child overflow */
}

.post-content article h2 {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #333;
}

.post-content .meta {
    color: #666;
    margin-bottom: 20px;
}

.post-content hr {
    border: none;
    border-top: 1px solid #eee;
    margin: 20px 0;
}

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

.empty-state {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #888;
    font-size: 1.2rem;
    min-height: 300px;
}

/* CTA Button */
.cta-button {
    padding: 15px 40px;
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
    background-color: #ff7e5f; /* Coral color for contrast */
    border: none;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 126, 95, 0.4);
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 126, 95, 0.6);
    background-color: #feb47b;
}

.cta-button:active {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .banner h1 {
        font-size: 2rem;
    }
    
    .navbar {
        padding: 1rem 20px;
    }

    .blog-layout {
        flex-direction: column;
        gap: 30px;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #eee;
        padding-right: 0;
        padding-bottom: 20px;
        
        /* Reset sticky for mobile */
        position: static;
        height: auto;
        overflow-y: visible;
    }
    
    #content-start {
        padding: 80px 20px 40px; /* Reduce padding on mobile */
    }
}
