/* --- Global Styles --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 960px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navigation --- */
nav {
    background-color: #333;
    padding: 1rem 0;
}

nav .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    text-decoration: none;
}

nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
}

nav ul li {
    margin-left: 20px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

nav ul li a:hover {
    color: #ddd;
}

/* --- Main Content --- */
main {
    padding: 2rem 0;
}

h1, h2 {
    color: #444;
}

/* --- Home Page "About Me" Section --- */
.about-section {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.about-section h1 {
    margin-top: 0;
}

/* --- Project Grid --- */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.project-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    overflow: hidden; /* To contain the image */
}

.project-card img {
    width: 100%;
    height: 200px;
    object-fit: cover; /* This makes your images fit nicely */
}

.project-card-content {
    padding: 1rem;
}

.project-card h3 {
    margin-top: 0;
}

.project-card p {
    font-size: 0.9rem;
}

/* --- Contact Form --- */
.contact-form {
    background: #fff;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    box-sizing: border-box; /* Important for padding to work */
}

.btn {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #555;
}

/* --- Footer --- */
footer {
    text-align: center;
    padding: 0.4rem 0;
    margin-top: 0.4rem;
    background-color: #333;
    color: #fff;
}
/* Ensure the html and body can take up full height */
html {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* 100% of the viewport height */
    
    /* It's also good practice to reset the default margin */
    margin: 0;
}

main {
    flex-grow: 1; /* This is the key! It makes the main content
                     area expand to fill all available space,
                     pushing the footer down. */
}

.image-gallery img {
    max-width: 100%;
    height: auto;
}

/*
=====================================================
--- Responsive (Mobile) Styles ---
This block tells the browser to apply these styles
ONLY on screens 768px wide or smaller.
=====================================================
*/
@media (max-width: 768px) {

    /* --- Navigation --- */
    nav .container {
        flex-direction: column; /* Stack logo and links */
        align-items: center;
    }

    nav ul {
        flex-direction: column; /* Stack nav links */
        margin-top: 1rem;       /* Add space between logo and links */
        align-items: center;
        width: 100%;
    }

    nav ul li {
        margin-left: 0;         /* Remove side margin */
        margin-top: 10px;       /* Add space between stacked links */
        width: 100%;
        text-align: center;
    }

    nav ul li a {
        width: 100%;
        box-sizing: border-box; /* Make padding inclusive */
    }

    /* --- Project Grid --- */
    .project-grid {
        /* This forces the grid to be one column on mobile */
        /* (Even though auto-fit already does a good job) */
        grid-template-columns: 1fr; 
    }

    /* --- Form/About Page --- */
    .about-section, .contact-form {
        /* Add a little less padding on small screens */
        padding: 1.5rem;
    }

    h1 {
        font-size: 2rem; /* Make main headings a bit smaller */
    }

    /* Make the container take up more screen width */
    .container {
        padding: 0 15px;
    }
}