:root {
  --color-main: #11A84E;
  --color-secondary: #22C768;
  --color-button-gradient: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  --color-background-main: #08160F; /* Custom background */
  --color-card-bg: #11271B; /* Custom card background */
  --color-text-main: #F2FFF6; /* Custom main text color */
  --color-text-secondary: #A7D9B8; /* Custom secondary text color */
  --color-border: #2E7A4E; /* Custom border color */
  --color-glow: #57E38D;
  --color-gold: #F2C14E; /* Custom gold color */
  --color-divider: #1E3A2A;
  --color-deep-green: #0A4B2C; /* Custom deep green */
  
  /* Convert HEX to RGB for rgba usage */
  --color-main-rgb: 17, 168, 78; /* #11A84E */
  --color-card-bg-rgb: 17, 39, 27; /* #11271B */
}

/* General styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--color-text-main); /* Using custom text color */
  background-color: var(--color-background-main); /* Using custom background color */
}

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

.page-blog__section-title {
  font-size: clamp(28px, 4vw, 36px);
  color: var(--color-gold); /* Using custom gold color for titles */
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
  line-height: 1.2;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  padding-top: 10px; /* Small top margin, relies on body padding-top for header offset */
  background-color: var(--color-deep-green); /* Using custom deep green */
  color: var(--color-text-main);
  display: flex;
  flex-direction: column; /* Ensure image is above content */
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 500px;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 600px; /* Limit height for aesthetic */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px; /* Space between image and text */
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  filter: none; /* Ensure no filter is applied */
}

.page-blog__hero-content {
  max-width: 900px;
  padding: 20px;
  z-index: 1; /* Ensure text is above any potential background layers */
}

.page-blog__hero-title {
  font-size: clamp(32px, 5vw, 48px); /* Using clamp for responsive H1 */
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-main);
  margin-bottom: 15px;
  max-width: 600px; /* Constrain H1 length */
  margin-left: auto;
  margin-right: auto;
}

.page-blog__hero-description {
  font-size: clamp(16px, 2.5vw, 20px);
  margin-bottom: 30px;
  color: var(--color-text-secondary); /* Using custom secondary text color */
}

.page-blog__hero-cta-button {
  display: inline-block;
  padding: 15px 30px;
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Custom button gradient */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 18px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__hero-cta-button:hover {
  background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
  padding: 60px 0;
  background-color: var(--color-background-main);
}

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

.page-blog__post-card {
  background-color: var(--color-card-bg); /* Custom card background */
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  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 8px 25px rgba(0, 0, 0, 0.3);
}

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

.page-blog__post-image {
  width: 100%;
  height: 225px; /* Fixed height for consistent card images */
  object-fit: cover;
  filter: none; /* Ensure no filter is applied */
  border-radius: 10px 10px 0 0;
  flex-shrink: 0;
}

.page-blog__post-content {
  padding: 20px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  color: var(--color-text-main);
}

.page-blog__post-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--color-text-main);
  flex-grow: 1;
}

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

.page-blog__post-date {
  font-size: 14px;
  color: var(--color-text-secondary);
  opacity: 0.8;
  margin-top: auto; /* Push date to bottom */
}

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

.page-blog__view-all-button {
  display: inline-block;
  padding: 12px 25px;
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%); /* Custom button gradient */
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 16px;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button responsiveness */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__view-all-button:hover {
  background: linear-gradient(180deg, #13994A 0%, #2AD16F 100%);
}

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

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid var(--color-border); /* Custom border color */
  overflow: hidden;
  background: var(--color-card-bg); /* Custom card background */
  color: var(--color-text-main);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-blog__faq-item summary.page-blog__faq-question::-webkit-details-marker {
  display: none;
}
details.page-blog__faq-item summary.page-blog__faq-question:hover {
  background: rgba(var(--color-main-rgb), 0.1); /* Lighter hover for dark background */
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--color-text-main);
}
.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: var(--color-text-secondary);
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 20px 20px;
  background: rgba(var(--color-card-bg-rgb), 0.8); /* Slightly lighter background for answer */
  border-radius: 0 0 5px 5px;
  color: var(--color-text-secondary);
}
.page-blog__faq-answer p {
    margin-bottom: 0;
}

/* Ensure contrast for all text elements */
.page-blog h1, .page-blog h2, .page-blog h3, .page-blog h4, .page-blog h5, .page-blog h6 {
  color: var(--color-text-main);
}
.page-blog p, .page-blog li, .page-blog span, .page-blog time {
  color: var(--color-text-secondary);
}
.page-blog__hero-cta-button, .page-blog__view-all-button {
  color: #ffffff; /* Explicitly white for buttons on dark gradient */
}

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

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__posts-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  /* General mobile adjustments */
  .page-blog__container {
    padding: 0 15px;
  }

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

  /* Hero Section Mobile */
  .page-blog__hero-section {
    padding-top: 10px !important; /* Ensure small top padding */
    min-height: auto;
  }

  .page-blog__hero-image-wrapper {
    max-height: 300px;
    margin-bottom: 15px;
  }

  .page-blog__hero-title {
    font-size: 28px;
    max-width: 100%;
  }

  .page-blog__hero-description {
    font-size: 15px;
    margin-bottom: 20px;
  }

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

  /* Latest Posts Section Mobile */
  .page-blog__latest-posts-section {
    padding: 40px 0;
  }

  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
  }

  .page-blog__post-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__post-image {
    height: 180px; /* Adjust image height for mobile cards */
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; /* Ensure responsiveness */
  }

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

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

  .page-blog__post-excerpt {
    font-size: 14px;
  }

  .page-blog__view-all-wrapper {
    margin-top: 30px;
  }

  .page-blog__view-all-button {
    padding: 10px 20px;
    font-size: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* FAQ Section Mobile */
  details.page-blog__faq-item summary.page-blog__faq-question {
    padding: 15px;
  }
  .page-blog__faq-qtext {
    font-size: 15px;
  }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 15px 15px;
  }
  
  /* General image responsiveness for all images within .page-blog */
  .page-blog img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Containers for images/content to prevent overflow */
  .page-blog__hero-image-wrapper,
  .page-blog__posts-grid,
  .page-blog__post-card,
  .page-blog__view-all-wrapper,
  .page-blog__faq-list,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    /* Adding padding to containers for inner spacing */
    padding-left: 15px;
    padding-right: 15px;
  }
  
  /* Specific button container styles for mobile */
  .page-blog__hero-content .page-blog__hero-cta-button,
  .page-blog__view-all-wrapper .page-blog__view-all-button {
    display: block; /* Ensure buttons stack if needed */
    margin-left: auto;
    margin-right: auto;
  }
}