/* style/blog.css */

/* --- General Page Styles --- */
.page-blog {
  font-family: Arial, sans-serif;
  color: var(--text-main); /* Ensure contrast based on body background */
  background-color: var(--background);
  line-height: 1.6;
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: var(--text-main);
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.page-blog__section-description {
  font-size: 1.1em;
  color: var(--text-secondary);
  text-align: center;
  max-width: 800px;
  margin: 0 auto 40px auto;
}

/* --- Hero Section --- */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image above content */
  align-items: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: var(--card-bg); /* Fallback if image not loaded */
  overflow: hidden;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 30px; /* Space between image and content */
}

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

.page-blog__hero-content {
  text-align: center;
  max-width: 900px;
  margin: 0 auto;
  z-index: 1;
  padding: 0 20px;
}

.page-blog__hero-title {
  /* No fixed large font-size */
  font-weight: bold;
  line-height: 1.1;
  color: var(--text-main);
  margin-bottom: 20px;
  font-size: clamp(2em, 4vw, 3.5em); /* Use clamp for H1 */
}

.page-blog__hero-description {
  font-size: 1.2em;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* --- CTA Button Base --- */
.page-blog__cta-button {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.2s ease;
  cursor: pointer;
  white-space: normal; /* Allow text wrapping for buttons */
  word-wrap: break-word; /* Allow text wrapping for buttons */
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #2AD16F 0%, #13994A 100%);
  color: #ffffff;
  border: none;
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

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

.page-blog__btn-secondary:hover {
  background: var(--border);
  color: var(--text-main);
  transform: translateY(-2px);
}

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

.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 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(-8px);
  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 consistency */
  object-fit: cover;
  display: block;
  filter: none; /* Ensure no filter is applied */
}

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

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

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

.page-blog__post-date {
  font-size: 0.85em;
  color: var(--text-secondary);
  opacity: 0.8;
}

.page-blog__view-all {
  text-align: center;
}

/* --- Featured Section --- */
.page-blog__featured-section {
  padding: 80px 0;
  background-color: var(--card-bg); /* Use card background for contrast */
}

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

.page-blog__featured-card {
  background-color: var(--background); /* Use background color for contrast */
  border-radius: 12px;
  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__featured-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-blog__featured-image {
  width: 100%;
  height: 300px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  filter: none; /* Ensure no filter is applied */
}

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

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

.page-blog__featured-title a {
  color: var(--text-main);
  text-decoration: none;
}

.page-blog__featured-title a:hover {
  color: var(--primary-color); /* Highlight on hover */
}

.page-blog__featured-excerpt {
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 15px;
  flex-grow: 1;
}

/* --- Call to Action Section --- */
.page-blog__cta-section {
  background-color: var(--deep-green); /* Use a darker green for strong contrast */
  padding: 80px 20px;
  text-align: center;
  color: #ffffff;
}

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

.page-blog__cta-description {
  font-size: 1.1em;
  color: #f2fff6; /* Lighter text for description */
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

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

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

.page-blog__faq-item {
  background-color: var(--card-bg);
  border-radius: 12px;
  margin-bottom: 20px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  color: var(--text-main);
}

.page-blog__faq-item summary {
  list-style: none; /* Remove default marker */
  cursor: pointer;
}

.page-blog__faq-item summary::-webkit-details-marker {
  display: none; /* Remove default marker for webkit */
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 1.2em;
  font-weight: bold;
  color: var(--text-main);
  border-bottom: 1px solid var(--divider);
  transition: background-color 0.3s ease;
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
  border-bottom: 1px solid var(--border);
}

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

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

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg); /* Rotate plus to cross */
}

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

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-blog__hero-title {
    font-size: clamp(2em, 5vw, 3em);
  }

  .page-blog__section-title {
    font-size: 2em;
  }

  .page-blog__featured-grid {
    grid-template-columns: 1fr; /* Stack featured cards */
  }
}

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

  .page-blog__container {
    padding: 0 15px;
  }

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important; /* body handles --header-offset, this is decorative */
  }

  .page-blog__hero-title {
    font-size: clamp(1.8em, 6vw, 2.5em);
  }

  .page-blog__hero-description {
    font-size: 1em;
  }

  .page-blog__section-title {
    font-size: 1.8em;
  }

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

  .page-blog__latest-posts,
  .page-blog__featured-section,
  .page-blog__cta-section,
  .page-blog__faq-section {
    padding: 60px 0;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr; /* Stack blog cards */
  }

  .page-blog__post-card {
    margin-bottom: 20px;
  }

  .page-blog__post-image {
    height: 200px; /* Adjust image height for mobile */
  }

  .page-blog__post-content,
  .page-blog__featured-content {
    padding: 20px;
  }

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

  .page-blog__featured-image {
    height: 250px;
  }

  .page-blog__featured-title {
    font-size: 1.4em;
  }

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

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

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

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

  /* --- Mobile Image Adaption --- */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
    filter: none !important; /* Ensure no filter is applied */
  }
  
  .page-blog__hero-image-wrapper,
  .page-blog__post-card,
  .page-blog__featured-card,
  .page-blog__cta-section,
  .page-blog__faq-section,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  /* --- Mobile Button Adaption --- */
  .page-blog__cta-button,
  .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;
    padding-right: 15px;
    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;
    display: flex; /* Ensure flex context for wrap */
    flex-direction: column; /* Stack buttons vertically */
  }
}

/* --- Color Variables (from custom colors) --- */
: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;
}

/* Ensure contrast for text elements */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
}

p, li {
  color: var(--text-secondary);
}

.page-blog__post-title, .page-blog__featured-title {
  color: var(--text-main);
}

.page-blog__post-excerpt, .page-blog__featured-excerpt, .page-blog__post-date {
  color: var(--text-secondary);
}

.page-blog__faq-question {
  color: var(--text-main);
}

.page-blog__faq-answer p {
  color: var(--text-secondary);
}

.page-blog__cta-section {
  background-color: var(--deep-green);
  color: var(--text-main);
}
.page-blog__cta-title {
  color: var(--text-main);
}
.page-blog__cta-description {
  color: var(--text-secondary);
}