/* Стили для правого сайдбара и его блоков */

.right-sidebar {
    border-radius: 8px;
    padding: 20px 18px;
    min-width: 260px;
    max-width: 340px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 50px; /* высота шапки сайта */
    align-self: flex-start;
    z-index: 100;
    /* Для старых браузеров можно использовать fixed, но sticky предпочтительнее */
}

.sidebar-section {
    display: flex;
    flex-direction: column;
    gap: 15px;
}


.tags-section,
.popular-users-section,
.latest-comments-section,
.latest-users-section {
    background: #ffffff;
    border-radius: 6px;
    padding: 10px 14px 14px 14px;
    margin-bottom: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.tags-section h3,
.popular-users-section h3,
.latest-comments-section h3,
.latest-users-section h3 {
    font-size: 17px;
    margin: 0 0 12px 0;
    color: #666666;
    font-weight: 600;
}

.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 10px;
}

.homepage-tag-link {
    background: #e3f2fd;
    border-radius: 50px;
    padding: 4px 10px;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}
.homepage-tag-link:hover {
    background: #bbdefb;
    color: #0d47a1;
}

.popular-users-list, .latest-users-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.popular-user-item, .latest-user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 15px;
}

.user-nickname-link {
    color: #1976d2;
    text-decoration: none;
    font-weight: 500;
}
.user-nickname-link:hover {
    text-decoration: underline;
    color: #0d47a1;
}

.article-count, .registration-date {
    color: #888;
    font-size: 13px;
}

.latest-comments-list {
    display: flex;
    flex-direction: column;
}

.latest-comment-item {
    background: #fff;
    border-radius: 4px;
    padding: 8px 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    font-size: 14px;
}

.comment-text {
    color: #333;
		border-left: 0 solid #6366f1;
		border-radius: 0;
		padding: 0;
		background: inherit;
		border-radius: 0;
}

.comment-article a {
    color: #1976d2;
    text-decoration: none;
    font-size: 14px;
}
.comment-article a:hover {
    text-decoration: underline;
}

.comment-content-preview {
    color: #888;
    font-size: 14px;
    margin-top: 2px;
}

.view-all-users {
    margin-top: 10px;
    text-align: right;
}

@media (max-width: 1100px) {
    .right-sidebar {
        margin-left: 0;
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .right-sidebar {
        display: none;
        position: fixed;
        top: 0;
        right: -100%;
        width: 300px;
        height: 100vh;
        background: white;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
        z-index: 1100;
        padding: 20px;
        overflow-y: auto;
        transition: right 0.3s ease;
				
    }
    
    .right-sidebar.mobile-sidebar-open {
        display: block;
        right: 0;
				margin-top: 0;
				width: auto;
				border-radius: 0px;
    }
		.tags-section {
        margin: 0;
        width: auto;
    }
}
