/* ==========================================================================
   ru-openrouter.ru — Новости (public-news)
   Страничные стили страниц /v2/news и /v2/news/{slug}.
   Паттерн: глобальные стили в public.css, страничные — здесь (public-<page>.css).
   Тёмная/светлая темы — через CSS-переменные из public.css (--bg, --glass-*, --text, --accent).
   ========================================================================== */
.site-main > .container { padding-top: 0px !important; }

/* ===== Page layout ===== */
.news-page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px 40px;
}

/* ===== Hero ===== */
.news-hero {
    position: relative;
    text-align: center;
    padding: 56px 0 40px;
    overflow: hidden;
}
.news-hero__glow {
    position: absolute;
    top: -40%;
    left: 50%;
    transform: translateX(-50%);
    width: 720px;
    height: 440px;
    background: radial-gradient(closest-side, rgba(14, 165, 233, 0.20), transparent 70%);
    pointer-events: none;
    z-index: 0;
}
.news-hero__orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}
.news-hero__orb--1 { width: 210px; height: 210px; top: 10%; left: 8%; background: rgba(56, 189, 248, 0.25); }
.news-hero__orb--2 { width: 240px; height: 240px; bottom: -20%; right: 10%; background: rgba(34, 211, 238, 0.18); }
.news-hero__inner { position: relative; z-index: 1; }
.news-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-radius: 999px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--accent-2);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.news-hero__badge svg { width: 16px; height: 16px; }
.news-hero__title {
    margin: 18px 0 12px;
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 45%, var(--accent-3) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.news-hero__sub {
    margin: 0 auto;
    max-width: 560px;
    color: var(--text-muted);
    font-size: 1.02rem;
    line-height: 1.6;
}

/* ===== Layout: main + sidebar ===== */
.news-layout,
.news-article__layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 28px;
    align-items: start;
}
.news-main,
.news-article__main { min-width: 0; }
.news-sidebar {
    position: sticky;
    top: 84px;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

/* ===== Состояния (пусто / ошибка / недоступно / не найдено) ===== */
.news-state {
    text-align: center;
    padding: 64px 20px;
}
.news-state--card {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--glass-blur));
    padding: 48px 24px;
}
.news-state__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin-bottom: 18px;
    color: var(--accent);
    background: var(--surface-2);
    border: 1px solid var(--glass-border);
}
.news-state__icon svg { width: 34px; height: 34px; }
.news-state__icon--warning { color: #f59e0b; }
.news-state__title {
    margin: 0 0 10px;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
}
.news-state__text {
    margin: 0 auto 22px;
    max-width: 420px;
    color: var(--text-muted);
    line-height: 1.6;
}
.news-state__btn { min-width: 180px; }

/* ===== Фильтр по категории (на ленте) ===== */
.news-catbar {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
}
.news-catbar__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.news-catbar__back svg { width: 16px; height: 16px; }
.news-catbar__back:hover { color: var(--text); }
.news-catbar__chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: var(--accent-2);
    font-size: 0.85rem;
    font-weight: 600;
}

/* ===== Карточки новостей ===== */
.news-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.news-card {
    display: flex;
    gap: 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    overflow: hidden;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.news-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.3);
}
.news-card--pinned { border-color: rgba(14, 165, 233, 0.4); }
.news-card__media {
    flex: 0 0 220px;
    display: block;
    overflow: hidden;
}
.news-card__media img {
    width: 100%;
    height: 100%;
    min-height: 150px;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}
.news-card:hover .news-card__media img { transform: scale(1.04); }
.news-card__body {
    flex: 1;
    min-width: 0;
    padding: 18px 20px 16px;
    display: flex;
    flex-direction: column;
}
.news-card__meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.news-card__category {
    display: inline-flex;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--accent-2);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.news-card__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.news-card__date svg { width: 14px; height: 14px; }
