#right-sidebar {
    color: #333;
    flex-shrink: 0;
}

#right-sidebar {
    width: 400px !important;
    min-width: 400px !important;
    flex-shrink: 0 !important;
}

#right-sidebar .sidebar__inner {
    padding: 10px 20px 10px 30px;
    position: relative;
    transform: translate(0, 0);
    transform: translate3d(0, 0, 0);
    will-change: position, transform;
    width: 400px !important;
    min-height: calc(100vh - 53px);
    /* Account for 53px header height */
    background-color: var(--bg-primary);
    border-left: 1px solid var(--border-color);
}

/* When sidebar is fixed (sticky), let the script handle dimensions */
#right-sidebar.is-affixed .sidebar__inner {
    padding-top: 10px;
}


#right-sidebar .section {
    margin-bottom: 30px;
}

#right-sidebar .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
    padding: 0 0 5px 0;
}

#right-sidebar .section-title {
    margin-bottom: 10px;
    font-size: var(--font-18);
    color: var(--text-primary);
    font-weight: var(--font-weight-semibold);
    font-family: var(--fontH);
    line-height: var(--line-height-normal);
}

#right-sidebar .section-paragraph {
    font-size: var(--font-12);
    color: var(--text-secondary);
}

#right-sidebar .content-item {
    display: flex;
    padding-bottom: 12px;
}

#right-sidebar .content-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Modified to move image to the right side */
#right-sidebar .content-image {
    width: 65px;
    height: 65px;
    border-radius: 10px;
    overflow: hidden;
    margin-left: 12px;
    /* Changed from margin-right to margin-left */
    margin-right: 0;
    /* Removed right margin */
    flex-shrink: 0;
    background-color: #f5f5f5;
    order: 2;
    /* Added to move image to the right */
}

#right-sidebar .content-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modified to adjust content info layout */
#right-sidebar .content-info {
    flex: 1;
    min-width: 0;
    order: 1;
    /* Added to keep content info on the left */
}

#right-sidebar .content-title {
    color: var(--text-primary) !important;
    text-decoration: none !important;
    font-weight: var(--font-weight-medium);
    line-height: var(--line-height-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: var(--font-14);
}

#right-sidebar .user-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

#right-sidebar .user-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#right-sidebar .user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    flex-shrink: 0;
    background-color: #f5f5f5;
}

#right-sidebar .user-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#right-sidebar .user-info {
    flex: 1;
    min-width: 0;
}

#right-sidebar .user-name {
    font-size: var(--font-14);
    font-weight: var(--font-weight-semibold);
    margin: 0 0 3px 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .user-username {
    font-size: var(--font-12);
    color: #757575;
    margin: 0 0 3px 0;
}

#right-sidebar .user-bio {
    font-size: var(--font-12);
    color: var(--text-secondary);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

#right-sidebar .follow-btn {
    background: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 20px;
    padding: 6px 12px;
    font-size: var(--font-12);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

#right-sidebar .follow-btn:hover {
    opacity: 0.9;
}

#right-sidebar .follow-btn.following {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

#right-sidebar .view-all-link {
    display: block;
    color: var(--text-secondary);
    font-size: var(--font-16);
    font-weight: var(--font-weight-normal);
    text-decoration: none;
    margin-top: 10px;
    transition: background 0.2s;
}

#right-sidebar .view-all-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Publisher info styles */
#right-sidebar .content-publisher {
    margin-bottom: 5px;
}

#right-sidebar .content-publisher a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
}

#right-sidebar .content-publisher img {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    margin-right: 8px;
    object-fit: cover;
}

#right-sidebar .content-publisher .publisher-fallback {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--bg-secondary);
    margin-right: 8px;
}

#right-sidebar .content-publisher span {
    color: var(--text-primary);
    font-size: var(--font-15);
    font-weight: var(--font-weight-medium);
}



#right-sidebar .featured-image-fallback {
    background: var(--bg-secondary);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Sidebar Footer Styles (similar to header dropdown footer) */
#right-sidebar .footer-links-container {
    position: relative;
}

#right-sidebar .footer-links {
    gap: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
}

#right-sidebar .footer-link {
    font-size: var(--font-13);
    color: var(--text-secondary);
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .footer-link.copyright-text {
    cursor: default;
}

#right-sidebar .footer-link.copyright-text:hover {
    text-decoration: none;
    color: var(--text-secondary);
}

#right-sidebar .footer-link:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* Topic Chips in Right Sidebar */
#right-sidebar .topic-tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

#right-sidebar .topic-tag {
    text-decoration: none;
    white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid var(--bg-secondary);
    color: var(--text-secondary);
    font-size: var(--font-15);
    font-weight: var(--font-weight-normal);
    line-height: var(--line-height-normal);
    border-radius: 8px;
    transition: all 0.2s ease;
    background: var(--bg-secondary);
}

#right-sidebar .topic-tag:hover {
    color: var(--text-primary);
}


#right-sidebar .topic-tag.active {
    border: 1px solid var(--text-primary);
    color: var(--text-primary);
}

/* Publishers Section Specific Styles */
#right-sidebar .publisher-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    gap: 12px;
}

#right-sidebar .publisher-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--bg-secondary);
    margin: 0;
}

#right-sidebar .publisher-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#right-sidebar .publisher-info {
    flex: 1;
    min-width: 0;
}

#right-sidebar .publisher-info a {
    text-decoration: none;
    display: flex;
    flex-direction: column;
}

#right-sidebar .publisher-name {
    font-size: var(--font-16);
    font-weight: var(--font-weight-medium);
    color: var(--text-primary);
    margin: 0;
    line-height: var(--line-height-tight);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .publisher-username {
    font-size: var(--font-15);
    color: var(--text-secondary);
    margin: 2px 0 0 0;
    font-weight: var(--font-weight-normal);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#right-sidebar .publisher-follow-btn {
    background-color: var(--text-primary);
    color: var(--bg-primary);
    border: none;
    border-radius: 9999px;
    padding: 7px 18px;
    font-size: var(--font-14);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: opacity 0.2s ease;
    flex-shrink: 0;
}

#right-sidebar .publisher-follow-btn:hover {
    opacity: 0.9;
}

#right-sidebar .publisher-follow-btn.following {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    /* Standard X border color */
}

#right-sidebar .publisher-follow-btn.following:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: #cfd9de;
    color: var(--text-primary);
}

#right-sidebar .publisher-follow-btn.following {
    position: relative;
}

.no-publishers-msg {
    font-size: var(--font-14);
    color: var(--text-secondary);
    padding: 10px 0;
}

/* Footer Dropdown Styles handled by global component */
#right-sidebar .item-dropdown-container .footer-link.btn-text:hover {
    color: var(--text-primary);
    text-decoration: underline;
}