/* Base styles for the Blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Default dark text for light body background */
  background-color: #FFFFFF; /* Explicitly set body background to white */
}

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

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  padding-top: 10px; /* Small top padding, assuming shared.css handles body padding */
  margin-bottom: 40px;
  text-align: center;
  background-color: #f5f5f5;
}

.page-blog__hero-image {
  width: 100%;
  overflow: hidden;
}

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

.page-blog__hero-content {
  padding: 20px;
  background-color: #FFFFFF; /* Ensure content block has light background */
  margin-top: -20px; /* Slightly overlap with image for design */
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-blog__main-title {
  font-size: 2.5rem;
  font-weight: bold;
  color: #017439; /* Brand color for H1 */
  margin-bottom: 15px;
  line-height: 1.2;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.page-blog__description {
  font-size: 1.1rem;
  color: #555555;
  margin-bottom: 20px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Section Titles & Intros */
.page-blog__section-title {
  font-size: 2rem;
  font-weight: bold;
  color: #017439;
  text-align: center;
  margin-bottom: 15px;
  padding-top: 40px;
}

.page-blog__section-intro {
  font-size: 1rem;
  color: #555555;
  text-align: center;
  margin-bottom: 40px;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

/* Latest Articles Section */
.page-blog__latest-articles-section {
  padding: 40px 0;
  background-color: #f9f9f9;
  color: #333333;
}

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

.page-blog__article-card {
  background-color: #ffffff;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  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__article-link {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__article-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for consistent card images */
  overflow: hidden;
}

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

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

.page-blog__article-title {
  font-size: 1.3rem;
  font-weight: bold;
  color: #017439;
  margin-bottom: 10px;
}

.page-blog__article-meta {
  font-size: 0.9rem;
  color: #777777;
  margin-bottom: 15px;
}

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

.page-blog__read-more-btn {
  display: inline-block;
  padding: 8px 15px;
  background-color: #017439;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.95rem;
  align-self: flex-start;
  transition: background-color 0.3s ease;
}

.page-blog__read-more-btn:hover {
  background-color: #005a2e;
}

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

.page-blog__btn-primary {
  display: inline-block;
  padding: 12px 25px;
  background-color: #017439;
  color: #ffffff;
  text-decoration: none;
  border-radius: 5px;
  font-size: 1.1rem;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.page-blog__btn-primary:hover {
  background-color: #005a2e;
}

/* Categories Section */
.page-blog__categories-section {
  padding: 60px 0;
  background-color: #017439;
  color: #ffffff;
  text-align: center;
}

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

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

.page-blog__category-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 15px;
  margin-top: 30px;
}

.page-blog__category-item {
  display: inline-block;
  padding: 10px 20px;
  background-color: #ffffff;
  color: #017439;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  transition: background-color 0.3s ease, color 0.3s ease;
  border: 2px solid #ffffff;
}

.page-blog__category-item:hover {
  background-color: #e0e0e0;
  color: #004a25;
}

/* CTA Section */
.page-blog__cta-section {
  padding: 60px 0;
  text-align: center;
  background-color: #f9f9f9;
  color: #333333;
}

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

.page-blog__btn-register {
  display: inline-block;
  padding: 15px 30px;
  background-color: #C30808; /* Custom Register color */
  color: #FFFF00; /* Custom Register font color */
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: none;
}

.page-blog__btn-register:hover {
  background-color: #a30606;
  transform: translateY(-2px);
}

.page-blog__btn-login {
  display: inline-block;
  padding: 15px 30px;
  background-color: #C30808; /* Custom Login color */
  color: #FFFF00; /* Custom Login font color */
  text-decoration: none;
  border-radius: 8px;
  font-size: 1.2rem;
  font-weight: bold;
  transition: background-color 0.3s ease, transform 0.3s ease;
  border: none;
}

.page-blog__btn-login:hover {
  background-color: #a30606;
  transform: translateY(-2px);
}

/* General image responsiveness */
.page-blog img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Responsive styles for mobile */
@media (max-width: 768px) {
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

  .page-blog__container,
  .page-blog__hero-content,
  .page-blog__articles-grid,
  .page-blog__category-list,
  .page-blog__cta-buttons {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }

  .page-blog__hero-section {
    padding-top: 10px; /* Small top padding for mobile */
    margin-bottom: 20px;
  }

  .page-blog__hero-image img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__main-title {
    font-size: 1.8rem;
    margin-bottom: 10px;
  }

  .page-blog__description,
  .page-blog__section-intro {
    font-size: 1rem;
    margin-bottom: 20px;
  }

  .page-blog__section-title {
    font-size: 1.7rem;
    padding-top: 20px;
    margin-bottom: 15px;
  }

  .page-blog__articles-grid {
    grid-template-columns: 1fr; /* Single column for articles */
    gap: 20px;
    margin-bottom: 30px;
  }

  .page-blog__article-card {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .page-blog__article-image-wrapper {
    height: 180px;
  }

  .page-blog__category-list {
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
  }

  .page-blog__category-item {
    width: 100%;
    padding: 12px 15px;
  }

  .page-blog__cta-buttons {
    flex-direction: column !important; /* Stack buttons vertically */
    gap: 15px;
    margin-top: 20px;
  }

  .page-blog__btn-primary,
  .page-blog__btn-register,
  .page-blog__btn-login,
  .page-blog__read-more-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;
  }
  
  /* Ensure all images inside page-blog are responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  /* Example for long text content area in mobile */
  .page-blog__content-area p,
  .page-blog__content-area li {
    font-size: 1rem;
  }

  .page-blog__content-area table {
    width: 100%;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-blog__content-area table thead,
  .page-blog__content-area table tbody,
  .page-blog__content-area table th,
  .page-blog__content-area table td,
  .page-blog__content-area table tr {
    display: block;
  }

  .page-blog__content-area table tr {
    margin-bottom: 15px;
  }

  .page-blog__content-area table td::before {
    content: attr(data-label);
    float: left;
    font-weight: bold;
    text-transform: uppercase;
    margin-right: 10px;
  }
}