/* Стили для контента текстовых страниц из визуального редактора */
.usercontent {
  display: block;
  line-height: 1.29;
  counter-reset: section-counter;
  padding-left: 1.75rem;
}
.news-interview-text.usercontent {
  padding-left: 0;
}

@media (min-width: 768px) {
  .usercontent {
    padding-left: 6rem;
  }
  .news-interview-text.usercontent {
    padding-left: 0;
  }
}

@media (min-width: 1024px) {
  .usercontent {
    padding-left: 14.688rem;
  }
  .news-interview-text.usercontent {
    padding-left: 0;
  }
}

/* Заголовки - без нумерации */
.news-interview-text.usercontent > h1,
.news-interview-text.usercontent > h2,
.news-interview-text.usercontent > h3 {
  counter-reset: none;
  position: relative;
  left: auto;
  max-width: 100%;
  margin-top: 40px;
  
}

@media (min-width: 768px) {
  .news-interview-text.usercontent > h1,
  .news-interview-text.usercontent > h2,
  .news-interview-text.usercontent > h3 {
    position: absolute;
    left: 0;
    max-width: 40%;
    margin-top: 0;
  }
}

.news-interview-text.usercontent > h1::before,
.news-interview-text.usercontent > h2::before,
.news-interview-text.usercontent > h3::before {
  display: none;
}

/* Заголовки h2 - слева с нумерацией */
.usercontent > h2 {
  counter-increment: section-counter;
  position: relative;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  line-height: 1.1;
  text-transform: uppercase;
  width: auto;
}

.usercontent > h2:first-child {
  margin-top: 0;
}

@media (min-width: 1024px) {
    .usercontent > h2 {
      float: left;
      clear: left;
    }
}

@media (min-width: 768px) {
  .usercontent > h2 {
    font-size: 0.875rem;
  }
}

/* Нумерация для заголовков h2 */
.usercontent > h2::before {
  content: counter(section-counter, decimal-leading-zero);
  position: absolute;
  left: -1.75rem;
  top: 0;
  font-size: 0.75rem;
  line-height: 1.1;
  font-weight: normal;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .usercontent > h2::before {
    left: -6rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .usercontent > h2::before {
    left: -14.688rem;
  }
}

/* Заголовки h3 - слева с нумерацией */
.usercontent > h3 {
  counter-increment: section-counter;
  position: relative;
  margin-bottom: 1rem;
  font-size: 0.75rem;
  line-height: 1.1;
  text-transform: uppercase;
  width: auto;
}

.usercontent > h3:first-child {
  margin-top: 0;
}

@media (min-width: 768px) {
  .usercontent > h3 {
    font-size: 0.875rem;
  }
}

/* Нумерация для заголовков h3 */
.usercontent > h3::before {
  content: counter(section-counter, decimal-leading-zero);
  position: absolute;
  left: -1.75rem;
  top: 0;
  font-size: 0.75rem;
  line-height: 1.1;
  font-weight: normal;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .usercontent > h3::before {
    left: -6rem;
    font-size: 0.875rem;
  }
}

@media (min-width: 1024px) {
  .usercontent > h3::before {
    left: -14.688rem;
  }
}

/* Параграфы - справа в колонке на десктопе */
.usercontent > p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.29;
  color: #000;
  max-width: 100%;
  margin-left: 0;
}

.news-interview-text.usercontent > p {
  width: auto;
  margin-left: 0;
  max-width: 90%;
}
@media (min-width: 1024px) {
  .usercontent > p {
    max-width: 53.7%;
    margin-left: auto;
  }
}

.usercontent > p:last-child {
  margin-bottom: 0;
}

/* Параграфы с ограничением ширины (если нужно) */
.usercontent p.max-w-\[530px\] {
  max-width: 530px;
}

