/* ========================================== */
/* news.css — живые новости (стиль как каталог) */
/* ========================================== */

.news-section {
    --news-ink: #0f4446;
    --news-accent: #1a6b6d;
    --news-line: rgba(15, 68, 70, 0.12);

    max-width: 1000px;
    width: 100%;
    margin: 50px auto 48px;
    padding: 0;
    box-sizing: border-box;
}

.news-section.is-collapsed {
    display: none;
}

/* Заголовок + крестик — как у каталога, на прозрачном фоне */
.news-section__header {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    padding: 4px 44px 14px;
    border-bottom: 1px solid var(--news-line);
}

.news-section__title {
    margin: 0;
    font-size: clamp(1.35rem, 2.1vw, 1.7rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--news-ink);
    line-height: 1.25;
    text-align: center;
}

.news-section__close {
    position: absolute;
    right: 4px;
    top: 2px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: #666;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease, background 0.15s ease;
}

.news-section__close:hover {
    color: #e53935;
    background: rgba(244, 67, 54, 0.1);
}

.news-section__panel {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    animation: newsPanelIn 0.2s ease;
}

@keyframes newsPanelIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.news-section__inner {
    padding: 18px 18px 18px;
}

.news-section__loading,
.news-section__error {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 28px 12px;
    color: #888;
    font-size: 13px;
}

.news-section__error {
    flex-direction: column;
    color: #c62828;
}

.news-section__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #1a6b6d;
    border-radius: 50%;
    animation: newsSpin 0.7s linear infinite;
}

@keyframes newsSpin {
    to { transform: rotate(360deg); }
}

.news-section__retry-btn {
    margin-top: 8px;
    padding: 6px 14px;
    border: 1px solid #1a6b6d;
    border-radius: 8px;
    background: #fff;
    color: #1a6b6d;
    font-size: 12px;
    font-family: inherit;
    cursor: pointer;
}

.news-section__retry-btn:hover {
    background: #1a6b6d;
    color: #fff;
}

/* Меню источников — по центру */
.news-sources {
    display: flex;
    justify-content: center;
    gap: 17px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.news-source-btn {
    padding: 5px 13px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    color: #555;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}

.news-source-btn:hover {
    border-color: #455060;
    color: #455060;
}

.news-source-btn.active {
    background: #455060;
    border-color: #455060;
    color: #fff;
}

/* Подзаголовок между линией заголовка и белым блоком (по центру пробела) */
.news-legal {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    margin: 0;
    padding: 0 16px;
    font-size: 11px;
    line-height: 1.35;
    color: rgba(40, 65, 80, 0.45);
    text-align: center;
    box-sizing: border-box;
}

.news-date-header {
    font-size: 12px;
    font-weight: 600;
    color: rgba(40, 65, 80, 0.5);
    letter-spacing: 0.02em;
    padding: 6px 0 8px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.news-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f5f5f5;
    text-decoration: none;
    color: inherit;
    transition: background 0.15s;
}

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

.news-item:hover {
    background: #fafafa;
    margin: 0 -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 6px;
}

.news-item__num {
    font-size: 13px;
    color: #6b7a8d;
    font-weight: 700;
    min-width: 18px;
    flex-shrink: 0;
    padding-top: 1px;
}

.news-item__content {
    flex: 1;
}

.news-item__title {
    font-size: 13px;
    font-weight: 500;
    color: #222;
    line-height: 1.4;
    margin-bottom: 3px;
}

.news-item__excerpt {
    font-size: 12px;
    color: rgba(40, 65, 80, 0.55);
    line-height: 1.4;
    margin-top: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-item__date {
    font-size: 11px;
    color: #aaa;
}

.news-source-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 0 4px;
    border-top: 1px solid rgba(40, 65, 80, 0.1);
    margin-top: 4px;
}

.news-source-footer__name {
    font-size: 12px;
    font-weight: 600;
    color: #455060;
}

.news-source-footer__link {
    font-size: 12px;
    color: #1a6b6d;
    text-decoration: none;
}

.news-source-footer__link:hover {
    text-decoration: underline;
}

.news-source-footer__save {
    margin-left: auto;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid #1a6b6d;
    background: #fff;
    color: #1a6b6d;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-source-footer__save:hover {
    background: #1a6b6d;
    color: #fff;
}

/* Нижняя кнопка — как «Закрыть каталог» */
.news-section__footer {
    display: flex;
    justify-content: center;
    margin-top: 48px;
    padding-top: 16px;
    border-top: 1px solid var(--news-line);
}

.news-section__collapse-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid rgba(26, 107, 109, 0.3);
    background: linear-gradient(145deg, #e8eef2 0%, #eef2f4 100%);
    color: var(--news-accent);
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.news-section__collapse-btn:hover {
    background: var(--news-accent);
    color: #fff;
    transform: translateY(-1px);
}

@media (max-width: 880px) {
    .news-section {
        margin: 40px auto 28px;
        padding: 0 4px;
        box-sizing: border-box;
    }

    .news-section__header {
        padding-right: 40px;
        padding-left: 40px;
    }

    .news-sources {
        gap: 12px;
    }

    .news-source-btn {
        font-size: 13px;
        padding: 5px 11px;
    }
}

@media (max-width: 490px) {
    .news-section {
        padding: 0 4px;
        margin-top: 32px;
    }

    .news-section__header {
        padding-right: 36px;
        padding-left: 36px;
    }

    .news-section__title {
        font-size: 1.25rem;
    }

    .news-section__inner {
        padding: 14px 12px 14px;
    }

    .news-sources {
        gap: 10px;
    }

    .news-source-btn {
        font-size: 13px;
        padding: 5px 10px;
    }

    .news-item__title {
        font-size: 12px;
    }

    .news-section__footer {
        margin-top: 40px;
    }
}
