/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  color: #333333; /* Default dark text for light body background */
  background-color: #FFFFFF;
}

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

.page-blog__section-title {
  font-size: clamp(24px, 4vw, 36px);
  font-weight: 700;
  color: #017439;
  text-align: center;
  margin-bottom: 40px;
  line-height: 1.2;
}

.page-blog__section-title--light {
  color: #FFFFFF;
}

.page-blog__btn-primary,
.page-blog__btn-secondary,
.page-blog a[class*="button"],
.page-blog a[class*="btn"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  text-align: center;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  word-wrap: break-word;
}

.page-blog__btn-primary {
  background-color: #017439;
  color: #FFFFFF;
  border: 2px solid transparent;
}

.page-blog__btn-primary:hover {
  background-color: #025f2e;
}

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

.page-blog__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #017439;
}

/* Custom colors for Login/Register if needed, applied to specific buttons */
.page-blog__cta-button[href*="redirect"] {
  background-color: #C30808;
  color: #FFFF00;
  border: 2px solid #C30808;
}

.page-blog__cta-button[href*="redirect"]:hover {
  background-color: #a30606;
  color: #FFFF00;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding-top: 10px; /* Small top padding, relying on body for header offset */
  padding-bottom: 60px;
}

.page-blog__hero-image-wrapper {
  width: 100%;
  max-height: 550px; /* Limit height for desktop */
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 40px;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  min-height: 200px; /* Min size for all images */
}

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 900px;
  padding: 0 20px;
}

.page-blog__main-title {
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 800;
  color: #FFFFFF;
  margin-bottom: 20px;
  line-height: 1.2;
}

.page-blog__description {
  font-size: clamp(16px, 2vw, 20px);
  color: #f0f0f0;
  margin-bottom: 30px;
  line-height: 1.6;
}

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

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

.page-blog__article-card {
  background-color: #FFFFFF;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  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__card-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  min-height: 200px; /* Min size for all images */
}

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

.page-blog__card-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  line-height: 1.4;
}

.page-blog__card-title a {
  color: #017439;
  text-decoration: none;
}

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

.page-blog__article-date {
  font-size: 14px;
  color: #666;
  margin-bottom: 15px;
}

.page-blog__card-excerpt {
  font-size: 16px;
  color: #555;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.page-blog__read-more-button {
  align-self: flex-start;
}

.page-blog__button-group {
  text-align: center;
  margin-top: 20px;
}

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

.page-blog__categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
  justify-items: center;
}

.page-blog__category-item {
  display: block;
  background-color: #025f2e;
  color: #FFFFFF;
  padding: 15px 20px;
  border-radius: 8px;
  text-align: center;
  font-weight: 600;
  text-decoration: none;
  transition: background-color 0.3s ease, transform 0.3s ease;
  max-width: 100%;
  box-sizing: border-box;
}

.page-blog__category-item:hover {
  background-color: #014d27;
  transform: translateY(-3px);
}

/* Featured Content Section */
.page-blog__featured-content-section {
  padding: 60px 0;
}

.page-blog__featured-article {
  display: flex;
  gap: 40px;
  align-items: center;
  background-color: #FFFFFF;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  padding: 30px;
}

.page-blog__featured-image {
  width: 50%;
  height: auto;
  border-radius: 8px;
  display: block;
  min-height: 200px; /* Min size for all images */
}

.page-blog__featured-text {
  width: 50%;
}

.page-blog__featured-text p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 20px;
  color: #555;
}

.page-blog__learn-more-button {
  margin-top: 10px;
}

/* About Blog Section */
.page-blog__about-blog-section {
  padding: 60px 0;
  background-color: #025f2e;
}

.page-blog__about-content {
  display: flex;
  gap: 40px;
  align-items: center;
}

.page-blog__about-image {
  width: 40%;
  height: auto;
  border-radius: 8px;
  display: block;
  min-height: 200px; /* Min size for all images */
}

.page-blog__about-text {
  width: 60%;
  color: #f0f0f0;
}

