/* CSS for Responsive Navbar with Flexbox */
body { margin: 0; font-family: sans-serif; }
.navbar {
display: flex;
justify-content: space-between; /* Logo left, links right */
align-items: center; /* Vertically align items */
background-color: #2c3e50; /* Dark blue-grey */
padding: 1em 2em;
color: white;
box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.logo {
color: white;
text-decoration: none;
font-size: 1.5em;
font-weight: bold;
padding: 0.5em 0;
}
.nav-links {
list-style: none;
margin: 0;
padding: 0;
display: flex; /* Make links horizontal */
gap: 1.5em; /* Space between links */
}
.nav-links a {
color: white;
text-decoration: none;
padding: 0.8em 1.2em;
transition: background-color 0.3s ease, border-radius 0.3s ease;
border-radius: 4px;
}
.nav-links a:hover {
background-color: #34495e; /* Slightly lighter dark blue-grey */
}
/* Responsive behavior for smaller screens (e.g., stack items) */
@media (max-width: 768px) {
.navbar {
flex-direction: column; /* Stack logo and nav links */
align-items: flex-start; /* Align all items to the start */
padding: 1em;
}
.nav-links {
margin-top: 1em;
flex-direction: column; /* Stack links vertically */
gap: 0.5em; /* Less space between stacked links */
width: 100%; /* Full width for stacked links */
}
.nav-links li {
width: 100%;
}
.nav-links a {
display: block; /* Make links fill the width */
text-align: center;
padding: 0.8em 1em;
border-bottom: 1px solid rgba(255,255,255,0.1); /* Separator for stacked links */
}
.nav-links li:last-child a {
border-bottom: none;
}
}