:root {
  --primary-color: #017439;
  --secondary-color: #FFFFFF;
  --text-dark: #333333;
  --text-light: #FFFFFF;
  --bg-light: #FFFFFF;
  --btn-register-bg: #C30808;
  --btn-login-bg: #C30808;
  --btn-login-register-text: #FFFF00; /* Special color for login/register button text */
  --header-offset: 122px; /* Default value, assumed to be set by shared.css */
}

.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark); /* Default text color for light background */
  background-color: var(--bg-light); /* Explicitly set for clarity */
}

/* Hero Section */
.page-blog__hero-section {
  display: flex;
  flex-direction: column; /* Ensure image is above content */
  align-items: center;
  text-align: center;
  padding: 10px 20px 40px; /* Small top padding, relying on body for header offset */
  background-color: var(--bg-light);
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 1200px; /* Limit hero image width on desktop */
  margin-bottom: 30px;
  overflow: hidden;
  border-radius: 8px;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover; /* Cover for desktop, will change for mobile */
  border-radius: 8px;
}

.page-blog__hero-content {
  max-width: 800px;
  padding: 0 20px;
}

.page-blog__main-title {
  font-size: clamp(2.2em, 4vw, 3.2em); /* Responsive font size for H1 */
  color: var(--primary-color);
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.1em;
  margin-bottom: 30px;
}

