/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light body background */
  background-color: #ffffff;
}

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

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: #017439;
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__section-title--white {
  color: #ffffff;
}

.page-blog__section-intro {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  color: #555555;
}

.page-blog__section-intro--white {
  color: #f0f0f0;
}

/* Hero Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, body handles header offset */
  position: relative;
  overflow: hidden;
  text-align: center;
  background: linear-gradient(135deg, #017439, #005f2e);
  padding-bottom: 50px;
}

.page-blog__hero-image {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 25%; /* Aspect ratio 4:1 for a wide banner */
  overflow: hidden;
}

.page-blog__hero-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.7); /* Slightly dim the image for text readability */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: 30px 20px;
  color: #ffffff;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size */
  font-weight: 800;
  color: #FFFF00; /* Register/Login font color for prominence */
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: 1.15em;
  margin-bottom: 30px;
  line-height: 1.6;
  color: #f0f0f0;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  transition: background-color 0.3s ease, transform 0.3s ease;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
  max-width: 100%;
}

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

.page-blog__btn-primary:hover {
  background-color: #e01c1c;
  transform: translateY(-2px);
}

.page-blog__btn-secondary {
  background-color: #017439; /* Primary color */
  color: #FFFFFF;
  border: 2px solid #017439;
}

.page-blog__btn-secondary:hover {
  background-color: #005f2e;
  transform: translateY(-2px);
}

/* Latest Articles Section */
.page-blog__latest-articles {
  padding: 60px 0;
  background-color: #f9f9f9;
}

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

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

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

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

.page-blog__card-image {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  overflow: hidden;
}

.page-blog__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-blog__card-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

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

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

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

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #017439; /* Primary brand color */
  color: #ffffff;
}

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

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 180px;
}

.page-blog__category-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
}

.page-blog__category-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
  color: #FFFF00; /* Register/Login font color for prominence */
}

.page-blog__category-description {
  font-size: 1em;
  color: #f0f0f0;
}

/* Bottom CTA Section */
.page-blog__cta-bottom {
  padding: 60px 0;
  background-color: #f0f0f0;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: #ffffff;
}

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

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

.page-blog__faq-item summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: #017439;
  cursor: pointer;
  background-color: #eaf7ed; /* Light green background for summary */
  transition: background-color 0.3s ease;
}

.page-blog__faq-item summary:hover {
  background-color: #dcebdc;
}

.page-blog__faq-item summary::-webkit-details-marker {
  display: none;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  color: #017439;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  padding: 20px 25px;
  font-size: 1em;
  color: #555555;
  border-top: 1px solid #e0e0e0;
}

.page-blog__faq-answer p {
  margin: 0;
}

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

/* Mobile Responsive Styles */
@media (max-width: 768px) {
  .page-blog__container,
  .page-blog__hero-content {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* HERO Section */
  .page-blog__hero-section {
    padding-top: 10px; /* Consistent small top padding */
    padding-bottom: 30px;
  }

  .page-blog__hero-image {
    padding-bottom: 45%; /* Adjust aspect ratio for mobile */
  }

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

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

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 15px !important;
    font-size: 1em !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Latest Articles Section */
  .page-blog__latest-articles {
    padding: 40px 0;
  }

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

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

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

  .page-blog__card-image {
    height: 180px; /* Adjust card image height */
  }

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

  .page-blog__card-excerpt {
    font-size: 0.9em;
  }

  .page-blog__view-all-button-container {
    margin-top: 30px;
  }

  /* Categories Section */
  .page-blog__categories-section {
    padding: 40px 0;
  }

  .page-blog__category-grid {
    grid-template-columns: 1fr; /* Single column for categories */
    gap: 20px;
  }

  .page-blog__category-card {
    min-height: 150px;
    padding: 25px;
  }

  .page-blog__category-title {
    font-size: 1.3em;
  }

  /* Bottom CTA Section */
  .page-blog__cta-bottom {
    padding: 40px 0;
  }

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

  .page-blog__faq-item summary {
    padding: 15px 20px;
    font-size: 1em;
  }

  .page-blog__faq-answer {
    padding: 15px 20px;
    font-size: 0.95em;
  }

  /* General image and container responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-blog__hero-section,
  .page-blog__latest-articles,
  .page-blog__categories-section,
  .page-blog__cta-bottom,
  .page-blog__faq-section,
  .page-blog__container,
  .page-blog__article-card,
  .page-blog__category-card,
  .page-blog__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__hero-content { /* Override padding for hero content */
    padding-left: 15px;
    padding-right: 15px;
  }
}