/* Blog section styles */
#blog-posts {
  padding: 40px 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  text-align: center;
  margin: 0 auto;
  background-color: transparent;
  transition: background-color 0.3s ease, color 0.3s ease;
}

#blog-posts h2 {
  margin-bottom: 30px;
  text-align: center;
  font-size: 28px;
  position: relative;
  padding-bottom: 15px;
}

#blog-posts h2:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: #007bff;
  border-radius: 3px;
}

#blog-posts > div {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  gap: 15px;
  overflow-x: auto;
  padding-bottom: 20px;
  width: 100%;
  max-width: 100%;
  -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
  scrollbar-width: none;  /* Hide scrollbar for Firefox */
  scroll-behavior: smooth;
  padding-left: 10px;
  padding-right: 10px;
  box-sizing: border-box;
  margin: 0 auto;
}

/* Hide scrollbar for Chrome, Safari and Opera */
#blog-posts > div::-webkit-scrollbar,
#blog-posts .card::-webkit-scrollbar {
  display: none;
}

#blog-posts .card {
  -ms-overflow-style: none;  /* Hide scrollbar for IE and Edge */
  scrollbar-width: none;  /* Hide scrollbar for Firefox */
  flex: 0 0 240px;
  min-width: 240px;
  max-width: 240px;
  display: block;
  background: #fff;
  border-radius: 8px;
  overflow: auto; /* Changed from 'hidden' to 'auto' to allow scrolling */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease, color 0.3s ease, border 0.3s ease;
  margin: 0;
  height: 420px; /* Fixed height for all cards */
  position: relative;
  padding-bottom: 0; /* Removed padding as we're using margin on the paragraph */
  border: 1px solid rgba(0, 0, 0, 0.05);
}

#blog-posts .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

#blog-posts .card > div:first-child {
  height: 180px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}

#blog-posts .card h4 {
  padding: 15px 15px 5px;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  flex-shrink: 0;
  transition: color 0.3s ease;
}

#blog-posts .card p {
  padding: 0 15px 5px;
  margin: 0 0 60px 0; /* Add bottom margin to make space for the button */
  font-size: 14px;
  line-height: 1.5;
  color: #666;
  max-height: none; /* Allow full text to display */
  overflow: visible;
  transition: color 0.3s ease;
}

#blog-posts .card .read-more-container {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 15px;
  text-align: center;
  background-color: #fff;
  z-index: 2;
  transition: background-color 0.3s ease, border-color 0.3s ease;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#blog-posts .card .read-more {
  display: inline-block;
  padding: 8px 15px;
  color: #fff;
  background-color: #007bff;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  text-align: center;
  width: 100%;
  box-sizing: border-box;
}

#blog-posts .card .read-more:hover {
  background-color: #0056b3;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  transform: translateY(-2px);
}

/* Dark mode support */
.dark-theme #blog-posts {
  background-color: rgba(30, 30, 30, 0.3);
}

.dark-theme #blog-posts h2 {
  color: #eee;
}

.dark-theme #blog-posts h2:after {
  background: #3a9fff;
}

.dark-theme #blog-posts .card {
  background: #222;
  color: #eee;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.dark-theme #blog-posts .card:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.dark-theme #blog-posts .card h4 {
  color: #eee;
}

.dark-theme #blog-posts .card p {
  color: #aaa;
}

.dark-theme #blog-posts .card .read-more-container {
  background-color: #222;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.dark-theme #blog-posts .card .read-more {
  background-color: #3a9fff;
  color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.dark-theme #blog-posts .card .read-more:hover {
  background-color: #66b5ff;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
  transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
  #blog-posts > div {
    padding-bottom: 15px;
  }

  #blog-posts .card {
    flex: 0 0 220px;
    min-width: 220px;
    max-width: 220px;
    height: 400px;
  }
}

@media (max-width: 768px) {
  #blog-posts > div {
    padding-bottom: 15px;
    gap: 10px;
  }

  #blog-posts .card {
    flex: 0 0 200px;
    min-width: 200px;
    max-width: 200px;
    height: 380px;
  }

  #blog-posts .card > div:first-child {
    height: 150px;
  }

  #blog-posts .card .read-more-container {
    padding: 12px;
    bottom: 0;
  }
}

@media (max-width: 480px) {
  #blog-posts .card {
    flex: 0 0 180px;
    min-width: 180px;
    max-width: 180px;
    height: 350px;
  }

  #blog-posts .card > div:first-child {
    height: 120px;
  }

  #blog-posts .card h4 {
    font-size: 14px;
    padding: 10px 10px 5px;
  }

  #blog-posts .card p {
    font-size: 12px;
    padding: 0 10px 5px;
    margin-bottom: 50px;
  }

  #blog-posts .card .read-more-container {
    padding: 10px;
    bottom: 0;
  }

  #blog-posts .card .read-more {
    font-size: 12px;
    padding: 6px 12px;
  }
}
