/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default text color for light backgrounds */
  background-color: #F5F7FA; /* Custom background color */
}

.page-blog__container {
  max-width: 1170px;
  margin: 0 auto;
  padding: 40px 16px;
  box-sizing: border-box;
}

.page-blog__section-title {
  font-size: 2.5em;
  font-weight: 700;
  color: #E53935; /* Brand color for titles */
  text-align: center;
  margin-bottom: 15px;
  line-height: 1.2;
}

.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;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
  max-width: 100%; /* Ensure responsiveness */
  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: #FFFFFF;
  color: #E53935;
  border: 2px solid #E53935;
}

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

/* Hero Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, assuming body handles header offset */
  padding-bottom: 60px;
  background-color: #F5F7FA; /* Light background for hero */
}

.page-blog__hero-container {
  max-width: 1170px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 40px 16px;
  gap: 40px;
}

.page-blog__hero-content {
  flex: 1 1 50%;
  min-width: 300px;
  color: #333333;
}

.page-blog__main-title {
  font-size: 3em;
  font-weight: 800;
  color: #E53935;
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 600px;
}

.page-blog__hero-description {
  font-size: 1.15em;
  margin-bottom: 30px;
  color: #555555;
  max-width: 650px;
}

.page-blog__cta-group {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.page-blog__hero-image {
  flex: 1 1 40%;
  min-width: 300px;
  text-align: center;
}

.page-blog__hero-side-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
}

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

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

.page-blog__post-card {
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid #E0E0E0; /* Border for cards */
}

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

.page-blog__post-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.page-blog__post-thumbnail {
  width: 100%;
  height: 250px; /* Fixed height for thumbnails */
  object-fit: cover;
  display: block;
}

.page-blog__post-content {
  padding: 20px;
}

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

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

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

.page-blog__read-more {
  color: #E53935;
  font-weight: 600;
  display: inline-block;
}

.page-blog__read-more:hover {
  text-decoration: underline;
}

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

/* Categories Section */
.page-blog__categories-section {
  background-color: #E53935; /* Dark brand color background */
  color: #ffffff; /* White text for dark background */
  padding: 60px 0;
}

.page-blog__categories-section .page-blog__section-title {
  color: #ffffff;
}

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

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

.page-blog__category-item {
  text-align: center;
  background: rgba(255, 255, 255, 0.1);
  padding: 30px;
  border-radius: 12px;
  transition: background 0.3s ease;
}

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

.page-blog__category-image {
  width: 100%;
  max-width: 250px;
  height: auto;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__category-title {
  font-size: 1.5em;
  font-weight: 700;
  margin-bottom: 10px;
}

.page-blog__category-title a {
  color: #ffffff;
  text-decoration: none;
}

.page-blog__category-title a:hover {
  text-decoration: underline;
}

.page-blog__category-text {
  font-size: 1em;
  color: #f0f0f0;
}

/* Guide Section */
.page-blog__guide-section {
  background-color: #F5F7FA; /* Light background */
  padding: 60px 0;
}

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

.page-blog__guide-item {
  background: #ffffff;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  text-align: center;
  border: 1px solid #E0E0E0;
}

.page-blog__guide-image {
  width: 100%;
  height: 200px; /* Fixed height for guide images */
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 20px;
  display: block;
}

.page-blog__guide-title {
  font-size: 1.5em;
  font-weight: 700;
  color: #333333;
  margin-bottom: 10px;
}

.page-blog__guide-text {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
}

.page-blog__guide-link {
  color: #E53935;
  font-weight: 600;
  text-decoration: none;
}

.page-blog__guide-link:hover {
  text-decoration: underline;
}

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

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

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

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

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

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

.page-blog__faq-question::-webkit-details-marker {
  display: none;
}

.page-blog__faq-toggle {
  font-size: 1.5em;
  line-height: 1;
  transition: transform 0.3s ease;
}

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

.page-blog__faq-answer {
  padding: 0 20px 20px;
  font-size: 1em;
  color: #f0f0f0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

.page-blog__faq-item[open] .page-blog__faq-answer {
  max-height: 500px; /* Arbitrary large enough value */
  padding-top: 10px;
}

.page-blog__faq-answer p {
  margin: 0;
  padding: 0;
}

/* Call to Action Section */
.page-blog__cta-section {
  background-color: #F5F7FA; /* Light background */
  padding: 60px 0;
}

.page-blog__cta-section .page-blog__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
}

.page-blog__cta-content {
  flex: 1 1 50%;
  min-width: 300px;
  text-align: left;
}

.page-blog__cta-image-wrapper {
  flex: 1 1 40%;
  min-width: 300px;
  text-align: center;
}

.page-blog__cta-image {
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  display: block;
  margin: 0 auto;
}

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

/* Responsive styles */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: 2.5em;
  }

  .page-blog__hero-container,
  .page-blog__cta-section .page-blog__container {
    flex-direction: column;
    text-align: center;
  }

  .page-blog__hero-content,
  .page-blog__cta-content {
    flex: 1 1 100%;
    text-align: center;
  }

  .page-blog__cta-group,
  .page-blog__cta-buttons {
    justify-content: center;
  }

  .page-blog__post-thumbnail {
    height: 220px;
  }

  .page-blog__category-image {
    max-width: 200px;
  }
}

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

  .page-blog__container {
    padding: 20px 15px !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }

  .page-blog__section-title {
    font-size: 2em;
    margin-bottom: 10px;
  }

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

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

  .page-blog__main-title {
    font-size: 2em;
    margin-bottom: 15px;
  }

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

  .page-blog__cta-group {
    flex-direction: column;
    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;
    padding-right: 15px;
  }

  .page-blog__hero-side-image,
  .page-blog__post-thumbnail,
  .page-blog__category-image,
  .page-blog__guide-image,
  .page-blog__cta-image,
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }

  .page-blog__post-thumbnail,
  .page-blog__guide-image {
    height: 180px; /* Adjust height for mobile */
  }

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

  .page-blog__posts-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .page-blog__post-card {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  }

  /* Categories Section */
  .page-blog__categories-section {
    padding: 40px 0;
  }

  .page-blog__categories-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  /* Guide Section */
  .page-blog__guide-section {
    padding: 40px 0;
  }

  .page-blog__guide-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

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

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

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

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

  /* CTA Section */
  .page-blog__cta-section {
    padding: 40px 0;
  }

  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
  }

  .page-blog__cta-content,
  .page-blog__cta-image-wrapper {
    padding-left: 15px;
    padding-right: 15px;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
}

/* Ensure all image containers handle overflow on mobile */
.page-blog__hero-image,
.page-blog__posts-grid,
.page-blog__categories-grid,
.page-blog__guide-grid,
.page-blog__cta-image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}