/* style/blog.css */

/* General styles for the page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: var(--background-color, #ffffff); /* Default to white if var not set */
}

.page-blog__content-area {
  max-width: 1170px;
  margin: 0 auto;
  padding: 40px 16px;
  box-sizing: border-box;
}

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

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

.page-blog__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  color: #555555;
}

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

/* Hero Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, body handles header offset */
  padding-bottom: 60px;
  background-color: #ffffff; /* Light background for hero */
}

.page-blog__hero-container {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 40px 16px;
  gap: 40px;
}

.page-blog__hero-content {
  flex: 1 1 45%;
  min-width: 300px;
  text-align: left;
  color: #333333;
}

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

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

.page-blog__cta-buttons {
  display: flex;
  gap: 15px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.page-blog__hero-image {
  flex: 1 1 45%;
  min-width: 300px;
  text-align: center;
}

.page-blog__hero-side-image {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05em;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box; /* Crucial for responsiveness */
  max-width: 100%; /* Ensure buttons don't overflow */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text breaking */
}

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

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

.page-blog__btn-primary--yellow { /* For CTA section */
  background-color: #FFFF00;
  color: #C30808;
  border-color: #FFFF00;
}

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


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

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

.page-blog__btn-secondary--white { /* For CTA section */
  background-color: transparent;
  color: #ffffff;
  border-color: #ffffff;
}

.page-blog__btn-secondary--white:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.page-blog__read-more-btn {
  display: inline-block;
  margin-top: 15px;
  color: #017439;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

.page-blog__read-more-btn:hover {
  color: #005a2e;
  text-decoration: underline;
}

/* Blog Section */
.page-blog__blog-section {
  padding-top: 60px;
  padding-bottom: 60px;
  background-color: #f8f8f8; /* Slightly off-white background */
}

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

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

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

.page-blog__blog-card-media {
  width: 100%;
  height: 220px; /* Fixed height for consistent card images */
  overflow: hidden;
}

.page-blog__blog-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.page-blog__blog-card-content {
  padding: 20px;
  flex-grow: 1; /* Allows content to expand and push footer down */
  display: flex;
  flex-direction: column;
}

.page-blog__blog-card-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: bold;
}

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

.page-blog__blog-card-title a:hover {
  color: #005a2e;
  text-decoration: underline;
}

.page-blog__blog-card-meta {
  font-size: 0.9em;
  color: #888888;
  margin-bottom: 15px;
}

.page-blog__blog-card-excerpt {
  font-size: 1em;
  color: #666666;
  margin-bottom: 15px;
  flex-grow: 1; /* Push the read more button to the bottom */
}

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

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

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

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

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  background-color: #f9f9f9;
  cursor: pointer;
  font-size: 1.15em;
  font-weight: bold;
  color: #017439;
  transition: background-color 0.3s ease;
  list-style: none; /* Hide default marker */
}

.page-blog__faq-question::-webkit-details-marker { /* Hide default marker for webkit browsers */
  display: none;
}

.page-blog__faq-item[open] > .page-blog__faq-question {
  background-color: #e0e0e0;
}

.page-blog__faq-question:hover {
  background-color: #e0e0e0;
}

.page-blog__faq-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: #017439;
}

.page-blog__faq-answer {
  padding: 15px 25px;
  font-size: 1em;
  color: #555555;
  background-color: #ffffff;
}

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

/* CTA Section (Dark Background) */
.page-blog__cta-section {
  padding-top: 80px;
  padding-bottom: 80px;
  background-color: #017439; /* Main brand color for dark background */
  text-align: center;
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__hero-container {
    flex-direction: column;
    text-align: center;
  }

  .page-blog__hero-content {
    text-align: center;
    order: 2; /* Content below image on tablet */
  }

  .page-blog__hero-image {
    order: 1; /* Image above content on tablet */
    margin-bottom: 30px;
  }

  .page-blog__cta-buttons {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding-top: 10px !important; /* Ensure minimal top padding for mobile */
    padding-bottom: 40px;
  }

  .page-blog__hero-container {
    padding: 20px 15px;
    gap: 20px;
  }

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

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

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 10px;
  }

  .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;
  }

  /* Ensure all containers and images are responsive */
  .page-blog__content-area,
  .page-blog__blog-section,
  .page-blog__faq-section,
  .page-blog__cta-section,
  .page-blog__hero-section,
  .page-blog__blog-card-media {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden; /* Prevent horizontal scroll */
  }

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

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

  .page-blog__section-description {
    font-size: 0.95em;
    margin-bottom: 30px;
  }

  .page-blog__blog-list {
    grid-template-columns: 1fr; /* Single column for blog cards */
    gap: 25px;
  }

  .page-blog__blog-card-media {
    height: 180px; /* Adjust height for mobile card images */
  }

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

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

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

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