/* Базовая область статьи */
.article-content {
    font-size: 1.05rem;
    line-height: 1.75;
    color: #212529;
    background-color: white;
    padding: 10px;
    border: 1px solid black;
  }
  
  /* Заголовки: ровные отступы, иерархия размеров */
  .article-content h1,
  .article-content h2,
  .article-content h3,
  .article-content h4,
  .article-content h5,
  .article-content h6 {
    margin-top: 1.6em;
    margin-bottom: 0.6em;
    line-height: 1.3;
    font-weight: 700;
  }
  .article-content h1 { font-size: clamp(1.8rem, 2vw + 1.2rem, 2.2rem); }
  .article-content h2 { font-size: clamp(1.6rem, 1.6vw + 1rem, 1.9rem); }
  .article-content h3 { font-size: clamp(1.3rem, 1.2vw + 0.9rem, 1.5rem); }
  
  /* Абзацы, списки */
  .article-content p { margin: 0 0 1em; }
  .article-content ul,
  .article-content ol { padding-left: 1.4em; margin: 0 0 1em; }
  .article-content li + li { margin-top: 0.35em; }
  
  /* Ссылки */
  .article-content a { color: #0d6efd; text-decoration: underline; }
  .article-content a:hover { text-decoration: none; }
  
  /* Изображения (в т.ч. вставки CKEditor) */
  .article-content img,
  .article-content figure img {
    max-width: 60%;
    height: auto;
    display: block;
    margin: 0 auto;
  }
  .article-content figure {
    margin: 1.25rem 0;
  }
  .article-content figcaption {
    font-size: .9rem;
    color: #6c757d;
    text-align: center;
    margin-top: .4rem;
  }
  
  /* Выравнивания CKEditor */
  .article-content .image {
    margin: 1rem 0;
  }
  .article-content .image.image_resized {
    max-width: 100%;
  }
  .article-content .image-style-align-left,
  .article-content .image.image-style-align-left {
    float: left;
    margin: 0.25rem 1rem 0.5rem 0;
    max-width: 50%;
  }
  .article-content .image-style-align-right,
  .article-content .image.image-style-align-right {
    float: right;
    margin: 0.25rem 0 0.5rem 1rem;
    max-width: 50%;
  }
  .article-content .image-style-align-center,
  .article-content .image.image-style-align-center {
    margin-left: auto;
    margin-right: auto;
  }
  @media (max-width: 768px) {
    .article-content .image-style-align-left,
    .article-content .image-style-align-right {
      float: none;
      margin: 0.5rem 0;
      max-width: 100%;
    }
  }
  
  /* Таблицы из CKEditor (.table -> реальная таблица внутри) */
  .article-content .table {
    margin: 1.25rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .article-content .table table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px; /* при узком экране включится горизонтальный скролл */
  }
  .article-content .table th,
  .article-content .table td,
  .article-content table th,
  .article-content table td {
    border: 1px solid #dee2e6;
    padding: .6rem .75rem;
    vertical-align: top;
  }
  .article-content .table thead th,
  .article-content table thead th {
    background: #f8f9fa;
    font-weight: 600;
  }
  
  /* Код */
  .article-content pre,
  .article-content code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
    font-size: .95rem;
  }
  .article-content pre {
    background: #0f172a; /* тёмный синий */
    color: #e2e8f0;
    border-radius: .5rem;
    padding: 1rem;
    overflow: auto;
    margin: 1rem 0;
  }
  .article-content code {
    background: #f1f3f5;
    color: #1f2937;
    padding: .15rem .35rem;
    border-radius: .25rem;
  }
  .article-content pre code {
    background: transparent;
    padding: 0;
    color: inherit;
  }
  
  /* Цитаты */
  .article-content blockquote {
    border-left: 4px solid #0d6efd;
    padding: .5rem 1rem;
    margin: 1rem 0;
    color: #495057;
    background: #f8f9fa;
  }
  
  /* Горизонтальная линия */
  .article-content hr {
    border: 0;
    height: 1px;
    background: #e9ecef;
    margin: 2rem 0;
  }
  
  /* Медиа (видео, iframe) — адаптивно 16:9 по умолчанию */
  .article-content .media,
  .article-content .media-embed,
  .article-content iframe,
  .article-content video {
    max-width: 100%;
  }
  .article-content .media,
  .article-content .media-embed {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    margin: 1rem 0;
    background: #000;
    border-radius: .5rem;
  }
  .article-content .media iframe,
  .article-content .media-embed iframe,
  .article-content .media video,
  .article-content .media-embed video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
  }
  
  /* Списки с изображениями внутри — не вылезать за контейнер */
  .article-content li img {
    max-width: 100%;
  }
  
  /* Очистка обтеканий после картинок */
  .article-content::after {
    content: "";
    display: table;
    clear: both;
  }
  
  /* Вариант тёмного фона 
  @media (prefers-color-scheme: dark) {
    /* Подправь, если у тебя нет тёмной темы 
    .article-content { color: #e9ecef; }
    .article-content blockquote { background: #1f2937; color: #d1d5db; border-left-color: #60a5fa; }
    .article-content .table th,
    .article-content .table td,
    .article-content table th,
    .article-content table td { border-color: #334155; }
    .article-content .table thead th,
    .article-content table thead th { background: #111827; }
    .article-content code { background: #111827; color: #e5e7eb; }
  }
  