/* style/blog.css */

/* General styling for the blog page content */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light body background */
  background-color: var(--background-color, #FFFFFF); /* Ensure body background is respected */
}

/* Container for main content areas */
.page-blog__container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  box-sizing: border-box;
}

/* Section titles */
.page-blog__section-title {
  font-size: clamp(28px, 4vw, 38px); /* H2, H3, H4 can use clamp for size */
  color: #26A9E0;
  text-align: center;
  margin-bottom: 40px;
  font-weight: 700;
  line-height: 1.2;
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Ensure image is above content */
  align-items: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: #f8f8f8; /* Light background for the section */
}

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

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

.page-blog__hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__hero-title {
  font-size: clamp(36px, 5vw, 56px); /* H1 font size with clamp */
  color: #26A9E0;
  margin-bottom: 20px;
  font-weight: 800;
  line-height: 1.1;
  max-width: 60ch; /* Limit line length for readability */
  margin-left: auto;
  margin-right: auto;
}

.page-blog__hero-description {
  font-size: clamp(16px, 2vw, 20px);
  color: #555555;
  margin-bottom: 30px;
}

/* CTA Buttons */
.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  width: 100%; /* Ensure container takes full width */
  max-width: 100%; /* Ensure container takes full width */
  box-sizing: border-box;
}

.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;
  text-align: center;
  max-width: 100%; /* Ensure buttons adapt to screen width */
  box-sizing: border-box;
  white-space: normal; /* Allow text to wrap */
  word-wrap: break-word; /* Allow long words to break */
}

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

.page-blog__btn-primary:hover {
  background-color: #1e87c2;
  border-color: #1e87c2;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

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

.page-blog__btn-secondary:hover {
  background-color: #f0f8ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Login button specific color (if any, using custom color rules) */
.page-blog a[href*="login.html"],
.page-blog a[href*="register.html"],
.page-blog a[href*="plink_id"] {
  background-color: #EA7C07;
  border-color: #EA7C07;
  color: #FFFFFF;
}

.page-blog a[href*="login.html"]:hover,
.page-blog a[href*="register.html"]:hover,
.page-blog a[href*="plink_id"]:hover {
  background-color: #c46406;
  border-color: #c46406;
}


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

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

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

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

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

.page-blog__card-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;
  color: #26A9E0;
  margin-bottom: 10px;
  font-weight: 700;
  line-height: 1.3;
}

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

.page-blog__card-description {
  font-size: 16px;
  color: #555555;
  margin-bottom: 20px;
  flex-grow: 1; /* Allow description to take available space */
}

.page-blog__read-more {
  display: inline-block;
  color: #26A9E0;
  font-weight: 600;
  text-decoration: underline;
  margin-top: auto; /* Push to bottom */
}

.page-blog__read-more:hover {
  color: #1e87c2;
}

.page-blog__view-all-wrapper {
  text-align: center;
}

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #26A9E0; /* Dark background */
  color: #FFFFFF; /* Light text */
}

.page-blog__category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
}

.page-blog__category-item {
  background-color: rgba(255, 255, 255, 0.15);
  border-radius: 25px;
  padding: 8px 20px;
  transition: background-color 0.3s ease;
}

.page-blog__category-item:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

.page-blog__category-link {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: 600;
  font-size: 16px;
}

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

.page-blog__faq-list {
  max-width: 800px;
  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;
}

.page-blog__faq-item summary {
  list-style: none; /* Remove default marker */
  cursor: pointer;
  padding: 20px 25px;
  font-size: 18px;
  font-weight: 700;
  color: #333333;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: background-color 0.3s ease;
}

.page-blog__faq-item summary::-webkit-details-marker {
  display: none; /* For Webkit browsers */
}

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

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

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

.page-blog__faq-answer {
  padding: 0 25px 20px 25px;
  font-size: 16px;
  color: #555555;
  line-height: 1.7;
}

/* Footer CTA Section */
.page-blog__footer-cta-section {
  padding: 80px 0;
  background-color: #26A9E0;
  text-align: center;
  color: #FFFFFF;
}

.page-blog__footer-cta-title {
  font-size: clamp(30px, 4vw, 42px);
  color: #FFFFFF;
  margin-bottom: 20px;
  font-weight: 700;
}

.page-blog__footer-cta-description {
  font-size: clamp(16px, 2vw, 20px);
  color: #f0f8ff;
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* Responsive design */
@media (max-width: 1024px) {
  .page-blog__article-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  }
}

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

  /* Images */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* All content containers for mobile */
  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__faq-section,
  .page-blog__footer-cta-section,
  .page-blog__hero-image-wrapper,
  .page-blog__hero-content,
  .page-blog__article-grid,
  .page-blog__faq-list,
  .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;
    overflow: hidden !important; /* Ensure no overflow on containers */
  }

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

  .page-blog__hero-title {
    font-size: clamp(28px, 7vw, 42px);
  }

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

  /* Buttons */
  .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;
    font-size: 16px;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  /* Article cards */
  .page-blog__article-grid {
    grid-template-columns: 1fr; /* Single column layout */
  }

  .page-blog__card-image {
    height: 200px; /* Adjust height for mobile */
  }

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

  .page-blog__card-description {
    font-size: 15px;
  }

  /* Categories */
  .page-blog__category-list {
    flex-direction: column;
    align-items: center;
  }

  .page-blog__category-item {
    width: 100%;
    text-align: center;
  }

  /* FAQ */
  .page-blog__faq-item summary {
    font-size: 16px;
    padding: 15px 20px;
  }

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

  /* Footer CTA */
  .page-blog__footer-cta-section {
    padding: 60px 15px;
  }

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