/* ============================================
   Sidebar RSS - Colonne droite Feed
   ============================================ */

.rss-sidebar {
    position: sticky;
    top: 120px;
    padding-left: 0.5rem;
    padding-top: 1rem;
}

/* Scrollbar fine */
.rss-sidebar::-webkit-scrollbar {
    width: 4px;
}
.rss-sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.rss-sidebar::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}
.rss-sidebar::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* ============================================
   Widget 1 : Publications récentes (internes)
   ============================================ */

.nws-widget {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Header --- */
.nws-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(to right, #7c3aed 0%, #ffffff 100%);
    color: #fff;
}

.nws-widget-title {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.nws-widget-title i {
    font-size: 0.75rem;
    opacity: 0.85;
}

/* --- Liste numérotée --- */
.nws-list {
    padding: 0;
}

.nws-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.6rem 0.85rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.nws-item:last-child {
    border-bottom: none;
}

.nws-item:hover {
    background-color: #f0f7ff;
    text-decoration: none;
    color: inherit;
}

/* Numéro */
.nws-item-num {
    font-size: 1.3rem;
    font-weight: 800;
    color: #d1d5db;
    line-height: 1;
    min-width: 24px;
    padding-top: 2px;
    font-variant-numeric: tabular-nums;
    transition: color 0.15s ease;
}

.nws-item:hover .nws-item-num {
    color: #7c3aed;
}

/* Contenu */
.nws-item-content {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.nws-item-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.nws-item:hover .nws-item-title {
    color: #7c3aed;
}

/* Point "Nouveau" */
.nws-new-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #ef4444;
    margin-right: 4px;
    vertical-align: middle;
    position: relative;
    top: -1px;
    animation: nws-pulse 2s ease-in-out infinite;
}

@keyframes nws-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Méta (auteur + date) */
.nws-item-meta {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 3px;
    font-size: 0.7rem;
    color: #94a3b8;
    line-height: 1;
}

.nws-item-author {
    font-weight: 500;
    color: #64748b;
}

.nws-item-sep {
    margin: 0 5px;
    color: #cbd5e1;
}

.nws-item-date {
    color: #94a3b8;
}

/* --- État vide publications --- */
.nws-empty {
    padding: 2rem 1rem;
    text-align: center;
}

.nws-empty-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nws-empty-icon i {
    font-size: 1.3rem;
    color: #60a5fa;
}

.nws-empty-text {
    font-size: 0.82rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 0.2rem;
}

.nws-empty-sub {
    font-size: 0.72rem;
    color: #94a3b8;
}

/* ============================================
   Widget 2 : Actualités du Livre (RSS consolidé)
   ============================================ */

.rss-widget {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Header RSS --- */
.rss-widget-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.65rem 0.85rem;
    background: linear-gradient(to right, #7c3aed 0%, #ffffff 100%);
    color: #fff;
}

.rss-widget-title {
    font-size: 0.82rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.rss-widget-title i {
    font-size: 0.7rem;
    opacity: 0.85;
}

.rss-widget-count {
    font-size: 0.65rem;
    font-weight: 500;
    color: #7c3aed;
    background: rgba(124,58,237,0.1);
    padding: 2px 8px;
    border-radius: 10px;
}

/* --- Onglets sources --- */
.rss-tabs {
    display: flex;
    gap: 4px;
    padding: 0.5rem 0.65rem;
    background: #fafbfd;
    border-bottom: 1px solid #f0f0f0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.rss-tabs::-webkit-scrollbar {
    display: none;
}

.rss-tab {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    background: #fff;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 1.3;
}

.rss-tab:hover {
    border-color: #a855f7;
    color: #7c3aed;
    background: #faf5ff;
}

.rss-tab.active {
    background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.3);
}

.rss-tab i {
    font-size: 0.6rem;
}

.rss-tab-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
}

.rss-tab.active .rss-tab-icon {
    filter: brightness(10);
}

/* --- Liste articles RSS --- */
.rss-feed-list {
    padding: 0;
    max-height: 420px;
    overflow-y: auto;
}

.rss-feed-list::-webkit-scrollbar {
    width: 3px;
}
.rss-feed-list::-webkit-scrollbar-track {
    background: transparent;
}
.rss-feed-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.rss-feed-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.6rem 0.85rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f5f5f5;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.rss-feed-item:last-child {
    border-bottom: none;
}

.rss-feed-item:hover {
    background-color: #faf5ff;
    text-decoration: none;
    color: inherit;
}

/* Source badge (favicon + nom + date) */
.rss-feed-source {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 3px;
    font-size: 0.65rem;
    line-height: 1;
}

.rss-feed-src-icon {
    width: 14px;
    height: 14px;
    border-radius: 3px;
    object-fit: contain;
}

.rss-feed-src-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #a855f7;
    flex-shrink: 0;
}

.rss-feed-src-name {
    font-weight: 600;
    color: #7c3aed;
}

.rss-feed-src-sep {
    color: #cbd5e1;
    margin: 0 1px;
}

.rss-feed-src-date {
    color: #94a3b8;
}

/* Titre article */
.rss-feed-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8rem;
    font-weight: 500;
    color: #334155;
    line-height: 1.4;
    transition: color 0.15s ease;
}

.rss-feed-item:hover .rss-feed-title {
    color: #7c3aed;
}

/* Contenu (source + titre) */
.rss-feed-item > div:first-child {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Icône lien externe */
.rss-feed-ext {
    color: #e2e8f0;
    font-size: 0.55rem;
    padding-top: 14px;
    min-width: 14px;
    text-align: center;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.rss-feed-item:hover .rss-feed-ext {
    color: #7c3aed;
    transform: translate(1px, -1px);
}

/* --- État vide filtre --- */
.rss-feed-empty {
    padding: 1.5rem 1rem;
    text-align: center;
    color: #94a3b8;
    font-size: 0.78rem;
}

.rss-feed-empty i {
    display: block;
    font-size: 1.3rem;
    margin-bottom: 0.4rem;
    opacity: 0.4;
}
