/* Basic Reset & Defaults */
:root {
  --primary-color: #333;
  --secondary-color: #555;
  --accent-color: #007bff;
  --background-color: #fdfdfd;
  --card-background: #fff;
  --border-color: #eee;
  --text-light: #666;
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
  --font-serif: Georgia, Cambria, "Times New Roman", Times, serif;
}

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

html {
  scroll-behavior: smooth;
}

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

main {
  flex-grow: 1;
}

/* Structure & Spacing */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 1.5rem; /* Padding on sides */
}

section {
  padding: 3rem 0; /* Vertical spacing between sections */
}

section:last-child {
  padding-bottom: 4rem;
}

/* Header & Footer */
.site-header {
  padding: 0.8rem 0; /* Adjusted padding slightly */
  background-color: var(--card-background);
  border-bottom: 1px solid var(--border-color);
}

/* --- Updated Header Navigation Styles --- */
.site-header nav {
    display: flex;
    justify-content: space-between; /* Space between logo/title area and nav links */
    align-items: center; /* Vertically align items in the nav bar */
    gap: 1rem; /* Optional gap between elements */
}

/* Styles for the link wrapping logo/title */
.site-logo-link {
    display: inline-flex; /* Align logo and text nicely */
    align-items: center;
    gap: 0.75rem; /* Space between logo and text title */
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
    font-size: 1.2em; /* Adjust title size if needed */
}
.site-logo-link:hover {
    /* Optional: Define hover effect if needed */
    color: var(--accent-color);
    text-decoration: none; /* Prevent underline on hover */
}

/* Styles for the logo image itself */
.site-logo {
    height: 40px; /* Control logo size - ADJUST AS NEEDED */
    width: auto;  /* Maintain aspect ratio */
    display: block; /* Helps prevent extra space */
    flex-shrink: 0; /* Prevent logo from shrinking if space is tight */
}

/* Class for the text part of the title */
.site-title-text {
    display: inline-block;
    white-space: nowrap; /* Prevent title wrapping if too long */
}

/* Container for the navigation links */
.nav-links {
    /* Add styles if needed, e.g., for spacing between links */
}
.nav-links a {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem;
    margin-left: 0.5rem; /* Space between nav links */
    font-weight: normal; /* Ensure nav links aren't bold like title */
}
.nav-links a:hover {
    color: var(--accent-color);
    text-decoration: none;
}
/* --- End Updated Header Navigation Styles --- */


.site-footer {
  border-top: 1px solid var(--border-color);
  border-bottom: none;
  margin-top: auto; /* Pushes footer to bottom */
  color: var(--text-light);
  font-size: 0.9em;
  text-align: center;
  padding: 1.5rem 0; /* Added padding to footer */
}


/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  margin-bottom: 1rem;
  line-height: 1.2;
  color: var(--primary-color);
}

h1 { font-size: 2.8em; }
h2 { font-size: 2em; margin-top: 1em; }
/* h3 styling mostly within .card-content and .post-content */

p {
  margin-bottom: 1rem;
  color: var(--secondary-color);
}

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

a:hover {
  text-decoration: underline;
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 0;
  background-color: var(--card-background); /* Light background for hero */
}
.hero h1 {
  margin-bottom: 0.5rem;
}
.hero p {
  font-size: 1.2em;
  color: var(--text-light);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Image */
.hero-image {
    padding-top: 0; /* Remove top padding if it follows hero section */
}
.hero-image .center-image {
  text-align: center;
}
.hero-image img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Latest Posts Section */
.latest-posts h2 {
  text-align: center;
  margin-bottom: 2.5rem;
}

.post-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

/* Post Card Styling */
.card {
  display: flex;
  gap: 1rem;
  background-color: var(--card-background);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

/* Card Image Container */
.card-image {
  flex-shrink: 0;
  width: 100px;
  height: 100px;
}
.card-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* Card Text Content Container */
.card-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}
.card-content h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2em;
    font-family: var(--font-serif);
    line-height: 1.3;
}
.card-content h3 a {
  color: var(--primary-color);
  text-decoration: none;
}
.card-content h3 a:hover {
  color: var(--accent-color);
  text-decoration: none;
}
.card-content p {
    flex-grow: 1;
    margin-bottom: 0.5rem;
    font-size: 0.9em;
    color: var(--text-light);
    line-height: 1.5;
}
.post-meta-preview {
    margin-top: auto;
    font-size: 0.8em;
    color: var(--text-light);
}

