/* style/blog.css */

/* --- General Page Styles --- */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main); /* Using custom property from color scheme */
  background-color: var(--bg); /* Using custom property from color scheme */
}

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

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

/* --- Hero Section --- */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Enforce image on top, text below */
  align-items: center;
  padding: 60px 0;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: var(--bg);
}

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

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.page-blog__hero-content {
  max-width: 900px;
  text-align: center;
  padding: 0 20px;
}

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

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

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow buttons to wrap on smaller screens */
}

/* --- Buttons --- */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  box-sizing: border-box;
  max-width: 100%; /* Ensure button doesn't overflow */
}

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

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

.page-blog__btn-secondary {
  background: #ffffff;
  color: var(--primary-color); /* Fallback to primary color */
  border: 2px solid var(--primary-color);
}

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

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

.page-blog__posts-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); /* Custom card background */
  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(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.page-blog__post-image-wrapper {
  width: 100%;
  height: 220px; /* Fixed height for image consistency */
  overflow: hidden;
  box-sizing: border-box;
}

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

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

.page-blog__post-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  line-height: 1.3;
  font-weight: bold;
}

.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(--primary-color); /* Highlight on hover */
}

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex-grow: 1; /* Pushes read more link to bottom */
}

.page-blog__read-more-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

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

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

/* --- Categories Section --- */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: var(--deep-green); /* Custom deep green background */
}

.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 25px;
}

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: var(--card-bg); /* Custom card background */
  border-radius: 10px;
  padding: 20px;
  text-decoration: none;
  color: var(--text-main);
  transition: transform 0.3s ease, background-color 0.3s ease;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  background-color: rgba(var(--primary-color-rgb), 0.1); /* Lighter primary color hover */
}

.page-blog__category-icon {
  width: 100px; /* Ensure images are not too small but still fit card */
  height: 75px;
  object-fit: contain;
  margin-bottom: 15px;
  border-radius: 8px; /* Slightly rounded corners for icons */
}

.page-blog__category-name {
  font-size: 1.1em;
  font-weight: bold;
}

/* --- Featured Article Section --- */
.page-blog__featured-article-section {
  padding: 80px 0;
  background-color: var(--deep-green); /* Custom deep green background */
  color: #ffffff; /* White text for dark section */
}

.page-blog__featured-article-section .page-blog__section-title {
  color: #ffffff;
}

.page-blog__featured-content {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  gap: 40px;
  align-items: center;
}

.page-blog__featured-text {
  flex: 1;
  min-width: 300px;
}

.page-blog__featured-title {
  font-size: 2em;
  color: var(--gold); /* Custom gold color for emphasis */
  margin-bottom: 20px;
  line-height: 1.3;
}

.page-blog__featured-excerpt {
  font-size: 1.1em;
  color: var(--text-secondary); /* Lighter text for readability */
  margin-bottom: 20px;
}

.page-blog__featured-list {
  list-style: none;
  padding-left: 0;
  margin-bottom: 30px;
}

.page-blog__featured-list li {
  margin-bottom: 10px;
  padding-left: 25px;
  position: relative;
  color: var(--text-secondary);
}

.page-blog__featured-list li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: var(--gold); /* Gold checkmark */
  font-weight: bold;
}

.page-blog__featured-image-wrapper {
  flex: 1;
  min-width: 300px;
  text-align: center;
}

.page-blog__featured-image {
  width: 100%;
  height: auto;
  max-width: 600px; /* Limit image width */
  border-radius: 12px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
}

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

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

.page-blog__faq-item {
  background-color: var(--card-bg); /* Custom card background */
  border: 1px solid var(--border-color); /* Custom border color */
  border-radius: 10px;
  margin-bottom: 15px;
  overflow: hidden;
}

.page-blog__faq-item[open] {
  background-color: var(--deep-green); /* Darker background when open */
}

.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);
  cursor: pointer;
  background-color: transparent; /* Ensure summary background is transparent */
  list-style: none; /* Remove default marker */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
  color: var(--gold); /* Gold question when open */
}

.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);
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  color: var(--gold); /* Gold toggle when open */
}

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

/* --- Responsive Design --- */
/* Custom properties for color scheme */
:root {
  --primary-color: #11A84E;
  --secondary-color: #22C768;
  --primary-color-rgb: 17, 168, 78; /* RGB for primary color */
  --button-gradient-start: #2AD16F;
  --button-gradient-end: #13994A;
  --card-bg: #11271B;
  --bg: #08160F;
  --text-main: #F2FFF6;
  --text-secondary: #A7D9B8;
  --border-color: #2E7A4E;
  --glow-color: #57E38D;
  --gold: #F2C14E;
  --divider-color: #1E3A2A;
  --deep-green: #0A4B2C;
}

/* Ensure color contrast for elements not explicitly styled */
.page-blog p,
.page-blog li {
  color: var(--text-secondary); /* Default text color for body background */
}

.page-blog h1,
.page-blog h2,
.page-blog h3,
.page-blog h4,
.page-blog h5,
.page-blog h6 {
  color: var(--text-main);
}


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

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

  .page-blog__posts-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

@media (max-width: 768px) {
  .page-blog__hero-section {
    padding: 40px 0;
    padding-top: 10px !important; /* body already handles header offset */
  }

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

  .page-blog__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: 0.95em;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__featured-article-section,
  .page-blog__faq-section {
    padding: 40px 0;
  }

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

  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
  }

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

  .page-blog__category-icon {
    width: 80px;
    height: 60px;
  }

  .page-blog__category-name {
    font-size: 1em;
  }

  .page-blog__featured-content {
    flex-direction: column;
  }

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

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

  .page-blog__featured-excerpt {
    font-size: 0.95em;
  }

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

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

  /* Mobile 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,
  .page-blog__hero-image-wrapper,
  .page-blog__post-image-wrapper,
  .page-blog__category-card,
  .page-blog__featured-image-wrapper,
  .page-blog__faq-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Prevent overflow for containers */
  }

  /* Video responsiveness (if any) */
  .page-blog video,
  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  .page-blog__video-section,
  .page-blog__video-container,
  .page-blog__video-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important;
  }

  /* Ensure content area does not cause horizontal scroll */
  .page-blog {
    overflow-x: hidden;
  }
}