/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #ffffff; /* Light text for dark body background */
  background-color: transparent; /* Body background is handled by shared.css */
}

.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: bold;
  text-align: center;
  margin-bottom: 20px;
  color: #ffffff; /* Default light text for dark sections */
  line-height: 1.2;
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 20px 60px; /* Small top padding, larger bottom */
  min-height: 500px;
  overflow: hidden;
  box-sizing: border-box;
}

.page-blog__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

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

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 900px;
  padding: 20px;
  background: rgba(0, 0, 0, 0.4); /* Semi-transparent overlay for text readability */
  border-radius: 8px;
}

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

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

.page-blog__btn-primary {
  display: inline-block;
  background-color: #017439;
  color: #ffffff;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  border: 2px solid transparent;
}

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

/* Latest Posts Section */
.page-blog__latest-posts-section {
  padding: 80px 0;
  background-color: #ffffff; /* Light background for this section */
  color: #333333;
}

.page-blog__latest-posts-section .page-blog__section-title,
.page-blog__latest-posts-section .page-blog__section-description {
  color: #333333;
}

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

.page-blog__post-card {
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  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-image {
  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.4em;
  margin-bottom: 10px;
  line-height: 1.3;
}

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

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

.page-blog__post-date {
  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__read-more {
  display: inline-block;
  color: #017439;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
  align-self: flex-start;
}

.page-blog__read-more:hover {
  color: #005f2e;
}

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

.page-blog__btn-secondary {
  display: inline-block;
  background-color: #ffffff;
  color: #017439;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  border: 2px solid #017439;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Why Choose Us Section */
.page-blog__why-choose-us-section {
  padding: 80px 0;
  background-color: #017439; /* Brand color dark background */
  color: #ffffff;
}

.page-blog__why-choose-us-content {
  display: flex;
  align-items: center;
  gap: 40px;
}

.page-blog__why-choose-us-text {
  flex: 1;
}

.page-blog__why-choose-us-text .page-blog__section-title,
.page-blog__why-choose-us-text .page-blog__section-description {
  text-align: left;
  color: #ffffff;
  margin-left: 0;
  margin-right: 0;
}

.page-blog__why-choose-us-list {
  list-style: none;
  padding: 0;
  margin-top: 30px;
}

.page-blog__why-choose-us-list li {
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="%23FFFFFF" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"></polyline></svg>') no-repeat left center;
  background-size: 20px;
  padding-left: 30px;
  margin-bottom: 15px;
  font-size: 1.1em;
}

.page-blog__why-choose-us-image-wrapper {
  flex: 1;
  text-align: center;
}

.page-blog__why-choose-us-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0 auto;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: #f0f0f0; /* Light background */
  color: #333333;
}

.page-blog__faq-section .page-blog__section-title,
.page-blog__faq-section .page-blog__section-description {
  color: #333333;
}

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

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

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.2em;
  font-weight: bold;
  cursor: pointer;
  color: #333333;
  border-bottom: 1px solid #eeeeee;
  list-style: none; /* For details/summary */
}

.page-blog__faq-item[open] .page-blog__faq-question {
  border-bottom: 1px solid #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-item summary::-webkit-details-marker {
  display: none;
}

.page-blog__faq-answer {
  padding: 20px;
  padding-top: 0;
  color: #555555;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: #017439;
  color: #ffffff;
  position: relative;
  overflow: hidden;
  text-align: center;
}

.page-blog__cta-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__cta-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.3;
}

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

.page-blog__cta-content .page-blog__section-title,
.page-blog__cta-content .page-blog__section-description {
  color: #ffffff;
}

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

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

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

  .page-blog__why-choose-us-content {
    flex-direction: column;
  }

  .page-blog__why-choose-us-text .page-blog__section-title,
  .page-blog__why-choose-us-text .page-blog__section-description {
    text-align: center;
  }

  .page-blog__why-choose-us-list {
    margin-left: auto;
    margin-right: auto;
  }
}

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

  .page-blog__hero-section {
    padding: 10px 15px 40px;
    min-height: 400px;
  }

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

  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
    margin-bottom: 10px;
  }

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

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    padding: 12px 25px;
    font-size: 0.9em;
  }

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

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

  .page-blog__latest-posts-section,
  .page-blog__why-choose-us-section,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding: 50px 0;
  }

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

  .page-blog__post-image {
    height: 200px;
  }

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

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

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

  /* Mobile image responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__hero-image,
  .page-blog__post-image,
  .page-blog__why-choose-us-image,
  .page-blog__cta-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Mobile container responsiveness */
  .page-blog__section,
  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__latest-posts-section,
  .page-blog__why-choose-us-section,
  .page-blog__faq-section,
  .page-blog__cta-section,
  .page-blog__post-card,
  .page-blog__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow-x: hidden !important; /* Ensure no horizontal scroll */
  }

  /* 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;
    padding-left: 15px !important;
    padding-right: 15px !important;
    margin-bottom: 10px; /* Add space between stacked buttons */
  }

  .page-blog__cta-buttons,
  .page-blog__button-group,
  .page-blog__btn-container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    flex-wrap: wrap !important;
    gap: 10px;
    flex-direction: column !important; /* Stack buttons vertically */
  }

  /* Hero section padding-top for mobile - small amount */
  .page-blog__hero-section {
    padding-top: 10px !important;
  }
}

/* Dark background styles for specific sections */
.page-blog__dark-bg {
  background-color: #1a1a2e; /* Inherited body background, but explicitly set for clarity */
  color: #ffffff;
}

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

/* Button colors from custom palette */
.page-blog__btn-primary {
  background-color: #C30808; /* Register/Login color */
  color: #FFFF00; /* Register/Login font color */
  border: 2px solid transparent;
}

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

.page-blog__btn-secondary {
  background-color: #ffffff;
  color: #C30808; /* Register/Login color */
  border: 2px solid #C30808;
}

.page-blog__btn-secondary:hover {
  background-color: #C30808;
  color: #FFFF00;
}