.news-card__title {
    margin: 0 0 8px;
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.35;
}
.news-card__title a {
    color: var(--text);
    text-decoration: none;
}
.news-card__title a:hover { color: var(--accent-2); }
.news-card__excerpt {
    margin: 0 0 14px;
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
}
.news-card__footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.news-card__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.news-card__more svg { width: 15px; height: 15px; }
.news-card__views {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.news-card__views svg { width: 15px; height: 15px; }
.news-card__pinned {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--accent-2);
    font-size: 0.8rem;
    font-weight: 600;
}
.news-card__pinned svg { width: 15px; height: 15px; }

/* ===== Пагинация ===== */
.news-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.news-pagination__btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(10px);
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: background .2s ease, border-color .2s ease, transform .15s ease;
}
.news-pagination__btn svg { width: 16px; height: 16px; }
.news-pagination__btn:hover {
    background: var(--glass-hi);
    border-color: rgba(14, 165, 233, 0.45);
    color: var(--text);
    transform: translateY(-1px);
}
.news-pagination__btn--disabled {
    opacity: 0.4;
    pointer-events: none;
}
.news-pagination__info {
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ===== Сайдбар-виджеты ===== */
.news-widget {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--glass-blur));
    padding: 18px;
}
.news-widget__title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.news-widget__title svg { width: 17px; height: 17px; color: var(--accent); }
.news-widget__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.news-widget__list a {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.4;
    text-decoration: none;
    transition: background .15s ease, color .15s ease;
}
.news-widget__list a:hover {
    background: var(--surface-2);
    color: var(--text);
}
.news-widget__list li.is-active a {
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.3);
    color: var(--accent-2);
    font-weight: 600;
}
.news-widget__list--links li {
    border-bottom: 1px dashed var(--border);
    padding: 7px 0;
}
.news-widget__list--links li:last-child { border-bottom: 0; }
.news-widget__list--links a {
    padding: 2px 4px;
    color: var(--text);
}
.news-widget__list--links a:hover { color: var(--accent-2); background: none; }
.news-widget__empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.88rem;
}

/* ===== Статья ===== */
.news-article__header {
    position: relative;
    text-align: center;
    padding: 48px 0 34px;
    overflow: hidden;
    margin-bottom: 8px;
}
.news-article__header-inner {
    position: relative;
    z-index: 1;
    max-width: 820px;
    margin: 0 auto;
}
.news-article__preview {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 7px 14px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.4);
    color: #f59e0b;
    font-size: 0.82rem;
    font-weight: 600;
}
.news-article__preview svg { width: 15px; height: 15px; }
.news-article__back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
}
.news-article__back svg { width: 16px; height: 16px; }
.news-article__back:hover { color: var(--text); }
.news-article__category {
    display: inline-flex;
    margin-bottom: 12px;
    padding: 5px 14px;
    border-radius: 999px;
    background: rgba(14, 165, 233, 0.14);
    border: 1px solid rgba(14, 165, 233, 0.35);
    color: var(--accent-2);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-decoration: none;
}
.news-article__category:hover { filter: brightness(1.15); }
.news-article__title {
    margin: 0 0 14px;
    font-size: clamp(1.6rem, 3.4vw, 2.4rem);
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--text);
}
.news-article__meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
}
.news-article__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 0.88rem;
}
.news-article__meta-item svg { width: 15px; height: 15px; }

.news-article__image {
    margin: 0 0 24px;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow);
}
.news-article__image img {
    display: block;
    width: 100%;
    max-height: 460px;
    object-fit: cover;
}

