/* style/blog.css */

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

/* Color contrast safety */
.page-blog__dark-bg {
  background: #017439;
  color: #ffffff;
}

.page-blog__light-bg {
  background: #ffffff;
  color: #333333;
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  padding-bottom: 60px;
  overflow: hidden;
  text-align: center;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 40px;
}

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

.page-blog__hero-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 20px;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.2em);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #ffffff;
}

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

/* Blog List Section */
.page-blog__blog-list-section {
  padding: 60px 0;
}

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

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

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

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

.page-blog__post-cover-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

.page-blog__post-cover {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Enforce minimum size */
}

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

.page-blog__card-title {
  font-size: 1.5em;
  font-weight: 600;
  margin-bottom: 15px;
  line-height: 1.3;
}

.page-blog__card-title a {
  color: #017439;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__card-title a:hover {
  color: #005f2e;
}

.page-blog__post-meta {
  font-size: 0.9em;
  color: #666666;
  margin-bottom: 15px;
}

.page-blog__post-summary {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1;
}

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

/* Call to Action Section */
.page-blog__cta-section {
  padding: 80px 20px;
  text-align: center;
}

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

.page-blog__cta-description {
  font-size: 1.1em;
  margin-bottom: 40px;
  color: #f0f0f0;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1em;
  cursor: pointer;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box;
  max-width: 100%; /* Ensure responsiveness */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word;
}

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

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

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

.page-blog__btn-secondary:hover {
  background: #f0f0f0;
  color: #005f2e;
}

.page-blog__cta-button {
  min-width: 250px; /* Ensure button is not too small */
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .page-blog__hero-section {
    padding-bottom: 40px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 2.8em);
  }

  .page-blog__section-title {
    font-size: 2em;
  }

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

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

@media (max-width: 768px) {
  .page-blog__container {
    padding: 0 15px;
  }

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

  .page-blog__hero-image-wrapper,
  .page-blog__post-cover-wrapper,
  .page-blog__blog-card,
  .page-blog__cta-section,
  .page-blog__blog-list-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  /* Buttons responsiveness */
  .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;
    margin-bottom: 15px; /* Add spacing for stacked buttons */
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__hero-section {
    padding-top: 10px !important;
    padding-bottom: 30px;
  }

  .page-blog__main-title {
    font-size: 2em;
  }

  .page-blog__description {
    font-size: 1em;
  }

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

  .page-blog__blog-grid {
    grid-template-columns: 1fr;
  }

  .page-blog__cta-title {
    font-size: 1.6em;
  }

  .page-blog__cta-section {
    padding: 40px 15px;
  }
}

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: 1.8em;
  }

  .page-blog__section-title {
    font-size: 1.6em;
  }

  .page-blog__cta-title {
    font-size: 1.4em;
  }

  .page-blog__blog-card {
    margin-bottom: 20px;
  }
}