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

html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; /* Slightly modern font stack */
    background-color: #1e1e1e; /* dark gray background */
    color: #d3d3d3; /* light gray text */
    line-height: 1.6;
}

/* --- Header Styling --- */
.main-header {
    background-color: #242424;
    padding: 30px 20px;
    border-bottom: 2px solid #2f2f2f;
    text-align: center;
}

/* Improvement: Style the h1 link to look like a heading, not a standard link */
.main-header .blog-title-link {
    color: inherit; /* Inherits color from h1 */
    text-decoration: none;
    display: inline-block; /* Needed for hover effect */
}

.main-header .blog-title-link:hover {
    opacity: 0.8; /* Subtle visual feedback */
    text-decoration: none;
}

.main-header h1 {
    font-size: 2.5em;
    color: #f0f0f0;
}

.main-header p {
    margin-top: 5px;
    color: #bcbcbc;
}

/* --- Layout Container --- */
.container {
    flex: 1;
    width: 90%;
    max-width: 1100px;
    margin: 20px auto;
    display: flex;
    gap: 30px;
    padding: 0 20px; /* Adjusted padding to remove the 20px margin outside the max-width */
}

/* --- Main Content Area --- */
.content {
    flex: 3;
    background-color: #242424;
    padding: 30px; /* Increased padding slightly for better spacing */
    border: 1px solid #333333;
    border-radius: 4px;
}

/* Improvement: Better vertical rhythm for headings */
.content h2, 
.content h3 {
    color: #f0f0f0;
    margin-top: 1.5em; 
    margin-bottom: 0.5em;
    border-bottom: 1px solid #333333;
    padding-bottom: 5px;
}
.content h2:first-child, .content h3:first-child {
    margin-top: 0; /* No extra margin above the first heading */
}

.content article {
    margin-bottom: 30px; /* Increased separation between articles */
    padding-bottom: 15px;
    border-bottom: 1px dashed #333333; /* Use a dashed border to visually separate articles */
}
.content article:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Improvement: Clearer paragraph separation */
.content p {
    margin: 0 0 1em 0;
}

/* Improvement: Styling the 'Read More' link */
.content article .read-more {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 12px;
    border: 1px solid #6ec7c7;
    border-radius: 3px;
    font-size: 0.9em;
    background-color: #303030;
    transition: all 0.2s;
}

.content article .read-more:hover {
    background-color: #6ec7c7;
    color: #242424; /* Dark text on hover background */
    text-decoration: none;
}


/* --- Sidebar Styling --- */
.sidebar {
    flex: 1;
    background-color: #2a2a2a;
    padding: 20px;
    border: 1px solid #333333;
    border-radius: 4px;
    height: fit-content; /* Stops sidebar from stretching full height when content is short */
}

.sidebar h3 {
    color: #f0f0f0;
    margin-bottom: 15px;
    border-bottom: 1px solid #3a3a3a;
    padding-bottom: 5px;
}

/* Improvement: Removing default list styles for a cleaner archive */
.sidebar ul {
    list-style: none; 
    padding-left: 0;
}

.sidebar ul li {
    margin-bottom: 12px;
}

.sidebar ul li a {
    color: #6ec7c7; /* teal-cyan accent */
    text-decoration: none;
}

.sidebar ul li a:hover {
    text-decoration: underline;
    color: #9be4e4; 
}

/* --- Links (General) --- */
a {
    color: #6ec7c7; 
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
    color: #9be4e4;
}

/* --- Footer Styling --- */
.main-footer {
    background-color: #242424;
    color: #bcbcbc;
    text-align: center;
    padding: 15px 0;
    width: 100%;
    margin-top: auto;
    border-top: 2px solid #2f2f2f;
}

.main-footer a {
    color: #6ec7c7;
    text-decoration: underline;
}

.main-footer a:hover {
    color: #9be4e4;
}

/* --- Horizontal Rule Styling --- */
hr {
    border: none;
    border-top: 1px solid #333333;
    margin: 20px 0;
}

/* --- Responsive Design --- */
@media (max-width: 768px) {
    .container {
        flex-direction: column;
        gap: 20px;
        padding: 0 10px; /* Reduced side padding on small screens */
    }

    .content, .sidebar {
        flex: 1;
        padding: 20px;
    }

    .main-header h1 {
        font-size: 2em;
    }
}
