/* style/blog.css */

/* --- General Styles --- */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main); /* Assuming dark body background, use light text */
  background-color: var(--bg); /* Use custom background color */
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: var(--gold); /* Using gold for prominent titles */
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

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

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

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

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

.page-blog__btn-secondary:hover {
  background: var(--deep-green);
  color: #ffffff;
}

/* --- Hero Section --- */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: var(--bg);
  overflow: hidden; /* Ensure no overflow from image */
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  position: relative;
  display: flex;
  justify-content: center;
  margin-bottom: 40px; /* Space between image and content */
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 10px;
  max-width: 1200px; /* Constrain image width on desktop */
}

.page-blog__hero-content {
  text-align: center;
  max-width: 900px;
  z-index: 1;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.2em); /* Using clamp for H1 font size */
  color: var(--text-main);
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

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

.page-blog__hero-content .page-blog__btn-primary {
  padding: 15px 35px;
  font-size: 1.1em;
}

/* --- Latest Articles Section --- */
.page-blog__latest-articles-section {
  padding: 80px 0;
  background-color: var(--bg);
}

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

.page-blog__article-card {
  background-color: var(--card-bg);
  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;
}

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

.page-blog__article-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

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

.page-blog__article-content {
  padding: 20px;
}

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

.page-blog__article-excerpt {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 15px;
  min-height: 70px; /* Ensure consistent card height */
}

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

.page-blog__latest-articles-section .page-blog__cta-buttons {
    text-align: center;
    margin-top: 50px;
}

/* --- Categories Section --- */
.page-blog__categories-section {
  padding: 80px 0;
  background-color: var(--deep-green); /* Use a custom color from palette */
}

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

.page-blog__category-card {
  background-color: var(--card-bg);
  border-radius: 10px;
  padding: 30px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__category-icon {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 20px;
  display: block; /* Ensure it respects width/height */
  margin-left: auto;
  margin-right: auto;
}

.page-blog__category-title {
  font-size: 1.5em;
  color: var(--text-main);
  margin-bottom: 10px;
}

.page-blog__category-description {
  font-size: 0.95em;
  color: var(--text-secondary);
  margin-bottom: 20px;
  min-height: 60px;
}

/* --- Featured Article Section --- */
.page-blog__featured-article-section {
  padding: 80px 0;
  background-color: var(--bg);
}

.page-blog__featured-article-grid {
  margin-top: 40px;
}

.page-blog__featured-article-item {
  display: flex;
  flex-direction: column; /* Default for mobile, will change for desktop */
  background-color: var(--card-bg);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

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

.page-blog__featured-content {
  padding: 30px;
}

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

.page-blog__featured-excerpt {
  font-size: 1.1em;
  color: var(--text-secondary);
  margin-bottom: 30px;
}

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

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

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

.page-blog__faq-item summary {
  list-style: none; /* Hide default marker */
}
.page-blog__faq-item summary::-webkit-details-marker {
  display: none; /* Hide default marker for webkit browsers */
}

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

.page-blog__faq-question:hover {
  background-color: var(--deep-green);
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  color: var(--gold);
  margin-left: 15px;
}

.page-blog__faq-answer {
  padding: 20px;
  font-size: 1em;
  color: var(--text-secondary);
  background-color: var(--card-bg);
  border-top: 1px solid var(--divider); /* Consistent border */
}

.page-blog__faq-answer p {
  margin-bottom: 0; /* Remove default paragraph margin */
}

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 100%; /* Ensure container takes full width */
  box-sizing: border-box; /* Include padding in width */
  overflow: hidden; /* Hide overflow */
}

.page-blog__cta-buttons .page-blog__btn-primary,
.page-blog__cta-buttons .page-blog__btn-secondary {
  min-width: 180px;
  font-size: 1.1em;
}

/* --- Responsive Design --- */
@media (min-width: 769px) {
  .page-blog__featured-article-item {
    flex-direction: row;
  }
  .page-blog__featured-image {
    width: 50%;
    height: auto;
  }
  .page-blog__featured-content {
    width: 50%;
  }
}

@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__main-title {
    font-size: clamp(1.8em, 5vw, 2.8em);
  }
}

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

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important;
  }
  
  .page-blog__main-title {
    font-size: clamp(1.5em, 6vw, 2.5em);
  }

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

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

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

  .page-blog__latest-articles-section,
  .page-blog__categories-section,
  .page-blog__featured-article-section,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding: 50px 0;
  }

  /* Images responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Image containers responsive */
  .page-blog__hero-image-wrapper,
  .page-blog__article-card,
  .page-blog__category-card,
  .page-blog__featured-article-item,
  .page-blog__featured-image,
  .page-blog__category-icon {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important; /* Ensure no overflow */
  }

  /* Buttons responsive */
  .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;
  }
  
  /* Button containers responsive */
  .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-direction: column !important; /* Stack buttons vertically */
    gap: 15px;
    overflow: hidden !important;
  }

  .page-blog__article-image {
    height: auto; /* Allow auto height for mobile to avoid cropping issues */
  }

  .page-blog__article-excerpt,
  .page-blog__category-description {
    min-height: auto; /* Auto height on mobile */
  }

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

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

/* Ensure contrast for text on various backgrounds */
.page-blog__card,
.page-blog__section,
.page-blog__box {
  color: var(--text-main); /* Default light text for dark custom backgrounds */
}

/* Specific background colors for sections/cards */
.page-blog__latest-articles-section,
.page-blog__featured-article-section,
.page-blog__cta-section {
  background-color: var(--bg);
}

.page-blog__categories-section,
.page-blog__faq-section {
  background-color: var(--deep-green);
}

.page-blog__article-card,
.page-blog__category-card,
.page-blog__featured-article-item,
.page-blog__faq-item {
  background-color: var(--card-bg);
  color: var(--text-main);
}

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

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

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

/* Links within content */
.page-blog a {
  color: var(--gold); /* Use gold for links */
  text-decoration: underline;
}
.page-blog a:hover {
  color: var(--glow);
  text-decoration: none;
}