/* style/blog.css */

/* General styles for the blog page, respecting body background and text colors */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-main, #1F2D3D); /* Use Text Main color for general text */
  background-color: var(--page-bg, #F4F7FB); /* Ensure body background is respected */
}

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

.page-blog__section-title {
  font-size: 32px;
  color: var(--text-main, #1F2D3D);
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
}

/* Hero Banner Section (for blog page, not homepage hero) */
.page-blog__hero-banner {
  background: linear-gradient(180deg, var(--primary-color, #2F6BFF) 0%, var(--secondary-color, #6FA3FF) 100%);
  color: #ffffff;
  padding: 60px 20px;
  text-align: center;
  /* body { padding-top: var(--header-offset); } handles top spacing, this is for internal spacing */
  padding-top: calc(10px + var(--header-offset, 0px)); /* Small top padding for the content area, plus header offset for visual consistency */
  position: relative;
  overflow: hidden;
}

.page-blog__hero-content-wrapper {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

.page-blog__hero-title {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #ffffff;
  line-height: 1.2;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.page-blog__hero-description {
  font-size: 18px;
  line-height: 1.8;
  opacity: 0.9;
  max-width: 800px;
  margin: 0 auto 30px;
}

/* Intro Section */
.page-blog__intro-section {
    padding: 40px 0;
    background-color: var(--card-bg, #FFFFFF);
    border-bottom: 1px solid var(--border-color, #D6E2FF);
}

.page-blog__intro-text {
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-main, #1F2D3D);
    max-width: 900px;
    margin: 0 auto;
    text-align: justify;
}

/* Featured Posts Section */
.page-blog__featured-posts {
  padding: 60px 0;
  background-color: var(--page-bg, #F4F7FB);
  border-bottom: 1px solid var(--border-color, #D6E2FF);
}

.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: var(--card-bg, #FFFFFF);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color, #D6E2FF);
}

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

.page-blog__post-link {
  text-decoration: none;
  display: block;
  color: var(--text-main, #1F2D3D);
}

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

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

.page-blog__post-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 15px;
  color: var(--primary-color, #2F6BFF);
  transition: color 0.3s ease;
  min-height: 66px;
}

.page-blog__post-card:hover .page-blog__post-title {
  color: var(--secondary-color, #6FA3FF);
}

.page-blog__post-excerpt {
  font-size: 15px;
  color: var(--text-main, #1F2D3D);
  margin-bottom: 20px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 120px;
}

.page-blog__post-date {
  font-size: 14px;
  color: #666666;
  display: block;
  text-align: right;
}

/* View All Button */
.page-blog__view-all {
  text-align: center;
  margin-top: 30px;
}

.page-blog__cta-button {
  display: inline-block;
  padding: 15px 40px;
  background: linear-gradient(180deg, #4A8BFF 0%, #2F6BFF 100%);
  color: #ffffff;
  text-decoration: none;
  border-radius: 8px;
  font-size: 18px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  border: none;
  cursor: pointer;
  min-width: 200px;
}

.page-blog__cta-button:hover {
  background: linear-gradient(180deg, #2F6BFF 0%, #4A8BFF 100%);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* CTA Section */
.page-blog__cta-section {
  background: var(--primary-color, #2F6BFF);
  color: #ffffff;
  padding: 80px 20px;
  text-align: center;
  margin-top: 60px;
}

.page-blog__cta-title {
  font-size: 38px;
  font-weight: 800;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 18px;
  line-height: 1.7;
  max-width: 700px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

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

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 12px;
  border: 1px solid var(--border-color, #D6E2FF);
  overflow: hidden;
  background: var(--card-bg, #FFFFFF);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  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: #f0f5ff; /* Lighter shade of blue-white */
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: var(--text-main, #1F2D3D);
}
.page-blog__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: var(--primary-color, #2F6BFF);
  flex-shrink: 0;
  margin-left: 20px;
  width: 30px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 25px 25px;
  background: #f9fbfc; /* Slightly off-white for answer background */
  border-radius: 0 0 12px 12px;
  color: var(--text-main, #1F2D3D);
}
details.page-blog__faq-item .page-blog__faq-answer p {
  margin: 0;
  font-size: 16px;
  line-height: 1.7;
}

/* Latest News Section (similar to blog posts, but for news) */
.page-blog__latest-news-section {
    padding: 60px 0;
    background-color: var(--page-bg, #F4F7FB);
    border-top: 1px solid var(--border-color, #D6E2FF);
}

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

.page-blog__news-item {
    background: var(--card-bg, #FFFFFF);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border-color, #D6E2FF);
}

.page-blog__news-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.page-blog__news-link {
    text-decoration: none;
    display: block;
    color: var(--text-main, #1F2D3D);
}

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

.page-blog__news-content {
    padding: 25px;
}

.page-blog__news-title {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--primary-color, #2F6BFF);
    transition: color 0.3s ease;
    min-height: 66px;
}

.page-blog__news-item:hover .page-blog__news-title {
    color: var(--secondary-color, #6FA3FF);
}

.page-blog__news-excerpt {
  font-size: 15px;
  color: var(--text-main, #1F2D3D);
  margin-bottom: 20px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 120px;
}

.page-blog__news-date {
  font-size: 14px;
  color: #666666;
  display: block;
  text-align: right;
}


/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-title {
    font-size: 40px;
  }
  .page-blog__hero-description {
    font-size: 16px;
  }
  .page-blog__section-title {
    font-size: 28px;
  }
  .page-blog__post-title, .page-blog__news-title {
    font-size: 20px;
  }
  .page-blog__cta-title {
    font-size: 32px;
  }
  .page-blog__cta-description {
    font-size: 16px;
  }
  .page-blog__faq-qtext {
    font-size: 16px;
  }
}

@media (max-width: 768px) {
  .page-blog__container {
    padding: 15px;
  }
  
  .page-blog__hero-banner {
    padding: 40px 15px;
    padding-top: calc(10px + var(--header-offset, 0px)); /* Mobile small top padding */
  }
  .page-blog__hero-title {
    font-size: 32px;
  }
  .page-blog__hero-description {
    font-size: 15px;
  }

  .page-blog__intro-section {
    padding: 30px 0;
  }
  .page-blog__intro-text {
    padding: 0 15px;
    text-align: left;
  }

  .page-blog__featured-posts, .page-blog__faq-section, .page-blog__cta-section, .page-blog__latest-news-section {
    padding: 40px 0;
  }
  .page-blog__section-title {
    font-size: 24px;
    margin-bottom: 30px;
  }
  .page-blog__posts-grid, .page-blog__news-list {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  .page-blog__post-image, .page-blog__news-image {
    height: 180px;
    max-width: 100% !important;
    width: 100% !important;
    min-width: 200px;
    min-height: 200px;
  }
  .page-blog__post-content, .page-blog__news-content {
    padding: 20px;
  }
  .page-blog__post-title, .page-blog__news-title {
    font-size: 18px;
    min-height: auto;
  }
  .page-blog__post-excerpt, .page-blog__news-excerpt {
    font-size: 14px;
    min-height: auto;
    -webkit-line-clamp: 4;
  }
  
  .page-blog__cta-title {
    font-size: 28px;
  }
  .page-blog__cta-description {
    font-size: 15px;
  }
  .page-blog__cta-button {
    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;
  }

  details.page-blog__faq-item summary.page-blog__faq-question {
    padding: 15px 20px;
  }
  .page-blog__faq-qtext {
    font-size: 15px;
  }
  .page-blog__faq-toggle {
    font-size: 24px;
    margin-left: 15px;
  }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 20px 20px;
  }
  details.page-blog__faq-item .page-blog__faq-answer p {
    font-size: 14px;
  }

  /* Ensure all images and containers are responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block;
  }
  .page-blog__section, 
  .page-blog__card, 
  .page-blog__container, 
  .page-blog__post-card, 
  .page-blog__news-item {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  .page-blog__post-card, .page-blog__news-item {
      padding-left: 0;
      padding-right: 0;
  }
}

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

/* Contrast fixes for specific elements if needed */
.page-blog__dark-section {
  background: var(--primary-color, #2F6BFF);
  color: #ffffff;
}
.page-blog__light-section {
  background: var(--card-bg, #FFFFFF);
  color: var(--text-main, #1F2D3D);
}