/* Статья журнала (2026-11-29, docs/type-journal-2026-11/mockups): оглавление, ширина строки, таблицы карточками на телефоне.
   Подключается в header.php только на is_singular('post'). Разметку оглавления и data-label у ячеек добавляет inc/journal.php. */

/* Строка текста не шире ~75 знаков; таблицы и картинки — на всю ширину колонки */
.m2-article > p, .m2-article > ul, .m2-article > ol, .m2-article > h2, .m2-article > h3, .m2-article > h4,
.m2-article > blockquote, .m2-article > .art-toc-m { max-width: 760px; }
.m2-article h2[id] { scroll-margin-top: 140px; }
#faq { scroll-margin-top: 140px; }

/* Оглавление справа: прилипает при прокрутке */
.sidebar .art-toc { position: sticky; top: 140px; align-self: flex-start; }
.art-toc h3 { margin: 0 0 12px; }
.art-toc ol, .art-toc-m ol { margin: 0; padding-left: 20px; font-size: 15px; line-height: 1.45; }
.art-toc li, .art-toc-m li { margin-bottom: 8px; }

/* Оглавление на узком экране — раскрываемый блок перед первым разделом */
.art-toc-m { display: none; margin: 0 0 24px; padding: 12px 16px; border: 1px solid #e3e8ef; border-radius: 6px; background: #f7f8fb; font-size: 16px; }
.art-toc-m summary { cursor: pointer; font-weight: 700; color: #1a2433; }
.art-toc-m ol { margin-top: 10px; }
@media (max-width: 1169px) {
    .art-toc-m { display: block; }
    .sidebar .art-toc { display: none; }
}

/* Таблицы с шапкой из 3–5 колонок на телефоне — карточками, без прокрутки вбок */
@media (max-width: 767px) {
    .article-content table.m2-cards { min-width: 0; }
    .article-table-shell:has(table.m2-cards) .article-table-hint { display: none; }
    .article-table-shell:has(table.m2-cards) .article-table-scroll { overflow: visible; border: 0; background: none; }
    .article-content table.m2-cards,
    .article-content table.m2-cards tbody,
    .article-content table.m2-cards tr,
    .article-content table.m2-cards td { display: block; width: auto; }
    .article-content table.m2-cards thead,
    .article-content table.m2-cards tr:has(th) { display: none; }
    .article-content table.m2-cards caption { display: block; }
    .article-content table.m2-cards tr { margin: 0 0 8px; padding: 12px; border: 1px solid #e3e8ef; border-radius: 6px; background: #fff; }
    .article-content table.m2-cards td { padding: 0 0 6px; border: 0; background: none; font-size: 14px; line-height: 1.45; }
    .article-content table.m2-cards td::before { content: attr(data-label); display: block; margin-top: 4px; color: #5f6b7a; font-size: 12px; }
    .article-content table.m2-cards td:first-child { font-size: 15px; font-weight: 700; color: #1a2433; }
    .article-content table.m2-cards td:first-child::before { display: none; }
    /* «зебра» и начертание из article-tables.css сильнее по специфичности */
    .article-table-shell .article-content table.m2-cards tr td,
    .article-content .article-table-shell table.m2-cards tr td { background: none !important; }
    .article-content .article-table-shell table.m2-cards tr td:first-child { font-weight: 700 !important; color: #1a2433; }
}
