/* ──────────────────────────────────────────────
   news.css — публичные разделы /News (лента) и /Help (справочник)
   Использует тематические переменные сайта (light/dark).
   ────────────────────────────────────────────── */

/* Каркас страницы (.news-page/-hero/-empty/-section) — в общем page-shell.css */

/* ── Фильтр по категории + поиск ── */
.news-filter {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1rem;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.75rem;
}

.news-search {
    position: relative;
    flex: 1 1 240px;
    max-width: 360px;
}

.news-search__icon {
    position: absolute;
    left: .8rem;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-2);
    pointer-events: none;
}

.news-search input {
    width: 100%;
    padding: .6rem .9rem .6rem 2.4rem;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--bg-card);
    color: var(--text);
    font-size: .95rem;
}

.news-search input:focus {
    outline: none;
    border-color: var(--primary);
}

.news-chips {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.news-chip {
    display: inline-flex;
    align-items: center;
    padding: .35rem .85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-2);
    font-size: .85rem;
    font-weight: 600;
    text-decoration: none;
    transition: border-color .15s ease, color .15s ease, background .15s ease;
}

.news-chip:hover {
    border-color: var(--primary);
    color: var(--text);
}

.news-chip.is-active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* ── Сетка карточек ── */
.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.news-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg, 14px);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.news-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--primary);
}

.news-card__cover-link {
    display: block;
}

.news-card__cover {
    aspect-ratio: 16 / 9;
    background: var(--bg-subtle, var(--bg-hover));
    overflow: hidden;
}

.news-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.news-card__cover--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2);
    opacity: .5;
}

.news-card__cover--empty svg {
    width: 44px;
    height: 44px;
}

.news-card__body {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    padding: 1rem;
    flex: 1;
}

.news-card__cat {
    align-self: flex-start;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    padding: .15rem .5rem;
    border-radius: 999px;
}

.news-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.news-card__title a {
    color: var(--text);
    text-decoration: none;
}

.news-card__title a:hover {
    color: var(--primary);
}

.news-card__summary {
    color: var(--text-2);
    font-size: .9rem;
    line-height: 1.5;
    margin: 0;
}

.news-card__date {
    margin-top: auto;
    color: var(--text-2);
    font-size: .8rem;
}

/* ── Страница статьи ── */
.news-article {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem;
}

.news-article__back {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: .9rem;
    margin-bottom: 1.25rem;
}

.news-article__back:hover {
    text-decoration: underline;
}

.news-article__cat {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: var(--primary);
    background: color-mix(in srgb, var(--primary) 12%, transparent);
    padding: .15rem .5rem;
    border-radius: 999px;
}

.news-article__title {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
    margin: .75rem 0 .5rem;
}

.news-article__date {
    display: block;
    color: var(--text-2);
    font-size: .85rem;
    margin-bottom: 1.5rem;
}

.news-article__cover {
    width: 100%;
    border-radius: var(--radius-lg, 14px);
    margin-bottom: 1.5rem;
}

.news-article__content {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.7;
}

.news-article__content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
}

.news-article__content h2,
.news-article__content h3 {
    color: var(--text);
    margin: 1.6rem 0 .6rem;
}

.news-article__content a {
    color: var(--primary);
}

.news-article__content p {
    margin: 0 0 1rem;
}

@media (max-width: 540px) {
    .news-grid {
        grid-template-columns: 1fr;
    }
}