/* General Section Styles */
.page-blog__section {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.page-blog__section-title {
  font-size: 2.2em;
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

/* Buttons */
.page-blog__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  cursor: pointer;
  text-align: center;
  max-width: 100%; /* Ensure buttons are responsive */
  box-sizing: border-box;
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-blog__btn-primary {
  background-color: var(--btn-register-bg); /* Use custom register color */
  color: var(--btn-login-register-text); /* Use custom font color */
  border: 2px solid var(--btn-register-bg);
  margin-right: 15px;
}

.page-blog__btn-primary:hover {
  background-color: #a40606; /* Darken on hover */
  border-color: #a40606;
}

.page-blog__btn-secondary {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.page-blog__btn-secondary:hover {
  background-color: var(--primary-color);
  color: var(--secondary-color);
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 15px;
  width: 100%; /* For responsive button container */
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Featured Posts */
.page-blog__featured-posts {
  background-color: #f9f9f9; /* Slightly off-white for contrast */
}

.page-blog__post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.page-blog__post-card {
  background-color: var(--bg-light);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
  height: 100%; /* Ensure cards have equal height */
  display: flex;
  flex-direction: column;
}

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

.page-blog__post-link {
  text-decoration: none;
  color: var(--text-dark);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__post-thumbnail {
  width: 100%;
  height: 200px; /* Fixed height for thumbnails */
  overflow: hidden;
}

.page-blog__post-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__post-thumbnail img {
  transform: scale(1.05);
}

.page-blog__post-content {
  padding: 20px;
  flex-grow: 1; /* Allow content to grow */
  display: flex;
  flex-direction: column;
}

.page-blog__post-title {
  font-size: 1.4em;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-meta {
  font-size: 0.9em;
  color: #777;
  margin-bottom: 15px;
}

.page-blog__post-excerpt {
  font-size: 1em;
  color: #555;
  flex-grow: 1;
}

.page-blog__view-all-button-container {
  text-align: center;
  margin-top: 40px;
}

/* Latest Posts (List View) */
.page-blog__latest-posts {
  background-color: var(--bg-light);
}

.page-blog__post-list {
  display: grid;
  grid-template-columns: 1fr; /* Single column layout for list */
  gap: 30px;
}

.page-blog__list-item {
  display: flex;
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease;
}

.page-blog__list-item:hover {
  transform: translateY(-3px);
}

.page-blog__list-item-thumbnail {
  width: 30%; /* Fixed width for thumbnail */
  flex-shrink: 0;
  overflow: hidden;
}

.page-blog__list-item-thumbnail img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.page-blog__list-item-content {
  padding: 20px;
  flex-grow: 1;
}

.page-blog__list-item-title {
  font-size: 1.3em;
  color: var(--primary-color);
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__list-item-title a {
  text-decoration: none;
  color: var(--primary-color);
}

.page-blog__list-item-title a:hover {
  text-decoration: underline;
}

.page-blog__read-more {
  display: inline-block;
  margin-top: 15px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
}

.page-blog__read-more:hover {
  text-decoration: underline;
}

/* CTA Banner */
.page-blog__cta-banner {
  background: linear-gradient(45deg, var(--primary-color), #005a2e); /* Gradient with brand color */
  color: var(--text-light);
  text-align: center;
  padding: 80px 20px;
}

.page-blog__cta-title {
  font-size: 2.5em;
  margin-bottom: 20px;
  color: var(--text-light);
  font-weight: bold;
}

.page-blog__cta-description {
  font-size: 1.2em;
  max-width: 800px;
  margin: 0 auto 40px;
}

/* FAQ Section */
.page-blog__faq-section {
  background-color: #f9f9f9;
}

.page-blog__faq-list {
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__faq-item {
  background-color: var(--bg-light);
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--primary-color);
  cursor: pointer;
  list-style: none; /* Remove default marker */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* Hide default marker for webkit browsers */
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 10px;
  color: #777;
}

.page-blog__faq-answer {
  padding: 0 20px 20px;
  font-size: 1em;
  color: #555;
}

/* General image responsive styles */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* General container responsive styles */
.page-blog__section,
.page-blog__post-grid,
.page-blog__post-list,
.page-blog__cta-banner,
.page-blog__faq-section,
.page-blog__hero-image-wrapper,
.page-blog__hero-content,
.page-blog__cta-buttons,
.page-blog__faq-list,
.page-blog__post-card,
.page-blog__list-item {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden; /* Prevent horizontal scroll */
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

  /* Hero Section - Mobile */
  .page-blog__hero-section {
    padding: 10px 15px 30px;
  }

  .page-blog__hero-image-wrapper {
    margin-bottom: 20px;
  }

  .page-blog__hero-image {
    object-fit: contain !important; /* Contain for mobile, avoid cropping */
    aspect-ratio: unset !important; /* Remove aspect ratio constraint */
    max-height: none !important; /* Remove max height constraint */
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em);
    margin-bottom: 15px;
  }

  .page-blog__description {
    font-size: 1em;
    margin-bottom: 25px;
  }

  /* Section Titles - Mobile */
  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
    padding: 0 15px;
  }

  /* Buttons - Mobile */
  .page-blog__cta-buttons {
    flex-direction: column !important;
    gap: 10px;
    padding: 0 15px;
  }

  .page-blog__cta-button {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-right: 0 !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Featured Posts - Mobile */
  .page-blog__featured-posts {
    padding: 40px 15px;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-blog__post-card {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .page-blog__post-thumbnail {
    height: 180px;
  }

  .page-blog__post-title {
    font-size: 1.2em;
  }

  /* Latest Posts - Mobile */
  .page-blog__latest-posts {
    padding: 40px 15px;
  }

  .page-blog__list-item {
    flex-direction: column;
  }

  .page-blog__list-item-thumbnail {
    width: 100%;
    height: 180px;
  }

  .page-blog__list-item-content {
    padding: 15px;
  }

  .page-blog__list-item-title {
    font-size: 1.1em;
  }

  /* CTA Banner - Mobile */
  .page-blog__cta-banner {
    padding: 50px 15px;
  }

  .page-blog__cta-title {
    font-size: 1.8em;
  }

  .page-blog__cta-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  /* FAQ Section - Mobile */
  .page-blog__faq-section {
    padding: 40px 15px;
  }

  .page-blog__faq-question {
    font-size: 1.1em;
    padding: 15px;
  }

  .page-blog__faq-answer {
    padding: 0 15px 15px;
  }

  /* General image responsive styles - Mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  /* All content containers for mobile */
  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Ensure no filter on images */
.page-blog img {
  filter: none !important;
}