/* --- Right Sidebar - Popular Posts --- */

.sidebar-popular {
  position: sticky;
  top: 100px;
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-title {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #2c3e50;
  margin: 0 0 1.25rem 0;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid #f0f0f0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sidebar-title i {
  color: #ff6b35;
  font-size: 1rem;
}

.popular-posts-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.popular-post-item {
  margin-bottom: 1rem;
}

.popular-post-item:last-child {
  margin-bottom: 0;
}

.popular-post-link {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  text-decoration: none;
  color: inherit;
  padding: 0.625rem;
  margin: -0.625rem;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.popular-post-link:hover {
  background: #f8f9fa;
  text-decoration: none;
  color: inherit;
}

.popular-post-link:hover .popular-post-title {
  color: #008AFF;
}

.popular-post-thumb {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 8px;
  overflow: hidden;
  background: #f0f0f0;
}

.popular-post-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.popular-post-link:hover .popular-post-thumb img {
  transform: scale(1.08);
}

.popular-post-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.25rem;
}

.popular-post-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.popular-post-title {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  color: #2c3e50;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.15s ease;
}

.popular-post-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.popular-post-date {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.7rem;
  color: #868e96;
  font-weight: 500;
}

.popular-post-tag {
  font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 0.65rem;
  color: #6c757d;
  background: #f2f2f2;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-weight: 500;
}

/* --- Home Layout with Sidebar --- */

.home-layout {
  display: flex;
  gap: 3rem;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}

.home-main {
  flex: 1;
  min-width: 0;
  max-width: 720px;
}

.home-sidebar {
  width: 280px;
  flex-shrink: 0;
}

/* Hide sidebar on smaller screens */
@media (max-width: 1199px) {
  .home-layout {
    max-width: 720px;
  }
  
  .home-sidebar {
    display: none;
  }
  
  .home-main {
    max-width: 100%;
  }
}

/* Adjust for medium-large screens */
@media (min-width: 1200px) and (max-width: 1399px) {
  .home-layout {
    gap: 2rem;
    max-width: 1000px;
  }
  
  .home-sidebar {
    width: 260px;
  }
}

/* Full width on large screens */
@media (min-width: 1400px) {
  .home-layout {
    max-width: 1150px;
    gap: 3.5rem;
  }
  
  .home-sidebar {
    width: 300px;
  }
}

/* Ensure sidebar doesn't overlap footer */
.sidebar-popular {
  max-height: calc(100vh - 140px);
  overflow-y: auto;
}

/* Custom scrollbar for sidebar if content overflows */
.sidebar-popular::-webkit-scrollbar {
  width: 4px;
}

.sidebar-popular::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-popular::-webkit-scrollbar-thumb {
  background: #dee2e6;
  border-radius: 2px;
}

.sidebar-popular::-webkit-scrollbar-thumb:hover {
  background: #adb5bd;
}
