/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: #ffffff; /* Light text for dark body background */
  background-color: transparent; /* Body background is handled by shared.css (#0a0a0a) */
}

.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, 42px); /* Responsive font size for H2 */
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: inherit; /* Inherit from section for contrast */
}

.page-blog__section-intro {
  font-size: 18px;
  text-align: center;
  margin-bottom: 40px;
  color: inherit;
}

/* Color contrast classes */
.page-blog__dark-bg {
  background-color: #0a0a0a; /* Ensure dark background for sections */
  color: #ffffff; /* Light text on dark background */
  padding: 60px 0;
}

.page-blog__light-bg {
  background-color: #1a1a1a; /* Slightly lighter dark background for contrast */
  color: #ffffff; /* Light text on dark background */
  padding: 60px 0;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 10px; /* Small top padding, body handles header offset */
  padding-bottom: 60px;
  overflow: hidden;
}

.page-blog__hero-image-container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  filter: brightness(0.6); /* Slightly darken image for text readability */
}

.page-blog__hero-content {
  position: relative; /* Not absolute, for upper-image-lower-text */
  z-index: 10;
  max-width: 900px;
  margin-top: 30px; /* Space between image and content */
  padding: 0 20px;
  box-sizing: border-box;
}

.page-blog__main-title {
  font-size: clamp(36px, 5vw, 58px); /* H1 font size with clamp */
  font-weight: 800;
  margin-bottom: 20px;
  color: #FFFFFF;
  line-height: 1.2;
}

.page-blog__hero-description {
  font-size: 20px;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 18px;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background-color: #26A9E0;
  color: #FFFFFF;
  border: 2px solid #26A9E0;
  margin: 10px;
}

.page-blog__btn-primary:hover {
  background-color: #1e87b7;
  border-color: #1e87b7;
}

.page-blog__btn-secondary {
  background-color: transparent;
  color: #26A9E0;
  border: 2px solid #26A9E0;
  margin: 10px;
}

.page-blog__btn-secondary:hover {
  background-color: #26A9E0;
  color: #FFFFFF;
}

.page-blog__cta-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Latest Posts Grid */
.page-blog__latest-posts .page-blog__section-title,
.page-blog__latest-posts .page-blog__section-intro {
  color: #ffffff;
}

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

.page-blog__post-card {
  background-color: rgba(255, 255, 255, 0.05); /* Slightly transparent white for cards */
  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;
  color: #ffffff;
}

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

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

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

.page-blog__card-title {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.3;
}

.page-blog__card-title a {
  color: #26A9E0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__card-title a:hover {
  color: #1e87b7;
}

.page-blog__card-meta {
  font-size: 14px;
  color: #bbbbbb;
  margin-bottom: 15px;
}

.page-blog__card-excerpt {
  font-size: 16px;
  color: #cccccc;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more {
  display: inline-block;
  color: #26A9E0;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
  transition: color 0.3s ease;
}

.page-blog__read-more:hover {
  color: #1e87b7;
  text-decoration: underline;
}

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

/* Categories Section */
.page-blog__categories .page-blog__section-title,
.page-blog__categories .page-blog__section-intro {
  color: #ffffff;
}

.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: rgba(255, 255, 255, 0.08); /* Slightly more transparent white for categories */
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease, background-color 0.3s ease;
  color: #ffffff;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  background-color: rgba(255, 255, 255, 0.12);
}

.page-blog__category-image {
  width: 100%;
  height: auto;
  max-width: 150px;
  margin: 0 auto 20px;
  border-radius: 8px;
  display: block;
}

.page-blog__category-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-blog__category-title a {
  color: #26A9E0;
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__category-title a:hover {
  color: #1e87b7;
}

.page-blog__category-description {
  font-size: 15px;
  color: #cccccc;
}

/* Popular Posts Section (reusing post-grid styles) */
.page-blog__popular-posts .page-blog__section-title,
.page-blog__popular-posts .page-blog__section-intro {
  color: #ffffff;
}

/* FAQ Section */
.page-blog__faq-section .page-blog__section-title,
.page-blog__faq-section .page-blog__section-intro {
  color: #ffffff;
}

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

.page-blog__faq-item {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  color: #ffffff;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  color: #ffffff;
  transition: background-color 0.3s ease;
  list-style: none; /* For <summary> tag */
}

.page-blog__faq-item summary::-webkit-details-marker {
  display: none;
}

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

.page-blog__faq-toggle {
  font-size: 24px;
  line-height: 1;
  margin-left: 15px;
}

.page-blog__faq-answer {
  padding: 0 25px 20px;
  font-size: 16px;
  color: #cccccc;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
  max-height: 500px; /* Adjust as needed */
  padding-top: 10px;
  transition: max-height 0.5s ease-in, padding 0.3s ease-in;
}

/* If using div for FAQ, need active class */
.page-blog__faq-item.active .page-blog__faq-answer {
  max-height: 500px !important;
  padding-top: 10px;
}

/* CTA Section */
.page-blog__cta-section .page-blog__section-title,
.page-blog__cta-section .page-blog__section-intro {
  color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    max-width: 700px;
  }
}

@media (max-width: 768px) {
  .page-blog__container {
    padding: 0 15px;
  }

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

  .page-blog__main-title {
    font-size: clamp(30px, 8vw, 48px);
  }

  .page-blog__hero-description {
    font-size: 18px;
  }

  .page-blog__section-title {
    font-size: clamp(24px, 6vw, 36px);
  }

  .page-blog__section-intro {
    font-size: 16px;
  }

  .page-blog__post-grid,
  .page-blog__category-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-blog__post-card {
    margin-left: 0;
    margin-right: 0;
  }

  .page-blog__post-image {
    height: 180px;
  }

  .page-blog__card-title {
    font-size: 20px;
  }

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

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

  /* Mobile responsive for images */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__hero-image-container,
  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__faq-item,
  .page-blog__cta-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    margin-left: auto;
    margin-right: auto;
  }

  /* Mobile responsive for buttons */
  .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;
    margin: 10px 0 !important; /* Adjust margins for vertical stack */
  }

  .page-blog__cta-buttons {
    flex-direction: column !important;
    gap: 10px;
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 480px) {
  .page-blog__hero-description {
    font-size: 16px;
  }

  .page-blog__post-image {
    height: 150px;
  }

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

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

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    font-size: 16px;
    padding: 12px 20px;
  }
}