/* ═══════════════════════════════════════════════════════════════
   IT Institute · «Деловая газета» · блоки текста статей
   Стили для НЕИЗМЕННОЙ разметки статей (классы и вложенность не трогаем).
   Подключается на шаблонах: статья, хаб раздела, методология, о проекте.
   Файл дизайн-агента (Claude Design, «Редизайн сайта It-institute.ru», article-blocks.css) — без правок;
   дополнения сайта — в article.css.
   ═══════════════════════════════════════════════════════════════ */

:root {
  /* Цвет */
  --ink: #111111;        /* текст, линейки, кнопки */
  --body: #333333;       /* основной текст */
  --muted: #5a5a5a;      /* мета, подписи · 6.9:1 на белом */
  --rule: #d9d9d9;       /* тонкие линейки */
  --tint: #f5f5f5;       /* врезки */
  --paper: #ffffff;      /* фон */
  --red: #c0201b;        /* акцент · 5.9:1 на белом */
  --red-dark: #9a1915;   /* наведение на красную кнопку */
  --red-on-ink: #ff8a80; /* акцент на чёрном */
  /* Шрифты */
  --ff-serif: 'Source Serif 4', Georgia, serif;   /* заголовки, текст статей, цифры */
  --ff-sans: 'IBM Plex Sans', 'Segoe UI', sans-serif; /* интерфейс, таблицы, подписи */
  --ff-mono: 'IBM Plex Mono', ui-monospace, monospace; /* коды, номера источников */
  /* Линейки */
  --rule-section: 4px solid var(--ink); /* начало раздела */
  --rule-block: 1px solid var(--ink);   /* шапка блока */
  --rule-item: 1px solid var(--rule);   /* между пунктами */
  /* Отступы: 4 8 12 16 24 32 48 64 */
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 24px; --s6: 32px; --s7: 48px; --s8: 64px;
}

/* ── Текст ─────────────────────────────────────────────── */
.article-content { font-family: var(--ff-serif); font-size: 18px; line-height: 1.65; color: var(--body); min-width: 0; overflow-wrap: break-word; }
.article-content > :first-child { margin-top: 0; }
.article-content p { margin: 0 0 18px; text-wrap: pretty; }
.article-content strong, .article-content b { font-weight: 600; color: var(--ink); }
.article-content a { color: var(--ink); text-decoration: underline; text-decoration-color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 3px; }
.article-content a:hover { color: var(--red); }
.article-content a:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.article-content h2 { font-family: var(--ff-serif); font-size: 30px; line-height: 1.15; font-weight: 700; letter-spacing: -.015em; color: var(--ink); margin: 56px 0 18px; padding-top: 14px; border-top: var(--rule-block); text-wrap: balance; scroll-margin-top: 24px; }
.article-content h3 { font-family: var(--ff-serif); font-size: 22px; line-height: 1.25; font-weight: 600; color: var(--ink); margin: 32px 0 12px; text-wrap: balance; }
.article-content ul, .article-content ol { margin: 0 0 20px; padding-left: 24px; }
.article-content li { margin: 0 0 8px; padding-left: 4px; }
.article-content li::marker { color: var(--red); }
.article-content ol li::marker { font-family: var(--ff-sans); font-size: .85em; font-weight: 600; }
.article-content hr { border: 0; border-top: var(--rule-item); margin: 40px 0; }
.article-content code { font-family: var(--ff-mono); font-size: .85em; background: var(--tint); padding: 1px 5px; }
.article-content pre { font-family: var(--ff-mono); font-size: 14px; line-height: 1.55; background: var(--tint); border-top: var(--rule-block); padding: 16px 18px; overflow-x: auto; margin: 0 0 24px; }
.article-content pre code { background: none; padding: 0; }
.article-content blockquote { margin: 32px 0; padding: 16px 0 0; border-top: var(--rule-block); font-style: italic; font-size: 22px; line-height: 1.4; color: var(--ink); }

