/* ============================================================
   Стили для новостей (бесконечная лента)
   ============================================================ */

/* Анимация появления новостей */
.news-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: var(--bg-item);
    border-radius: 12px;
    padding: 14px 20px;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-left: 6px solid var(--green-border);
    cursor: pointer;
    box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.news-item:hover {
    background: var(--bg-hover);
    border-left-color: var(--accent-line-hover);
    box-shadow: 0 4px 14px rgba(0,0,0,0.7);
}

.news-item .news-header {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}

.news-item .news-date {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--date);
    letter-spacing: 0.5px;
    background: var(--bg-date);
    padding: 0 12px;
    border-radius: 30px;
    line-height: 1.8;
    white-space: nowrap;
}

.news-item .news-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-title);
}

.news-item .news-brief {
    font-size: 0.95rem;
    color: var(--text-soft);
    margin-top: 2px;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Индикатор загрузки */
.news-loading {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-dim);
}

.news-loading-spinner {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid var(--spinner-track);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: news-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

@keyframes news-spin {
    to { transform: rotate(360deg); }
}

/* Убираем стандартные стили для загрузки из mainpage */
#mainpage-content .news-loading,
#mainpage-content .news-loading-spinner,
#mainpage-content .news-item {
    /* Эти стили не должны пересекаться с mainpage */
}

/* ============================================================
   Стили для оверлейного просмотра новостей
   ============================================================ */

#news-viewer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(10, 14, 12, 0.92);
    backdrop-filter: blur(4px);
    padding: 20px;
    box-sizing: border-box;
    overflow: hidden;
    animation: fadeIn 0.25s ease;
}

#news-viewer-content {
    max-width: 860px;
    margin: 40px auto;
    background: var(--bg-footer);
    border-radius: var(--radius-lg);
    padding: 32px 40px;
    color: var(--text);
    font-family: var(--font-main);
    line-height: 1.8;
    max-height: 80vh;
    overflow-y: auto;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-deep);
    position: relative;
}

#news-viewer-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.8rem;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.2s, color 0.2s;
    line-height: 1;
    z-index: 10;
}

#news-viewer-close:hover {
    background: rgba(184, 124, 75, 0.2);
    color: var(--cream);
}

/* Мобильная адаптация: меньше отступов, больше текста на экран */
@media (max-width: 768px) {
    #news-viewer-content {
        margin: 12px auto;
        padding: 20px 18px;
        border-radius: var(--radius-md);
    }
}

@media (max-width: 480px) {
    #news-viewer-overlay {
        padding: 8px;
    }
    #news-viewer-content {
        margin: 4px auto;
        padding: 16px 14px;
        max-height: 92vh;
    }
    #news-viewer-close {
        top: 8px;
        right: 10px;
    }
}

#news-viewer-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 12px 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

#news-viewer-content h1,
#news-viewer-content h2,
#news-viewer-content h3,
#news-viewer-content h4 {
    color: var(--cream);
    margin-top: 24px;
    margin-bottom: 12px;
}

#news-viewer-content p {
    margin-bottom: 16px;
    line-height: 1.8;
}

#news-viewer-content ul,
#news-viewer-content ol {
    padding-left: 24px;
    margin-bottom: 16px;
}

#news-viewer-content li {
    margin-bottom: 6px;
}

#news-viewer-content blockquote {
    border-left: 4px solid var(--accent);
    padding-left: 16px;
    margin: 16px 0;
    color: var(--text-muted-2);
    font-style: italic;
}