/* All Posts Link */
.all-posts-link {
  text-align: center;
  margin-top: 2.5rem;
}
.all-posts-link a {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: var(--accent-color);
  color: white;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.2s ease;
}
.all-posts-link a:hover {
  background-color: #0056b3;
  text-decoration: none;
}


/* Newsletter Section */
.newsletter {
  background-color: #f0f0f0;
  text-align: center;
}
.newsletter h2 {
  margin-bottom: 0.5rem;
}
.newsletter p {
  color: var(--text-light);
  margin-bottom: 1.5rem;
}
.newsletter-form {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  max-width: 500px;
  margin: 0 auto 1rem auto;
}
.newsletter-form input[type="email"] {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1em;
  flex-grow: 1;
  min-width: 200px;
}
.newsletter-form button {
  padding: 0.8rem 1.5rem;
  font-size: 1em;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.newsletter-form button:hover {
  background-color: #0056b3;
}
.newsletter small {
  font-size: 0.85em;
  color: var(--text-light);
}

/* Single Post Styles */
.post-single {
  padding: 2rem 0; /* Add some vertical padding */
}
.post-header {
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}
.post-header h1 {
  margin-bottom: 0.5rem;
  font-size: 2.6em; /* Larger title for single post */
  line-height: 1.2;
}
.post-meta {
  font-size: 0.9em;
  color: var(--text-light);
}
.post-meta a {
  color: var(--text-light);
}
.post-meta a:hover {
  color: var(--accent-color);
}
.post-meta .categories {
    display: inline-block; /* Prevent wrapping issues */
    margin-left: 5px;
}
.post-content {
  line-height: 1.75; /* Improve readability */
  font-size: 1.05em;
  color: var(--secondary-color);
}
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  font-family: var(--font-serif);
  color: var(--primary-color);
  margin-top: 2.2em;
  margin-bottom: 1em;
  line-height: 1.3;
}
.post-content h2 { font-size: 1.8em; }
.post-content h3 { font-size: 1.5em; }
.post-content h4 { font-size: 1.3em; }
.post-content p {
  margin-bottom: 1.3em;
}
.post-content ul,
.post-content ol {
  margin-bottom: 1.3em;
  padding-left: 1.8em;
}
.post-content li {
  margin-bottom: 0.6em;
}
.post-content blockquote {
  margin: 1.8em 0;
  padding: 0.8em 1.5em;
  border-left: 5px solid var(--accent-color);
  background-color: #f7f7f7;
  color: var(--secondary-color);
  font-style: italic;
}
.post-content blockquote p {
    margin-bottom: 0;
}
.post-content pre {
  background-color: #f0f0f0;
  border: 1px solid var(--border-color);
  padding: 1em;
  border-radius: 4px;
  overflow-x: auto;
  margin: 1.5em 0;
  font-size: 0.9em;
  line-height: 1.4;
}
.post-content code {
   font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
   background-color: #eef0f1;
   padding: 0.2em 0.4em;
   border-radius: 3px;
   font-size: 0.9em;
}
.post-content pre code {
   background-color: transparent;
   padding: 0;
   border-radius: 0;
   font-size: inherit;
   line-height: inherit;
}
.post-content img {
   max-width: 100%;
   height: auto;
   display: block;
   margin: 1.5em auto;
   border-radius: 4px;
   box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.post-content a {
    color: var(--accent-color);
    text-decoration: underline;
    text-decoration-skip-ink: auto;
}
.post-content a:hover {
    color: #0056b3;
}
.post-content hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2.5em 0;
}


/* Responsive Adjustments */
@media (max-width: 768px) {
  h1 { font-size: 2.4em; }
  h2 { font-size: 1.8em; }
  .container { padding: 0 1rem; }
  section { padding: 2rem 0; }
  .hero { padding: 3rem 0; }
  .post-header h1 { font-size: 2.2em; } /* Adjust single post title */
}

@media (max-width: 480px) {
    h1 { font-size: 2em; }
    h2 { font-size: 1.6em; }
    .hero p { font-size: 1em; }
    .newsletter-form { flex-direction: column; align-items: stretch; }
    .newsletter-form input[type="email"], .newsletter-form button {
        width: 100%;
    }
    .card {
        /* Keep side-by-side even on small screens for this layout */
        /* Or optionally stack: flex-direction: column; align-items: center; */
    }
    .site-header nav {
        /* Adjust header on small screens if needed */
        /* flex-direction: column; align-items: flex-start; */
    }
    .post-header h1 { font-size: 2em; }
    .post-content { font-size: 1em; }
}