/* Reset default styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Single, consolidated body style */
body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    width: 100%;
}

/* Main content area */
main {
    flex: 1;  /* This makes it expand to fill available space */
    width: 100%;  /* Full width */
    margin: 0 auto;
    padding: 2rem;
}

/* Container for content width limitation */
.content-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

article {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Footer */
footer {
    text-align: center;
    padding: 0.5rem;
    background: #333;
    margin-top: auto;  /* This pushes it to the bottom */
    width: 100%;
}

/* Header and Navigation */
header {
    background-color: #333;
    color: white;
    padding: 1rem;
}

/* Navigation */
nav {
    display: flex;
    align-items: center; /* Center items vertically */
    justify-content: space-between; /* Space between logo and nav groups */
    max-width: 1200px; /* Limit the width of the nav */
    margin: 0 auto; /* Center the nav */
}

/* Logo */
.logo {
    flex: 0 1 auto; /* Allow the logo to take only necessary space */
}

.logo h1 {
    color: #fff;
    font-size: 1.5rem;
    margin: 0;
    text-decoration: none;
}

/* Navigation Container */
.nav-container {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping of groups */
    justify-content: center; /* Center the groups */
    max-width: 100%; /* Ensure it doesn't exceed the viewport width */
}

/* Navigation Groups */
.nav-group {
    display: flex; /* Arrange links horizontally within each group */
    justify-content: center; /* Center the links within the group */
    margin: 0.5rem; /* Add some spacing between groups */
}

/* Navigation Links */
.nav-links {
    display: flex; /* Arrange links horizontally */
    padding: 0;
    list-style: none; /* Remove default list styling */
    flex-wrap: nowrap; /* Prevent wrapping of links */
    justify-content: center; /* Center the links */
}

.nav-links li {
    margin: 0 1rem; /* Add horizontal spacing between links */
}

.nav-links a {
    color: #ddd;
    text-decoration: none;
}

.nav-links a:hover {
    color: #fff;
}

/* Media query for the widest state (default) */
@media (min-width: 1000px) {
    .nav-container {
        flex-direction: row; /* Keep groups in a row */
    }
}

/* Media query for the middle state */
@media (max-width: 999px) and (min-width: 545px) {
    nav {
        display: flex;
        justify-content: space-between; /* Space between logo and nav groups */
        align-items: center; /* Center items vertically */
    }
    .logo {
        flex: 1; /* Allow the logo to take up available space */
        text-align: left; /* Align text to the left */
    }
    .nav-container {
        display: flex;
        flex-direction: row; /* Keep groups in a row */
        justify-content: flex-end; /* Align the nav groups to the right */
        flex: 1; /* Allow nav container to take up remaining space */
    }
}

/* Media query for the smallest state */
@media (max-width: 544px) and (min-width: 385px) {
    nav {
        flex-direction: column; /* Stack logo above nav groups */
        align-items: center; /* Center items */
    }
    .nav-container {
        flex-direction: column; /* Stack groups vertically */
    }
    .nav-group {
        flex-wrap: wrap; /* Allow links to wrap within the group */
        justify-content: center; /* Center the links within the group */
    }
    .nav-links {
        justify-content: center; /* Center the links when wrapping */
    }
    .nav-links li {
        flex: 1 0 45%; /* Allow each link to take up to 45% of the width */
        text-align: center; /* Center the text */
        margin: 0.5rem 0; /* Add vertical spacing between links */
    }
}

@media (max-width: 384px) {
    nav {
        flex-direction: column; /* Stack logo above nav groups */
        align-items: center; /* Center items */
    }
    .nav-container {
        flex-direction: column; /* Stack groups vertically */
    }
    .nav-links {
        display: flex;
        justify-content: center;
        flex-wrap: wrap;
    }
    .nav-links li {
        flex: 1 0 45%; /* Allow each link to take up to 100% of the width */
        text-align: center; /* Center the text */
        margin: 0.5rem 0; /* Add vertical spacing between links */
    }
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 4rem 2rem;
    background-color: #f4f4f4;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

/* Featured Works Section */
.featured-works {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

footer p {
    color: #ddd;
    font-size: 0.8rem;
    margin: 0;
}

.project-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.project-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.project-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.project-card h1 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.project-card p {
    margin-bottom: 1rem;
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem;
}

.card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: #333;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

p {
    margin-bottom: 1.2em;
}

/* Add this rule to remove underline from links in the logo */
.logo a {
    text-decoration: none; /* Remove underline */
    color: white; /* Optional: Set the link color to white or any color you prefer */
}

.back-button {
    display: inline-block;
    margin: 1rem 0;
    padding: 0.5rem 1rem;
    background-color: #53846e;
    color: rgb(236, 236, 236);
    text-decoration: none;
    border-radius: 5px;
}

.back-button:hover {
    background-color: #415e4f;
}