* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
}

header {
    background-color: #333;
    padding: 1rem 0;
}

.nav-links {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 2rem;
}

.nav-links li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.hero {
    background: #fff;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
}

.hero h1 {
    margin-bottom: 1rem;
    font-size: 2rem;
}

.hero p {
    max-width: 800px;
    margin: 0 auto 1rem auto;
}

.hero button {
    padding: 0.5rem 1rem;
    font-size: 1rem;
    background-color: #333;
    color: white;
    border: none;
    cursor: pointer;
}

.content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0 2rem;
}

.blog-posts {
    flex: 2;
    display: flex;
    flex-direction: row;        /* Changed to row for side-by-side */
    gap: 2rem;
    flex-wrap: wrap;            /* Wrap if screen too narrow */
}

.blog-posts article {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    flex: 1 1 calc(33.333% - 1.33rem); /* roughly 1/3 width minus gap */
    box-sizing: border-box;
    min-width: 250px; /* optional, prevents articles from getting too narrow */
}

.blog-posts article img {
    max-width: 100%;
    height: auto;
    margin-top: 0.5rem;
    border-radius: 4px;
}

aside {
    flex: 1;
    background: white;
    margin-left: 2rem;
    padding: 1rem;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    max-width: 300px;
}

aside h2 {
    margin-bottom: 1rem;
}

aside ul {
    list-style: none;
}

aside ul li {
    margin-bottom: 0.5rem;
}

aside ul li a {
    text-decoration: none;
    color: #007BFF;
}

footer {
    background: #333;
    color: white;
    text-align: center;
    padding: 1rem;
    margin-top: 2rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .content {
        flex-direction: column;
        padding: 1rem;
    }

    aside {
        margin-left: 0;
        margin-top: 2rem;
        max-width: 100%;
    }

    .blog-posts {
        flex-direction: column; /* stack vertically on small screens */
    }

    .blog-posts article {
        flex: 1 1 100%;
        min-width: auto;
    }
}
