/* --- Global Styles --- */
:root {
    --primary-color: #4064d7;
    --dark-grey: #303030;
    --light-grey: #f5f5f5;
    --background-color: #ffffff;

    /* Disabling this because Killian BG already has an overlay built in */
    --hero-overlay: rgba(255, 255, 255, 0);
}

body {
    margin: 0;
    font-family: 'Varela Round', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--dark-grey);
    background-color: var(--background-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(20px, 4vw, 50px);
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    color: var(--dark-grey);
}

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

ul {
    list-style: none;
    padding-left: 0;
}

h1,
h2,
h3,
h4 {
    font-family: 'Rubik', sans-serif;
    font-weight: 700;
    color: var(--dark-grey);
}

h1 {
    font-size: 5rem;
    line-height: 1.2;
    margin: .3em 0;
}

h3 {
    font-size: 2.15rem;
    text-align: center;
    margin-bottom: 1rem;
}

h4 {
    font-size: 1.5rem;
}


/* --- Header --- */
.site-header {
    background-color: var(--background-color);
    padding: .85em 0;
    border-bottom: 1px solid #eaeaea;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    max-width: 139px;
    display: block;
}

.main-navigation ul {
    display: flex;
    margin: 0;
}

.main-navigation li {
    margin-left: 2em;
}

.main-navigation a {
    color: var(--dark-grey);
    font-weight: bold;
}

.main-navigation a.current,
.main-navigation a:hover {
    color: var(--primary-color);
}

/* --- Hero Section --- */
.hero {
    background-image: url('/images/killianbg.jpg');
    background-size: cover;
    background-position: center;
    padding: 10em 0;
    text-align: left;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--hero-overlay);
}

.hero-container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2em;
}

.hero-text {
    flex: 1;
}

.hero-text .subtitle {
    font-family: 'Rubik', sans-serif;
    font-weight: bold;
    color: var(--dark-grey);
    letter-spacing: 1px;
}

.hero-image img {
    border-radius: 50%;
    width: 100%;
    max-width: 305px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* --- Projects Section --- */
.projects {
    padding: 4em 0;
    background-color: var(--light-grey);
}

.projects-header {
    text-align: center;
    margin-bottom: 3em;
}

.projects-header .divider {
    width: 80px;
    height: 3px;
    background-color: var(--primary-color);
    margin: 1rem auto;
}

.project-card {
    display: flex;
    background-color: var(--background-color);
    margin-bottom: 2em;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.project-card:nth-child(odd) {
    flex-direction: row-reverse;
}

.project-image {
    flex-basis: 50%;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-details {
    flex-basis: 50%;
    padding: 2em 3em;
    display: flex;
    flex-direction: column;
}

.project-details h4 {
    margin-bottom: 0.25em;
}

.project-subtitle {
    font-size: 1rem;
    font-style: italic;
    color: #555;
    margin-top: 0;
    margin-bottom: 1.5em;
}

.project-details ul {
    list-style: disc;
    padding-left: 20px;
}

.project-details li {
    margin-bottom: 0.5em;
}

/* --- Achievements Section --- */
.achievements {
    padding: 4em 0;
    background-color: var(--background-color);
}

.achievements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5em;
    text-align: left;
}

.achievement-item {
    background-color: var(--background-color);
    padding: 2em;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.achievement-item h4 {
    font-size: 1.25rem;
    margin-bottom: 0.5em;
}

.achievement-item p {
    margin-top: 0;
    font-size: 1rem;
    line-height: 1.6;
    color: #555;
}

/* --- Footer --- */
.site-footer {
    background-color: #232323;
    color: #ffffff;
    text-align: center;
    padding: 2em 0;
}

/* --- Responsive Styles --- */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    .header-container {
        flex-direction: column;
    }

    .main-navigation ul {
        padding-top: 1em;
        justify-content: center;
        gap: 2em;
        padding-left: 0;
    }

    .main-navigation li {
        margin-left: 0;
    }

    .hero {
        padding: 4em 0;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
    }

    .hero-text {
        order: 2;
    }

    .hero-image {
        order: 1;
    }

    .project-card,
    .project-card:nth-child(odd) {
        flex-direction: column;
    }

    .achievements-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Blog Page Styles --- */

.blog-hero {
    background-image: url('/images/coding.jpg');
    /* Default blog hero image */
    background-size: cover;
    background-position: center;
    padding: 9em 0;
    /* Approx 144px, similar to original 150px */
    text-align: center;
    position: relative;
}

.blog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(12, 12, 12, 0.6);
    /* Overlay to match original */
}

.blog-hero .hero-container {
    /* Ensure text is above overlay */
    position: relative;
    display: flex;
    /* Overriding default hero-container flex for centering text */
    justify-content: center;
}

.blog-hero .hero-text h1 {
    font-size: 3rem;
    color: #ffffff;
    margin-bottom: 0.5em;
}

.blog-hero .hero-text .subtitle {
    font-size: 1.25rem;
    color: #ffffff;
    font-family: 'Varela Round', sans-serif;
    font-weight: normal;
    letter-spacing: normal;
    /* Reset letter-spacing if not desired for blog subtitle */
}

.blog-posts {
    padding-top: 20px;
    padding-bottom: 70px;
    background-color: var(--background-color);
    /* White background for the section */
    margin-top: -120px;
    /* Pulls section up over the hero */
    position: relative;
    /* Establishes stacking context */
    z-index: 1;
    /* Ensures it's above the hero's ::before pseudo-element if needed */
}

.blog-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* Two columns for desktop and tablet */
    gap: 2em;
}

.blog-card {
    background-color: #f7f7f7;
    /* Light grey background for cards */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-5px);
}

