/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.sidebar-card {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}

.add-description {
    position: absolute;
    top: 0;
    left: 0;
    color: white;
    font-size: 16px;
    font-weight: 600;
    background-color: rgba(0, 0, 0, 0.9);
    padding: 5px 10px;
    border-radius: 10px;
}

.card-content {
    padding: 20px;
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    overflow: auto;
}

.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 16px;

}

.publish-time {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #6b7280;
    font-size: 14px;
}

.trending-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 5px 0;
}

.rank {
    min-width: 20px;
    height: 20px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    color: white;
}

.keyword {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rank.up {
    background: #dc2626;
}
.sidebar-title i {
    color: #dc2626;
}

/* Related Posts */
.related-posts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.related-post {
    padding: 16px 0;
    border-bottom: 1px solid #eee;
}

.related-post:last-child {
    border-bottom: none;
}

.related-post-content h4 {
    margin-bottom: 8px;
}

.related-post-content h4 a {
    color: #e2e8f0;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.related-post-content h4 a:hover {
    color: #3b82f6;
}

.related-post-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
}

.related-post-meta .author {
    color: #94a3b8;
}

.related-post-meta .stats {
    display: flex;
    align-items: center;
    gap: 12px;
}

.related-post-meta .stats i {
    font-size: 10px;
}

/* Trending Tags */
.trending-tags {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.trending-tag {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: white;
    border: 1px solid #eee;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
}

.trending-tag:hover {
    background: #eee;
    border-color: #475569;
}

.trending-tag.hot {
    border-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.tag-name {
    color: #e2e8f0;
    font-weight: 500;
    font-size: 13px;
}

.tag-count {
    color: #64748b;
    font-size: 11px;
}
  
  /* 추천 사이드바 메인 컨테이너 */
  .recommendation-sidebar {
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: sticky;
    top: 20px;
    height: fit-content;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
  }
  
  /* 추천 섹션 */
  .recommendation-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
  }
  
  .recommendation-section:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  }
  
  /* 섹션 헤더 */
  .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fafbfc;
  }
  
  .section-title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  
  .section-title i {
    font-size: 14px;
    color: #64748b;
  }
  
  .view-all-btn {
    background: none;
    border: none;
    color: #3b82f6;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s ease;
  }
  
  .view-all-btn:hover {
    background: #eff6ff;
    color: #2563eb;
  }
  
  /* 추천 리스트 */
  .recommendation-list {
    display: flex;
    flex-direction: column;
  }
  
  /* 추천 아이템 공통 스타일 */
  .recommendation-item {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    gap: 10px;
  }

  .recommendation-item img {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
  }

  .item-actions {
    display: flex;
    align-items: center;
  }
  
  .recommendation-item:last-child {
    border-bottom: none;
  }
  
  .recommendation-item:hover {
    background: #f8fafc;
    transform: translateX(2px);
  }
  
  .recommendation-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: transparent;
    transition: background 0.2s ease;
  }
  
  .recommendation-item:hover::before {
    background: #3b82f6;
  }
  
  /* 뉴스 아이템 스타일 */
  .side-news-item {
    display: flex;
    gap: 12px;
  }
  
  .item-thumbnail {
    position: relative;
    flex-shrink: 0;
  }
  
  .item-thumbnail img {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
  }
  
  .item-category {
    position: absolute;
    top: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
  }
  
  .item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
  }
  
  .item-title {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    margin-bottom: 8px;
  
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word; /* ✅ 너무 긴 단어 줄바꿈 */
  }
  
  .item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: #64748b;
  }
  
  .item-source {
    font-weight: 500;
    color: #475569;
  }
  
  .item-time {
    color: #94a3b8;
  }
  
  .item-views {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
  }
  
  .item-stats {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #64748b;
  }
  
  /* 커뮤니티 아이템 스타일 */
  .community-item .item-content {
    width: 100%;
  }
  
  .community-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }
  
  .side-author-info {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  .author-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
  }
  
  .side-author-name {
    font-size: 12px;
    font-weight: 500;
    color: #475569;
  }
  
  .author-level {
    font-size: 10px;
    background: #f1f5f9;
    color: #64748b;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: 600;
  }
  
  .recommend-category {
    font-size: 14px;
    background: #dbeafe;
    color: #1d4ed8;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
  }
  
  /* 태그 컨테이너 */
  .tags-container {
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  
  .tag-item {
    background: #f1f5f9;
    color: #475569;
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
  }
  
  .tag-item:hover {
    background: #e2e8f0;
    color: #334155;
    transform: translateY(-1px);
  }
  
  .tag-item.hot {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    color: #92400e;
    border-color: #f59e0b;
    position: relative;
  }
  
  .tag-item.hot::after {
    content: "🔥";
    margin-left: 4px;
  }

@media (max-width: 768px) {
  .sidebar {
      order: 1;
  }
}  