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

/* :root MUST be defined for the JS to set --header-height */
:root {
    --header-height: 100px; /* Sensible default, will be updated by JS */
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height); /* ESSENTIAL for sticky header navigation */
}

body {
    font-family: "Inter", 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    /* padding-top: var(--header-height); /* Alternative if scroll-padding-top has issues, but scroll-padding-top is preferred */
}

.container {
    width: 80%;
    max-width: 1100px;
    margin: auto;
    overflow: hidden;
    padding: 0 20px;
}

h1, h2, h3, h4 {
    margin-bottom: 1rem;
    color: #0e1428;
    font-weight: 700;
}

h1 {
    font-size: 2.8rem;
    font-weight: 900;
}
h1 a {
    color: inherit;
    text-decoration: none;
}


h2 {
    font-size: 2rem;
    text-align: center;
    padding-bottom: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #2c3e50;
}

h3 {
    font-size: 1.5rem;
}

h4 {
    font-size: 1.2rem;
    color: #1c2331;
}

p {
    margin-bottom: 1rem;
}

a {
    color: #0e1428;
    text-decoration: none;
    font-weight: 700;
}

a:hover {
    color: #3b5998;
    text-decoration: underline;
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Header & Navigation - STICKY and CLICKABLE EXPAND */
header#pageHeader { /* Use ID for specificity if needed */
    background: #0e1428;
    color: #fff;
    padding: 10px 0; /* Adjusted padding */
    border-bottom: 3px solid #1c2a4d;
    position: sticky; /* MAKE HEADER STICKY */
    top: 0;           /* Stick to the top */
    left: 0;          /* Ensure it spans full width */
    right: 0;         /* Ensure it spans full width */
    z-index: 1000;    /* Keep header on top of other content */
    width: 100%;      /* Ensure it spans full width */
}

header .header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow nav to wrap below on mobile if header is part of flex flow */
}

header .site-title {
    text-align: left;
    /* No flex-grow needed if toggle is small and nav is absolutely positioned on mobile when open */
}
header .site-title h1 {
    color: #fff;
    margin-bottom: 0; /* Adjusted margin */
    font-size: 1.6rem; /* Slightly smaller for sticky header */
}
header .site-title h1 a {
    color: #fff;
}
header .site-title p {
    font-size: 0.75rem; /* Smaller subtitle */
    margin-bottom: 0;
    color: #bdc3c7;
}

.menu-toggle {
    display: none; /* Hidden by default, shown on mobile */
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    padding: 5px;
    margin-left: auto; /* Pushes toggle to the right if site-title doesn't take full width */
}
.menu-toggle:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

nav.main-nav {
    /* Desktop: Will be part of the flex flow or positioned differently */
    /* Mobile: Will be hidden and then shown */
    width: 100%; /* On mobile, it takes full width when open */
    clear: both; /* Ensure it clears floats if any were used (unlikely here) */
}

/* Desktop Navigation (when hamburger is hidden) */
@media(min-width: 769px) {
    .menu-toggle {
        display: none;
    }
    nav.main-nav {
        width: auto; /* Auto width on desktop */
        max-height: none !important; /* Ensure it's always visible */
        overflow: visible !important; /* Ensure it's always visible */
        margin-left: 20px; /* Space between title and nav */
    }
    nav.main-nav ul {
        display: flex;
        flex-direction: row;
        justify-content: flex-end; /* Align nav items to the right on desktop */
        margin-top: 0; /* Align with site title */
    }
    nav.main-nav ul li {
        padding: 0 7px;
    }
    nav.main-nav ul li a {
        color: #ecf0f1;
        text-transform: uppercase;
        font-weight: 700;
        font-size: 0.8rem;
        padding: 8px 5px;
        display: block; /* Or inline-block */
        text-align: center;
        transition: color 0.3s ease, background-color 0.3s ease;
        border-bottom: none; /* Remove mobile border */
    }
    nav.main-nav ul li a:hover {
        color: #fff;
        background-color: #1c2a4d;
        text-decoration: none;
        border-radius: 4px;
    }
    nav.main-nav ul li a[download] {
        background-color: #2c3e50;
        color: #fff !important;
        padding: 6px 12px;
        border-radius: 4px;
        margin: 0 0 0 10px; /* Align download button */
        display: inline-block;
    }
    nav.main-nav ul li a[download]:hover {
        background-color: #3b5998;
    }
}

