/* style/blog.css */

/* 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 for clarity if shared.css doesn't */
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: column; /* Image on top, content below */
  align-items: center;
  padding: 60px 20px;
  padding-top: 10px; /* Small top padding, body handles --header-offset */
  background: linear-gradient(135deg, #26A9E0, #FFFFFF); /* Blend brand color with white */
  text-align: center;
  overflow: hidden; /* Ensure content stays within bounds */
}

.page-blog__hero-content {
  max-width: 900px;
  margin-bottom: 30px; /* Space between text and image */
  z-index: 2; /* Ensure text is above any background elements */
  color: #FFFFFF; /* White text for gradient background */
}

.page-blog__main-title {
  font-size: clamp(2.5rem, 4vw, 3.5rem); /* Responsive H1 font size */
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #FFFFFF;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

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

.page-blog__hero-image-wrapper {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  z-index: 1;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
  min-width: 200px; /* Ensure minimum size */
  min-height: 200px;
}

/* CTA Buttons in Hero */
.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap; /* Allow wrapping on small screens */
  width: 100%; /* Ensure container takes full width for wrapping */
  max-width: 600px;
  margin: 0 auto;
}

.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
  max-width: 100%; /* Responsive button width */
  white-space: normal; /* Allow text wrap */
  word-wrap: break-word; /* Allow text wrap */
}

.page-blog__btn-primary {
  background-color: #EA7C07; /* Login color for primary action */
  color: #FFFFFF;
  border: 2px solid #EA7C07;
}

.page-blog__btn-primary:hover {
  background-color: #d46c06;
  border-color: #d46c06;
  transform: translateY(-2px);
}

.page-blog__btn-secondary {
  background-color: #FFFFFF;
  color: #26A9E0; /* Brand color for secondary action */
  border: 2px solid #26A9E0;
}

.page-blog__btn-secondary:hover {
  background-color: #f0f0f0;
  color: #1e87b7;
  border-color: #1e87b7;
  transform: translateY(-2px);
}

/* Articles Section */
.page-blog__articles-section {
  padding: 80px 0;
  background-color: #f8f9fa; /* Light grey background for contrast */
}

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

.page-blog__section-title {
  font-size: clamp(2rem, 3.5vw, 2.8rem);
  font-weight: 700;
  color: #26A9E0; /* Brand color for section titles */
  text-align: center;
  margin-bottom: 50px;
}

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

.page-blog__article-card {
  background-color: #FFFFFF;
  border-radius: 10px;
  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 8px 25px rgba(0, 0, 0, 0.15);
}

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

.page-blog__post-cover {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
  min-width: 200px; /* Ensure minimum size */
  min-height: 200px;
}

.page-blog__card-content {
  padding: 20px;
  flex-grow: 1; /* Allows content to take available space */
  display: flex;
  flex-direction: column;
}

.page-blog__card-title {
  font-size: 1.3rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 10px;
  flex-grow: 1;
}

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

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

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

.page-blog__read-more:hover {
  color: #1e87b7;
  text-decoration: underline;
}

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

/* CTA Section at bottom */
.page-blog__cta-section {
  padding: 80px 20px;
  background-color: #26A9E0; /* Brand color background */
  text-align: center;
  color: #FFFFFF;
}

.page-blog__section-title--white {
  color: #FFFFFF;
  margin-bottom: 20px;
}

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

.page-blog__cta-section .page-blog__cta-buttons {
  margin-top: 0; /* Override margin from hero cta-buttons */
}

/* Responsive Design */
@media (max-width: 1024px) {
  .page-blog__hero-section {
    padding: 40px 15px;
  }
  .page-blog__main-title {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }
  .page-blog__hero-description,
  .page-blog__cta-description {
    font-size: 1rem;
  }
  .page-blog__articles-section,
  .page-blog__cta-section {
    padding: 60px 0;
  }
}

@media (max-width: 768px) {
  /* Ensure all images are responsive */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important;
    height: auto !important;
    display: block !important;
  }
  
  /* Ensure all containers with images are responsive */
  .page-blog__hero-image-wrapper,
  .page-blog__article-card,
  .page-blog__container {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    padding-left: 15px;
    padding-right: 15px;
    overflow: hidden !important; /* Prevent horizontal scroll */
  }

  /* Specific padding for hero section on mobile */
  .page-blog__hero-section {
    padding-top: 10px !important; /* body already handles --header-offset */
    padding-left: 15px;
    padding-right: 15px;
  }

  /* Buttons responsive on mobile */
  .page-blog__cta-buttons {
    flex-direction: column; /* Stack buttons vertically */
    gap: 15px;
  }

  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 20px;
    font-size: 1rem;
    white-space: normal !important;
    word-wrap: break-word !important;
  }

  .page-blog__section-title {
    font-size: clamp(1.8rem, 5vw, 2.5rem);
    margin-bottom: 30px;
  }

  .page-blog__post-cover {
    height: 180px; /* Slightly smaller height for mobile */
  }

  .page-blog__article-card {
    min-width: unset; /* Allow cards to shrink */
  }
}

/* Color Contrast Enforcement */
.page-blog__light-bg {
  background-color: #FFFFFF;
  color: #333333;
}

.page-blog__dark-bg {
  background-color: #26A9E0;
  color: #FFFFFF;
}

/* Ensure text in content areas has sufficient contrast */
.page-blog p,
.page-blog li,
.page-blog__card-excerpt,
.page-blog__post-date {
  color: #333333; /* Dark text for light backgrounds */
}

/* Override for dark sections */
.page-blog__hero-content,
.page-blog__cta-section p,
.page-blog__section-title--white {
  color: #FFFFFF; /* White text for dark/gradient backgrounds */
}

/* Button specific contrast already handled by explicit colors */