/* General container for the Read Also section */
.read-also-box {
  border: double 2px #BD3730;
  background-color: #fff8f8;
  padding: 15px;
  margin-top: 40px;
  box-shadow: 0 0 10px rgba(0,0,0,0.05);
  display: flex;
  flex-direction: column;
  border-radius: 8px; /* Slightly rounded corners for the box */
}

/* Animated and centered heading */
.read-also-heading {
  text-align: center;
  font-weight: bold;
  color: #BD3730;
  font-size: 18px;
  /* Adjust margin-bottom to create space after the line */
  margin: 0 auto 15px auto; /* Center the heading itself */
  display: flex; /* For aligning text and emoji */
  justify-content: center;
  align-items: center;
  gap: 8px; /* Space between text and emoji */
  /* Only flicker animation for the main heading text */
  animation: flicker 1.5s infinite;
  padding-bottom: 5px; /* Space between text and the line */
  border-bottom: 1px solid #BD3730; /* The thin line */
  width: fit-content; /* Make the border only as wide as the content */
}

/* Keyframes for a subtle flicker effect */
@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* Specific animation for the finger emoji */
.read-also-heading .finger-emoji {
  display: inline-block; /* Essential for transform to work */
  animation: bounceFinger 1s infinite alternate 0.2s; /* Bouncing finger animation */
}

/* Keyframes for a subtle bouncing finger effect */
@keyframes bounceFinger {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); } /* Move up slightly */
}

/* Grid layout for related posts */
.related-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 2 columns for desktop */
  gap: 12px;
  width: 100%;
}

/* Styling for each individual related post item */
.related-posts-list li {
  display: flex;
  align-items: flex-start;
  border: 1px solid #e0e0e0;
  background-color: #ffffff;
  border-radius: 5px;
  padding: 10px;
  gap: 12px; /* Increased gap between image and title to 12px */
  transition: box-shadow 0.3s ease; /* Smooth shadow transition on hover */
}

.related-posts-list li:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.1); /* Subtle shadow on hover */
}

/* Styling for the thumbnail image container */
.related-thumb {
    flex-shrink: 0; /* Prevent thumbnail from shrinking */
}
.related-thumb img {
  width: 60px; /* Increased image size */
  height: 60px; /* Increased image size */
  object-fit: cover;
  border-radius: 5px;
  transition: transform 0.3s ease; /* Image hover animation */
  display: block; /* Ensures image takes its own space */
}

/* Image zoom effect on hover */
.related-posts-list li a:hover .related-thumb img {
  transform: scale(1.05);
}

/* Content area for title and meta */
.related-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Post title styling */
.related-title {
  font-size: 12px;
  font-weight: bold;
  color: #000; /* Black title color */
  transition: color 0.3s ease; /* Smooth color transition on hover */
  border: 1px solid #f0dada; /* Light border for title */
  padding: 5px;
  border-radius: 3px;
  margin-bottom: 4px;
  line-height: 1.3; /* Adjust line height for better readability */
}

/* Link styling for the entire post item */
.related-posts-list li a {
  display: flex; /* Ensures entire area is clickable and laid out correctly */
  align-items: flex-start;
  text-decoration: none;
  color: inherit; /* Inherit text color from parent */
  width: 100%;
}

/* Red hover effect for post titles */
.related-posts-list li a:hover .related-title {
  color: #BD3730; /* Red color on hover */
}

/* Meta information (author, date) */
.related-meta {
  font-size: 10px;
  color: #555;
  display: flex;
  align-items: center;
  gap: 5px;
  align-self: flex-end; /* Pushes the meta to the right within its column container */
}

/* Author avatar styling */
.related-meta img {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  object-fit: cover;
}

/* Load More Button styling and glow effect */
#loadMoreRelatedPosts {
    transition: box-shadow 0.3s ease-in-out, transform 0.3s ease;
}

#loadMoreRelatedPosts:hover {
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.7), 0 0 25px rgba(99, 102, 241, 0.5); /* Blue glow effect */
    transform: translateY(-2px); /* Slight lift */
}

/* Mobile Responsiveness: Switch to a single column on smaller screens */
@media (max-width: 768px) {
  .related-posts-list {
    grid-template-columns: 1fr; /* Single column for mobile */
  }

  .read-also-heading {
    font-size: 16px; /* Slightly smaller heading on mobile */
  }

  .related-posts-list li {
    flex-direction: row; /* Keep content in a row on mobile for compact view */
    align-items: flex-start; /* Align to the top */
  }
}
