/* Reset and Base Styles */
body, html {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Open Sans', Arial, sans-serif; /* Modern sans-serif font */
    background-color: #f8f9fa; /* Lighter background */
    color: #343a40; /* Darker text for better contrast */
    line-height: 1.6;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* Container for consistent padding and max-width */
.nav-container, .main-container, .footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem; /* Consistent horizontal padding */
}

/* Header and Navigation */
header {
    background-color: #ffffff; /* White header */
    color: #343a40;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0; /* Subtle border */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

nav .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.8rem; /* Slightly larger logo */
    font-weight: 700; /* Bolder logo */
    font-family: 'Roboto', sans-serif;
    text-decoration: none;
    color: #007bff; /* Primary color for logo */
}

nav .nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem; /* Increased gap */
}

nav .nav-links a {
    text-decoration: none;
    color: #343a40;
    font-weight: 600; /* Bolder nav links */
    transition: color 0.3s ease;
}

nav .nav-links a:hover, nav .nav-links a:focus {
    color: #0056b3; /* Darker shade on hover */
}

/* Main Content Area */
main {
    padding: 2rem 0; /* More vertical padding */
}

/* Hero Section */
.hero-section {
    background-color: #007bff; /* Primary color background */
    color: #ffffff;
    padding: 3rem 1rem; /* Generous padding */
    text-align: center;
    border-radius: 8px; /* Rounded corners */
    margin-bottom: 2rem;
}

.hero-content h1 {
    font-size: 2.8rem; /* Larger hero title */
    font-family: 'Roboto', sans-serif;
    margin-bottom: 1rem;
}

.hero-content p {
    font-size: 1.2rem; /* Larger hero text */
    max-width: 800px;
    margin: 0 auto 1.5rem auto; /* Centered and spaced */
}

.hero-image-placeholder {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 2rem;
    margin-top: 1.5rem;
    border: 2px dashed rgba(255, 255, 255, 0.5);
}
.hero-image-placeholder p {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
}

.hero-image {
    max-width: 100%; /* Ensure image is responsive */
    height: auto; /* Maintain aspect ratio */
    border-radius: 8px; /* Match section rounding */
    margin-top: 1.5rem; /* Space above the image */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow */
}


/* Content Wrapper for Main Content and Sidebar */
.content-wrapper {
    display: flex;
    gap: 2rem; /* Gap between main content and sidebar */
}

.main-content {
    flex: 3; /* Main content takes more space */
}

.sidebar {
    flex: 1; /* Sidebar takes less space */
    margin-top: 0; /* Align with top of main content if hero is separate */
}

/* Article Styling */
.index-article {
    background-color: #ffffff;
    padding: 2rem; /* More padding */
    border-radius: 8px; /* Rounded corners */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05); /* Softer shadow */
}

.index-article h2 {
    font-size: 2rem;
    font-family: 'Roboto', sans-serif;
    color: #007bff;
    margin-top: 0;
    margin-bottom: 1rem;
}
.index-article h3 {
    font-size: 1.5rem;
    font-family: 'Roboto', sans-serif;
    color: #343a40;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.index-article p {
    margin-bottom: 1rem;
    font-size: 1rem;
}

.cta-link {
    display: inline-block;
    background-color: #28a745; /* Green CTA */
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    margin-top: 1rem;
}

.cta-link:hover {
    background-color: #218838; /* Darker green on hover */
}

/* Sidebar Widget */
.sidebar-widget {
    background-color: #ffffff;
    padding: 1.5rem; /* More padding */
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 1.5rem;
}

.sidebar-widget h3 {
    font-size: 1.4rem; /* Slightly larger widget title */
    font-family: 'Roboto', sans-serif;
    color: #007bff;
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: 2px solid #007bff; /* Title underline */
    padding-bottom: 0.5rem;
}

.recent-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.recent-posts-list li {
    margin-bottom: 0.75rem; /* Spacing between posts */
}

.recent-posts-list a {
    text-decoration: none;
    color: #343a40;
    font-weight: 600;
    transition: color 0.3s ease;
}

.recent-posts-list a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* Footer */
footer {
    background-color: #343a40; /* Dark footer */
    color: #f8f9fa;
    text-align: center;
    padding: 2rem 0; /* More padding */
    margin-top: 3rem; /* More space before footer */
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0 0 0;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    text-decoration: none;
    color: #adb5bd; /* Lighter link color */
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #ffffff; /* White on hover */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .content-wrapper {
        flex-direction: column;
    }

    nav .nav-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    nav .nav-links {
        margin-top: 0.5rem;
    }

    .hero-content h1 {
        font-size: 2.2rem;
    }
    .hero-content p {
        font-size: 1rem;
    }
}

/* Styles for individual blog posts to match index.html */
.main-content article {
    background-color: #ffffff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    margin-bottom: 2rem; /* Add some space below the article */
}

.main-content article h1 {
    font-size: 2.5rem; /* Slightly smaller than hero h1 */
    font-family: 'Roboto', sans-serif;
    color: #007bff; /* Primary color for article title */
    margin-top: 0;
    margin-bottom: 1.5rem;
    border-bottom: none; /* Remove default h1 border if any from other styles */
}

.main-content article h2 {
    font-size: 1.8rem;
    font-family: 'Roboto', sans-serif;
    color: #343a40; /* Darker color for subheadings */
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.main-content article h3 {
    font-size: 1.4rem;
    font-family: 'Roboto', sans-serif;
    color: #343a40;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.main-content article p {
    margin-bottom: 1.2rem;
    font-size: 1rem;
    line-height: 1.7; /* Slightly more line height for readability */
}

.main-content article ul,
.main-content article ol {
    margin-bottom: 1.2rem;
    padding-left: 1.5rem; /* Indent lists */
}

.main-content article li {
    margin-bottom: 0.5rem;
}

.main-content article a {
    color: #007bff; /* Primary color for links */
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.main-content article a:hover {
    color: #0056b3; /* Darker shade on hover */
    text-decoration: underline;
}

.main-content article img {
    max-width: 100%;
    height: auto;
    border-radius: 8px; /* Rounded corners for images */
    margin: 1.5rem 0; /* Space around images */
    box-shadow: 0 2px 6px rgba(0,0,0,0.1); /* Subtle shadow for images */
}

.main-content article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.main-content article th,
.main-content article td {
    border: 1px solid #e0e0e0; /* Light border for table cells */
    padding: 0.75rem;
    text-align: left;
}

.main-content article th {
    background-color: #f8f9fa; /* Light background for table headers */
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
}

.main-content article code {
    background-color: #e9ecef; /* Slightly different background for code blocks */
    padding: 0.2em 0.4em;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.main-content article pre {
    background-color: #e9ecef;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto; /* Allow horizontal scrolling for long code lines */
    margin: 1.5rem 0;
}

.main-content article pre code {
    background-color: transparent; /* Code inside pre should not have its own background */
    padding: 0;
    font-size: 0.9em;
}

/* Adjust image paths for blog posts if they are relative to the post's directory */
.main-content article img[src^="media/"],
.main-content article img[src^="../../media/"] {
    /* No specific change needed if paths are correct, but this is a placeholder for potential adjustments */
}

/* Ensure the center div for images behaves well */
.main-content article center div {
    margin-bottom: 1.5rem;
}
