/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: #FFFFFF; /* Explicitly set for clarity */
}

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

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

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

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
  margin-bottom: 40px;
  background-color: #f0f0f0;
}

.page-blog__hero-image-wrapper {
  position: relative;
  width: 100%;
  height: 0;
  padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
  overflow: hidden;
}

.page-blog__hero-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-blog__hero-content {
  max-width: 800px;
  margin: 40px auto;
  text-align: center;
  padding: 0 15px;
}

.page-blog__hero-title {
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: #017439;
  margin-bottom: 20px;
  /* Using clamp for responsive font size, but within reasonable bounds */
  font-size: clamp(2.2em, 4vw, 3em);
}

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

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

.page-blog__hero-cta-button {
  background-color: #017439;
  color: #ffffff;
  border: 2px solid #017439;
}

.page-blog__hero-cta-button:hover {
  background-color: #005f2c;
  border-color: #005f2c;
}

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

.page-blog__article-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  transition: transform 0.3s ease;
  height: 100%; /* Ensure cards in a row have equal height */
  display: flex;
  flex-direction: column;
}

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

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

.page-blog__article-image {
  width: 100%;
  height: 225px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

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

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

.page-blog__article-date {
  font-size: 0.85em;
  color: #777777;
  margin-bottom: 15px;
}

.page-blog__read-more-button {
  display: inline-block;
  margin-top: auto; /* Pushes the button to the bottom */
  color: #017439;
  font-weight: bold;
  text-decoration: none;
  padding: 8px 0;
  border-top: 1px solid #eee;
  text-align: center;
}

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

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

.page-blog__view-all-button {
  background-color: #017439;
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

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

/* Featured Article Section */
.page-blog__dark-section {
  background-color: #017439;
  color: #ffffff;
}

.page-blog__dark-section p {
  color: #f0f0f0;
}

.page-blog__featured-content {
  display: flex;
  gap: 30px;
  align-items: center;
}

.page-blog__featured-text {
  flex: 1;
}

.page-blog__featured-image {
  flex: 0 0 500px;
  max-width: 500px;
  height: auto;
  border-radius: 10px;
  object-fit: cover;
  display: block;
}

/* Categories Section */
.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  text-align: center;
}

.page-blog__category-card {
  background: #f5f5f5;
  color: #017439;
  padding: 25px 15px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 1px solid #e0e0e0;
}

.page-blog__category-card:hover {
  background-color: #017439;
  color: #ffffff;
}

/* CTA Section */
.page-blog__cta-content {
  text-align: center;
}

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

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

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

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

/* FAQ Section */
.page-blog__faq-list {
  max-width: 900px;
  margin: 0 auto;
}

.page-blog__faq-item {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15em;
  font-weight: bold;
  color: #017439;
  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-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

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

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    margin: 30px auto;
  }

  .page-blog__hero-title {
    font-size: clamp(2em, 4.5vw, 2.8em);
  }

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

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

  .page-blog__featured-content {
    flex-direction: column;
    gap: 20px;
  }

  .page-blog__featured-image {
    max-width: 100%;
    flex: none;
  }

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

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

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

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

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

  .page-blog__hero-section {
    padding-top: 10px; /* Still small top padding */
    margin-bottom: 20px;
  }

  .page-blog__hero-content {
    margin: 20px auto;
    padding: 0 10px;
  }

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

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

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

  /* General image adaptation for mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  /* General container adaptation for mobile */
  .page-blog__container,
  .page-blog__section,
  .page-blog__card,
  .page-blog__hero-image-wrapper,
  .page-blog__article-grid,
  .page-blog__category-grid,
  .page-blog__faq-list,
  .page-blog__featured-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

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

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

  .page-blog__article-image {
    height: 180px; /* Adjust height for mobile */
  }

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

  .page-blog__featured-image {
    border-radius: 8px;
  }

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

  .page-blog__category-card {
    padding: 20px 10px;
    font-size: 1em;
  }

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

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

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

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