/* ── Таблица: прокрутка внутри своей рамки, страница не едет ── */
.article-content table { display: block; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 28px 0 32px; font-family: var(--ff-sans); font-size: 14px; line-height: 1.45; font-variant-numeric: tabular-nums; border-top: var(--rule-section); border-bottom: var(--rule-block); scrollbar-width: thin; scrollbar-color: var(--ink) var(--tint); }
.article-content table:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }
.article-content thead th { border-bottom: var(--rule-block); }
.article-content th { text-align: left; vertical-align: bottom; font-weight: 600; color: var(--ink); padding: 10px 14px 10px 0; min-width: 7.5em; }
.article-content td { text-align: left; vertical-align: top; padding: 10px 14px 10px 0; color: var(--body); border-top: var(--rule-item); min-width: 7.5em; }
.article-content tbody tr:first-child td { border-top: 0; }
.article-content td:first-child { font-weight: 500; color: var(--ink); min-width: 10em; }
.article-content tbody tr:hover td { background: var(--tint); }

/* Таблица сравнения — шапка чёрной плашкой, первая колонка — предмет сравнения */
.article-content table.compare-table { border-top: 0; }
.article-content table.compare-table thead th { background: var(--ink); color: var(--paper); padding: 10px 14px; border-bottom: 0; }
.article-content table.compare-table td { padding: 11px 14px; }
.article-content table.compare-table td:first-child { font-weight: 600; }
.article-content table.compare-table td:nth-child(2) { font-family: var(--ff-serif); font-size: 18px; font-weight: 700; color: var(--red); white-space: nowrap; }

