.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: var(--page-bg, #F5F7FA); /* Ensure background is light */
}

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

/* HERO Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, header offset is handled by body */
  padding-bottom: 40px;
  text-align: center;
  color: #ffffff; /* White text for dark background */
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%); /* Brand gradient background */
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 600px; /* Limit image height */
  overflow: hidden;
}

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

.page-blog__hero-content {
  position: relative; /* Ensure content is above the image */
  z-index: 10;
  padding: 20px;
  max-width: 800px;
  margin-top: -150px; /* Pull content up over the image slightly */
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3em); /* Responsive H1 font size */
  font-weight: 700;
  margin-bottom: 15px;
  line-height: 1.2;
  color: #ffffff;
}

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

/* General Section Styling */
.page-blog__section-title {
  font-size: clamp(1.8em, 3vw, 2.5em); /* Responsive H2 font size */
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #E53935; /* Brand color for titles */
}

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

/* Blog Content Grid */
.page-blog__content-grid {
  padding: 60px 0;
  background-color: #ffffff; /* Card BG */
}

.page-blog__blog-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
  align-items: stretch;
}

.page-blog__blog-card {
  background-color: #ffffff;
  border: 1px solid #E0E0E0; /* Border color */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  height: 100%; /* Ensure cards stretch */
}

.page-blog__blog-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

.page-blog__blog-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.page-blog__blog-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

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

.page-blog__blog-card-title {
  font-size: 1.3em;
  font-weight: 600;
  margin-bottom: 10px;
  color: #333333;
  flex-grow: 1;
}

.page-blog__blog-card-excerpt {
  font-size: 0.95em;
  color: #555555;
  margin-bottom: 15px;
}

.page-blog__blog-card-date {
  font-size: 0.85em;
  color: #888888;
  margin-bottom: 15px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog__btn-outline {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

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

.page-blog__btn-secondary {
  background-color: #ffffff;
  color: #E53935;
  border: 2px solid #E53935;
}

.page-blog__btn-secondary:hover {
  background-color: #E53935;
  color: #ffffff;
  transform: translateY(-2px);
}

.page-blog__btn-outline {
  background: none;
  color: #E53935;
  border: 1px solid #E53935;
  padding: 8px 15px;
  font-size: 0.9em;
  align-self: flex-start;
}

.page-blog__btn-outline:hover {
  background-color: #E53935;
  color: #ffffff;
}

.page-blog__view-all-button-wrapper {
    text-align: center;
    margin-top: 40px;
}

.page-blog__view-all-button {
    min-width: 200px;
}

/* Latest News Section (Slider) */
.page-blog__latest-news {
  padding: 60px 0;
  background-color: #1a202c; /* Dark background */
  color: #ffffff;
}

.page-blog__latest-news .page-blog__section-title {
  color: #ffffff;
}

.page-blog__latest-news .page-blog__section-description {
  color: #f0f0f0;
}

.page-blog__blog-slider {
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  max-width: 1200px;
}

.page-blog__blog-slider-track {
  display: flex;
  gap: 20px;
  transition: transform 0.5s ease-in-out;
  padding-bottom: 20px;
}

.page-blog__blog-slide {
  flex: 0 0 calc(33.333% - 14px); /* Three items per row with gap */
  max-width: calc(33.333% - 14px);
  background-color: #333d4b; /* Darker card background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.page-blog__latest-news .page-blog__blog-card-title,
.page-blog__latest-news .page-blog__blog-card-excerpt,
.page-blog__latest-news .page-blog__blog-card-date {
  color: #ffffff;
}

.page-blog__latest-news .page-blog__btn-outline {
    color: #FF5A4F;
    border-color: #FF5A4F;
}

.page-blog__latest-news .page-blog__btn-outline:hover {
    background-color: #FF5A4F;
    color: #ffffff;
}

.page-blog__slider-controls {
  position: absolute;
  top: 50%;
  width: 100%;
  display: flex;
  justify-content: space-between;
  transform: translateY(-50%);
  z-index: 10;
  pointer-events: none; /* Allow clicks through to slides */
}

.page-blog__slider-prev,
.page-blog__slider-next {
  background-color: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  font-size: 1.5em;
  color: #ffffff;
  cursor: pointer;
  pointer-events: auto; /* Re-enable clicks for buttons */
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s ease;
}

.page-blog__slider-prev:hover,
.page-blog__slider-next:hover {
  background-color: rgba(255, 255, 255, 0.4);
}

.page-blog__slider-prev::before {
  content: '‹';
}

.page-blog__slider-next::before {
  content: '›';
}

/* CTA Section */
.page-blog__cta-section {
  padding: 60px 0;
  text-align: center;
  background-color: #F5F7FA; /* Light background */
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 30px;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: #ffffff; /* Card BG */
}

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

.page-blog__faq-item {
  background-color: #F5F7FA;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.page-blog__faq-item[open] {
  background-color: #f0f0f0;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  font-size: 1.1em;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  list-style: none; /* Remove default marker */
}

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

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

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: bold;
  color: #E53935;
  margin-left: 15px;
  transition: transform 0.3s ease;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  transform: rotate(45deg);
}

.page-blog__faq-answer {
  padding: 0 25px 18px;
  font-size: 1em;
  color: #555555;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__container {
    padding: 20px 30px;
  }

  .page-blog__hero-content {
    margin-top: -100px;
  }

  .page-blog__blog-masonry {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  .page-blog__blog-slide {
    flex: 0 0 calc(50% - 10px);
    max-width: calc(50% - 10px);
  }
}

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

  .page-blog__container {
    padding-left: 15px;
    padding-right: 15px;
  }

  /* HERO Section */
  .page-blog__hero-section {
    padding-top: 10px; /* Small top padding for mobile */
    padding-bottom: 30px;
  }

  .page-blog__hero-image-wrapper {
    max-height: 300px;
  }

  .page-blog__hero-content {
    margin-top: -80px; /* Adjust pull up for mobile */
    padding: 15px;
  }

  .page-blog__main-title {
    font-size: 1.8em;
    margin-bottom: 10px;
  }

  .page-blog__hero-description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  /* General Section */
  .page-blog__section-title {
    font-size: 1.6em;
    margin-bottom: 15px;
  }

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

  /* Blog Content Grid (Masonry) */
  .page-blog__blog-masonry {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
  }

  .page-blog__blog-card-image {
    height: 180px;
  }

  .page-blog__blog-card-title {
    font-size: 1.1em;
  }

  .page-blog__blog-card-excerpt {
    font-size: 0.9em;
  }

  /* Latest News Section (Slider) */
  .page-blog__blog-slider-track {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }

  .page-blog__blog-slide {
    flex: 0 0 calc(100% - 30px); /* Single item with side margin */
    max-width: calc(100% - 30px);
    margin: 0 15px;
    scroll-snap-align: start;
  }

  .page-blog__slider-controls {
    display: none; /* Hide controls on small mobile */
  }

  /* Buttons */
  .page-blog__btn-primary,
  .page-blog__btn-secondary,
  .page-blog__btn-outline,
  .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;
  }

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically on mobile */
    gap: 15px;
    padding-left: 15px;
    padding-right: 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__view-all-button-wrapper {
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__view-all-button {
    width: 100% !important;
  }

  /* Images in general */
  .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__blog-slider {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow-x: hidden;
  }

  /* FAQ Section */
  .page-blog__faq-question {
    font-size: 1em;
    padding: 15px 20px;
  }

  .page-blog__faq-toggle {
    font-size: 1.2em;
  }

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