/* 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 background */
  background-color: #F5F7FA; /* Custom background color */
}

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

.page-blog__section-title {
  font-size: 36px;
  font-weight: 700;
  color: #E53935; /* Main brand color for titles */
  text-align: center;
  margin-bottom: 40px;
  position: relative;
  padding-bottom: 15px;
}

.page-blog__section-title::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, #FF5A4F 0%, #E53935 100%);
  border-radius: 2px;
}

/* Hero Section */
.page-blog__hero-section {
  padding-top: 10px; /* Small top padding, assuming shared.css handles body padding-top */
  background-color: #F5F7FA;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 50px;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}

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

.page-blog__hero-content {
  max-width: 900px;
  padding: 30px 20px 0;
}

.page-blog__hero-title {
  font-weight: 700;
  color: #E53935; /* Main brand color */
  margin-bottom: 20px;
  line-height: 1.2;
  /* Using clamp for responsive H1 font size, avoiding fixed large values */
  font-size: clamp(28px, 4.5vw, 48px);
}

.page-blog__hero-description {
  font-size: 18px;
  color: #333333;
  margin-bottom: 30px;
}

.page-blog__btn-primary {
  display: inline-block;
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: none;
  cursor: pointer;
  max-width: 100%; /* Ensure button adapts */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(229, 57, 53, 0.4);
}

/* Blog Posts Section */
.page-blog__posts-section {
  padding: 50px 0;
  background-color: #F5F7FA;
}

.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: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
}

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

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

.page-blog__post-image {
  width: 100%;
  height: 225px; /* Fixed height for consistency, adjust as needed */
  object-fit: cover;
  display: block;
}

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

.page-blog__post-title {
  font-size: 22px;
  font-weight: 600;
  color: #333333;
  margin-bottom: 10px;
  line-height: 1.3;
  transition: color 0.3s ease;
}

.page-blog__post-link:hover .page-blog__post-title {
  color: #E53935;
}

.page-blog__post-date {
  font-size: 14px;
  color: #666666;
  margin-bottom: 15px;
  display: block;
}

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

.page-blog__read-more {
  display: inline-block;
  color: #E53935;
  font-weight: 600;
  text-decoration: none;
  font-size: 16px;
  transition: color 0.3s ease;
}

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

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

.page-blog__btn-secondary {
  display: inline-block;
  background: #ffffff;
  color: #E53935;
  padding: 15px 30px;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  font-size: 18px;
  border: 2px solid #E53935;
  transition: background-color 0.3s ease, color 0.3s ease, transform 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* Ensure button adapts */
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

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

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

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 8px;
  border: 1px solid #E0E0E0;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 25px;
  cursor: pointer;
  user-select: none;
  list-style: none;
  transition: background-color 0.3s ease;
}
details.page-blog__faq-item summary.page-blog__faq-question::-webkit-details-marker {
  display: none;
}
details.page-blog__faq-item summary.page-blog__faq-question:hover {
  background: #fdfdfd;
}
.page-blog__faq-qtext {
  flex: 1;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333;
}
.page-blog__faq-toggle {
  font-size: 28px;
  font-weight: bold;
  color: #E53935;
  flex-shrink: 0;
  margin-left: 15px;
  width: 32px;
  text-align: center;
}
details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 25px 20px;
  background: #f9f9f9;
  border-radius: 0 0 8px 8px;
  font-size: 16px;
  color: #555555;
}
details.page-blog__faq-item .page-blog__faq-answer p {
  margin: 0;
}


/* Responsive styles */
/* @media (max-width: 1024px) - For tablets and smaller desktops */
@media (max-width: 1024px) {
  .page-blog__section-title {
    font-size: 32px;
    margin-bottom: 35px;
  }

  .page-blog__hero-content {
    padding: 25px 20px 0;
  }

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

  .page-blog__posts-grid {
    gap: 25px;
  }

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

  .page-blog__post-excerpt {
    font-size: 15px;
  }

  details.page-blog__faq-item summary.page-blog__faq-question {
    padding: 16px 20px;
  }
  .page-blog__faq-qtext {
    font-size: 17px;
  }
  .page-blog__faq-toggle {
    font-size: 26px;
    width: 30px;
  }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 20px 18px;
  }
}

/* @media (max-width: 768px) - For mobile devices */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }
  
  .page-blog__container {
    padding: 0 15px;
  }

  .page-blog__section-title {
    font-size: 28px;
    margin-bottom: 30px;
    padding-bottom: 10px;
  }

  .page-blog__section-title::after {
    width: 60px;
    height: 3px;
  }

  /* Hero Section */
  .page-blog__hero-section {
    padding-top: 10px !important; /* Small top padding, assuming shared.css handles body padding-top */
    margin-bottom: 40px;
  }

  .page-blog__hero-image-wrapper {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding: 0 15px; /* Add padding to prevent image touching edges */
  }

  .page-blog__hero-image {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    border-radius: 6px;
  }

  .page-blog__hero-content {
    padding: 20px 15px 0;
  }

  .page-blog__hero-title {
    font-size: clamp(24px, 7vw, 36px); /* Adjust clamp for mobile */
    margin-bottom: 15px;
  }

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

  /* Buttons */
  .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: 12px 20px !important;
    font-size: 16px !important;
  }

  .page-blog__view-all {
    padding: 0 15px; /* Add padding to container */
  }

  /* Blog Posts Section */
  .page-blog__posts-section {
    padding: 40px 0;
  }

  .page-blog__posts-grid {
    grid-template-columns: 1fr; /* Single column on mobile */
    gap: 20px;
    padding: 0 15px; /* Add padding to grid container */
  }

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

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

  .page-blog__post-title {
    font-size: 18px;
  }

  .page-blog__post-date {
    font-size: 13px;
  }

  .page-blog__post-excerpt {
    font-size: 14px;
  }

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

  .page-blog__faq-list {
    padding: 0 15px; /* Add padding to list container */
  }

  details.page-blog__faq-item summary.page-blog__faq-question {
    padding: 15px 18px;
  }
  .page-blog__faq-qtext {
    font-size: 16px;
  }
  .page-blog__faq-toggle {
    font-size: 24px;
    width: 28px;
  }
  details.page-blog__faq-item .page-blog__faq-answer {
    padding: 0 18px 15px;
    font-size: 15px;
  }

  /* General image and container rules for mobile */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .page-blog__posts-section,
  .page-blog__faq-section {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }
}