/* Mobile Navigation (when hamburger is shown) */
@media(max-width: 768px) {
    header .header-container {
        /* flex-wrap: wrap; /* Already set, nav will drop below */
    }
    header .site-title {
        flex-grow: 1; /* Allow title to take available space next to toggle */
    }
    .menu-toggle {
        display: block;
    }

    nav.main-nav {
        max-height: 0; /* Hidden by default */
        overflow: hidden;
        transition: max-height 0.4s ease-out; /* Smooth transition */
        width: 100%; /* Full width */
        background-color: #1c2a4d; /* Background for the expanded mobile menu */
        position: absolute; /* Position it absolutely below the fixed header bar */
        top: 100%; /* Start right below the header part (site-title & toggle) */
        left: 0;
        right: 0;
        box-shadow: 0 4px 8px rgba(0,0,0,0.2); /* Shadow for dropdown */
    }
    nav.main-nav.active {
        max-height: 70vh; /* Or a large enough fixed value like 500px, 70vh allows it to take up to 70% of viewport height */
        overflow-y: auto; /* Allow scrolling if menu is very long */
    }
    header#pageHeader.nav-active {
        /* Styles for the main header bar when nav is open, if needed */
        /* e.g., change border or shadow */
    }

    nav.main-nav ul {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        margin-top: 0;
        padding: 10px 0; /* Padding inside the expanded nav */
    }
    nav.main-nav ul li {
        padding: 0;
        width: 100%;
    }
    nav.main-nav ul li a {
        color: #ecf0f1;
        text-transform: uppercase;
        font-weight: 700;
        font-size: 0.9rem;
        padding: 15px 20px; /* Larger tap targets */
        display: block;
        text-align: left;
        border-bottom: 1px solid #2c3e50; /* Separator */
        transition: color 0.3s ease, background-color 0.3s ease;
    }
    nav.main-nav ul li:last-child a {
        border-bottom: none;
    }
    nav.main-nav ul li a:hover {
        background-color: #2c3e50; /* Darker hover for mobile links */
        color: #fff;
    }
    nav.main-nav ul li a[download] {
        background-color: #3b5998; /* Distinct color for download */
        color: #fff !important;
        padding: 12px 20px;
        border-radius: 0; /* Full width look for download button in mobile nav */
        margin: 10px 0 0 0; /* Margin above download */
        text-align: center;
        display: block;
    }
    nav.main-nav ul li a[download]:hover {
        background-color: #4e69a2;
    }
}


/* Hero Section - Content after sticky header */
#hero {
    background: #ecf0f1;
    padding: 40px 0; /* Adjust if needed, body padding-top handles space for header */
    /* No margin-top needed due to scroll-padding-top or body padding-top */
}

#hero .container {
    display: flex;
    align-items: center;
    gap: 30px;
}

#hero .profile-pic-container {
    flex-shrink: 0;
}

#hero .profile-pic {
    width: 200px;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
}

#hero .hero-text {
    flex-grow: 1;
}
#hero .hero-text h2 {
    text-align: left;
    border-bottom: none;
    margin-bottom: 15px;
    color: #0e1428;
}
#hero .hero-text p {
    font-size: 1.1rem;
    color: #34495e;
}

/* Sections - General */
section {
    padding: 50px 0;
    background-color: #fff;
    margin-bottom: 0;
    box-shadow: none;
}
section:not(#hero){
    border-top: 1px solid #e9ecef;
}
section:not(#hero):nth-child(even) {
    background-color: #f8f9fa;
}



/* --- ALL OTHER STYLES (Project Grid, Skills, Gallery, Blog, Footer etc.) remain the same as your previous version --- */
/* Make sure to include them below this point */


