body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.sticky_header{
    position: sticky;
    top: 0;
    z-index: 1000; /* higher than other elements */
  }

.blog_entry {
  font-family: 'Arial', sans-serif;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  flex: 1; /* This makes the blog content expand to fill available space */

  /*display: grid;*/
  display: block;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
  padding: 2rem;
  background-color: #f9f9f9;
  margin: 0 auto; /* center content inside full width */
}

/* Add a wrapper for the main content area */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.pagination {
  margin-top: auto; /* Push pagination to bottom of content area */
  text-align: center;
  margin-bottom: 2rem;
  padding-top: 2rem;
}

/* Keep only this scoped version */
.blog_entry .blog_card {
  display: flex;
  flex-direction: column;
  padding-left: 1rem;
  /* border-left: 4px solid rgb(43, 43, 43); */  /* Removed black bar completely */
  background-color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-bottom: 2rem;
  /* Remove fixed min-height, let content determine height */
}

.blog_card {
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog_card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.blog_content_row {
  display: flex;
  flex-direction: row;
  gap: 1.5rem;
  align-items: flex-start;
  flex: 1; /* Allow content to grow */
  min-height: 0; /* Allow shrinking */
}

.blog_images {
  flex: 0 0 50%;
  max-width: 50%;
}

.blog_image_gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.5rem;
  margin-top: 0.5%;
  margin-bottom: 0.5%;
}

.blog_image_container {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
}

.blog_image_gallery .blog_image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 6px;
  transition: transform 0.3s ease;
}

.blog_image_gallery .blog_image:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Overlay for "+X more" images */
.image_overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.3s ease;
}

.image_overlay:hover {
  background: rgba(0, 0, 0, 0.8);
}

.more_images_text {
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.blog_text_content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  min-height: 0; /* Allow content to shrink */
  overflow: hidden; /* Prevent overflow */
}

.blog_title {
  margin-top: 1%;
  font-size: 1.5rem;
  font-weight: bold;
  color: #333;
  margin-bottom: 0.5rem;
  flex-shrink: 0; /* Don't shrink the title */
}

.blog_description {
  font-size: 1rem;
  color: #555;
  line-height: 1.6;
  white-space: pre-line;
  overflow: hidden;
  
  /* Limit to height of images (approximately 200px) */
  max-height: 200px; /* Match the image height */
  
  /* CSS-only text truncation that fills available space */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 8; /* Reduced from 12 to about 8 lines to fit 200px */
  text-overflow: ellipsis;
  position: relative;
}

/* Add a subtle fade effect at the bottom for better visual truncation */
.blog_description::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 30px;
  height: 1.6em;
  background: linear-gradient(to right, transparent, white);
  pointer-events: none;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .blog_content_row {
    flex-direction: column;
  }
  
  .blog_images {
    flex: none;
    max-width: 100%;
  }
  
  .blog_image_gallery {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }
  
  .blog_image_gallery .blog_image {
    height: 150px;
  }
  
  .more_images_text {
    font-size: 1rem;
  }
  
  .blog_description {
    -webkit-line-clamp: 6; /* Fewer lines on mobile */
    max-height: 150px; /* Match mobile image height */
  }
}

.admin_controls {
  padding: 1rem;
  border-top: 1px solid #eee;
  background: #f8f9fa;
  flex-shrink: 0; /* Don't shrink admin controls */
}

/* REMOVE THE OLD EDIT MODAL STYLES - THESE WERE CAUSING THE CONFLICT */
/* 
.edit_post_modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal_overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal_content {
  position: relative;
  background: white;
  border-radius: 8px;
  padding: 2rem;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}
*/

.edit-post-btn {
  background:rgb(139, 0, 8);
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s ease;
}

.edit-post-btn:hover {
 background: rgb(101, 0, 5);
}
