/*
 * Типографика контентных страниц (шаблон content.php).
 * Оформляет HTML, приходящий из редактора внутри .text-content.
 * Класс отдельный: .topic (новости) превращает strong в тёмную плашку,
 * а .main-content общий со страницами /docs/.
 * Версия — по filemtime в provodnik_scripts(), бампать вручную не нужно.
 */

/*
 * Отступ над хлебными крошками: .section даёт 60px сверху (30px на мобильных)
 * плюс 23px от main — вместе почти сотня. Ужимаем, не трогая .section
 * и .n-block: они общие с новостями, контактами и документацией.
 */
.section-content {
    padding-top: 20px;
}

@media (max-width: 767px) {
    .section-content {
        padding-top: 10px;
    }
}

.text-content {
    max-width: 900px;
    font-weight: 300;
    font-size: 18px;
    line-height: 1.55;
    letter-spacing: -0.2px;
}

/* Контент не должен разъезжаться относительно шапки страницы */
.text-content > *:first-child {
    margin-top: 0;
}

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

.text-content h2 {
    margin: 60px 0 24px;
    font-weight: 300;
    font-size: 32px;
    line-height: 1.15;
}

.text-content h3 {
    margin: 40px 0 20px;
    font-weight: 400;
    font-size: 24px;
    line-height: 1.2;
}

.text-content p {
    margin: 20px 0;
}

.text-content a {
    text-decoration: underline;
}

.text-content a:hover {
    text-decoration: none;
}

.text-content strong {
    font-weight: 500;
}

/* Списки: штатные маркеры выключены, рисуются псевдоэлементами */
.text-content ul,
.text-content ol {
    margin: 24px 0;
    padding-left: 0;
    list-style: none;
}

.text-content li {
    position: relative;
    padding-left: 28px;
}

.text-content li + li {
    margin-top: 14px;
}

.text-content ul > li::before {
    content: "";
    position: absolute;
    top: 0.5em;
    left: 4px;
    width: 8px;
    height: 8px;
    background-color: var(--green);
    border-radius: 50%;
}

.text-content ol {
    counter-reset: text-content-item;
}

.text-content ol > li {
    counter-increment: text-content-item;
}

.text-content ol > li::before {
    content: counter(text-content-item) ".";
    position: absolute;
    left: 0;
    color: var(--green);
    font-weight: 400;
}

/* Таблицы: в style.min.css оформления для них нет вовсе */
.text-content table {
    width: 100%;
    margin: 32px 0;
    border-collapse: collapse;
    font-size: 16px;
    line-height: 1.45;
}

.text-content th,
.text-content td {
    padding: 14px 18px;
    border: 1px solid var(--grayLight);
    text-align: left;
    vertical-align: top;
}

.text-content th {
    font-weight: 400;
}

.text-content tbody tr:nth-child(even) {
    background-color: #fafafa;
}

@media (max-width: 768px) {
    .text-content {
        font-size: 16px;
    }

    .text-content h2 {
        margin: 40px 0 18px;
        font-size: 22px;
    }

    .text-content h3 {
        margin: 30px 0 16px;
        font-size: 20px;
    }

    .text-content p {
        margin: 16px 0;
    }

    /* Двухколоночная таблица иначе распирает вёрстку на узких экранах */
    .text-content table {
        display: block;
        overflow-x: auto;
        font-size: 15px;
    }

    .text-content th,
    .text-content td {
        padding: 10px 12px;
    }
}