/* General Button Styles (copied from previous for completeness) */
.btn, .view-all-link, .read-more-link, .project-link, .back-link, .github-link {
    display: inline-block;
    background: #0e1428; /* NEW DARK BLUE for buttons */
    color: #fff !important;
    padding: 10px 20px;
    border-radius: 5px; /* Slightly more rounded */
    margin-top: 15px; /* Consistent margin */
    font-size: 0.95rem; /* Consistent font size */
    text-align: center;
    font-weight: 700;
    transition: background-color 0.3s ease, transform 0.2s ease;
    border: none; /* Remove default border */
    cursor: pointer;
}
.btn:hover, .view-all-link:hover, .read-more-link:hover, .project-link:hover, .back-link:hover, .github-link:hover {
    background-color: #1c2a4d; /* Slightly lighter blue for hover */
    text-decoration: none;
    transform: translateY(-2px); /* Slight lift on hover */
}
.text-center {
    text-align: center;
}

/* Project Grid (copied from previous for completeness) */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.project-card {
    background: #fff;
    border: 1px solid #e0e0e0; /* Lighter border */
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.07); /* Slightly more pronounced shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 15px rgba(0,0,0,0.1);
}

.project-card img,
.project-placeholder-img {
    width: 100%;
    height: 200px;
    background-color: #e9ecef; /* Lighter placeholder */
    display: flex;
    align-items: center;
    justify-content: center;
    color: #566573; /* Darker placeholder text */
    font-style: italic;
    border-radius: 5px;
    margin-bottom: 15px;
    object-fit: cover;
}

.project-card h3 {
    font-size: 1.3rem;
    color: #0e1428; /* NEW DARK BLUE */
    margin-top: 0;
}

.project-card p {
    font-size: 0.95rem;
    margin-bottom: 10px;
    flex-grow: 1;
    color: #566573; /* Slightly muted text color */
}
.project-card p strong {
    color: #2c3e50; /* Darker color for strong text */
}


/* Skills Section (copied from previous for completeness) */
.skills-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}
.skill-category {
    background: #f8f9fa; /* Light background */
    padding: 25px; /* Increased padding */
    border-radius: 8px; /* More rounded */
    border: 1px solid #e0e0e0; /* Light border */
}
.skill-category h3 {
    color: #0e1428; /* NEW DARK BLUE */
    margin-bottom: 15px; /* Increased margin */
    border-bottom: 1px solid #d1d9e0; /* Lighter border */
    padding-bottom: 10px; /* Increased padding */
    font-size: 1.25rem; /* Slightly larger */
}
.skill-category ul li {
    padding: 8px 0; /* Increased padding */
    border-bottom: 1px dotted #d1d9e0; /* Lighter dotted border */
    color: #495057; /* Muted list item color */
}
.skill-category ul li:last-child {
    border-bottom: none;
}

/* Education Section (copied from previous for completeness) */
.education-entry {
    background: #f8f9fa;
    padding: 20px;
    border-left: 5px solid #0e1428; /* NEW DARK BLUE accent */
    margin-bottom: 20px;
    border-radius: 0 5px 5px 0; /* Rounded corners on one side */
}
.education-entry h3 {
    color: #0e1428; /* NEW DARK BLUE */
    font-size: 1.2rem;
}
.education-entry p {
    color: #495057;
}

/* Contact Section (copied from previous for completeness) */
.contact-links {
    list-style: none;
    padding: 0;
    text-align: center;
}
.contact-links li {
    margin-bottom: 15px;
    font-size: 1.1rem;
}
.contact-links li a {
    color: #0e1428; /* NEW DARK BLUE */
    transition: color 0.3s ease;
    font-weight: 400; /* Normal weight for contact links */
}
.contact-links li a:hover {
    color: #3b5998; /* Lighter blue for hover */
}
.contact-links i {
    margin-right: 10px;
    color: #0e1428; /* NEW DARK BLUE for icons */
    width: 20px; /* Ensure consistent icon spacing */
    text-align: center;
}


