/* style/blog.css */

/* General styles for the blog page, ensuring text contrast */
.page-blog {
  font-family: Arial, sans-serif;
  color: #333333; /* Default text color for light background */
  background-color: #ffffff; /* Body background is default white */
  line-height: 1.6;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 40px; /* Small top padding, larger bottom for content */
  background-color: #f8f8f8; /* Light background for hero section */
}

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

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

.page-blog__hero-content {
  max-width: 960px;
  text-align: center;
  padding: 30px 20px 0;
  color: #333333; /* Ensure contrast on light background */
}

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

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

/* Primary Button Style */
.page-blog__btn-primary {
  display: inline-block;
  background-color: #017439;
  color: #ffffff;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease;
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  background-color: #005c2d;
}

/* Secondary Button Style */
.page-blog__btn-secondary {
  display: inline-block;
  background-color: #ffffff;
  color: #017439;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  border: 2px solid #017439;
}

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


/* Articles Section */
.page-blog__articles-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 20px;
  background-color: #ffffff; /* Ensure light background for articles */
}

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

.page-blog__articles-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;
  border: 1px solid #e0e0e0; /* Add border for definition */
}

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

.page-blog__article-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-blog__article-image {
  width: 100%;
  height: 200px; /* Fixed height for consistent card images */
  object-fit: cover;
  display: block;
}

.page-blog__article-content {
  padding: 20px;
}

.page-blog__article-title {
  font-size: 1.4em;
  font-weight: 600;
  margin-bottom: 10px;
  color: #017439; /* Brand color for article titles */
  line-height: 1.4;
}

.page-blog__article-date {
  font-size: 0.9em;
  color: #666666;
  margin-bottom: 15px;
  display: block;
}

.page-blog__article-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* Limit excerpt to 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.page-blog__read-more {
  color: #017439;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  transition: color 0.3s ease;
}

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

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

/* CTA Section */
.page-blog__cta-section {
  background-color: #017439; /* Dark brand color background */
  color: #ffffff; /* White text for dark background */
  padding: 60px 20px;
  text-align: center;
}

.page-blog__cta-title {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 20px;
}

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

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


/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 2.5em);
  }
  .page-blog__articles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  /* Mobile general */
  .page-blog__hero-section,
  .page-blog__articles-section,
  .page-blog__cta-section {
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
  }

  /* Images responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Image containers responsive */
  .page-blog__hero-image-wrapper,
  .page-blog__article-card,
  .page-blog__article-image {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  /* Buttons responsive */
  .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 !important;
    padding-right: 15px !important;
  }
  
  /* Button containers responsive */
  .page-blog__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 0 !important; /* Buttons themselves have padding */
    padding-right: 0 !important;
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px !important;
  }

  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2em);
  }

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

  .page-blog__article-title {
    font-size: 1.2em;
  }
  
  .page-blog__article-image {
    height: 180px; /* Adjust height for mobile */
  }

  .page-blog__hero-section {
    padding-top: 10px !important; /* Ensure small top padding */
  }
}