/* ===== Типографика тела статьи (санитизированный HTML) ===== */
.news-article__body {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--glass-blur));
    padding: 28px 30px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.75;
    word-wrap: break-word;
}
.news-article__body > :first-child { margin-top: 0; }
.news-article__body > :last-child { margin-bottom: 0; }
.news-article__body h1,
.news-article__body h2,
.news-article__body h3,
.news-article__body h4 {
    margin: 1.5em 0 0.6em;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text);
}
.news-article__body h1 { font-size: 1.5rem; }
.news-article__body h2 { font-size: 1.32rem; }
.news-article__body h3 { font-size: 1.16rem; }
.news-article__body h4 { font-size: 1.02rem; }
.news-article__body p { margin: 0 0 1em; }
.news-article__body a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }
.news-article__body a:hover { filter: brightness(1.15); }
.news-article__body strong, .news-article__body b { color: var(--text); font-weight: 700; }
.news-article__body ul, .news-article__body ol { margin: 0 0 1em; padding-left: 1.4em; }
.news-article__body li { margin-bottom: 0.4em; }
.news-article__body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}
.news-article__body blockquote {
    margin: 0 0 1em;
    padding: 12px 18px;
    border-left: 3px solid var(--accent);
    border-radius: 0 12px 12px 0;
    background: var(--surface-2);
    color: var(--text-muted);
}
.news-article__body code {
    padding: 2px 7px;
    border-radius: 6px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    color: var(--code-text);
    font-size: 0.88em;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.news-article__body pre {
    margin: 0 0 1em;
    padding: 16px 18px;
    border-radius: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    overflow-x: auto;
    color: var(--code-text);
    font-size: 0.88em;
    line-height: 1.6;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.news-article__body pre code { padding: 0; background: none; border: 0; }
.news-article__body table {
    width: 100%;
    margin: 0 0 1em;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.news-article__body th,
.news-article__body td {
    padding: 9px 12px;
    border: 1px solid var(--border);
    text-align: left;
}
.news-article__body th { background: var(--surface-2); font-weight: 600; }
.news-article__body hr {
    margin: 1.6em 0;
    border: 0;
    border-top: 1px solid var(--border);
}
.news-article__body iframe { max-width: 100%; border-radius: 12px; }

/* ===== Поделиться ===== */
.news-article__share {
    margin-top: 22px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    backdrop-filter: blur(var(--glass-blur));
    padding: 20px 22px;
}
.news-article__share-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}
.news-article__share-title svg { width: 17px; height: 17px; color: var(--accent); }
.news-share {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.news-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    text-decoration: none;
    cursor: pointer;
    transition: transform .15s ease, filter .2s ease, border-color .2s ease, background .2s ease;
}
.news-share__btn svg { width: 17px; height: 17px; }
.news-share__btn:hover { transform: translateY(-1px); filter: brightness(1.1); color: #fff; }
.news-share__btn--tg { background: rgba(39, 174, 231, 0.16); border-color: rgba(39, 174, 231, 0.4); color: #54c0ee; }
.news-share__btn--vk { background: rgba(0, 119, 255, 0.14); border-color: rgba(0, 119, 255, 0.4); color: #5b9bff; }
.news-share__btn--copy.is-copied { background: rgba(34, 197, 94, 0.15); border-color: rgba(34, 197, 94, 0.45); color: #4ade80; }

/* ===== Читайте также ===== */
.news-article__related { margin-top: 22px; }
.news-article__related-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 14px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
}
.news-article__related-title svg { width: 19px; height: 19px; color: var(--accent); }
.news-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 14px;
}
.news-related-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 18px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    backdrop-filter: blur(var(--glass-blur));
    text-decoration: none;
    transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.news-related-card:hover {
    transform: translateY(-2px);
    border-color: rgba(14, 165, 233, 0.45);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
}
.news-related-card__title {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--text);
}
.news-related-card:hover .news-related-card__title { color: var(--accent-2); }
.news-related-card__date {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}
.news-related-card__date svg { width: 13px; height: 13px; }

/* ===== Адаптивность ===== */
@media (max-width: 991.98px) {
    .news-layout,
    .news-article__layout { grid-template-columns: 1fr; }
    .news-sidebar {
        position: static;
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        align-items: start;
    }
    .news-card__media { flex-basis: 180px; }
}

@media (max-width: 575.98px) {
    .news-page { padding: 0 16px 32px; }
    .news-hero { padding: 36px 0 28px; }
    .news-card { flex-direction: column; }
    .news-card__media { flex-basis: auto; max-height: 200px; }
    .news-card__media img { min-height: 0; height: 200px; }
    .news-card__body { padding: 16px; }
    .news-article__header { padding: 32px 0 24px; }
    .news-article__body { padding: 20px 18px; font-size: 0.95rem; }
    .news-article__meta { gap: 12px; }
    .news-share__btn { flex: 1 1 auto; justify-content: center; }
}
