/* style/blog.css */

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

.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: 2.5em;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
  color: #26A9E0; /* Brand color for titles */
}

.page-blog__featured-posts .page-blog__section-title {
  color: #26A9E0;
}

.page-blog__latest-posts .page-blog__section-title {
  color: #FFFFFF;
}

.page-blog__faq-section .page-blog__section-title {
  color: #26A9E0;
}

.page-blog__cta-section .page-blog__section-title {
  color: #FFFFFF;
}

.page-blog__section-description {
  font-size: 1.1em;
  text-align: center;
  margin-bottom: 40px;
  color: #f0f0f0; /* Light grey for descriptions on dark background */
}

.page-blog__featured-posts .page-blog__section-description {
  color: #555555; /* Darker grey for descriptions on light background */
}

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

.page-blog__faq-section .page-blog__section-description {
  color: #555555;
}

.page-blog__cta-section .page-blog__section-description {
  color: #f0f0f0;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image above content */
  align-items: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  background-color: #0a0a0a; /* Dark background to ensure text contrast */
  color: #ffffff;
  overflow: hidden; /* Ensure no overflow */
}

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

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

.page-blog__hero-content {
  max-width: 900px;
  text-align: center;
  z-index: 1; /* Ensure content is above any background effects */
}

.page-blog__hero-title {
  font-size: clamp(2.2em, 4vw, 3.5em); /* Responsive font size for H1 */
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #FFFFFF; /* White for H1 on dark background */
  letter-spacing: 1px;
}

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

.page-blog__hero-cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  width: 100%;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 15px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  text-align: center;
  max-width: 100%; /* Ensure buttons are responsive */
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text breaking */
}

.page-blog__btn-primary {
  background-color: #26A9E0; /* Primary brand color */
  color: #ffffff;
  border: 2px solid #26A9E0;
}

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

.page-blog__btn-secondary {
  background-color: transparent;
  color: #26A9E0; /* Primary brand color for text */
  border: 2px solid #26A9E0;
}

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

/* Specific login/register button color if needed, as per custom colors */
a[href*="redirect?plink_id"] {
  background-color: #EA7C07; /* Login/Register specific color */
  border-color: #EA7C07;
  color: #ffffff;
}

a[href*="redirect?plink_id"]:hover {
  background-color: #c96706;
  border-color: #c96706;
}

/* Featured Posts & Latest Posts Sections */
.page-blog__featured-posts,
.page-blog__latest-posts {
  padding: 80px 0;
}

.page-blog__featured-posts {
  background-color: #ffffff; /* Light background */
  color: #333333; /* Dark text for light background */
}

.page-blog__latest-posts {
  background-color: #0a0a0a; /* Dark background */
  color: #ffffff; /* Light text for dark background */
}

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

.page-blog__post-card {
  background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent white for cards on dark background */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__featured-posts .page-blog__post-card {
  background-color: #f9f9f9; /* Light background for cards in light section */
  color: #333333;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

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

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

.page-blog__post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__post-image {
  transform: scale(1.05);
}

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

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

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

.page-blog__latest-posts .page-blog__post-title a {
  color: #ffffff; /* White for titles on dark background */
}

.page-blog__post-title a:hover {
  color: #1e87c0;
}

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: #cccccc; /* Light grey for excerpt on dark background */
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__featured-posts .page-blog__post-excerpt {
  color: #555555; /* Dark grey for excerpt on light background */
}

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

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

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

/* FAQ Section */
.page-blog__faq-section {
  padding: 80px 0;
  background-color: #ffffff; /* Light background */
  color: #333333; /* Dark text */
}

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

.page-blog__faq-item {
  background-color: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  margin-bottom: 15px;
  overflow: hidden;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.page-blog__faq-item[open] {
  background-color: #eaf6fc; /* Lighter background when open */
  border-color: #26A9E0;
}

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.15em;
  font-weight: 600;
  color: #333333;
  cursor: pointer;
  list-style: none; /* Hide default marker for details/summary */
}

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

.page-blog__faq-qtext {
  flex-grow: 1;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  font-weight: 700;
  color: #26A9E0;
  margin-left: 15px;
  width: 20px;
  text-align: center;
}

.page-blog__faq-item[open] .page-blog__faq-toggle {
  content: '−'; /* Change to minus when open */
}

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

/* CTA Section */
.page-blog__cta-section {
  padding: 80px 0;
  background-color: #0a0a0a; /* Dark background */
  color: #ffffff;
  text-align: center;
}

.page-blog__cta-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
  width: 100%; /* Ensure container takes full width for flex-wrap */
}

/* Responsive Styles */
@media (max-width: 992px) {
  .page-blog__section-title {
    font-size: 2em;
  }

  .page-blog__hero-title {
    font-size: clamp(2em, 5vw, 3em);
  }

  .page-blog__hero-description {
    font-size: 1.1em;
  }

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

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

  .page-blog__container {
    padding: 0 15px;
  }

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

  .page-blog__section-description {
    font-size: 1em;
  }

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

  .page-blog__hero-cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
    padding: 0 15px;
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .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;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__post-grid {
    grid-template-columns: 1fr;
  }

  /* Images responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Video responsive (if any, though not in this blog page) */
  .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;
  }
  
  .page-blog__video-section {
    padding-top: 10px !important;
  }
  
  .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__faq-question {
    font-size: 1em;
    padding: 15px;
  }

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

/* Ensure no CSS filter changes image colors */
.page-blog img {
  filter: none;
}