/* style/blog.css */

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

.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;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.2;
}

/* --- Buttons --- */
.page-blog__btn-primary {
  display: inline-block;
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  padding: 14px 30px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.1em;
  transition: background-color 0.3s ease;
  border: none;
  cursor: pointer;
  box-sizing: border-box;
}

.page-blog__btn-primary:hover {
  background: linear-gradient(180deg, #E53935 0%, #FF5A4F 100%);
}

/* --- Title Section --- */
.page-blog__title-section {
  padding-top: 10px; /* Small top padding to avoid double header offset */
  padding-bottom: 40px;
  background-color: #ffffff;
}

.page-blog__title-section .page-blog__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.page-blog__title-content {
  flex: 1 1 50%;
  min-width: 300px;
}

.page-blog__main-title {
  font-weight: 800;
  color: #E53935;
  margin-bottom: 20px;
  line-height: 1.2;
  max-width: 600px; /* Constraint for H1 width */
  font-size: clamp(2.2em, 4vw, 3.2em); /* H1 font size constraint */
}

.page-blog__description {
  font-size: 1.1em;
  color: #333333;
  max-width: 700px;
}

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

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

/* --- Blog List Section --- */
.page-blog__blog-list-section {
  padding: 60px 0;
}

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

.page-blog__blog-card {
  background-color: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

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

.page-blog__card-image {
  width: 100%;
  height: 220px; /* Fixed height for consistent card image size */
  overflow: hidden;
}

.page-blog__card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

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

.page-blog__card-title {
  font-size: 1.3em;
  color: #E53933;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-blog__card-excerpt {
  font-size: 0.95em;
  color: #555555;
  margin-bottom: 15px;
}

.page-blog__card-date {
  font-size: 0.85em;
  color: #888888;
  display: block;
}

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

/* --- Why JBO Section --- */
.page-blog__why-jbo-section {
  padding: 60px 0;
  background-color: #ffffff;
}

.page-blog__why-jbo-section .page-blog__container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.page-blog__why-jbo-content {
  flex: 1 1 50%;
  min-width: 300px;
}

.page-blog__why-jbo-list {
  list-style: none;
  padding: 0;
  margin-top: 20px;
}

.page-blog__why-jbo-list li {
  font-size: 1.05em;
  color: #333333;
  margin-bottom: 15px;
  padding-left: 30px;
  position: relative;
}

.page-blog__why-jbo-list li::before {
  content: '✓';
  color: #E53935;
  font-weight: bold;
  position: absolute;
  left: 0;
  top: 0;
}

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

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

/* --- Call to Action Section --- */
.page-blog__cta-section {
  background: #E53935; /* Main brand color */
  color: #ffffff;
  text-align: center;
  padding: 60px 0;
}

.page-blog__cta-title {
  font-size: 2.2em;
  font-weight: 700;
  margin-bottom: 20px;
  line-height: 1.3;
  color: #ffffff;
}

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

.page-blog__cta-button {
  min-width: 220px; /* Ensure button has decent width */
}

/* --- Responsive Styles (max-width: 768px) --- */
@media (max-width: 768px) {
  .page-blog__container {
    padding: 20px 15px !important; /* Adjust padding for mobile */
  }

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

  /* HERO / Title Section */
  .page-blog__title-section {
    padding-top: 10px !important; /* Small top padding for mobile */
  }
  .page-blog__title-section .page-blog__container {
    flex-direction: column !important;
    gap: 30px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }

  .page-blog__main-title {
    font-size: 2em !important;
    text-align: center !important;
  }

  .page-blog__description {
    font-size: 1em !important;
    text-align: center !important;
  }

  .page-blog__title-image {
    order: -1 !important; /* Image above text on mobile */
  }

  /* Blog List Section */
  .page-blog__blog-list-section {
    padding: 40px 0 !important;
  }

  .page-blog__blog-grid {
    grid-template-columns: 1fr !important; /* Single column on mobile */
    gap: 20px !important;
  }

  .page-blog__card-image {
    height: 180px !important; /* Adjust image height for mobile cards */
  }

  .page-blog__card-title {
    font-size: 1.1em !important;
  }

  .page-blog__card-excerpt {
    font-size: 0.9em !important;
  }

  /* Why JBO Section */
  .page-blog__why-jbo-section {
    padding: 40px 0 !important;
  }
  .page-blog__why-jbo-section .page-blog__container {
    flex-direction: column !important;
    gap: 30px !important;
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
  .page-blog__why-jbo-image {
    order: -1 !important; /* Image above text on mobile */
  }

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

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

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

  /* Mobile image responsiveness (Applies to .page-blog img) */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    box-sizing: border-box !important;
  }
  
  /* Mobile container responsiveness (Applies to all sections/cards/containers) */
  .page-blog__title-section,
  .page-blog__blog-list-section,
  .page-blog__why-jbo-section,
  .page-blog__cta-section,
  .page-blog__blog-card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }

  /* Button responsiveness */
  .page-blog__btn-primary,
  .page-blog__cta-button,
  .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 !important;
    padding-right: 15px !important;
  }
  .page-blog__view-all-button-wrapper {
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}