/* Blockquote - на мобильных обычная ширина, на десктопе на всю ширину */
.usercontent blockquote {
  margin: -1rem 0 4rem -1.5rem;
  padding: 0;
  width: 100%;
  font-style: normal;
  font-size: 0.875rem;
  line-height: 1.2;
}

@media (min-width: 768px) and (max-width: 1023px) {
  .usercontent blockquote {
    margin: -1rem 0 4rem 0rem;
  }
}

@media (min-width: 1024px) {
  .usercontent blockquote {
    width: 80%;
    margin: -2rem 0 4rem 0;
  }
}

.usercontent blockquote p {
  margin-bottom: 1rem;
  font-size: 0.875rem;
  line-height: 1.29;
  max-width: none;
  margin-left: 0;
}

.usercontent blockquote p:last-child {
  margin-bottom: 0;
}

/* Заголовки внутри usercontent (не прямые потомки) */
.usercontent h1 {
  font-size: 2rem;
  line-height: 1.1;
  margin-bottom: 1rem;
}

.usercontent h2 {
  font-size: 0.75rem;
  line-height: 1.1;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

@media (min-width: 768px) {
  .usercontent h2 {
    font-size: 0.875rem;
  }
}

.usercontent h3 {
  font-size: 1rem;
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.usercontent h4,
.usercontent h5,
.usercontent h6 {
  font-size: 0.875rem;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

/* Списки */
.usercontent ul,
.usercontent ol {
  margin-bottom: 1rem;
  padding-left: 0;
  list-style: none;
}

.usercontent ul {
  list-style-type: none;
}

.usercontent ol {
  list-style-type: none;
}

.usercontent li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.29;
  font-size: 0.875rem;
}

.usercontent li:last-child {
  margin-bottom: 0;
}

.usercontent li::before {
  content: '';
  position: absolute;
  top: 0.563rem;
  left: 0.563rem;
  height: 0.188rem;
  width: 0.188rem;
  border-radius: 50%;
  background-color: #000;
}

/* Ссылки */
.usercontent a {
  text-decoration: underline;
  color: inherit;
}

.usercontent a:hover {
  color: #C5AC8F;
}

/* Таблицы - в колонке справа на десктопе */
.usercontent > table,
.usercontent p table,
.usercontent div table {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
  margin-right: 0;
  border-collapse: collapse;
  margin-bottom: 1rem;
}

@media (min-width: 1024px) {
  .usercontent > table,
  .usercontent p table,
  .usercontent div table {
    max-width: 53.7%;
    margin-left: auto;
    margin-right: 0;
  }
}

.usercontent th,
.usercontent td {
  padding: 0.25rem 0.5rem;
  padding-bottom: 1.5rem;
  border-top: 1px solid #000;
  border-left: none;
  border-right: none;
  border-bottom: none;
  text-align: left;
  vertical-align: top;
}

.usercontent th {
  font-weight: 600;
  text-transform: uppercase;
}

.usercontent tr:first-child th,
.usercontent tr:first-child td {
  border-top: 1px solid #000;
}

.usercontent tr:last-child th,
.usercontent tr:last-child td {
  padding-bottom: 0;
}

/* Изображения */
.usercontent img {
  max-width: 100%;
  height: auto;
  margin-bottom: 1rem;
}

.usercontent img:last-child {
  margin-bottom: 0;
}

/* Выделение текста */
.usercontent strong,
.usercontent b {
  font-weight: 600;
}

.usercontent em,
.usercontent i {
  font-style: italic;
}

/* Горизонтальная линия */
.usercontent hr {
  border: none;
  border-top: 1px solid #000;
  margin: 1.5rem 0;
}

/* Код */
.usercontent code {
  background-color: #f5f5f5;
  padding: 0.125rem 0.25rem;
  font-family: monospace;
  font-size: 0.875em;
}

.usercontent pre {
  background-color: #f5f5f5;
  padding: 1rem;
  overflow-x: auto;
  margin-bottom: 1rem;
}

.usercontent pre code {
  background-color: transparent;
  padding: 0;
}
