.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background: var(--background-color, #FFFFFF); /* Inherit from shared or default to white */
}

/* HERO Section (Non-homepage, so it's a banner-like hero) */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, relying on body padding-top for header offset */
  padding-bottom: 40px;
  background-color: #f8f8f8; /* Light background for contrast */
}

.page-blog__hero-container {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding: 40px 16px;
  box-sizing: border-box;
}

.page-blog__hero-content {
  flex: 1 1 50%;
  min-width: 300px;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 2.8em); /* Responsive H1 font size */
  font-weight: 700;
  line-height: 1.2;
  color: #017439; /* Brand color for main title */
  margin-bottom: 15px;
}

.page-blog__description {
  font-size: 1.1em;
  color: #555555;
  margin-bottom: 20px;
}

.page-blog__hero-image {
  flex: 1 1 40%;
  text-align: center;
}

.page-blog__hero-side-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  display: block; /* Ensure it behaves as a block element for max-width */
}

/* Posts Section */
.page-blog__posts-section {
  padding: 60px 0;
  background-color: #FFFFFF;
}

.page-blog__posts-container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: 2.2em;
  color: #017439;
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
}

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

.page-blog__post-card {
  background: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

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

.page-blog__post-thumbnail {
  width: 100%;
  height: 220px; /* Fixed height for thumbnails */
  object-fit: cover;
  display: block;
}

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

.page-blog__post-title {
  font-size: 1.3em;
  color: #017439;
  margin-bottom: 10px;
  line-height: 1.4;
  font-weight: 600;
}

.page-blog__post-excerpt {
  font-size: 0.95em;
  color: #666666;
  margin-bottom: 15px;
  flex-grow: 1;
}

.page-blog__post-date {
  font-size: 0.85em;
  color: #999999;
  text-align: right;
  display: block;
}

.page-blog__view-all-wrapper {
  text-align: center;
  margin-top: 20px;
}

.page-blog__view-all-button {
  display: inline-block;
  padding: 12px 25px;
  background-color: #017439;
  color: #FFFFFF;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1em;
  font-weight: 600;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  box-sizing: border-box; /* Ensure padding is included in total width */
}

.page-blog__view-all-button:hover {
  background-color: #005a2e;
}

/* CTA Section */
.page-blog__cta-section {
  background-color: #017439; /* Brand primary color */
  padding: 60px 0;
  text-align: center;
  color: #FFFFFF;
}

.page-blog__cta-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.page-blog__cta-title {
  font-size: clamp(1.8em, 3.5vw, 2.5em);
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
}

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-size: 1.1em;
  font-weight: 700;
  transition: all 0.3s ease;
  min-width: 180px;
  text-align: center;
  box-sizing: border-box; /* Crucial for mobile responsiveness */
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Break long words */
}

.page-blog__btn-primary {
  background-color: #C30808; /* Custom color for Register/Login */
  color: #FFFF00; /* Custom font color for Register/Login */
  border: 2px solid #C30808;
}

.page-blog__btn-primary:hover {
  background-color: #a30606;
  border-color: #a30606;
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: #FFFFFF;
  border: 2px solid #FFFFFF;
}

.page-blog__btn-secondary:hover {
  background-color: #FFFFFF;
  color: #017439;
}

/* General image and container responsiveness for content area */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-blog__hero-container {
    gap: 30px;
    padding: 30px 16px;
  }
  .page-blog__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
  }
  .page-blog__post-thumbnail {
    height: 200px;
  }
}

@media (max-width: 768px) {
  /* HERO Section */
  .page-blog__hero-section {
    padding-top: 10px !important; /* Ensure small top padding */
  }
  .page-blog__hero-container {
    flex-direction: column;
    text-align: center;
    padding: 20px 15px;
    gap: 20px;
  }
  .page-blog__hero-content,
  .page-blog__hero-image {
    flex: 1 1 100%;
    min-width: unset;
  }
  .page-blog__main-title {
    font-size: 2em; /* Adjust for mobile */
  }
  .page-blog__description {
    font-size: 1em;
  }

  /* Posts Section */
  .page-blog__posts-section {
    padding: 40px 0;
  }
  .page-blog__posts-container {
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }
  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }
  .page-blog__post-thumbnail {
    height: 180px; /* Smaller height for mobile thumbnails */
  }
  .page-blog__post-title {
    font-size: 1.1em;
  }
  .page-blog__post-excerpt {
    font-size: 0.9em;
  }
  .page-blog__view-all-button {
    width: 100% !important;
    max-width: 300px !important; /* Limit max width for button on mobile */
    margin: 0 auto;
    padding: 10px 20px;
    font-size: 1em;
    box-sizing: border-box !important;
  }

  /* CTA Section */
  .page-blog__cta-section {
    padding: 40px 0;
  }
  .page-blog__cta-container {
    padding: 0 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .page-blog__cta-title {
    font-size: 1.6em;
  }
  .page-blog__cta-description {
    font-size: 1em;
  }
  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 15px;
    padding: 0 15px; /* Add padding to button container */
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    min-width: unset;
    padding: 12px 20px;
    font-size: 1em;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* General Images and Containers */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  .page-blog__posts-section,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Ensure content area images maintain minimum size if not already handled by max-width */
.page-blog__post-thumbnail {
  min-width: 200px;
  min-height: 200px;
}

/* No CSS filters allowed on images */
.page-blog img {
  filter: none !important;
}