.blog-card-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.blog-card-content {
    padding: 1.5em;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card h4 {
    font-size: 1.65rem;
    /* Adjusted to be slightly smaller than project titles */
    margin-top: 0;
    margin-bottom: 0.5em;
}

.blog-card h4 a {
    color: var(--dark-grey);
}

.blog-card h4 a:hover {
    color: var(--primary-color);
}

.blog-card-meta {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 1em;
}

.blog-card-excerpt {
    margin-bottom: 1.5em;
    flex-grow: 1;
    /* Pushes button to the bottom */
    font-size: 0.95rem;
    line-height: 1.5;
}

.blog-card-excerpt p {
    margin: 0;
}

.btn,
.blog-card .btn {
    /* Ensuring .btn styles apply or can be specific */
    display: inline-block;
    background-color: var(--primary-color);
    color: #ffffff !important;
    /* Ensure text is white */
    padding: 0.7em 1.5em;
    border-radius: 50px;
    text-align: center;
    font-weight: normal;
    /* Matching original button font weight */
    font-family: 'Varela Round', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease;
    align-self: flex-start;
    text-decoration: none;
    /* Remove underline from button links */
    font-size: 0.9rem;
}

.btn:hover,
.blog-card .btn:hover {
    background-color: var(--dark-grey);
    color: #ffffff !important;
}

/* Responsive adjustments for blog grid */
@media (max-width: 767px) {
    .blog-grid {
        grid-template-columns: 1fr;
        /* Single column for mobile */
    }

    .blog-hero {
        padding: 6em 0;
    }

    .blog-hero .hero-text h1 {
        font-size: 2.5rem;
    }

    .blog-hero .hero-text .subtitle {
        font-size: 1.1rem;
    }

    .blog-posts {
        margin-top: -60px;
        /* Adjust negative margin for smaller hero */
        padding-top: 20px;
        padding-bottom: 40px;
    }
}

/* --- Single Blog Post Styles --- */
.blog-post-full {
    padding: 3em 0;
    /* Add some padding above and below the post */
}

.blog-post-container {
    max-width: 800px;
    /* Optimal width for reading long-form text */
    margin: 0 auto;
}

.blog-post-header {
    margin-bottom: 2em;
    text-align: left;
    /* Or 'center' if you prefer */
}

.blog-post-header h1 {
    font-size: 2.8rem;
    /* Slightly smaller than main hero h1, but prominent */
    margin-bottom: 0.25em;
    line-height: 1.3;
}

.post-meta {
    font-size: 0.95em;
    color: #555;
    /* Slightly lighter than main text */
    margin-bottom: 1.5em;
}

.post-meta time {
    margin-right: 1em;
}

.blog-post-full .featured-image {
    width: 100%;
    height: auto;
    margin-bottom: 2em;
    border-radius: 8px;
    /* Optional: if you want rounded corners */
}

.post-content-body {
    font-size: 1.1rem;
    /* Slightly larger for readability */
    line-height: 1.7;
}

.post-content-body p {
    margin-bottom: 1.5em;
}

.post-content-body h2 {
    font-size: 2rem;
    margin-top: 2em;
    margin-bottom: 1em;
}

.post-content-body h3 {
    font-size: 1.75rem;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
}

.post-content-body h4 {
    font-size: 1.5rem;
    margin-top: 1.5em;
    margin-bottom: 0.7em;
}

.post-content-body ul,
.post-content-body ol {
    margin-bottom: 1.5em;
    padding-left: 25px;
    /* Indent lists */
}

.post-content-body ul li,
.post-content-body ol li {
    margin-bottom: 0.5em;
}

.post-content-body ul {
    list-style: disc;
}

.post-content-body ol {
    list-style: decimal;
}

.post-content-body img {
    max-width: 100%;
    height: auto;
    margin: 1.5em 0;
    border-radius: 4px;
    /* Optional: slight rounding for inline images */
    display: block;
    /* To allow margin auto for centering if needed */
    margin-left: auto;
    margin-right: auto;
}

.post-content-body blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    border-left: 4px solid var(--primary-color);
    background-color: var(--light-grey);
    font-style: italic;
}

.post-content-body blockquote p {
    margin-bottom: 0;
}

.post-content-body pre {
    background-color: #2d2d2d;
    /* Dark background for code blocks */
    color: #f8f8f2;
    /* Light text for contrast */
    padding: 1em;
    border-radius: 4px;
    overflow-x: auto;
    /* Allow horizontal scrolling for long lines */
    margin-bottom: 1.5em;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
    line-height: 1.5;
}

.post-content-body code {
    font-family: 'Courier New', Courier, monospace;
    background-color: #f0f0f0;
    /* Light grey for inline code */
    padding: 0.2em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
    /* Slightly smaller than surrounding text */
}

.post-content-body pre code {
    background-color: transparent;
    /* Reset for code inside pre */
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    /* Inherit pre's font size */
}

/* Responsive adjustments for single post */
@media (max-width: 768px) {
    .blog-post-header h1 {
        font-size: 2.2rem;
    }

    .post-content-body {
        font-size: 1rem;
    }

    .post-content-body h2 {
        font-size: 1.8rem;
    }

    .post-content-body h3 {
        font-size: 1.6rem;
    }

    .blog-post-full {
        padding: 2em 0;
    }
}