/* Electro HUB — Новости 2026 (premium reading). Префикс ns-. Грузится после theme.css/news.css; их не трогаем.
   Тема сайта тёмная — оформление под неё: фон var(--eh-dark), бренд-красный #E10600. */
.ns-page, .ns-single, .ns-progress {
  --ns-red: var(--eh-red, #e10600);
  --ns-red-hi: #ff4a42;
  --ns-bg: var(--eh-dark, #161616);
  --ns-surface: #1d1d1d;
  --ns-surface-2: #242424;
  --ns-line: rgba(255, 255, 255, .10);
  --ns-text: #ececec;
  --ns-strong: #fff;
  --ns-muted: #a3a3a3;
  --ns-radius: 16px;
  --ns-col: 720px;
  --ns-wide: 1080px;
}
.ns-page a, .ns-single a { text-decoration: none; }
.ns-single, .ns-page { overflow-x: clip; }
.ns-col  { width: min(100% - 2rem, var(--ns-col)); }
.ns-wide { width: min(100% - 2rem, var(--ns-wide)); }
.ns-single .container.ns-col, .ns-page .container.ns-col, .ns-single .container.ns-wide, .ns-page .container.ns-wide { margin-inline: auto; }
.ns-single .container.ns-col, .ns-page .container.ns-col { width: min(100% - 2rem, var(--ns-col)); }
.ns-single .container.ns-wide, .ns-page .container.ns-wide { width: min(100% - 2rem, var(--ns-wide)); }
.ns-link { color: var(--ns-red-hi); font-weight: 600; transition: color .15s; }
.ns-link:hover { color: #fff; }
.ns-single :focus-visible, .ns-page :focus-visible { outline: 2px solid var(--ns-red-hi); outline-offset: 3px; border-radius: 6px; }

/* ——— Прогресс чтения ——— */
.ns-progress { position: fixed; inset: 0 0 auto 0; height: 3px; z-index: 1000; background: transparent; pointer-events: none; }
.ns-progress > span { display: block; height: 100%; width: 100%; background: var(--ns-red); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 10px rgba(225, 6, 0, .6); }

/* ——— Хлебные крошки ——— */
.ns-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; margin: 0 0 1.4rem; font-size: .85rem; line-height: 1.4; color: var(--ns-muted); }
.ns-crumbs a { color: var(--ns-muted); transition: color .15s; }
.ns-crumbs a:hover { color: #fff; }
.ns-crumbs > span[aria-hidden] { opacity: .45; }
.ns-crumb-cur { color: #cfcfcf; min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ——— Метка, мета ——— */
.ns-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .6rem; margin: 0; font-size: .86rem; color: var(--ns-muted); }
.ns-dot { opacity: .5; }
.ns-label { display: inline-flex; align-items: center; padding: .22rem .65rem; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--ns-red); line-height: 1.2; }
.ns-label--sm { padding: .18rem .55rem; font-size: .66rem; }

/* ——— Статья: шапка ——— */
.ns-head { padding: 2rem 0 1.4rem; }
.ns-single .ns-meta { margin-bottom: 1rem; }
.ns-title { margin: 0; font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.9rem); line-height: 1.14; font-weight: 800; letter-spacing: -.025em; color: var(--ns-strong); text-wrap: balance; overflow-wrap: break-word; }
.ns-standfirst { margin: 1.1rem 0 0; font-size: 1.2rem; line-height: 1.55; color: #cfcfcf; }

/* ——— Обложка: показывается целиком (object-fit: contain), не растягивается, ограничена по высоте ——— */
.ns-cover { position: relative; margin: .4rem auto 2.4rem; overflow: hidden; border-radius: 20px; background: var(--ns-surface); border: 1px solid var(--ns-line); box-shadow: 0 18px 50px rgba(0, 0, 0, .45); width: fit-content; max-width: 100%; }
.ns-cover-img { display: block; width: auto; height: auto; max-width: min(100%, var(--ns-cw, 100%)); max-height: 520px; object-fit: contain; margin: 0 auto; }
.ns-cover--wide .ns-cover-img { max-height: 460px; } /* горизонтальная обложка тоже целиком, без обрезки надписей */
/* Вертикальная обложка (слайды 4:5): справа от заголовка на ПК, под заголовком на телефоне */
.ns-head--split { padding-bottom: 2rem; }
.ns-head-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 380px); gap: 3rem; align-items: center; }
.ns-head--split .ns-cover { margin: 0; justify-self: end; }
.ns-head--split .ns-cover-img { max-height: 475px; }
.ns-head--split .ns-title { font-size: clamp(1.9rem, 1.1rem + 2.4vw, 2.7rem); }

