/* style/blog.css */

/* General 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 handles the actual background */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image on top, text below */
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: rgba(0, 0, 0, 0.4); /* Slightly dark overlay for readability */
}

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

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  max-width: 100%; /* Ensure image is responsive */
}

.page-blog__hero-content {
  max-width: 900px;
  width: 100%;
  z-index: 1;
}

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

.page-blog__hero-description {
  font-size: 1.1em;
  color: #f0f0f0;
  margin-bottom: 30px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__hero-cta {
  margin-top: 20px;
}

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 60px 0;
  background-color: #1a1a1a; /* Dark background for section */
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: #26A9E0;
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

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

.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.08); /* Semi-transparent white for cards */
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
}

.page-blog__post-card:hover {
  transform: translateY(-5px);
}

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

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

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

.page-blog__post-title {
  font-size: 1.4em;
  color: #26A9E0;
  margin-bottom: 10px;
  flex-grow: 1;
  font-weight: bold;
}

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: #e0e0e0;
  margin-bottom: 20px;
}

.page-blog__read-more {
  display: inline-block;
  color: #FFFFFF; /* White for read more */
  background-color: #26A9E0; /* Brand color background */
  padding: 8px 15px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: bold;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.page-blog__read-more:hover {
  background-color: #1e87c0; /* Slightly darker brand color on hover */
}

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

/* Categories Section */
.page-blog__categories {
  padding: 60px 0;
  background-color: #0d0d0d; /* Even darker background */
}

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

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  overflow: hidden;
  text-align: center;
  padding: 20px;
  text-decoration: none;
  color: #ffffff;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
}

.page-blog__category-image {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 15px;
  max-width: 100%; /* Ensure image is responsive */
}

.page-blog__category-title {
  font-size: 1.3em;
  color: #26A9E0;
  font-weight: bold;
}

/* FAQ Section */
.page-blog__faq-section {
  padding: 60px 0;
  background-color: #1a1a1a; /* Dark background */
}

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

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

.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  font-size: 1.2em;
  font-weight: bold;
  color: #26A9E0;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease;
  list-style: none; /* Remove default marker for details summary */
}

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

.page-blog__faq-item[open] .page-blog__faq-question {
  background-color: rgba(255, 255, 255, 0.1);
}

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

.page-blog__faq-answer {
  padding: 20px;
  font-size: 1em;
  color: #e0e0e0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: none; /* Hidden by default for JS version, details handles natively */
}

.page-blog__faq-item[open] .page-blog__faq-answer {
    display: block; /* Show when open for details tag */
}

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

.page-blog__cta-title {
  font-size: 2.8em;
  margin-bottom: 20px;
  font-weight: bold;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

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

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

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

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

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

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

/* Responsive adjustments */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 2.8em);
  }

  .page-blog__section-title {
    font-size: 2em;
  }
  
  .page-blog__cta-title {
    font-size: 2.2em;
  }
}

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

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

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

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

  .page-blog__latest-posts,
  .page-blog__categories,
  .page-blog__faq-section,
  .page-blog__cta-section {
    padding: 40px 0;
  }

  .page-blog__container {
    padding: 0 15px !important; /* Force padding for mobile */
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__post-grid,
  .page-blog__category-grid {
    grid-template-columns: 1fr; /* Single column for mobile */
    gap: 20px;
  }

  .page-blog__post-image,
  .page-blog__category-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important; /* Ensure images are responsive */
    display: block !important;
  }

  /* All images must be responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* All image containers must be responsive */
  .page-blog__hero-image-wrapper,
  .page-blog__post-card,
  .page-blog__category-card {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

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

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

  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .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; /* Add some padding to prevent text touching edges */
    padding-right: 15px;
  }

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

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

@media (max-width: 480px) {
  .page-blog__main-title {
    font-size: clamp(1.6em, 8vw, 2em);
  }
  .page-blog__section-title {
    font-size: 1.8em;
  }
  .page-blog__cta-title {
    font-size: 1.6em;
  }
}