/* Задача №78149. Раздел «Новости» в мобильном ЛК: баннер, список, статья. */

:root {
    --nw-ink: #0f172a;
    --nw-muted: #6b7280;
    --nw-line: #eef0f3;
    --nw-accent: #6366f1;
    --nw-accent2: #8b5cf6;
    --nw-grad: linear-gradient(135deg, #6366f1, #8b5cf6);
}

/* Задача №78149 (доп.): у сторонней вёрстки (MDB) <main> — flex-контейнер
   с align-items:center, из-за чего короткие страницы (мало новостей) повисают
   по центру экрана с большим пустым пространством сверху. На разделе «Новости»
   это особенно заметно — прижимаем содержимое к верху. */
body[data-route^="news/"] main { align-items: flex-start; }

/* Мини-презентация раздела — сразу под шапкой, перед поиском */
.news-intro {
    display: flex; align-items: flex-start; gap: 12px;
    background: var(--nw-grad); color: #fff; border-radius: 16px;
    padding: 16px; margin: 0 0 16px;
    box-shadow: 0 10px 24px rgba(99, 102, 241, .25);
}
.news-intro-icon {
    flex: none; width: 42px; height: 42px; border-radius: 12px;
    background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
    font-size: 19px;
}
.news-intro-text h2 { margin: 0 0 4px; font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }
.news-intro-text p { margin: 0; font-size: 12.5px; line-height: 1.5; opacity: .92; }

.news-banner {
    display: flex; align-items: center; gap: 10px;
    background: var(--nw-grad);
    color: #fff; border-radius: 14px; padding: 12px 14px; margin: 0 0 16px;
    box-shadow: 0 8px 20px rgba(99, 102, 241, .28);
}
.news-banner-body { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; color: #fff; text-decoration: none; }
.news-banner-icon {
    font-size: 17px; flex: none; width: 34px; height: 34px; border-radius: 10px;
    background: rgba(255,255,255,.18); display: flex; align-items: center; justify-content: center;
}
.news-banner-text { min-width: 0; }
.news-banner-title { display: block; font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.news-banner-excerpt { display: block; font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.news-banner-dismiss { flex: none; border: 0; background: rgba(255,255,255,.2); color: #fff; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; font-size: 13px; transition: background .15s; }
.news-banner-dismiss:active { background: rgba(255,255,255,.35); }

.news-search { position: relative; margin-bottom: 16px; }
.news-search i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: #9ca3af; font-size: 14px; }
.news-search input {
    width: 100%; padding: 11px 14px 11px 38px; border: 1px solid var(--nw-line); border-radius: 12px;
    font-size: 14px; box-sizing: border-box; background: #fff; transition: border-color .15s, box-shadow .15s;
}
.news-search input:focus { outline: none; border-color: var(--nw-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }

.news-card {
    display: flex; gap: 12px; background: #fff; border: 1px solid var(--nw-line); border-radius: 14px;
    padding: 12px; margin-bottom: 12px; text-decoration: none; color: inherit;
    box-shadow: 0 3px 10px rgba(15, 23, 42, .05); transition: transform .12s, box-shadow .12s;
}
.news-card:active { transform: scale(.99); box-shadow: 0 1px 4px rgba(15, 23, 42, .06); }
.news-card-img { width: 80px; height: 80px; border-radius: 10px; object-fit: cover; flex: none; background: #f3f4f6; }
.news-card-body { min-width: 0; flex: 1; }
.news-card-title { font-weight: 700; font-size: 14.5px; color: var(--nw-ink); margin-bottom: 3px; line-height: 1.3; }
.news-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--nw-accent); margin-right: 6px; vertical-align: middle; box-shadow: 0 0 0 3px rgba(99,102,241,.15); }
.news-card-excerpt { font-size: 13px; color: var(--nw-muted); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.4; }
.news-card-tags { margin-top: 5px; }
.news-card-tags .news-tag-chip,
.news-card-tags {
    font-size: 11px; color: var(--nw-accent); font-weight: 600;
}
.news-card-meta { display: flex; gap: 14px; margin-top: 7px; font-size: 12px; color: #9ca3af; }
.news-card-meta i { color: var(--nw-accent2); margin-right: 3px; }

.news-more { text-align: center; margin: 6px 0 18px; }
.news-empty { text-align: center; color: #9ca3af; padding: 40px 0; font-size: 14px; }
.news-empty::before {
    content: '\f1ea'; font-family: 'Font Awesome 5 Free'; font-weight: 900; display: block;
    font-size: 30px; margin-bottom: 10px; color: #d7d9e6;
}

.news-back { display: inline-flex; align-items: center; gap: 6px; color: var(--nw-muted); text-decoration: none; font-size: 13px; margin-bottom: 14px; font-weight: 600; }
.news-back:active { color: var(--nw-accent); }
.news-article-title { font-size: 22px; font-weight: 800; margin: 0 0 8px; color: var(--nw-ink); letter-spacing: -.01em; line-height: 1.25; }
.news-article-meta { font-size: 12.5px; color: #9ca3af; margin-bottom: 8px; }
.news-article-tags { font-size: 12.5px; color: var(--nw-accent); font-weight: 600; margin-bottom: 16px; }
.news-article-content { font-size: 15.5px; line-height: 1.7; color: var(--nw-ink); }
.news-article-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 6px 0; }
.news-article-content ul, .news-article-content ol { padding-left: 22px; }
.news-article-content h3 { font-size: 17px; font-weight: 800; margin: 18px 0 8px; }

.news-article-actions { margin: 20px 0; }
.news-like-btn {
    border: 1px solid var(--nw-line); background: #fff; border-radius: 999px; padding: 9px 18px;
    font-size: 14px; font-weight: 600; cursor: pointer; color: #374151; transition: background .15s, border-color .15s, transform .1s;
}
.news-like-btn:active { transform: scale(.97); }
.news-like-btn i { color: #ef4444; margin-right: 5px; }
.news-like-btn.is-liked { background: #fee2e2; border-color: #fecaca; }

.news-comments { border-top: 1px solid var(--nw-line); padding-top: 16px; }
.news-comments h3 { font-size: 16px; font-weight: 800; margin: 0 0 12px; color: var(--nw-ink); }
.news-comment { border-bottom: 1px solid var(--nw-line); padding: 11px 0; }
.news-comment-head { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: #9ca3af; margin-bottom: 4px; }
.news-comment-author { font-weight: 700; color: var(--nw-ink); }
.news-comment-del { margin-left: auto; border: 0; background: none; color: #d1d5db; cursor: pointer; padding: 2px 4px; }
.news-comment-del:active { color: #dc2626; }
.news-comment-text { font-size: 14px; color: var(--nw-ink); white-space: pre-wrap; line-height: 1.5; }
.news-comment-form { display: flex; gap: 8px; margin-top: 16px; align-items: flex-end; }
.news-comment-form textarea {
    flex: 1; border: 1px solid var(--nw-line); border-radius: 12px; padding: 10px 12px; font-size: 14px;
    resize: vertical; font-family: inherit; transition: border-color .15s, box-shadow .15s;
}
.news-comment-form textarea:focus { outline: none; border-color: var(--nw-accent); box-shadow: 0 0 0 3px rgba(99,102,241,.12); }
.news-comment-form .btn-primary { background: var(--nw-grad); border: 0; font-weight: 700; box-shadow: 0 6px 14px rgba(99,102,241,.28); }

@media (prefers-color-scheme: dark) {
    .news-search input { background: #0b0f19; border-color: #1f2430; color: #e5e7eb; }
    .news-card { background: #0b0f19; border-color: #1f2430; }
    .news-card-title { color: #e5e7eb; }
    .news-card-img { background: #1f2430; }
    .news-article-title { color: #e5e7eb; }
    .news-article-content { color: #e5e7eb; }
    .news-like-btn { background: #0b0f19; border-color: #1f2430; color: #e5e7eb; }
    .news-comments { border-color: #1f2430; }
    .news-comment { border-color: #1f2430; }
    .news-comment-author { color: #e5e7eb; }
    .news-comment-text { color: #e5e7eb; }
    .news-comment-form textarea { background: #0b0f19; border-color: #1f2430; color: #e5e7eb; }
}
