/* style/blog.css */

/* Base styles for the blog page content */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light background */
  background-color: #FFFFFF; /* Assuming body background is light from shared.css */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  justify-content: center;
  padding: 10px 20px 60px; /* Small top padding, larger bottom for separation */
  background-color: #f8f8f8; /* Light background for hero section */
  text-align: center;
  overflow: hidden; /* Ensure content doesn't overflow */
}

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

.page-blog__hero-image {
  width: 100%;
  max-width: 1200px; /* Max width for the image */
  height: auto;
  display: block;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.page-blog__hero-content {
  max-width: 900px;
  margin: 0 auto;
}

.page-blog__main-title {
  font-size: clamp(2em, 4vw, 3.2em); /* Responsive font size for H1 */
  color: #26A9E0; /* Brand color for H1 */
  margin-bottom: 15px;
  line-height: 1.2;
  font-weight: bold;
}

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

/* Common container for sections */
.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Section Titles and Descriptions */
.page-blog__section-title {
  font-size: clamp(1.8em, 3.5vw, 2.5em);
  color: #26A9E0;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

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

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: #FFFFFF;
}

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

.page-blog__blog-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.page-blog__card-image-wrapper {
  width: 100%;
  height: 225px; /* Fixed height for consistent card images */
  overflow: hidden;
}

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

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

.page-blog__card-title {
  font-size: 1.4em;
  margin-bottom: 10px;
  font-weight: bold;
}

.page-blog__card-title a {
  color: #26A9E0; /* Brand color for blog titles */
  text-decoration: none;
  transition: color 0.3s ease;
}

.page-blog__card-title a:hover {
  color: #1a7bb2; /* Darker shade on hover */
}

.page-blog__card-meta {
  font-size: 0.9em;
  color: #777777;
  margin-bottom: 15px;
}

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

.page-blog__read-more-btn {
  display: inline-block;
  background-color: #26A9E0;
  color: #ffffff;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  transition: background-color 0.3s ease;
  align-self: flex-start;
}

.page-blog__read-more-btn:hover {
  background-color: #1a7bb2;
}

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

/* Call to Action Section */
.page-blog__cta-section {
  background-color: #26A9E0; /* Brand primary color for CTA background */
  color: #ffffff; /* White text for contrast */
  padding: 80px 20px;
  text-align: center;
}

.page-blog__cta-section .page-blog__section-title {
  color: #ffffff; /* White title for dark background */
  margin-bottom: 15px;
}

.page-blog__cta-section .page-blog__section-description {
  color: #f0f0f0; /* Slightly off-white for description */
  margin-bottom: 40px;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 8px;
  font-size: 1.1em;
  font-weight: bold;
  text-decoration: none;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* Ensure buttons don't overflow */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Break long words */
}

.page-blog__btn-primary {
  background-color: #EA7C07; /* Login color for primary action */
  color: #ffffff;
  border: 2px solid #EA7C07;
}

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

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

.page-blog__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #1a7bb2;
  border-color: #f0f0f0;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: #f8f8f8;
}

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

.page-blog__faq-item {
  background-color: #ffffff;
  border-radius: 8px;
  margin-bottom: 15px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  overflow: hidden; /* Ensure content stays within bounds */
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.1em;
  font-weight: bold;
  color: #333333;
  cursor: pointer;
  border-bottom: 1px solid #eeeeee;
  user-select: none;
  list-style: none; /* Remove default marker for <summary> */
}

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

.page-blog__faq-question:hover {
  background-color: #f5f5f5;
}

.page-blog__faq-qtext {
  flex-grow: 1;
  color: #26A9E0; /* Brand color for FAQ questions */
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  margin-left: 15px;
  color: #26A9E0;
}

.page-blog__faq-answer {
  padding: 20px;
  font-size: 1em;
  color: #555555;
  border-top: 1px solid #eee;
}

.page-blog__faq-answer p {
  margin-bottom: 10px;
}
.page-blog__faq-answer p:last-child {
  margin-bottom: 0;
}


/* --- Responsive Styles --- */

/* Tablet and smaller desktops */
@media (max-width: 1024px) {
  .page-blog__hero-content {
    max-width: 768px;
  }
  .page-blog__post-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

/* Mobile devices */
@media (max-width: 768px) {
  /* General page content adjustments */
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-blog__container {
    padding: 0 15px !important; /* Ensure padding for mobile */
  }

  /* Hero Section */
  .page-blog__hero-section {
    padding: 10px 15px 40px !important; /* Adjust padding */
  }

  .page-blog__hero-image-wrapper {
    margin-bottom: 20px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em); /* Adjust H1 for smaller screens */
  }

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

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px !important;
    font-size: 1em !important;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Latest Posts Section */
  .page-blog__latest-posts {
    padding: 50px 0;
  }

  .page-blog__section-title {
    font-size: clamp(1.5em, 6vw, 2em);
    margin-bottom: 15px;
  }

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

  .page-blog__post-grid {
    grid-template-columns: 1fr; /* Single column for blog posts */
    gap: 25px;
  }

  .page-blog__card-image-wrapper {
    height: 180px; /* Adjust card image height */
  }

  .page-blog__card-title {
    font-size: 1.2em;
  }

  /* CTA Section */
  .page-blog__cta-section {
    padding: 50px 15px;
  }

  /* FAQ Section */
  .page-blog__faq-section {
    padding: 50px 0;
  }

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

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

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

  /* Image responsive override for all images within .page-blog */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Video responsive override for all videos within .page-blog */
  .page-blog video,
  .page-blog__video {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Video containers mobile adaptation */
  .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;
  }
  
  /* Buttons mobile adaptation */
  .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-wrap: wrap !important; /* Allow wrapping for multiple buttons */
    gap: 10px;
  }
  /* If buttons are in a flex column, ensure they fill width */
  .page-blog__cta-buttons {
    flex-direction: column !important;
  }

  /* Content area and card containers */
  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__video-section {
    padding-top: 10px !important; /* body already handles --header-offset */
  }
}