/* Дополнительные стили к /new-main/css/style.css для раздела новостей */

:root {
  --news-accent: #9ef86f;
  --news-accent-soft: rgba(158, 248, 111, 0.88);
}

/*
 * Подложка под mix-blend-mode у .body-bg + тёмная тема как на макете новостей.
 */
html:has(.chatboost-public-page),
body:has(.chatboost-public-page) {
  background-color: #000000 !important;
}

body:has(.chatboost-public-page) #__next {
  background-color: #000000 !important;
}

.chatboost-public-page {
  position: relative;
  min-height: 100vh;
  isolation: isolate;
  background-color: #000000;
  background-image: radial-gradient(
    ellipse 120% 75% at 0% 0%,
    rgba(158, 248, 111, 0.16) 0%,
    transparent 58%
  );
}

/* Слегка приглушаем фоновое фото — на макете доминирует чёрный и мягкое свечение */
.chatboost-public-page .body-bg {
  opacity: 0.5;
}

.chatboost-public-page .header__nav a:not(.news-nav--active) {
  color: rgba(248, 248, 248, 0.52);
  transition: color 0.2s;
}

.chatboost-public-page .header__nav a:not(.news-nav--active):hover {
  color: rgba(248, 248, 248, 0.88);
}

/*
 * MUI (светлая тема) задаёт ссылкам и заголовкам тёмный text.primary — на чёрном фоне
 * заголовок героя и подпись «Войти» почти пропадают. Фиксируем контраст.
 */
.chatboost-public-page .header__login {
  color: #f8f8f8 !important;
}

.chatboost-public-page .header__login:hover {
  color: #141414 !important;
}

.news-main {
  flex: 1;
  width: 100%;
}

/*
 * Landing .page-section .wrapper задаёт display:flex — flex-item сжимается,
 * контент новости становится узкой колонкой. Для страницы поста нужен блок.
 */
.chatboost-public-page .news-main .page-section .wrapper {
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.chatboost-public-page .news-main .news-article {
  width: 100%;
  max-width: 900px;
  box-sizing: border-box;
}

.news-hero {
  padding-top: 120px;
  padding-bottom: 40px;
}

@media (max-width: 1100px) {
  .news-hero {
    padding-top: 100px;
    padding-bottom: 28px;
  }
}

.news-hero__title {
  font-size: 43px;
  font-weight: 300;
  line-height: 1.15;
  text-align: center;
  margin-bottom: 16px;
  color: #f8f8f8 !important;
}

.news-hero__lead {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  font-size: 18px;
  font-weight: 300;
  color: rgba(248, 248, 248, 0.85);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  padding-bottom: 80px;
}

@media (max-width: 1100px) {
  .news-grid {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 48px;
  }
}

.news-card {
  display: flex;
  flex-direction: column;
  border-radius: 24px;
  overflow: hidden;
  background: #1e1e1e;
  border: none;
  box-shadow: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  min-height: 100%;
}

.news-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.news-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a1a1a;
}

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

.news-card__body {
  padding: 22px 24px 26px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-card__meta {
  font-size: 14px;
  font-weight: 400;
  color: var(--news-accent-soft);
  margin-bottom: 12px;
}

.news-card__title {
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
  margin-bottom: 12px;
  color: #f8f8f8;
}

.news-card__excerpt {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.45;
  color: rgba(248, 248, 248, 0.78);
  flex: 1;
}

.news-card__more {
  margin-top: 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--news-accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.news-card__more svg {
  flex-shrink: 0;
}

.news-load-sentinel {
  height: 4px;
  width: 100%;
  margin: 24px 0 48px;
}

.news-loading {
  text-align: center;
  padding: 16px 0 48px;
  font-size: 15px;
  color: rgba(248, 248, 248, 0.55);
}

.news-end {
  text-align: center;
  padding: 8px 0 56px;
  font-size: 14px;
  color: rgba(248, 248, 248, 0.45);
}

.noscript-news {
  padding: 24px 20px 80px;
}

.noscript-news h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 16px;
}

.noscript-news ul {
  list-style: disc;
  padding-left: 1.25rem;
}

.noscript-news li {
  margin-bottom: 8px;
}

/* Детальная новость */

.news-back {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--news-accent);
}

.news-article__topbar .news-back {
  margin-bottom: 0;
}

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

.news-article {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-bottom: 80px;
}

.news-article__topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-bottom: 16px;
}

.news-article__meta {
  font-size: 15px;
  color: var(--news-accent-soft);
  margin: 0;
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
}

.news-article__title {
  font-size: 40px;
  font-weight: 300;
  line-height: 1.15;
  margin-bottom: 28px;
  color: #f8f8f8 !important;
}

@media (max-width: 1100px) {
  .news-article__title {
    font-size: 30px;
  }
}

.news-article__media {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 32px;
  border: none;
}

.news-article__media img {
  width: 100%;
  display: block;
  vertical-align: middle;
}

.news-article__body {
  font-size: 18px;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(248, 248, 248, 0.92);
}

.news-article__body p {
  margin-bottom: 1.1em;
}

.news-article__body ul {
  list-style: disc;
  margin: 0 0 1.1em 1.2rem;
}

.news-article__body li {
  margin-bottom: 0.45em;
}

/* react-markdown: заголовки и код из поля description */
.news-article__body h1,
.news-article__body h2,
.news-article__body h3 {
  font-weight: 400;
  line-height: 1.25;
  margin: 1.1em 0 0.55em;
  color: #f8f8f8 !important;
}

.news-article__body h1 {
  font-size: 2rem;
}

.news-article__body h2 {
  font-size: 1.6rem;
}

.news-article__body h3 {
  font-size: 1.3rem;
}

.news-article__body pre {
  margin: 1em 0;
  padding: 1rem 1.1rem;
  border-radius: 12px;
  background: rgba(30, 30, 30, 0.95);
  overflow-x: auto;
  font-size: 0.9em;
  line-height: 1.45;
}

.news-article__body code {
  font-size: 0.92em;
  padding: 0.12em 0.35em;
  border-radius: 6px;
  background: rgba(48, 48, 48, 0.9);
}

.news-article__body pre code {
  padding: 0;
  background: transparent;
}

.news-article__body strong {
  font-weight: 500;
}

.news-article__body a {
  color: var(--news-accent-soft);
  text-decoration: underline;
}

.news-article__body a:hover {
  color: var(--news-accent);
}

.header__nav a.news-nav--active {
  color: var(--news-accent);
}

@media (prefers-reduced-motion: reduce) {
  .news-card {
    transition: none;
  }

  .news-card:hover {
    transform: none;
  }
}
