:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --card-bg: #11271B;
  --background: #08160F;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border: #2E7A4E;
  --glow: #57E38D;
  --gold: #F2C14E;
  --divider: #1E3A2A;
  --deep-green: #0A4B2C;
}

/* General styling for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main); /* Light text on dark backgrounds */
  background: var(--background); /* Default background color from custom palette */
}

.page-blog__section {
  padding: 60px 20px;
  text-align: center;
}

.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px; /* Added for mobile responsiveness */
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: clamp(28px, 4vw, 42px); /* Responsive font size for H2 */
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.2;
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 10px 0 60px 0; /* Small top padding, larger bottom padding */
  overflow: hidden;
  background: var(--background);
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 600px; /* Limit height for aesthetic */
  overflow: hidden;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  filter: brightness(0.7); /* Slightly darken image for text contrast */
}

.page-blog__hero-content {
  position: relative;
  text-align: center;
  padding: 40px 20px;
  max-width: 900px;
  margin-top: -100px; /* Pull content up slightly over the image for visual flow */
  z-index: 1; /* Ensure content is above image */
}

.page-blog__hero-title {
  font-size: clamp(32px, 5vw, 56px); /* Responsive font size for H1 */
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 20px;
  line-height: 1.1;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5); /* Enhance readability */
}

.page-blog__hero-description {
  font-size: clamp(18px, 2.5vw, 22px);
  color: var(--text-secondary);
  margin-bottom: 30px;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.4);
}

/* CTA Button Styling */
.page-blog__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.3s ease;
  background: var(--button-gradient);
  color: var(--text-main); /* Using text-main for consistency, which is #F2FFF6 */
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.page-blog__cta-button:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  opacity: 0.9;
}

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

.page-blog__cta-button--secondary:hover {
  background: var(--border);
  color: var(--background);
}

/* Latest Posts Section */
.page-blog__latest-posts {
  background: var(--background);
  padding-top: 80px;
  padding-bottom: 80px;
}

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

.page-blog__post-card {
  background: var(--card-bg); /* Custom Card BG */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: left;
  display: flex;
  flex-direction: column;
}

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

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

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

.page-blog__post-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__post-title a {
  color: var(--text-main);
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__post-title a:hover {
  color: var(--glow); /* Hover color from palette */
}

.page-blog__post-date {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 15px;
  display: block;
}

.page-blog__post-excerpt {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more {
  display: inline-block;
  color: var(--glow);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.3s ease;
}

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

.page-blog__button-container {
  margin-top: 50px;
  text-align: center;
}

/* Categories Section */
.page-blog__categories {
  background: var(--deep-green); /* Custom Deep Green */
  padding: 80px 20px;
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.page-blog__category-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: var(--card-bg);
  border-radius: 10px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-main);
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  min-height: 80px;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
  background: var(--border);
  color: var(--text-main);
}

/* Featured Article Section */
.page-blog__featured-article {
  background: var(--background);
  padding: 80px 20px;
  text-align: left;
}

.page-blog__featured-content {
  display: flex;
  flex-direction: row;
  gap: 40px;
  margin-top: 40px;
  align-items: flex-start;
}

.page-blog__featured-image {
  width: 50%;
  max-width: 600px;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-blog__featured-text {
  width: 50%;
  color: var(--text-secondary);
  font-size: 17px;
}

.page-blog__featured-text h3 {
  font-size: 28px;
  color: var(--text-main);
  margin-bottom: 20px;
}

.page-blog__featured-text p {
  margin-bottom: 15px;
  color: var(--text-secondary);
}

.page-blog__featured-text strong {
  color: var(--text-main);
}

/* FAQ Section */
.page-blog__faq-section {
  background: var(--card-bg); /* Custom Card BG */
  padding: 80px 20px;
}

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

.page-blog__faq-item {
  background: var(--deep-green); /* Darker background for FAQ items */
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.page-blog__faq-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.page-blog__faq-item[open] {
  background: var(--border); /* Highlight when open */
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  cursor: pointer;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-main);
  position: relative;
  list-style: none; /* For details/summary */
}

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

.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: 700;
  color: var(--glow);
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Rotate '+' to 'x' or similar */
  color: var(--text-main);
}

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

/* Final CTA Section */
.page-blog__cta-section {
  background: var(--background);
  padding: 80px 20px;
}

.page-blog__cta-container {
  max-width: 800px;
}

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

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    margin-top: -80px;
  }
}

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

  .page-blog__section {
    padding: 40px 15px;
  }

  .page-blog__section-title {
    font-size: 28px;
  }

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

  /* Hero Section */
  .page-blog__hero-section {
    padding-bottom: 40px;
  }

  .page-blog__hero-content {
    padding: 30px 15px;
    margin-top: -60px;
  }

  .page-blog__hero-title {
    font-size: 32px;
  }

  .page-blog__hero-description {
    font-size: 16px;
  }

  .page-blog__cta-button {
    font-size: 16px;
    padding: 12px 25px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Latest Posts */
  .page-blog__post-grid {
    grid-template-columns: 1fr;
    gap: 25px;
  }

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

  .page-blog__post-title {
    font-size: 20px;
  }

  /* Categories */
  .page-blog__category-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
  }

  .page-blog__category-card {
    font-size: 16px;
    min-height: 70px;
  }

  /* Featured Article */
  .page-blog__featured-content {
    flex-direction: column;
    gap: 30px;
  }

  .page-blog__featured-image,
  .page-blog__featured-text {
    width: 100%;
  }

  /* FAQ */
  .page-blog__faq-question {
    font-size: 18px;
    padding: 18px 20px;
  }

  .page-blog__faq-answer {
    padding: 0 20px 18px 20px;
    font-size: 15px;
  }

  /* Final CTA */
  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  /* Image responsiveness */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__hero-section {
    padding-top: 10px !important; /* body already handles --header-offset */
  }

  /* Ensure no overflow for 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;
  }
}