@import url('https://fonts.googleapis.com/css2?family=Caveat&display=swap');

/* --- Google-inspired Minimalist Theme --- */

/* --- Variables & Resets --- */
:root {
    --font-family-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --background-color: #ffffff;
    --surface-color: #f8f9fa;
    --on-surface-color: #202124;
    --primary-color: #1a73e8;
    --on-primary-color: #ffffff;
    --border-color: #dadce0;
    --container-max-width: 900px;
    --border-radius: 8px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-sans);
    background-color: var(--background-color);
    color: var(--on-surface-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

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

h1, h2, h3 {
    line-height: 1.2;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.25rem; font-weight: 600; }
h2 { font-size: 1.75rem; font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 500; }

/* --- Layout & Container --- */
.container {
    width: 90%;
    max-width: var(--container-max-width);
    margin-left: auto;
    margin-right: auto;
}

main {
    flex-grow: 1;
    padding-top: 2rem;
    padding-bottom: 4rem;
}

/* --- Header & Navigation --- */
.site-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

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

.logo {
    font-family: 'Caveat', cursive;
    font-size: 2rem;
    font-weight: 400;
    color: var(--on-surface-color);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--on-surface-color);
    font-weight: 500;
    padding-bottom: 0.25rem;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease-in-out;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0.5em;
}

.hamburger {
    display: block;
    position: relative;
    width: 2em;
    height: 3px;
    background: var(--on-surface-color);
    transition: transform 0.2s ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--on-surface-color);
    transition: transform 0.2s ease-in-out;
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}

@media (max-width: 768px) {
    .nav-toggle {
        display: block;
        z-index: 1001; /* Ensure it's above the nav */
    }

    .nav-open .hamburger {
        transform: rotate(45deg);
    }

    .nav-open .hamburger::before {
        transform: rotate(90deg);
        top: 0;
    }

    .nav-open .hamburger::after {
        transform: rotate(90deg);
        bottom: 0;
    }

    .nav-links {
        position: fixed; /* Use fixed to cover the whole screen */
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: var(--surface-color);
        flex-direction: column;
        align-items: center;
        justify-content: center; /* Center links vertically */
        gap: 1rem;
        padding: 2rem 0;
        z-index: 1000;
        
        /* Smooth transition */
        transform: translateY(-100%);
        transition: transform 0.3s ease-in-out;
        display: flex; /* Keep it flex for alignment */
    }

    .nav-links.show-nav {
        transform: translateY(0);
    }

    .nav-links a {
        padding: 1rem;
        width: 100%;
        text-align: center;
        border-bottom: 1px solid var(--border-color);
        font-size: 1.2rem;
    }

    .nav-links a:last-child {
        border-bottom: none;
    }

    .nav-links a:hover,
    .nav-links a.active {
        border-bottom-color: var(--primary-color);
    }

    /* Prevent body scroll when nav is open */
    body.nav-open {
        overflow: hidden;
    }
}

/* --- Footer --- */
.site-footer {
    background-color: var(--surface-color);
    border-top: 1px solid var(--border-color);
    padding: 2rem 0;
    color: #5f6368;
    font-size: 0.9rem;
    text-align: center;
}

.footer-nav {
    margin-bottom: 1rem;
}

.footer-nav a {
    color: #5f6368;
    margin: 0 0.75rem;
}

/* --- Buttons --- */
.btn, .cta-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    border: none;
}

.btn-accent, .cta-button {
    background-color: var(--primary-color);
    color: var(--on-primary-color);
    text-decoration: none;
}

.btn-accent:hover, .cta-button:hover {
    background-color: #1865c9;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    text-decoration: none;
}

/* --- Content Sections --- */
.content-block {
    max-width: 720px; /* Optimal reading width */
    margin: 3rem auto;
}

.content-block h2 {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem; /* Increased space after heading */
}

.content-block p {
    line-height: 1.7;
    margin-bottom: 1.5rem;
}

/* --- Blog Specific --- */
.blog-article {
    padding-top: 2rem;
}

.article-meta {
    color: #5f6368;
    margin-bottom: 2rem;
}

.blog-article h2 {
    margin-top: 2rem;
}

.blog-article ul {
    list-style-position: inside;
    padding-left: 1rem;
    margin-top: 1rem;
}

/* --- Grid System --- */
.cluster-grid-section {
    margin-top: 4rem;
    text-align: center;
}

.cluster-grid-updated {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    text-align: left;
}

.grid-card {
    display: block;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    text-decoration: none;
    color: var(--on-surface-color);
}

.grid-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-decoration: none;
}

.grid-card h3 {
    color: var(--primary-color);
}

.grid-card p {
    color: #5f6368;
    font-size: 0.9rem;
}

/* --- Utility --- */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* --- Blog Page --- */
.blog-post-list {
    margin-top: 3rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* --- Contact Form --- */
.contact-form {
    margin-top: 3rem;
    max-width: 600px;
}

.form-group-stacked {
    margin-bottom: 1.5rem;
}

.form-group-stacked label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.form-group-stacked input,
.form-group-stacked textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: var(--font-family-sans);
}

.form-group-stacked input:focus,
.form-group-stacked textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

/* --- Article & Markdown Styles --- */
.blog-article h1,
.blog-article h2,
.blog-article h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.blog-article p {
    margin-bottom: 1rem;
}

.blog-article ul,
.blog-article ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

.blog-article li {
    margin-bottom: 0.5rem;
}

.blog-article blockquote {
    border-left: 4px solid var(--primary-color);
    padding-left: 1rem;
    margin: 2rem 0;
    font-style: italic;
    color: #5f6368;
}

.blog-article code {
    background-color: #f1f3f4;
    padding: 0.2em 0.4em;
    margin: 0;
    font-size: 85%;
    border-radius: 3px;
}

.blog-article pre {
    background-color: #f1f3f4;
    padding: 1rem;
    border-radius: var(--border-radius);
    overflow-x: auto;
}

.blog-article pre code {
    padding: 0;
    background-color: transparent;
    border-radius: 0;
}