/* ——— Текст статьи ——— */
.ns-prose { font-size: clamp(1.125rem, 1.08rem + .2vw, 1.1875rem); line-height: 1.7; color: var(--ns-text); letter-spacing: .003em; overflow-wrap: break-word; word-break: break-word; hyphens: manual; }
.ns-prose > * { max-width: 100%; }
.ns-prose p { margin: 0 0 1.3em; }
.ns-prose > p:first-of-type { font-size: 1.07em; color: #f4f4f4; }
.ns-prose h2, .ns-prose h3, .ns-prose h4 { color: var(--ns-strong); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; margin: 2.2em 0 .7em; scroll-margin-top: 90px; }
.ns-prose h2 { font-size: 1.65em; padding-top: .9em; border-top: 1px solid var(--ns-line); }
.ns-prose h3 { font-size: 1.28em; }
.ns-prose h4 { font-size: 1.08em; text-transform: uppercase; letter-spacing: .05em; color: #d8d8d8; }
.ns-prose strong, .ns-prose b { color: #fff; font-weight: 700; }
.ns-prose a { color: var(--ns-red-hi); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: rgba(255, 74, 66, .45); overflow-wrap: anywhere; transition: color .15s, text-decoration-color .15s; }
.ns-prose a:hover { color: #fff; text-decoration-color: var(--ns-red-hi); }
.ns-prose ul, .ns-prose ol { margin: 0 0 1.4em; padding-left: 1.4em; }
.ns-prose ul { list-style: disc; }
.ns-prose ol { list-style: decimal; }
.ns-prose li { margin: 0 0 .55em; padding-left: .25em; }
.ns-prose li::marker { color: var(--ns-red); }
.ns-prose li.ns-li-emoji { list-style: none; margin-left: -1.4em; padding: .1em 0 .1em .25em; }
.ns-prose li:last-child { margin-bottom: 0; }
.ns-prose blockquote { margin: 1.8em 0; padding: .4em 0 .4em 1.2em; border-left: 3px solid var(--ns-red); color: #f0f0f0; font-size: 1.05em; }
.ns-prose hr { border: 0; border-top: 1px solid var(--ns-line); margin: 2.4em 0; }
.ns-prose p.ns-tags-line { color: var(--ns-muted); font-size: .88em; line-height: 1.6; margin-top: 2em; }
.ns-prose table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 0 0 1.6em; font-size: .95em; }
.ns-prose th, .ns-prose td { padding: .6em .9em; border: 1px solid var(--ns-line); text-align: left; }
.ns-prose iframe, .ns-prose video { max-width: 100%; border-radius: 14px; }
.ns-prose iframe { aspect-ratio: 16 / 9; width: 100%; height: auto; border: 0; }
.ns-prose pre, .ns-prose code { font-size: .9em; }
.ns-prose pre { overflow-x: auto; padding: 1em; background: var(--ns-surface); border-radius: 12px; }

/* ——— Картинки в тексте: не шире колонки, ограничены по высоте, без апскейла, по центру ——— */
.ns-prose img { display: block; width: auto; height: auto; max-width: 100%; max-height: 560px; margin-inline: auto; object-fit: contain; border-radius: 16px; background: var(--ns-surface); }
.ns-prose figure, .ns-prose .wp-block-image { margin: 2.1em auto; display: flex; flex-direction: column; align-items: center; max-width: 100%; }
.ns-prose figure img { box-shadow: 0 14px 40px rgba(0, 0, 0, .45); border: 1px solid var(--ns-line); }
.ns-prose figcaption, .ns-prose .wp-element-caption { margin: .8em 0 0; max-width: 100%; text-align: center; font-size: .85rem; line-height: 1.5; color: var(--ns-muted); }
.ns-prose .alignleft, .ns-prose .alignright { float: none; margin-inline: auto; }
.ns-prose .alignwide, .ns-prose .alignfull { max-width: 100%; width: auto; margin-inline: auto; }
.ns-prose .wp-block-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2em 0; }
.ns-prose .wp-block-gallery figure { margin: 0; }
.ns-prose .wp-block-gallery img { max-height: 320px; width: 100%; object-fit: cover; }

.ns-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 2rem 0; }
.ns-gallery figure { margin: 0; }
.ns-gallery img { width: 100%; height: auto; max-height: 340px; object-fit: cover; border-radius: 14px; border: 1px solid var(--ns-line); }
.ns-video { margin: 2rem 0; }
.ns-video video { width: 100%; max-height: 520px; border-radius: 16px; background: #000; }

/* ——— Поделиться ——— */
.ns-share { margin: 2.6rem 0 0; padding: 1.4rem 0 0; border-top: 1px solid var(--ns-line); }
.ns-share-title { display: block; margin-bottom: .8rem; font-size: .78rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--ns-muted); }
.ns-share-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.ns-share-btn { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--ns-line); background: var(--ns-surface); color: #ececec !important; font-size: .92rem; font-weight: 600; line-height: 1; cursor: pointer; transition: border-color .18s, background .18s, transform .18s; }
.ns-share-btn svg { flex: none; }
.ns-share-btn:hover { border-color: var(--ns-red); background: rgba(225, 6, 0, .12); transform: translateY(-1px); }
.ns-share-btn--ghost { background: transparent; }
.ns-share-note { margin: .8rem 0 0; font-size: .88rem; color: #cfcfcf; }
.ns-foot { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; margin: 1.6rem 0 0; font-size: .95rem; }

/* ——— Читайте также ——— */
.ns-related { margin-top: 4rem; padding: 3rem 0 4.5rem; background: var(--eh-dark-2, #1c1c1c); border-top: 1px solid var(--ns-line); }
.ns-related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.ns-related-head h2 { margin: 0; font-size: clamp(1.35rem, 1.1rem + 1vw, 1.8rem); font-weight: 800; letter-spacing: -.02em; color: #fff; }

/* ——— Карточки ——— */
.ns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.4rem; }
.ns-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ns-card, .ns-feature { display: flex; flex-direction: column; min-width: 0; background: var(--ns-surface); border: 1px solid var(--ns-line); border-radius: 18px; overflow: hidden; color: inherit; transition: transform .22s, border-color .22s, box-shadow .22s; }
.ns-card:hover, .ns-feature:hover { transform: translateY(-3px); border-color: rgba(225, 6, 0, .55); box-shadow: 0 18px 44px rgba(0, 0, 0, .5); }
.ns-media { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ns-surface-2); }
.ns-media img { width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: 50% 38%; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.ns-card:hover .ns-media img, .ns-feature:hover .ns-media img { transform: scale(1.03); }
.ns-media-ph { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: rgba(255, 255, 255, .25); background: linear-gradient(135deg, #1b1b1b, #262626); }
.ns-body { display: flex; flex-direction: column; gap: .55rem; padding: 1.15rem 1.25rem 1.3rem; flex: 1; min-width: 0; }
.ns-card-title { margin: 0; font-size: 1.15rem; line-height: 1.28; font-weight: 700; letter-spacing: -.01em; color: #fff; overflow-wrap: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ns-excerpt { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-size: .95rem; line-height: 1.55; color: var(--ns-muted); }
.ns-more { margin-top: auto; padding-top: .3rem; font-size: .9rem; font-weight: 700; color: var(--ns-red-hi); }
.ns-card:hover .ns-more, .ns-feature:hover .ns-more { color: #fff; }

/* Крупная первая карточка */
.ns-feature { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); margin-bottom: 1.4rem; border-radius: 22px; }
.ns-feature .ns-media { aspect-ratio: auto; min-height: 380px; height: 100%; max-height: 460px; }
.ns-feature .ns-body { justify-content: center; gap: .8rem; padding: 2rem 2.2rem; }
.ns-feature .ns-card-title { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.2rem); line-height: 1.16; letter-spacing: -.02em; -webkit-line-clamp: 4; }
.ns-feature .ns-excerpt { font-size: 1.04rem; -webkit-line-clamp: 5; }
.ns-feature .ns-more { margin-top: .5rem; display: inline-flex; align-self: flex-start; padding: .65rem 1.2rem; border-radius: 999px; background: var(--ns-red); color: #fff; }
.ns-feature:hover .ns-more { background: var(--eh-red-dark, #b80500); }

/* ——— Страница ленты ——— */
.ns-hero { padding: 2.4rem 0 2rem; border-bottom: 1px solid var(--ns-line); background: radial-gradient(800px 240px at 10% -20%, rgba(225, 6, 0, .15), transparent 70%); }
.ns-hero .ns-crumbs { margin-bottom: 1.2rem; }
.ns-eyebrow { margin: 0 0 .6rem; font-size: .76rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ns-red-hi); }
.ns-hero h1 { margin: 0; font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.4rem); line-height: 1.04; font-weight: 800; letter-spacing: -.035em; color: #fff; }
.ns-lead { margin: 1rem 0 0; max-width: 38rem; font-size: 1.1rem; line-height: 1.6; color: #bdbdbd; }
.ns-hero-link { margin: .9rem 0 0; }
.ns-feed { padding: 2rem 0 3.5rem; }
.ns-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1rem; margin-bottom: 1.6rem; }
.ns-chips { display: flex; gap: .5rem; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; max-width: 100%; }
.ns-chips::-webkit-scrollbar { display: none; }
.ns-chip { flex: none; min-height: 40px; padding: .45rem 1rem; border-radius: 999px; border: 1px solid var(--ns-line); background: var(--ns-surface); color: #d6d6d6; font-size: .9rem; font-weight: 600; cursor: pointer; transition: .18s; }
.ns-chip:hover { border-color: rgba(255, 255, 255, .3); color: #fff; }
.ns-chip.is-active { background: var(--ns-red); border-color: var(--ns-red); color: #fff; }
.ns-search input { width: min(100%, 260px); min-height: 40px; padding: .5rem 1rem; border-radius: 999px; border: 1px solid var(--ns-line); background: var(--ns-surface); color: #fff; font-size: .92rem; }
.ns-search input:focus { outline: none; border-color: var(--ns-red); box-shadow: 0 0 0 3px rgba(225, 6, 0, .2); }
.ns-search { display: block; }
[data-news-card][hidden] { display: none !important; }
.ns-filter-empty, .ns-empty { margin: 2rem 0; padding: 2rem; border: 1px dashed var(--ns-line); border-radius: var(--ns-radius); color: var(--ns-muted); text-align: center; }
.ns-pagination { margin-top: 2.2rem; }
.ns-pagination ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; list-style: none; padding: 0; margin: 0; }
.ns-pagination a, .ns-pagination span { display: inline-flex; min-width: 42px; height: 42px; align-items: center; justify-content: center; padding: 0 .8rem; border-radius: 999px; border: 1px solid var(--ns-line); background: var(--ns-surface); color: #ddd; font-weight: 600; }
.ns-pagination .current { background: var(--ns-red); border-color: var(--ns-red); color: #fff; }
.ns-seo { padding: 2.4rem 0 4rem; border-top: 1px solid var(--ns-line); }
.ns-seo h2 { margin: 0 0 1rem; font-size: 1.35rem; font-weight: 800; letter-spacing: -.015em; color: #fff; }
.ns-seo p { margin: 0 0 1em; font-size: 1.02rem; line-height: 1.7; color: #b5b5b5; }

/* ——— Планшет / телефон ——— */
@media (max-width: 1000px) {
  .ns-grid, .ns-grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ns-head-grid { grid-template-columns: 1fr; gap: 1.6rem; }
  .ns-head--split .ns-cover { justify-self: center; }
  .ns-feature { grid-template-columns: 1fr; }
  .ns-feature .ns-media { aspect-ratio: 16 / 9; min-height: 0; height: auto; max-height: 420px; }
  .ns-feature .ns-body { padding: 1.4rem 1.4rem 1.6rem; }
}
@media (max-width: 640px) {
  .ns-grid, .ns-grid--3 { grid-template-columns: 1fr; gap: 1.1rem; }
  .ns-head { padding: 1.4rem 0 1rem; }
  .ns-crumbs { font-size: .8rem; margin-bottom: 1rem; }
  .ns-crumb-cur, .ns-crumbs > span[aria-hidden]:nth-last-child(2) { display: none; }
  .ns-standfirst { font-size: 1.08rem; }
  .ns-cover { margin-bottom: 1.8rem; border-radius: 16px; }
  .ns-cover-img, .ns-head--split .ns-cover-img { max-height: 440px; }
  .ns-head--split { padding-bottom: 1rem; }
  .ns-prose { font-size: 1.125rem; }
  .ns-prose h2 { font-size: 1.45em; }
  .ns-prose img { max-height: 480px; border-radius: 14px; }
  .ns-prose .wp-block-gallery, .ns-gallery { grid-template-columns: 1fr; }
  .ns-share-row .ns-share-btn { flex: 1 1 calc(50% - .6rem); justify-content: center; }
  .ns-related { padding: 2.2rem 0 3rem; margin-top: 3rem; }
  .ns-related-head { flex-direction: column; align-items: flex-start; gap: .4rem; }
  .ns-hero { padding: 1.6rem 0 1.5rem; }
  .ns-search, .ns-search input { width: 100%; }
  .ns-feature .ns-card-title { font-size: 1.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ns-card, .ns-feature, .ns-media img, .ns-share-btn { transition: none; }
  .ns-progress > span { box-shadow: none; }
}
@media print { .ns-progress, .ns-share, .ns-related, .ns-foot { display: none !important; } }

/* Виджет «Новости Electro HUB в мессенджерах» (внизу ленты и статей) */
.ns-channels { padding: 2.6rem 0 3.4rem; }
.ns-channels-box { max-width: 640px; margin: 0 auto; padding: 1.8rem 1.6rem 1.9rem; text-align: center; border: 1px solid var(--ns-line); border-radius: 20px; background: linear-gradient(180deg, var(--ns-surface-2), var(--ns-surface)); box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 -2px 0 var(--ns-red) inset; }
.ns-channels-title { margin: 0 0 .45rem; font-size: clamp(1.2rem, 1.05rem + .7vw, 1.55rem); font-weight: 800; letter-spacing: -.015em; line-height: 1.25; color: #fff; }
.ns-channels-sub { margin: 0 0 1.3rem; font-size: .98rem; line-height: 1.5; color: var(--ns-muted); }
.ns-channels-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; }
.ns-ch-btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-width: 190px; min-height: 50px; padding: .7rem 1.5rem; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .16); background: #121212; color: #fff !important; font-size: 1rem; font-weight: 700; line-height: 1; transition: border-color .18s, background .18s, transform .18s, box-shadow .18s; }
.ns-ch-btn svg { flex: none; color: var(--ns-red-hi); transition: color .18s; }
.ns-ch-btn:hover, .ns-ch-btn:focus-visible { border-color: var(--ns-red); background: var(--ns-red); transform: translateY(-2px); box-shadow: 0 8px 22px rgba(225, 6, 0, .28); }
.ns-ch-btn:hover svg, .ns-ch-btn:focus-visible svg { color: #fff; }
.ns-ch-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 560px) {
  .ns-channels { padding: 2rem 0 2.6rem; }
  .ns-channels-box { padding: 1.4rem 1.1rem 1.5rem; }
  .ns-channels-row { flex-direction: column; }
  .ns-ch-btn { width: 100%; min-width: 0; }
}
@media (prefers-reduced-motion: reduce) { .ns-ch-btn { transition: none; } .ns-ch-btn:hover { transform: none; } }
@media print { .ns-channels { display: none !important; } }