/* Project Detail Page Styles (copied from previous for completeness) */
#project-detail-page .container h2 {
    text-align: left;
    border-bottom: none;
    margin-bottom: 15px; /* Reduced margin */
    color: #0e1428; /* NEW DARK BLUE */
}
.project-detail-image-main {
    width: 100%;
    max-width: 700px;
    height: auto;
    min-height: 300px;
    max-height: 450px;
    object-fit: contain;
    margin: 0 auto 30px auto; /* Increased bottom margin */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background-color: #e9ecef;
    color: #566573;
    font-style: italic;
    text-align: center;
    border: 1px solid #d1d9e0; /* Light border for placeholder */
}
#project-detail-page .container h3 {
    color: #0e1428; /* NEW DARK BLUE */
    margin-top: 30px; /* Increased margin */
    border-bottom: 1px solid #d1d9e0; /* Lighter border */
    padding-bottom: 10px; /* Increased padding */
    font-size: 1.4rem;
    text-align: left;
}
#project-detail-page .container ul {
    list-style: disc;
    padding-left: 25px;
    margin-bottom: 1.2rem;
    color: #495057;
}
#project-detail-page .container ul li {
    margin-bottom: 0.7rem;
    line-height: 1.7;
}
#project-detail-page .project-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 25px; /* Increased margin */
    margin-bottom: 25px; /* Increased margin */
}
#project-detail-page .project-gallery img,
#project-detail-page .project-gallery .project-placeholder-img {
    width: 100%;
    height: 180px; /* Slightly taller gallery images */
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #d1d9e0;
    background-color: #e9ecef;
    color: #566573;
    display: flex;
    align-items: center;
    justify-content: center;
    font-style: italic;
    transition: transform 0.3s ease;
}
#project-detail-page .project-gallery img:hover {
    transform: scale(1.05);
}

.github-link { /* Specific style to distinguish from back-link */
    background: #24292e; /* GitHub dark color */
}
.github-link:hover {
    background: #3e444a; /* Lighter GitHub dark on hover */
}
.github-link i {
    margin-right: 8px;
}


/* Footer (copied from previous for completeness) */
footer {
    text-align: center;
    padding: 30px; /* Increased padding */
    background: #0e1428; /* NEW DARK BLUE */
    color: #bdc3c7; /* Lighter text for footer */
    margin-top: 40px; /* Increased margin */
    border-top: 3px solid #1c2a4d; /* Added border top for footer */
}
footer p {
    margin: 0;
    font-size: 0.9rem;
}
footer a { /* If any links in footer */
    color: #ecf0f1;
    font-weight: 700;
}
footer a:hover {
    color: #fff;
}

/* Responsive Design Adjustments */
@media(max-width: 768px) {
    /* :root { --header-height: NEW_MOBILE_HEADER_HEIGHTpx; } /* Example */

    /* Mobile Header adjustments were moved into the main header CSS with @media queries */

    #hero .container {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    #hero .profile-pic {
        width: 160px;
        height: 200px;
        margin-bottom: 15px;
    }
    #hero .hero-text h2 {
        text-align: center;
        font-size: 1.8rem;
    }
    #hero .hero-text p {
        font-size: 1rem;
    }

    .container {
        width: 90%;
    }
    .project-grid, 
    .skills-container, 
    .gallery-grid, 
    #project-detail-page .project-gallery,
    .album-image-grid {
        grid-template-columns: 1fr;
    }
    .album-image-item {
        height: 220px;
    }

    h1 { font-size: 2rem; }
    h2 { font-size: 1.7rem; }
    h3 { font-size: 1.25rem; }

    #blog-post-detail-page .blog-content img,
    #project-detail-page .project-gallery img {
        max-width: 100%;
    }
    .project-detail-image-main {
        max-width: 100%;
        min-height: 200px;
    }

    .btn, .view-all-link, .read-more-link, .project-link, .back-link, .github-link {
        padding: 12px 18px;
        font-size: 1rem;
    }
}