.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #FFFFFF; /* Default background for content areas */
}

.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, body handles header offset */
  position: relative;
  overflow: hidden;
  text-align: center;
  background-color: #017439; /* Brand primary color for hero background */
  color: #ffffff; /* White text for dark background */
  padding-bottom: 40px;
}

.page-blog__hero-image-wrapper {
  position: relative;
  width: 100%;
  height: 500px; /* Fixed height for hero image wrapper */
  overflow: hidden;
}

.page-blog__hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover the wrapper while maintaining aspect ratio */
  display: block;
}

.page-blog__hero-content {
  max-width: 900px;
  margin: 20px auto 0;
  padding: 0 20px;
  text-align: center;
}

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

.page-blog__hero-description {
  font-size: 1.1em;
  margin-bottom: 30px;
  color: #f0f0f0;
}

.page-blog__section {
  padding: 60px 0;
}

.page-blog__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: bold;
  text-align: center;
  margin-bottom: 40px;
  color: inherit; /* Inherit color from parent section */
}

.page-blog__sub-title {
  font-size: 1.8em;
  font-weight: bold;
  margin-top: 30px;
  margin-bottom: 15px;
  color: inherit;
}

.page-blog p {
  margin-bottom: 15px;
  font-size: 1.05em;
  color: inherit;
}

.page-blog ul {
  list-style: disc;
  margin-left: 20px;
  margin-bottom: 15px;
  color: inherit;
}

.page-blog li {
  margin-bottom: 8px;
  color: inherit;
}

.page-blog a {
  color: #FFFF00; /* Link color for contrast */
  text-decoration: none;
}

.page-blog a:hover {
  text-decoration: underline;
}

.page-blog__btn-primary {
  display: inline-block;
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  background-color: #A00707;
  text-decoration: none;
}

.page-blog__btn-secondary {
  display: inline-block;
  background-color: #ffffff;
  color: #017439; /* Brand primary color */
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 2px solid #017439;
  margin-left: 15px;
}

.page-blog__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #017439;
  text-decoration: none;
}

.page-blog__article-image-wrapper {
  margin: 30px 0;
  text-align: center;
}

.page-blog__article-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

.page-blog__articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
  margin-top: 40px;
  align-items: stretch;
}

.page-blog__article-card {
  background-color: #ffffff;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__article-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: #333333;
}

.page-blog__article-thumbnail {
  width: 100%;
  height: 225px;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid #eee;
}

.page-blog__article-title {
  font-size: 1.3em;
  font-weight: bold;
  margin: 15px 15px 10px 15px;
  color: #017439; /* Brand primary color for titles */
}

.page-blog__article-excerpt {
  font-size: 0.95em;
  margin: 0 15px 15px 15px;
  flex-grow: 1;
  color: #555555;
}

.page-blog__read-more {
  display: block;
  padding: 0 15px 15px 15px;
  color: #C30808;
  font-weight: bold;
  font-size: 0.9em;
}

.page-blog__read-more time {
  font-weight: normal;
  font-style: italic;
  color: #777;
  margin-left: 5px;
}

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

.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
}

.page-blog__cta-content {
  max-width: 800px;
}

.page-blog__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: #f0f0f0;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

/* Ensure all images are responsive */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Ensure buttons are responsive */
.page-blog__cta-button,
.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog a[class*="button"],
.page-blog a[class*="btn"] {
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__cta-buttons,
.page-blog__button-group,
.page-blog__btn-container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}


/* Responsive styles for mobile */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.5;
  }

  .page-blog__hero-section {
    padding-top: 10px; /* Small top padding for mobile */
    padding-bottom: 30px;
  }

  .page-blog__hero-image-wrapper {
    height: 300px; /* Adjust hero image height for mobile */
  }

  .page-blog__main-title {
    font-size: 2em;
    margin-bottom: 10px;
  }

  .page-blog__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  .page-blog__section {
    padding: 40px 0;
  }

  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-blog__sub-title {
    font-size: 1.4em;
    margin-top: 25px;
  }

  .page-blog__articles-grid {
    grid-template-columns: 1fr; /* Single column for articles on mobile */
    gap: 20px;
  }

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

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

  .page-blog__cta-section {
    padding: 60px 0;
  }

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

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 15px;
    padding: 0 15px;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100%;
    margin-left: 0; /* Remove margin-left for stacked buttons */
    text-align: center;
  }

  /* Force images to be fully responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  /* Force button responsiveness */
  .page-blog__cta-button,
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog a[class*="button"],
  .page-blog a[class*="btn"] {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__cta-buttons,
  .page-blog__button-group,
  .page-blog__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
  }

  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
  }
}