/* style/blog.css */

/* --- General Styles --- */
.page-blog {
  font-family: 'Arial', sans-serif;
  color: #333333; /* Default text color for light body background */
  background-color: var(--background-color, #FFFFFF); /* Inherit from shared or default to white */
  line-height: 1.6;
}

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

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

/* --- Hero Section --- */
.page-blog__hero-section {
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  text-align: center;
  padding: 10px 0 60px; /* Small top padding */
  background-color: #f5f5f5;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 1200px; /* Constrain image width for desktop */
  margin-bottom: 30px;
}

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

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

.page-blog__main-title {
  font-weight: 800;
  color: #017439;
  line-height: 1.2;
  margin-bottom: 20px;
  /* No fixed font-size, rely on clamp if needed, otherwise default browser size */
}

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

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* Ensure button adapts to width */
  white-space: normal;
  word-wrap: break-word;
  text-align: center;
}

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

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

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

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

/* --- Latest Posts Section --- */
.page-blog__latest-posts {
  padding: 60px 0;
  background-color: #FFFFFF; /* Explicit white background for contrast */
}

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

.page-blog__post-card {
  background-color: #fcfcfc;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

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

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

.page-blog__post-title {
  font-size: 1.3em;
  font-weight: 700;
  color: #017439;
  margin-bottom: 10px;
  flex-grow: 1;
}

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 15px;
}

.page-blog__read-more {
  font-weight: 600;
  color: #C30808; /* Use accent color for read more */
  display: inline-block;
  margin-top: auto; /* Push to bottom */
}

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

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

/* --- CTA Section --- */
.page-blog__cta-section {
  background-color: #017439; /* Main brand color for dark background */
  color: #ffffff; /* White text for contrast */
  padding: 80px 0;
}

.page-blog__cta-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
}

.page-blog__cta-text {
  flex: 1;
  text-align: left;
}

.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: 30px;
  color: #f0f0f0;
}

.page-blog__cta-image-wrapper {
  flex: 0 0 500px; /* Fixed width for image on desktop */
  max-width: 50%; /* Max width relative to container */
}

.page-blog__cta-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

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

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

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

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.1em;
  font-weight: 600;
  color: #017439;
  cursor: pointer;
  background-color: #fcfcfc;
  transition: background-color 0.3s ease;
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
  background-color: #e6f7ed; /* Lighter green when open */
}

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

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: #C30808; /* Accent color for toggle */
}

/* Hide default details marker */
.page-blog__faq-item > summary {
  list-style: none;
}
.page-blog__faq-item > summary::-webkit-details-marker {
  display: none;
}

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

/* --- General CTA Section --- */
.page-blog__general-cta {
  background-color: #017439;
  color: #ffffff;
  padding: 60px 0;
  text-align: center;
}

.page-blog__general-cta-content {
  max-width: 800px;
}

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

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

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 2em;
  }

  .page-blog__hero-content {
    padding: 0 15px;
  }

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

  .page-blog__cta-container {
    flex-direction: column;
    text-align: center;
  }

  .page-blog__cta-text {
    text-align: center;
  }

  .page-blog__cta-image-wrapper {
    flex: none;
    max-width: 80%;
    margin-top: 30px;
  }
}

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

  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__hero-section {
    padding: 10px 0 40px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em); /* Using clamp for H1 on mobile */
  }

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

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 15px; /* Add padding to button container */
  }

  .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: 12px 20px;
  }

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

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

  .page-blog__post-thumbnail {
    height: 180px;
  }

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

  .page-blog__cta-section,
  .page-blog__faq-section,
  .page-blog__general-cta {
    padding: 40px 0;
  }

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

  .page-blog__cta-description,
  .page-blog__general-cta-description {
    font-size: 1em;
  }

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

  /* All images must be responsive */
  .page-blog img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__hero-image-wrapper,
  .page-blog__post-card,
  .page-blog__cta-image-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }
  
  /* Content area images minimum size constraint */
  .page-blog__latest-posts .page-blog__post-thumbnail {
    min-width: 200px !important; /* Ensure content images are not too small */
    min-height: 200px !important;
  }

  /* Video related styles (if any, though not directly in this blog page) */
  .page-blog video,
  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__video-section,
  .page-blog__video-container,
  .page-blog__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }
  .page-blog__video-section {
    padding-top: 10px !important; /* Small top padding, body handles header offset */
  }
}

/* Ensure no filter on images */
.page-blog img {
  filter: none !important;
}