.page-blog__about-text p {
  font-size: 17px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.page-blog__about-text a {
  color: #FFFF00;
  text-decoration: underline;
}

.page-blog__about-text a:hover {
  color: #FFFFFF;
}

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

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

details.page-blog__faq-item {
  margin-bottom: 15px;
  border-radius: 5px;
  border: 1px solid #e0e0e0;
  overflow: hidden;
  background: #fff;
}

details.page-blog__faq-item summary.page-blog__faq-question {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 20px;
  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: #f5f5f5;
}

.page-blog__faq-qtext {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  text-align: left;
  color: #333333;
}

.page-blog__faq-toggle {
  font-size: 24px;
  font-weight: bold;
  color: #666;
  flex-shrink: 0;
  margin-left: 15px;
  width: 28px;
  text-align: center;
}

details.page-blog__faq-item .page-blog__faq-answer {
  padding: 0 20px 20px;
  background: #f9f9f9;
  border-radius: 0 0 5px 5px;
  color: #555;
}

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

.page-blog__section,
.page-blog__card,
.page-blog__container {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

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

  .page-blog__container {
    padding: 15px;
  }

  .page-blog__section-title {
    font-size: clamp(20px, 6vw, 28px);
    margin-bottom: 30px;
  }

  /* HERO Section Mobile */
  .page-blog__hero-section {
    padding-top: 10px;
    padding-bottom: 40px;
  }

  .page-blog__hero-image-wrapper {
    max-height: 300px;
    margin-bottom: 20px;
  }

  .page-blog__hero-image {
    object-fit: contain !important; /* Ensure image is not cropped */
    aspect-ratio: unset !important;
    min-height: 200px !important;
  }

  .page-blog__main-title {
    font-size: clamp(24px, 7vw, 36px);
    margin-bottom: 15px;
  }

  .page-blog__description {
    font-size: clamp(15px, 3.5vw, 18px);
    margin-bottom: 25px;
  }

  /* Buttons Mobile */
  .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__button-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 0 15px;
  }

  /* Latest Articles Section Mobile */
  .page-blog__latest-articles-section {
    padding: 40px 0;
  }

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

  .page-blog__card-image {
    height: 180px;
    min-height: 200px !important;
  }

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

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

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

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

  .page-blog__category-item {
    padding: 12px 15px;
    font-size: 14px;
  }

  /* Featured Content Section Mobile */
  .page-blog__featured-content-section {
    padding: 40px 0;
  }

  .page-blog__featured-article {
    flex-direction: column;
    gap: 25px;
    padding: 20px;
  }

  .page-blog__featured-image,
  .page-blog__featured-text {
    width: 100%;
  }

  .page-blog__featured-image {
    min-height: 200px !important;
  }

  .page-blog__featured-text p {
    font-size: 15px;
  }

  /* About Blog Section Mobile */
  .page-blog__about-blog-section {
    padding: 40px 0;
  }

  .page-blog__about-content {
    flex-direction: column;
    gap: 25px;
  }

  .page-blog__about-image,
  .page-blog__about-text {
    width: 100%;
  }

  .page-blog__about-image {
    min-height: 200px !important;
  }

  .page-blog__about-text p {
    font-size: 15px;
  }

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

  details.page-blog__faq-item summary.page-blog__faq-question { padding: 15px; }
  .page-blog__faq-qtext { font-size: 15px; }
  details.page-blog__faq-item .page-blog__faq-answer { padding: 0 15px 15px; }

  /* General image and container mobile adaptation */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
  }

  .page-blog__section,
  .page-blog__card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
  }
}

/* Media Queries for Tablet (max-width: 1024px) - Adjustments for larger screens if needed */
@media (max-width: 1024px) {
  .page-blog__container {
    padding: 15px 30px;
  }

  .page-blog__articles-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .page-blog__featured-article,
  .page-blog__about-content {
    flex-direction: column;
    gap: 30px;
    text-align: center;
  }

  .page-blog__featured-image,
  .page-blog__featured-text,
  .page-blog__about-image,
  .page-blog__about-text {
    width: 100%;
  }

  .page-blog__featured-image,
  .page-blog__about-image {
    max-width: 700px;
    margin: 0 auto;
  }

  .page-blog__featured-text .page-blog__learn-more-button,
  .page-blog__about-text .page-blog__about-link {
    margin: 10px auto 0;
  }

  .page-blog__categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}