/* --- Global Styles & Variables --- */
:root {
  --primary-color: #007bff; /* A nice blue */
  --secondary-color: #6c757d; /* Grey for secondary text */
  --background-color: #f8f9fa;
  --surface-color: #ffffff;
  --text-color: #343a40;
  --heading-font: 'Poppins', sans-serif;
  --body-font: 'Roboto', sans-serif;
  --border-radius: 8px;
  --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

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

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

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px 0;
}

h1, h2, h3, h4 {
  font-family: var(--heading-font);
  line-height: 1.3;
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: #0056b3;
  text-decoration: underline;
}

p {
  margin-bottom: 1rem;
}

ul {
    list-style-position: inside;
    margin-bottom: 1rem;
}

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

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

.site-title {
  font-size: 1.8rem;
  font-weight: 700;
}

.site-title a {
  color: var(--text-color);
}
.site-title a:hover {
  text-decoration: none;
}

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.main-nav a {
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 5px;
  transition: background-color 0.3s, color 0.3s;
}

.main-nav a:hover, .main-nav .active {
  background-color: var(--primary-color);
  color: #fff;
  text-decoration: none;
}

/* --- Main Layout --- */
.main-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  margin-top: 30px;
  flex: 1;
}

@media (min-width: 768px) {
  .main-layout {
    grid-template-columns: 3fr 1fr;
  }
}

main {
  background-color: var(--surface-color);
  padding: 2rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
}

/* --- Blog Post Cards (Homepage) --- */
.blog-posts {
  display: grid;
  gap: 20px;
}

.post-card {
  border: 1px solid #ddd;
  border-radius: var(--border-radius);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.15);
}

.post-card-content {
  padding: 1.5rem;
}

.read-more {
  display: inline-block;
  margin-top: 1rem;
  font-weight: 700;
}

/* --- Sidebar --- */
.sidebar {
  padding: 1.5rem;
  background-color: var(--surface-color);
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  height: fit-content;
}

.widget {
  margin-bottom: 2rem;
}

.widget-title {
  border-bottom: 2px solid var(--primary-color);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.widget ul {
  list-style: none;
}

.widget li {
  margin-bottom: 0.5rem;
}

.widget a {
    display: block;
    padding: 5px;
    border-radius: 4px;
}
.widget a:hover {
    background-color: #f1f1f1;
    text-decoration: none;
}

.promo-widget {
    background-color: #e7f3ff;
    padding: 1rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 1px solid #b3d7ff;
}

/* --- Article Page --- */
.article-header {
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.article-meta {
    font-size: 0.9rem;
    color: var(--secondary-color);
    margin-top: 0.5rem;
}

.article-content h2 {
    margin-top: 2rem;
}
.article-content h3 {
    margin-top: 1.5rem;
}

.cta-section {
    background-color: #e7f3ff;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    margin-top: 2rem;
    border: 2px dashed var(--primary-color);
}
.cta-section h2 {
    margin-bottom: 1rem;
}
.cta-button {
    background-color: #28a745;
    color: #fff;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 700;
    display: inline-block;
    transition: background-color 0.3s;
}
.cta-button:hover {
    background-color: #218838;
    text-decoration: none;
}


/* --- Footer --- */
.site-footer {
  background-color: var(--text-color);
  color: #fff;
  text-align: center;
  padding: 2rem 0;
  margin-top: auto;
}

.site-footer .container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-links ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #fff;
}
.footer-links a:hover {
  text-decoration: underline;
}

/* --- Responsive Adjustments --- */
@media (max-width: 767px) {
  .site-header .container {
    flex-direction: column;
    gap: 1rem;
  }
  .main-nav ul {
    justify-content: center;
  }
}