/* ── Ключевые данные — 3–5 цифр в начале статьи ── */
.key-findings { margin: 0 0 36px; border-top: var(--rule-section); border-bottom: var(--rule-block); padding: 14px 0 20px; }
.kf-label { font-family: var(--ff-sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--red); margin-bottom: 14px; }
.kf-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 18px 32px; }
.kf-item { border-top: var(--rule-item); padding-top: 12px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kf-num { font-family: var(--ff-serif); font-size: 40px; line-height: 1; font-weight: 700; letter-spacing: -.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.kf-item:first-child .kf-num { color: var(--red); }
.kf-desc { font-family: var(--ff-sans); font-size: 14px; line-height: 1.45; color: var(--body); }

/* ── Врезки: вывод редакции / пояснение / предупреждение ── */
.callout { margin: 28px 0 32px; padding: 18px 22px 4px; background: var(--tint); border-top: var(--rule-block); }
.callout-label, .callout-title { display: block; font-family: var(--ff-sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin: 0 0 8px; }
.callout p, .callout-text, .callout-body { font-size: 17px; line-height: 1.55; color: #222; margin: 0 0 14px; }
/* Вывод редакции — самый сильный голос: без фона, толстая линейка, крупный текст */
.callout--tip { background: transparent; border-top: var(--rule-section); border-bottom: var(--rule-block); padding: 14px 0 6px; }
.callout--tip .callout-label, .callout--tip .callout-title { color: var(--red); }
.callout--tip p, .callout--tip .callout-text, .callout--tip .callout-body { font-size: 21px; line-height: 1.45; font-weight: 500; color: var(--ink); }
/* Пояснение — серая плашка (база) */
.callout--info { }
/* Предупреждение — красная рамка */
.callout--warn { background: var(--paper); border: 1px solid var(--red); padding: 16px 20px 2px; }
.callout--warn .callout-label, .callout--warn .callout-title { color: var(--red); }
.callout--warn .callout-label::before, .callout--warn .callout-title::before { content: '! '; font-weight: 700; }

/* ── Цифра в тексте ── */
.inline-stat { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; box-shadow: inset 0 -2px 0 var(--red); padding: 0 1px; }
.inline-stat .is-num { font-weight: 700; white-space: nowrap; }
.inline-stat .is-unit { font-weight: 600; font-size: .88em; color: var(--body); margin-left: 1px; }

/* ── Цитата ── */
.pullquote { margin: 40px 0; padding: 18px 0 0; border-top: var(--rule-section); font-family: var(--ff-serif); font-size: 26px; line-height: 1.3; font-style: italic; font-weight: 400; color: var(--ink); text-wrap: balance; }
.pullquote::before { content: '«'; color: var(--red); font-style: normal; font-weight: 700; margin-right: 2px; }
.pullquote:not(:has(.pullquote-text))::after { content: '»'; color: var(--red); font-style: normal; font-weight: 700; }
.pullquote-text { display: inline; }
.pullquote-text::after { content: '»'; color: var(--red); font-style: normal; font-weight: 700; }
.pullquote-source { display: block; margin-top: 12px; font-family: var(--ff-sans); font-size: 13px; font-style: normal; color: var(--muted); }

/* ── Методология ── */
.methodology-block { margin: 40px 0; padding: 18px 24px 6px; background: var(--tint); border-top: var(--rule-section); }
.methodology-label, .limitations-label, .footnotes-title { font-family: var(--ff-sans); font-size: 12px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); margin-bottom: 10px; }
.methodology-block h2, .limitations-block h2 { font-size: 23px; margin: 0 0 12px; padding-top: 0; border-top: 0; }
.methodology-block p { font-size: 16px; line-height: 1.6; }
.methodology-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 0 28px; margin-bottom: 14px; }
.meth-item { border-top: var(--rule-block); padding: 10px 0 14px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.meth-item-title { font-family: var(--ff-sans); font-size: 14px; font-weight: 600; color: var(--ink); }
.meth-item-text { font-size: 15px; line-height: 1.5; color: var(--body); }
.meth-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.meth-chip { font-family: var(--ff-mono); font-size: 12px; line-height: 1.4; border: 1px solid var(--ink); padding: 2px 8px; color: var(--ink); background: var(--paper); }

/* ── Ограничения ── */
.limitations-block { margin: 40px 0; padding: 18px 24px 6px; border: 1px solid var(--red); border-top-width: 4px; }
.limitations-label { color: var(--red); }
.limitations-block ul, .limitations-list { list-style: none; padding: 0; margin: 0 0 12px; counter-reset: lim; }
.limitations-block li, .limitations-list li { counter-increment: lim; position: relative; padding: 10px 0 10px 40px; margin: 0; border-top: var(--rule-item); font-size: 16px; line-height: 1.55; }
.limitations-block li::before, .limitations-list li::before { content: counter(lim, decimal-leading-zero); position: absolute; left: 0; top: 12px; font-family: var(--ff-mono); font-size: 12px; color: var(--red); }

/* ── Источники ── */
.footnotes { margin: 48px 0 0; border-top: var(--rule-section); padding-top: 12px; font-family: var(--ff-sans); }
.footnote-item { position: relative; padding: 9px 0 9px 40px; border-bottom: var(--rule-item); font-size: 14px; line-height: 1.5; color: var(--body); overflow-wrap: anywhere; }
.footnote-num { position: absolute; left: 0; top: 9px; font-family: var(--ff-mono); font-size: 12px; line-height: 21px; color: var(--red); }
.footnote-item a { font-weight: 500; }
.footnote-num + br { display: none; } /* WordPress вставляет <br> между номером и текстом — разметку не трогаем */

/* ── FAQ ── */
.faq-section { margin: 20px 0 32px; border-top: var(--rule-section); }
.faq-item { padding: 16px 0 4px; border-bottom: var(--rule-item); }
.faq-item h3 { margin: 0 0 8px; font-size: 20px; line-height: 1.3; }
.faq-item p { font-size: 17px; line-height: 1.6; margin: 0 0 12px; }

/* ── Призыв в статье ── */
.article-cta { margin: 36px 0; padding: 20px 24px; background: var(--ink); color: var(--paper) !important; font-family: var(--ff-sans); font-size: 16px; line-height: 1.55; }
.article-content .article-cta a { display: inline-block; margin-top: 8px; color: var(--paper); font-weight: 600; text-decoration: none; border-bottom: 2px solid var(--red-on-ink); padding-bottom: 2px; }
.article-content .article-cta a:hover { color: var(--red-on-ink); }

/* ── Телефон ── */
@media (max-width: 640px) {
  .article-content { font-size: 17px; }
  .article-content h2 { font-size: 25px; margin-top: 44px; }
  .article-content h3 { font-size: 20px; }
  .article-content table { font-size: 13px; margin-right: -16px; }
  .kf-num { font-size: 30px; overflow-wrap: break-word; hyphens: auto; } /* бывают не цифры, а длинные слова */
  .kf-grid { grid-template-columns: 1fr 1fr; gap: 16px 18px; }
  .kf-item:nth-child(odd):last-child { grid-column: 1 / -1; }
  .callout--tip p, .callout--tip .callout-text { font-size: 19px; }
  .pullquote { font-size: 22px; }
  .methodology-block, .limitations-block { padding-left: 16px; padding-right: 16px; }
  .limitations-block li, .limitations-list li { padding-left: 32px; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
