/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-main); /* Default text color from custom palette */
  background-color: var(--bg-color); /* Background from custom palette */
}

.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: var(--text-main); /* Main text color */
  text-align: center;
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__section-description {
  font-size: 1.1em;
  color: var(--text-secondary); /* Secondary text color */
  text-align: center;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  padding-bottom: 60px;
  background-color: var(--bg-color);
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 675px; /* Adjust as needed for aspect ratio */
  overflow: hidden;
  position: relative;
}

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

.page-blog__hero-content {
  position: relative; /* Ensure content is above any potential background layering issue */
  text-align: center;
  padding: 40px 20px;
  max-width: 900px;
  margin-top: -80px; /* Overlap slightly with image for visual appeal, but not covering text */
  background-color: var(--card-bg); /* Use card background for content block */
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
  z-index: 1;
  border: 1px solid var(--border-color);
}

.page-blog__main-title {
  color: var(--text-main);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  /* No fixed font-size, rely on responsive scaling and weight */
  font-size: clamp(2em, 4vw, 3em);
}

.page-blog__intro-description {
  color: var(--text-secondary);
  font-size: 1.15em;
  margin-bottom: 30px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.05em;
  transition: all 0.3s ease;
  white-space: normal;
  word-wrap: break-word;
  box-sizing: border-box;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  color: #ffffff;
  border: 2px solid transparent;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: var(--text-main);
  border: 2px solid var(--border-color);
}

.page-blog__btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

/* Featured Posts Section */
.page-blog__featured-posts,
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: var(--bg-color);
}

.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: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.page-blog__post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.page-blog__card-link {
  text-decoration: none;
  display: block;
  height: 100%;
  color: inherit;
}

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

.page-blog__card-content {
  padding: 25px;
}

.page-blog__card-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__card-meta {
  font-size: 0.9em;
  color: var(--text-secondary);
  margin-bottom: 15px;
}

.page-blog__card-excerpt {
  font-size: 1em;
  color: var(--text-secondary);
  line-height: 1.5;
}

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

/* Latest Posts Section (List style) */
.page-blog__post-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 25px;
  margin-bottom: 40px;
}

.page-blog__list-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color);
}

.page-blog__list-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}

.page-blog__list-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  padding: 20px;
}

.page-blog__list-image {
  width: 200px;
  height: 150px;
  object-fit: cover;
  border-radius: 8px;
  margin-right: 25px;
  flex-shrink: 0;
}

.page-blog__list-content {
  flex-grow: 1;
}

.page-blog__list-title {
  font-size: 1.3em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.3;
}

.page-blog__list-meta {
  font-size: 0.85em;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.page-blog__list-excerpt {
  font-size: 0.95em;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: var(--deep-green);
}

.page-blog__faq-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.page-blog__faq-item {
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.15em;
  font-weight: 600;
  color: var(--text-main);
  cursor: pointer;
  background-color: var(--card-bg);
  transition: background-color 0.3s ease;
  list-style: none; /* For details/summary */
}

.page-blog__faq-question::-webkit-details-marker {
  display: none; /* For details/summary */
}

.page-blog__faq-question:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
  color: var(--glow);
}

.page-blog__faq-item[open] .page-blog__faq-toggle,
.page-blog__faq-item.active .page-blog__faq-toggle {
  transform: rotate(45deg); /* Plus to X */
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 1em;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Bottom CTA Section */
.page-blog__cta-bottom {
  padding: 80px 0;
  text-align: center;
  background-color: var(--bg-color);
}

.page-blog__cta-title {
  font-size: 2.2em;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__cta-description {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    margin-top: -60px;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 2.8em);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__list-link {
    flex-direction: column;
    align-items: flex-start;
    padding: 15px;
  }
  .page-blog__list-image {
    width: 100%;
    height: 200px;
    margin-right: 0;
    margin-bottom: 15px;
  }
  .page-blog__card-image {
    height: 180px;
  }
}

@media (max-width: 768px) {
  .page-blog__hero-content {
    margin-top: -40px;
    padding: 30px 15px;
  }
  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
  }
  .page-blog__intro-description {
    font-size: 1em;
  }
  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 1em;
  }
  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 15px;
  }
  .page-blog__section-description {
    font-size: 0.95em;
    margin-bottom: 30px;
  }
  .page-blog__featured-posts,
  .page-blog__latest-posts,
  .page-blog__faq-section,
  .page-blog__cta-bottom {
    padding: 50px 0;
  }
  .page-blog__post-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-blog__card-image {
    height: 200px;
  }
  .page-blog__card-title {
    font-size: 1.2em;
  }
  .page-blog__list-item {
    padding: 0;
  }
  .page-blog__list-link {
    padding: 15px;
  }
  .page-blog__list-image {
    height: 150px;
  }
  .page-blog__list-title {
    font-size: 1.1em;
  }
  .page-blog__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }
  .page-blog__faq-answer {
    padding: 0 20px 15px;
    font-size: 0.95em;
  }
  .page-blog__cta-title {
    font-size: 1.8em;
  }
  .page-blog__cta-description {
    font-size: 1em;
  }

  /* Mobile image/video/button adapt - MUST INCLUDE */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog video,
  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__video-section,
  .page-blog__video-container,
  .page-blog__video-wrapper,
  .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;
    overflow: hidden !important; /* Ensure no overflow */
  }
  
  .page-blog__hero-section {
    padding-top: 10px !important;
  }

  .page-blog__cta-buttons {
    flex-wrap: wrap !important;
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-content {
    margin-top: -20px;
  }
  .page-blog__main-title {
    font-size: clamp(1.4em, 7vw, 2em);
  }
  .page-blog__card-image {
    height: 160px;
  }
  .page-blog__list-image {
    height: 120px;
  }
  .page-blog__list-title {
    font-size: 1em;
  }
  .page-blog__faq-question {
    font-size: 0.95em;
    padding: 12px 15px;
  }
  .page-blog__faq-answer {
    padding: 0 15px 12px;
  }
  .page-blog__cta-title {
    font-size: 1.6em;
  }
}