/* Текст статьи (блок text-content): текст из визуального редактора на детальных страницах.
   Перенесён из общего local/templates/muiv/css/style.css и дописан: заголовки h2–h6, списки, цитата, картинки, разделитель.
   Таблицы не оформляются: у них общий стиль сайта (общий style.css).
   Подключают через $this->addExternalCss() шаблоны news.detail/.default комплексных компонентов
   news/news, news/blog, news/events, news/science-events.
   Файл стоит в каскаде раньше общего style.css и Bootstrap: селекторы — «.text-content <тег>», сильнее их правил по тегу. */

.text-content {
  font-size: 16px;
  line-height: 1.5;
  color: var(--blue-dark-lite);
  overflow-wrap: break-word;
}

@media (min-width: 992px) {
  .text-content {
    font-size: 20px;
  }
}

.text-content > :first-child {
  margin-top: 0;
}

.text-content > :last-child {
  margin-bottom: 0;
}

/* Абзацы */
.text-content p {
  font-size: inherit;
  line-height: inherit;
  margin: 0 0 var(--space-15);
}

@media (min-width: 992px) {
  .text-content p {
    margin-bottom: var(--space-20);
  }
}

/* Последний абзац в ячейке таблицы, пункте списка и любой обёртке — без отступа снизу */
.text-content p:last-child {
  margin-bottom: 0;
}

.text-content b,
.text-content strong {
  font-weight: 700;
}

/* Заголовки: h2 — раздел статьи, h3 — подраздел, h4–h6 — младший заголовок */
.text-content h2,
.text-content h3,
.text-content h4,
.text-content h5,
.text-content h6 {
  font-weight: 600;
  font-style: normal;
  line-height: 1.25;
  margin: var(--space-30) 0 var(--space-15);
  padding: 0;
  color: var(--blue-dark-lite);
}

.text-content h2 {
  font-size: 24px;
}

.text-content h3 {
  font-size: 20px;
  margin-top: var(--space-25);
}

.text-content h4,
.text-content h5,
.text-content h6 {
  font-size: 18px;
  margin-top: var(--space-20);
  margin-bottom: var(--space-10);
}

@media (min-width: 992px) {
  .text-content h2 {
    font-size: 30px;
    margin-top: var(--space-50);
    margin-bottom: var(--space-20);
  }

  .text-content h3 {
    font-size: 24px;
    margin-top: var(--space-40);
    margin-bottom: var(--space-15);
  }

  .text-content h4,
  .text-content h5,
  .text-content h6 {
    font-size: 20px;
    margin-top: var(--space-30);
  }
}

/* Заголовок сразу под заголовком — без большого отступа */
.text-content :is(h2, h3, h4, h5, h6) + :is(h3, h4, h5, h6) {
  margin-top: 0;
}

/* Списки */
.text-content ul,
.text-content ol {
  margin: 0 0 var(--space-15);
  padding-left: var(--space-30);
}

@media (min-width: 992px) {
  .text-content ul,
  .text-content ol {
    margin-bottom: var(--space-20);
  }
}

.text-content :is(ul, ol) > li {
  position: relative;
  display: list-item;
  margin: 0;
}

.text-content :is(ul, ol) > li + li,
.text-content li > :is(ul, ol) {
  margin-top: var(--space-10);
}

.text-content li > :is(ul, ol) {
  margin-bottom: 0;
}

.text-content li > p {
  margin: 0;
}

.text-content ul {
  list-style: none;
}

.text-content ul > li::before {
  position: absolute;
  top: calc(.75em - 3px);
  left: calc(-1 * var(--space-20));
  width: 6px;
  height: 6px;
  content: '';
  border-radius: var(--radius-round);
  background: var(--pink);
}

.text-content ol {
  list-style: decimal;
}

.text-content ol > li::marker {
  font-weight: 700;
}

/* Цитата */
.text-content blockquote {
  font-style: italic;
  margin: var(--space-25) 0;
  padding: var(--space-20) var(--space-25);
  border-radius: var(--radius);
  background: var(--blue-lite);
}

@media (min-width: 992px) {
  .text-content blockquote {
    font-size: 22px;
    margin: var(--space-40) 0;
    padding: var(--space-30) var(--space-40);
  }
}

.text-content blockquote > :last-child {
  margin-bottom: 0;
}

.text-content blockquote cite,
.text-content blockquote footer {
  font-size: 14px;
  font-style: normal;
  display: block;
  margin-top: var(--space-10);
  color: var(--gray);
}

@media (min-width: 992px) {
  .text-content blockquote cite,
  .text-content blockquote footer {
    font-size: 16px;
  }
}

/* Разделитель */
.text-content hr {
  margin: var(--space-30) 0;
  opacity: 1;
  border: 0;
  border-top: 1px solid var(--border);
}

@media (min-width: 992px) {
  .text-content hr {
    margin: var(--space-40) 0;
  }
}

/* Картинки, подписи и встроенное видео */
.text-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius);
}

.text-content figure {
  margin: var(--space-25) 0;
}

.text-content figcaption {
  font-size: 14px;
  margin-top: var(--space-10);
  color: var(--gray);
}

@media (min-width: 992px) {
  .text-content figcaption {
    font-size: 16px;
  }
}

.text-content iframe,
.text-content video {
  max-width: 100%;
  border: 0;
  border-radius: var(--radius);
}
