/* Container layout */
main {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: stretch;
}

/* Sidebars and Main Content */
#desktopLeftSidebar {
  flex: 1 1 200px;  /* Allows it to shrink but not disappear immediately */
  min-width: 180px; /* Ensures it doesn't shrink below a reasonable size */
}

#desktopRightSidebar {
  flex: 1.2 1 280px; /* Slightly larger for ad space */
  min-width: 220px;  /* Ensures it holds size longer */
}

#templateMain {
  padding-top:0px;
  flex: 2 1 600px; /* Takes up most space but can shrink */
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Responsive behavior: Remove BOTH sidebars together */
@media (max-width: 1100px) { 
  #desktopLeftSidebar, #desktopRightSidebar {
    display: none !important;
  }

  #templateMain {
    flex: 1 1 100%; /* Full width on mobile */
  }
}






.post-content {
  max-height: 33vh;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-btn {
  background: none;
  border: none;
  color: blue;
  text-align: left;
  padding: 0;
  margin-top: 10px;
}

.post-content {
  max-height: 33vh;
  overflow: hidden;
  text-overflow: ellipsis;
}

.read-more-btn {
  background: none;
  border: none;
  color: blue;
  text-align: left;
  padding: 0;
  margin-top: 10px;
}








.like-comment-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px; /* Spacing between buttons */
  justify-content: flex-start; /* Align buttons to the left */
}

.like-comment-share button {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 12px;
  font-size: 14px;
  color: #333;
  background-color: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.like-comment-share button:hover {
  background-color: #e8f0fe;
  color: #007bff;
}

.like-comment-share button i {
  font-size: 18px;
}

/* Styles for upvote and downvote buttons */
.like-comment-share .upvote-btn,
.like-comment-share .downvote-btn {
  padding: 14px 20px; /* Increase padding */
  font-size: 16px; /* Slightly larger font */
  background-color: #f0f8ff; /* Light blue background */
}

.like-comment-share .upvote-btn:hover,
.like-comment-share .downvote-btn:hover {
  background-color: #d6eaff; /* Darker blue on hover */
  color: #0056b3; /* Dark blue text */
}

.like-comment-share .upvote-btn.active,
.like-comment-share .downvote-btn.active {
  background-color: #007bff; /* Active background color */
  color: #fff; /* Active text color */
}

.like-comment-share .score {
  font-size: 14px;
  font-weight: bold;
  color: #555;
}

.main-content .post-item .post-single-box .like-comment-share button.active i {
  color: #ffffff !important;
}

/* Remove borders on the like/comment/share section container */
.main-content .post-item .post-single-box .like-comment-share {
  border-top: 0 !important;
  border-bottom: 0 !important;
}

/* Post Images - Timeline Thumbnails */
.post-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin: 15px 0;
  width: 100%;
}

.post-img {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #f8f9fa;
  aspect-ratio: 16/9; /* Maintain aspect ratio */
  max-height: 200px;
}

.post-img::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.1);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.post-img:hover::before {
  opacity: 1;
}

.post-img img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Changed from contain to cover for better thumbnails */
  border-radius: 12px;
  transition: transform 0.3s ease;
}

.post-img:hover img {
  transform: scale(1.05);
}

/* Desktop: 2 columns */
@media (min-width: 768px) {
  .post-images {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

/* Mobile: 1 column */
@media (max-width: 767px) {
  .post-images {
    grid-template-columns: 1fr;
    gap: 15px;
  }

  .post-img {
    max-height: 180px;
  }
}

/* Link Preview Styles */
.post-link-preview {
  margin: 15px 0;
  border: 1px solid #e1e8ed;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.3s ease;
}

.post-link-preview:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.link-preview-card {
  display: flex;
  text-decoration: none;
  color: inherit;
}

.link-preview-card.no-image {
  flex-direction: column;
}

.link-preview-card.no-image .link-preview-content {
  padding: 16px;
}

.link-preview-image {
  flex: 0 0 120px;
  height: 120px;
  overflow: hidden;
  background: #f8f9fa;
}

.link-preview-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.link-preview-card:hover .link-preview-image img {
  transform: scale(1.05);
}

.link-preview-content {
  flex: 1;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.link-preview-title {
  font-size: 16px;
  font-weight: 600;
  color: #1c1e21;
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-description {
  font-size: 14px;
  color: #606770;
  line-height: 1.4;
  margin: 0 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.link-preview-url {
  font-size: 12px;
  color: #8a8d91;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* Mobile responsiveness for link previews */
@media (max-width: 767px) {
  .link-preview-card {
    flex-direction: column;
  }

  .link-preview-image {
    flex: none;
    width: 100%;
    height: 200px;
  }

  .link-preview-content {
    padding: 16px;
  }

  .link-preview-title {
    font-size: 18px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
  }

  .link-preview-description {
    -webkit-line-clamp: 4;
    line-clamp: 4;
  }
}

/* Loading and No More Posts Styles */
.loading-indicator {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  margin: 20px 0;
}

.loading-indicator .spinner-border {
  width: 2rem;
  height: 2rem;
}

.loading-indicator p {
  margin: 10px 0 0 0;
  font-size: 14px;
  color: #666;
}

.no-more-posts {
  padding: 30px 20px;
  text-align: center;
  color: #666;
  font-style: italic;
}

.no-more-posts p {
  margin: 0;
  font-size: 16px;
}
