/* style/blog.css */

/* Base styles for the blog page */
.page-blog {
  font-family: Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-main-color, #333333); /* Default text color, ensuring contrast */
  background-color: var(--site-bg-color, #F5F7FA); /* Default background color */
}

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

.page-blog__section-title {
  font-size: 2.5em;
  color: var(--primary-color, #E53935);
  text-align: center;
  margin-bottom: 40px;
  font-weight: bold;
}

/* Hero Section */
.page-blog__hero-section {
  position: relative;
  display: flex;
  flex-direction: column; /* Image above text */
  align-items: center;
  padding-top: 10px; /* Small decorative top padding */
  padding-bottom: 60px;
  background-color: var(--card-bg-color, #FFFFFF);
  overflow: hidden; /* Ensure no overflow */
}

.page-blog__hero-image-container {
  width: 100%;
  max-width: 100%; /* Ensure it takes full width */
  margin-bottom: 30px;
  box-sizing: border-box;
  overflow: hidden;
}

.page-blog__hero-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
  border-radius: 8px;
}

.page-blog__hero-content {
  text-align: center;
  max-width: 800px;
  padding: 0 20px;
}

.page-blog__main-title {
  font-weight: bold;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--primary-color, #E53935);
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 4vw, 3.2rem); /* Example clamp for responsive H1 */
}

.page-blog__description {
  font-size: 1.1em;
  color: var(--text-main-color, #333333);
  margin-bottom: 30px;
}

/* Buttons */
.page-blog__btn-primary,
.page-blog__btn-secondary {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1.05em;
  transition: all 0.3s ease;
  cursor: pointer;
  max-width: 100%; /* Ensure buttons adapt to width */
  box-sizing: border-box;
  white-space: normal; /* Allow text wrapping */
  word-wrap: break-word; /* Allow text wrapping */
}

.page-blog__btn-primary {
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  border: 2px solid transparent;
  margin-right: 15px;
}

.page-blog__btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.page-blog__btn-secondary {
  background: #ffffff;
  color: var(--primary-color, #E53935);
  border: 2px solid var(--primary-color, #E53935);
}

.page-blog__btn-secondary:hover {
  background: var(--primary-color, #E53935);
  color: #ffffff;
}

/* Latest Posts Section */
.page-blog__latest-posts-section {
  padding: 80px 0;
  background-color: var(--site-bg-color, #F5F7FA);
}

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

.page-blog__post-card {
  background-color: var(--card-bg-color, #FFFFFF);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color, #E0E0E0);
}

.page-blog__post-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

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

.page-blog__post-image-wrapper {
  width: 100%;
  height: 200px; /* Fixed height for consistency */
  overflow: hidden;
}

.page-blog__post-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.page-blog__post-card:hover .page-blog__post-image {
  transform: scale(1.05);
}

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

.page-blog__post-title {
  font-size: 1.4em;
  font-weight: bold;
  color: var(--text-main-color, #333333);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.page-blog__post-excerpt {
  font-size: 1em;
  color: #555555;
  margin-bottom: 20px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-blog__read-more-btn {
  display: inline-block;
  color: var(--primary-color, #E53935);
  font-weight: bold;
  text-decoration: none;
}

.page-blog__read-more-btn:hover {
  text-decoration: underline;
}

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

/* Categories Section */
.page-blog__categories-section {
  padding: 80px 0;
  background-color: var(--card-bg-color, #FFFFFF);
}

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

.page-blog__category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text-main-color, #333333);
  background-color: #f9f9f9;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-color, #E0E0E0);
}

.page-blog__category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

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

.page-blog__category-title {
  font-size: 1.2em;
  font-weight: bold;
  text-align: center;
  color: var(--primary-color, #E53935);
}

/* CTA Banner */
.page-blog__cta-banner {
  padding: 80px 0;
  background: linear-gradient(180deg, #FF5A4F 0%, #E53935 100%);
  color: #ffffff;
  text-align: center;
}

.page-blog__cta-content {
  max-width: 800px;
  margin: 0 auto;
}

.page-blog__cta-title {
  font-size: 2.8em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #ffffff;
}

.page-blog__cta-description {
  font-size: 1.2em;
  margin-bottom: 40px;
  color: #f0f0f0;
}

.page-blog__cta-banner .page-blog__btn-primary {
  margin-right: 20px;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  .page-blog__main-title {
    font-size: clamp(2rem, 5vw, 2.8rem);
  }
  .page-blog__section-title {
    font-size: 2em;
  }
  .page-blog__cta-title {
    font-size: 2.2em;
  }
}

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

  .page-blog__container {
    padding: 0 15px; /* Add padding for mobile content */
  }

  .page-blog__hero-section,
  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__cta-banner {
    padding: 40px 0; /* Adjust section padding */
  }

  .page-blog__main-title {
    font-size: clamp(1.8rem, 6vw, 2.5rem);
  }

  .page-blog__section-title {
    font-size: 1.8em;
    margin-bottom: 30px;
  }

  .page-blog__cta-title {
    font-size: 1.8em;
  }

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

  .page-blog__hero-image-container,
  .page-blog__post-image-wrapper,
  .page-blog__category-card,
  .page-blog__posts-grid,
  .page-blog__categories-grid,
  .page-blog__hero-section,
  .page-blog__latest-posts-section,
  .page-blog__categories-section,
  .page-blog__cta-banner {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding-left: 15px;
    padding-right: 15px;
  }
  
  .page-blog__post-image-wrapper {
    height: auto;
    aspect-ratio: 16 / 9; /* Maintain aspect ratio */
  }

  /* Buttons responsiveness */
  .page-blog__btn-primary,
  .page-blog__btn-secondary {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    margin-right: 0 !important; /* Remove right margin for stacking */
    margin-bottom: 15px !important; /* Add bottom margin for stacking */
  }

  .page-blog__hero-content .page-blog__btn-primary {
    margin-bottom: 15px !important; /* Add space between stacked buttons */
  }

  .page-blog__cta-banner .page-blog__btn-primary {
    margin-right: 0 !important;
  }

  .page-blog__cta-banner .page-blog__cta-content a {
    display: block; /* Stack buttons vertically */
    margin-bottom: 15px;
  }
  .page-blog__cta-banner .page-blog__cta-content a:last-child {
    margin-bottom: 0;
  }

  .page-blog__posts-grid,
  .page-blog__categories-grid {
    grid-template-columns: 1fr; /* Single column layout */
  }

  .page-blog__hero-section {
    padding-top: 10px !important; /* Keep small top padding */
  }
}

/* Color contrast adjustments for dark sections */
.page-blog__dark-section {
  color: #ffffff; /* Ensure white text on dark background */
}

.page-blog__dark-section .page-blog__section-title,
.page-blog__dark-section .page-blog__cta-title,
.page-blog__dark-section .page-blog__cta-description {
  color: #ffffff; /* Ensure white text on dark background */
}

/* No CSS filters on images */
.page-blog img {
  filter: none;
}