/* 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: #ffffff; /* Assuming body background is light */
}

/* Hero Section */
.page-blog__hero-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles header offset */
  background-color: #ffffff;
  color: #333333;
}

.page-blog__hero-container {
  max-width: 900px;
  margin-bottom: 30px;
  z-index: 1; /* Ensure text is above image if any overlap */
}

.page-blog__hero-title {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #017439; /* Brand color for title */
}

.page-blog__hero-description {
  font-size: 1.1rem;
  margin-bottom: 30px;
  color: #555555;
}

.page-blog__hero-buttons {
  display: flex;
  gap: 20px;
  justify-content: center;
}

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

/* Latest Posts Section */
.page-blog__latest-posts {
  padding: 60px 20px;
  background-color: #f9f9f9;
  color: #333333;
}

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

.page-blog__section-title {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: #017439;
}

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

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

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

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

.page-blog__post-cover {
  width: 100%;
  padding-top: 120px; /* Fixed height for consistency, roughly 800x450 aspect ratio */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

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

.page-blog__post-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #017439;
  line-height: 1.4;
}

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

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

.page-blog__read-more {
  color: #017439;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  position: relative;
}

.page-blog__read-more::after {
  content: '→';
  position: absolute;
  right: -15px;
  opacity: 0;
  transition: all 0.3s ease;
}

.page-blog__post-card:hover .page-blog__read-more::after {
  right: 0;
  opacity: 1;
}

.page-blog__view-all-posts {
  text-align: center;
  margin-top: 40px;
}

/* Call to Action Section */
.page-blog__cta-section {
  background-color: #017439; /* Brand primary color */
  color: #ffffff; /* White text for contrast */
  padding: 80px 20px;
  text-align: center;
}

.page-blog__cta-title {
  font-size: clamp(1.6rem, 4.5vw, 2.5rem);
  font-weight: 700;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto 40px auto;
  color: #f0f0f0;
}

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

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
  background-color: #C30808; /* Register/Login red */
  color: #FFFF00; /* Register/Login yellow text */
  border: 2px solid #C30808;
}

.page-blog__btn-primary:hover {
  background-color: #a00606;
  border-color: #a00606;
}

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

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

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-title {
    font-size: clamp(1.6rem, 5vw, 2.5rem);
  }
  .page-blog__section-title {
    font-size: clamp(1.4rem, 4vw, 2rem);
  }
}

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

  .page-blog__hero-section {
    padding: 40px 15px;
    padding-top: 10px !important;
  }

  .page-blog__hero-buttons,
  .page-blog__cta-buttons {
    flex-direction: column;
    gap: 15px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding-left: 15px;
    padding-right: 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__latest-posts,
  .page-blog__cta-section {
    padding: 40px 15px;
  }

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

  .page-blog__post-card {
    padding-bottom: 0;
  }

  /* Image responsive */
  .page-blog img {
    max-width: 100% !important;
    height: auto !important;
    display: block !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;
  }

  .page-blog__post-cover {
    padding-top: 120px !important; /* Ensure minimum height for image covers */
  }

}