/* ---------- Лист статьи ---------- */
.bl-doc {
    border-radius: 0 0 24px 24px;
}

.bl-text {
    min-width: 0;
    color: var(--text-color);
    font-size: var(--fs-16);
    line-height: 1.6;
    letter-spacing: var(--ls-16);
}

.bl-text > * + * {
    margin-top: 14px;
}

.bl-text :is(h3, h4, h5) {
    margin-top: 28px;
    font-weight: var(--fw-semibold);
    line-height: 1.3;
}

.bl-text h3 { font-size: var(--fs-20, 20px); letter-spacing: -0.015em; }

.bl-text h4 { font-size: var(--fs-18, 18px); }

.bl-text h5 { font-size: var(--fs-16); }

.bl-text :is(h3, h4, h5) + * {
    margin-top: 8px;
}

.bl-text :is(ul, ol) {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 20px;
}

.bl-text li::marker {
    color: var(--text-muted);
}

.bl-text a:not([class]) {
    color: var(--bl-accent);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--bl-accent) 40%, transparent);
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease;
}

.bl-text a:not([class]):hover {
    text-decoration-color: currentColor;
}

/* Таблица: шапка серыми подписями, строки волосяными линиями */
.bl-text figure.table {
    overflow-x: auto;
    margin-top: 20px;
    margin-bottom: 20px;
}

.bl-text table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--fs-14);
    line-height: 1.45;
    letter-spacing: var(--ls-14);
}

.bl-text th {
    padding: 0 16px 10px 0;
    color: var(--text-muted);
    font-weight: var(--fw-regular);
    text-align: left;
    vertical-align: bottom;
}

.bl-text td {
    padding: 12px 16px 12px 0;
    border-top: 1px solid var(--bl-line);
    vertical-align: top;
}

.bl-text td:first-child {
    font-weight: var(--fw-medium);
}

.bl-text :is(th, td):last-child {
    padding-right: 0;
}

.bl-text :is(.example-box, .tip-box) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--surface-secondary);
    font-size: var(--fs-14);
    line-height: 1.5;
    letter-spacing: var(--ls-14);
}

.bl-text .tip-box {
    background: color-mix(in srgb, var(--bl-accent) 10%, transparent);
}

.bl-text figure.article-image {
    margin-top: 20px;
    margin-bottom: 20px;
}

.bl-text figure.article-image img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--bl-line);
    border-radius: 16px;
}

.bl-text figcaption {
    margin-top: 8px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    line-height: 1.4;
}

.bl-row-link:hover .bl-go,
.bl-feat:hover .bl-go {
    color: var(--bl-accent);
    transform: translateX(3px);
}

/* Текст статьи выводится одним куском, как в базе. Номер раздела и линию над ним рисует сам h2 */
.bl-doc {
    counter-reset: bl-section;
    padding: 28px 20px;
}

.bl-text {
    padding-left: 56px;
    font-size: var(--fs-16);
    line-height: 1.6;
    letter-spacing: var(--ls-16);
}

/* Строка текста не длиннее 680px; заголовки разделов, таблицы, картинки и вакансии занимают всю ширину листа */
.bl-text > :not(h2, figure, table, pre, .blog-recommended-jobs) {
    max-width: 680px;
}

.bl-text h2:not(.similar-jobs-title) {
    position: relative;
    margin-top: 28px;
    padding-top: 28px;
    counter-increment: bl-section;
    font-size: var(--fs-24);
    font-weight: var(--fw-semibold);
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-wrap: balance;
    scroll-margin-top: 88px;
}

.bl-text h2:not(.similar-jobs-title) + * {
    margin-top: 16px;
}

.bl-text h2:not(.similar-jobs-title)::before {
    content: counter(bl-section, decimal-leading-zero);
    position: absolute;
    top: 33px;
    left: -56px;
    color: var(--text-muted);
    font-size: var(--fs-14);
    font-weight: var(--fw-regular);
    line-height: var(--lh-14);
    letter-spacing: var(--ls-14);
    font-variant-numeric: tabular-nums;
}

.bl-text h2:not(.similar-jobs-title)::after {
    content: "";
    position: absolute;
    top: 0;
    right: -20px;
    left: -76px;
    border-top: 1px solid var(--bl-line);
}

/* Статья без вступления: первому разделу линия сверху не нужна */
.bl-text:first-child > h2:first-child {
    margin-top: 0;
    padding-top: 0;
}

.bl-text:first-child > h2:first-child::before {
    top: 5px;
}

.bl-text:first-child > h2:first-child::after {
    content: none;
}

.bl-text-tail {
    margin-top: 28px;
}

.bl-text pre {
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--surface-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', 'Consolas', monospace;
    font-size: var(--fs-14);
    line-height: 1.6;
    overflow-x: auto;
}

.bl-text :not(pre) > code {
    padding: 2px 6px;
    border-radius: 6px;
    background: var(--surface-secondary);
    font-family: 'JetBrains Mono', 'Fira Code', 'SFMono-Regular', 'Consolas', monospace;
    font-size: var(--fs-14);
}

.bl-text :is(.success-box, .warning-box) {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
    margin-bottom: 20px;
    padding: 16px 20px;
    border-radius: 16px;
    background: var(--surface-secondary);
}

.bl-text .success-box {
    background: color-mix(in srgb, var(--bl-accent) 10%, transparent);
}

.bl-text .text-muted {
    color: var(--text-muted);
}
