/* style/blog.css */

/* --- General Styles --- */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: #333333; /* Dark text for light background */
  background-color: #ffffff; /* Assuming var(--secondary-color) resolves to white */
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: #26A9E0; /* Brand color for titles */
  text-align: center;
  margin-bottom: 20px;
  font-weight: bold;
}

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

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

.page-blog__section-description--white {
  color: #f0f0f0;
}

/* --- Buttons --- */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 12px 25px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: bold;
  transition: all 0.3s ease;
  text-align: center;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
  box-sizing: border-box;
  max-width: 100%;
}

.page-blog__btn-primary {
  background-color: #26A9E0;
  color: #ffffff;
  border: 2px solid #26A9E0;
}

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

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

.page-blog__btn-secondary:hover {
  background-color: #e0f4ff;
  color: #26A9E0;
}

/* --- Hero Section --- */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 450px; /* Minimum height for hero */
  overflow: hidden;
  padding-top: 10px; /* Small top padding, body handles header offset */
}

.page-blog__hero-image-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  overflow: hidden;
}

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

.page-blog__hero-content {
  position: relative;
  z-index: 1;
  max-width: 800px;
  padding: 40px 20px;
  background-color: rgba(0, 0, 0, 0.5); /* Dark overlay for text readability */
  border-radius: 10px;
  margin-top: 80px; /* Push content down from image top */
  margin-bottom: 40px;
}

.page-blog__main-title {
  color: #ffffff;
  font-size: clamp(2em, 4vw, 3.5em); /* Responsive font size for H1 */
  margin-bottom: 15px;
  line-height: 1.2;
  font-weight: bold;
}

.page-blog__description {
  color: #f0f0f0;
  font-size: 1.1em;
  margin-bottom: 30px;
}

/* --- Dark Background Section --- */
.page-blog__dark-section {
  background-color: #26A9E0; /* Brand primary color */
  color: #ffffff;
  padding: 60px 0;
}

.page-blog__dark-section .page-blog__section-description {
  color: #f0f0f0;
}

/* --- Latest Posts Section --- */
.page-blog__latest-posts {
  padding: 80px 0;
  background-color: #ffffff;
}

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

.page-blog__post-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__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: flex;
  flex-direction: column;
  height: 100%;
}

.page-blog__post-image {
  width: 100%;
  height: 220px; /* Fixed height for consistency */
  object-fit: cover;
  display: block;
}

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

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

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: #555555;
}

.page-blog__cta-container {
  text-align: center;
  margin-top: 60px;
}

/* --- Categories Section --- */
.page-blog__categories {
  padding: 80px 0;
}

.page-blog__category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 25px;
  margin-top: 40px;
}

.page-blog__category-card {
  background-color: rgba(255, 255, 255, 0.15); /* Slightly transparent white on brand blue */
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  text-decoration: none;
  color: #ffffff;
  transition: background-color 0.3s ease, transform 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-blog__category-card:hover {
  background-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-5px);
}

.page-blog__category-icon {
  width: 80px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 15px;
  display: block;
}

.page-blog__category-title {
  font-size: 1.2em;
  font-weight: bold;
  color: #ffffff;
}

/* --- Call to Action Section --- */
.page-blog__cta-section {
  padding: 80px 0;
  text-align: center;
}

.page-blog__cta-content {
  max-width: 900px;
}

.page-blog__cta-buttons {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 40px;
  flex-wrap: wrap; /* Ensure buttons wrap on smaller screens */
}

/* --- Responsive Design --- */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(2em, 5vw, 3em);
  }
}

@media (max-width: 768px) {
  .page-blog__container {
    padding: 0 15px !important;
  }

  /* General mobile text adjustments */
  .page-blog {
    font-size: 16px;
    line-height: 1.6;
  }

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

  .page-blog__section-description {
    font-size: 1em;
    margin-bottom: 30px;
  }

  /* Hero section adjustments */
  .page-blog__hero-section {
    min-height: 400px;
    padding: 40px 15px;
    padding-top: 10px !important; /* body handles --header-offset, this is decorative */
  }

  .page-blog__hero-content {
    padding: 30px 15px;
    margin-top: 60px;
  }

  .page-blog__main-title {
    font-size: clamp(1.8em, 7vw, 2.5em);
    margin-bottom: 10px;
  }

  .page-blog__description {
    font-size: 1em;
    margin-bottom: 20px;
  }

  /* Latest posts adjustments */
  .page-blog__latest-posts {
    padding: 60px 0;
  }

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

  .page-blog__post-image {
    height: auto !important; /* Override fixed height for responsiveness */
    max-height: 200px !important; /* Cap height to prevent excessively tall images */
  }

  /* Categories adjustments */
  .page-blog__categories {
    padding: 60px 0;
  }

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

  .page-blog__category-icon {
    width: 80px !important; /* Keep icons slightly larger for visibility */
    height: 80px !important;
    max-width: 100% !important;
  }

  /* CTA section adjustments */
  .page-blog__cta-section {
    padding: 60px 0;
  }

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

  /* Mobile image, video, button overflow prevention */
  .page-blog img {
    max-width: 100% !important;
    width: 100% !important; /* Ensure images take full width of their container */
    height: auto !important;
    display: block !important;
  }

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

  .page-blog__section,
  .page-blog__card,
  .page-blog__container,
  .page-blog__hero-section,
  .page-blog__latest-posts,
  .page-blog__categories,
  .page-blog__cta-section,
  .page-blog__post-card,
  .page-blog__category-card,
  .page-blog__cta-buttons,
  .page-blog__hero-content {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .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 !important;
    padding-right: 15px !important;
  }
  
  /* Specific override for CTA buttons to ensure they stack and have proper padding */
  .page-blog__cta-buttons {
    flex-direction: column !important;
    gap: 15px !important;
    padding-left: 15px !important;
    padding-right: 15px !important;
  }
}

/* Color Contrast Specifics based on Body background being light (white) */
.page-blog__light-bg {
  color: #333333; /* Light background, dark text */
  background-color: #ffffff;
}

.page-blog__dark-bg {
  color: #ffffff; /* Dark background, light text */
  background-color: #26A9E0;
}

/* Ensure specific elements maintain contrast */
.page-blog p,
.page-blog li {
  color: #333333;
}

.page-blog__card {
  background: #ffffff;
  color: #333333;
  border: 1px solid #e0e0e0;
}

.page-blog__dark-section {
  background: #26A9E0;
  color: #ffffff;
}

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

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