/* Статья раздела «Информация заказчику» — netcat_template/module/article_page.php (макет 01.10.2026).
   Все правила — внутри main.tpa: остальные страницы компонента «Статья» (услуги, отраслевые решения)
   и сам main.css не затрагиваются. Текст статьи лежит в .tpa-text.article_page — старые правила
   main.css для содержимого статей (таблицы, .imolo, .vazhno, .vorota) продолжают работать, ниже — только
   то, что меняет макет. */

html:has(main.tpa) {
    scroll-behavior: smooth;
}

/* body с overflow-x:hidden (main.css) — контейнер прокрутки, и position:sticky внутри него не работает;
   clip режет так же, но контейнером прокрутки не делает */
html:has(main.tpa) body {
    overflow-x: clip;
}

.tpa {
    padding-bottom: 80px;
}

/* ===== Шапка статьи ===== */
.tpa .tpa-head {
    padding-top: 28px;
}

.tpa .tpa-h1 {
    max-width: 980px;
    margin: 0 0 22px;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 500;
    font-size: 40px;
    line-height: 1.2;
}

.tpa .tpa-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
}

.tpa .tpa-chip {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    color: rgba(255, 255, 255, .62);
    font-size: 13px;
    line-height: 1.4;
}

.tpa a.tpa-chip--o {
    border-color: #FF5A00;
    color: #ff7a3d;
    transition: background .15s, color .15s;
}

.tpa a.tpa-chip--o:hover {
    background: #FF5A00;
    color: #fff;
}

.tpa .tpa-cover {
    aspect-ratio: 1195 / 500;
    overflow: hidden;
    background: #1d2332;
}

.tpa .tpa-cover img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ===== Текст + липкая колонка ===== */
.tpa .tpa-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 56px;
    padding-top: 48px;
}

.tpa .tpa-text {
    min-width: 0;
    color: rgba(255, 255, 255, .86);
    font-size: 17px;
    line-height: 1.72;
}

.tpa .tpa-text p {
    margin: 0 0 18px;
    line-height: 1.72;
    word-spacing: normal;
}

.tpa .tpa-text h2,
.tpa .tpa-text h3,
.tpa .tpa-text h4 {
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
}

.tpa .tpa-text h2 {
    margin: 48px 0 18px;
    font-weight: 500;
    font-size: 28px;
    line-height: 1.25;
}

.tpa .tpa-text h3 {
    margin: 36px 0 14px;
    font-weight: 500;
    font-size: 22px;
    line-height: 1.3;
}

.tpa .tpa-text h4 {
    margin: 26px 0 12px;
    font-weight: 700;
    font-size: 15px;
    line-height: 1.4;
    letter-spacing: .03em;
    text-transform: uppercase;
}

.tpa .tpa-text > :first-child,
.tpa .tpa-text > :first-child > :first-child,
.tpa .tpa-text > :first-child > :first-child > :first-child {
    margin-top: 0;
}

/* в старых текстах после заголовков стоит <br> */
.tpa .tpa-text h2 + br,
.tpa .tpa-text h3 + br,
.tpa .tpa-text h4 + br {
    display: none;
}

.tpa .tpa-text [id] {
    scroll-margin-top: 140px;
}

.tpa .tpa-text b,
.tpa .tpa-text strong {
    color: #fff;
}

.tpa .tpa-text a:not([class]) {
    color: #ff7a3d;
    text-decoration: underline;
}

.tpa .tpa-text a:not([class]):hover {
    color: #fff;
}

.tpa .tpa-text ul,
.tpa .tpa-text ol {
    margin: 0 0 18px;
    padding-left: 22px;
}

.tpa .tpa-text ul {
    list-style: disc;
}

.tpa .tpa-text ol {
    list-style: decimal;
}

.tpa .tpa-text li {
    margin: 0 0 6px;
    line-height: 1.6;
}

.tpa .tpa-text blockquote {
    margin: 0 0 18px;
    padding: 20px 24px;
    border-left: 3px solid #FF5A00;
    background: rgba(255, 255, 255, .04);
}

.tpa .tpa-text blockquote p:last-child {
    margin-bottom: 0;
}

.tpa .tpa-text img {
    max-width: 100%;
}

/* формулы (.invert) — в своём размере, а не на всю ширину колонки */
.tpa .tpa-text .invert img {
    width: auto;
    height: auto !important;
}

/* обёртку .tpa-table ставит шаблон: широкая таблица прокручивается внутри колонки */
.tpa .tpa-table {
    max-width: 100%;
    margin: 0 0 24px;
    overflow-x: auto;
}

.tpa .tpa-text table {
    margin: 0;
    font-size: 15px;
    line-height: 1.5;
}

.tpa .tpa-text table p {
    margin: 0;
    line-height: inherit;
}

/* вложенный .container внутри текста — по ширине колонки */
.tpa .tpa-text .container {
    width: auto;
    max-width: none;
    margin: 0;
}

/* двухколоночные врезки старой вёрстки — в одну колонку */
.tpa .tpa-text .molo {
    display: block;
    margin: 0;
}

.tpa .tpa-text .molo > div {
    display: block;
    width: auto;
}

.tpa .tpa-text .imolo {
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 24px;
}

.tpa .tpa-text .imolo > div:first-child {
    margin-right: 0;
}

.tpa .tpa-text .imolo > div > div {
    width: 100%;
    max-width: 557px;
}

/* ===== Призыв в середине статьи ===== */
.tpa .tpa-mid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    margin: 40px 0;
    padding: 28px 30px;
    background: #FF5A00;
}

.tpa .tpa-mid-t {
    margin-bottom: 6px;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
}

.tpa .tpa-text .tpa-mid p {
    margin: 0;
    color: #fff;
    font-size: 15px;
    line-height: 1.5;
    opacity: .95;
}

.tpa .tpa-mid .tpa-btn {
    flex: 0 0 auto;
    min-width: 230px;
}

/* ===== Кнопки ===== */
.tpa .tpa-btn {
    display: block;
    padding: 14px 16px;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
    letter-spacing: .04em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
    transition: background .15s;
}

.tpa .tpa-btn--d {
    background: #252C3D;
}

.tpa .tpa-btn--d:hover {
    background: #1b212c;
    color: #fff;
}

.tpa .tpa-btn--w {
    margin-top: 10px;
    padding: 12px 16px;
    border: 2px solid #fff;
}

.tpa .tpa-btn--w:hover {
    background: rgba(255, 255, 255, .12);
    color: #fff;
}

/* ===== Колонка: содержание + карточка расчёта ===== */
.tpa .tpa-aside {
    min-width: 0;
}

.tpa .tpa-stick {
    position: sticky;
    top: 135px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.tpa .tpa-toc {
    padding: 20px 22px 16px;
    border-top: 3px solid #FF5A00;
    background: #1d2332;
}

.tpa .tpa-toc-h {
    display: block;
    width: 100%;
    margin: 0 0 10px;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 15px;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
    cursor: default;
    pointer-events: none;
}

.tpa .tpa-toc ol {
    position: relative;
    /* колонка прилипает в 135px от верха: оглавление и карточка расчёта должны поместиться в экран */
    max-height: max(120px, calc(100vh - 590px));
    margin: 0;
    padding: 0;
    overflow: auto;
    list-style: none;
    counter-reset: tpa;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .25) transparent;
}

.tpa .tpa-toc ol::-webkit-scrollbar {
    width: 4px;
}

.tpa .tpa-toc ol::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .25);
}

.tpa .tpa-toc li {
    margin: 0;
    counter-increment: tpa;
}

.tpa .tpa-toc a {
    display: flex;
    gap: 10px;
    padding: 7px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .12);
    color: rgba(255, 255, 255, .62);
    font-size: 14px;
    line-height: 1.4;
    text-decoration: none;
    transition: color .15s;
}

.tpa .tpa-toc li:last-child a {
    border-bottom: 0;
}

.tpa .tpa-toc a::before {
    content: counter(tpa, decimal-leading-zero);
    flex: 0 0 auto;
    padding-top: 1px;
    color: #ff7a3d;
    font-size: 12px;
}

.tpa .tpa-toc a:hover,
.tpa .tpa-toc a.is-active {
    color: #fff;
}

.tpa .tpa-card {
    padding: 26px 24px;
    background: #FF5A00;
    color: #fff;
}

.tpa .tpa-card-t {
    margin-bottom: 10px;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 22px;
    line-height: 1.2;
}

.tpa .tpa-card p {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.45;
    opacity: .95;
}

.tpa .tpa-card-c {
    margin-top: 16px;
    text-align: center;
}

.tpa .tpa-card-ph {
    display: block;
    color: #fff;
    font-family: Roboto, Arial, sans-serif;
    font-weight: 700;
    font-size: 18px;
    text-decoration: none;
}

.tpa .tpa-card-m {
    display: inline-block;
    margin-top: 2px;
    color: #fff;
    font-size: 12px;
    text-decoration: none;
    opacity: .85;
}

.tpa .tpa-card-ph:hover,
.tpa .tpa-card-m:hover {
    text-decoration: underline;
}

/* ===== Похожие статьи — как «Новости компании» на главной ===== */
.tpa .tpa-rel {
    padding-top: 64px;
}

.tpa .tpa-rel-h {
    margin: 0 0 20px;
    color: #fff;
    font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
    font-weight: 700;
    font-size: 24px;
    line-height: 1.2;
    text-transform: uppercase;
}

.tpa .tpa-rel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.tpa .tpa-rel-card {
    display: block;
    color: #fff;
    text-decoration: none;
}

.tpa .tpa-rel-ph {
    display: block;
    height: 268px;
    overflow: hidden;
    background: #1d2332;
}

.tpa .tpa-rel-ph img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 1s;
}

.tpa .tpa-rel-card:hover img {
    transform: scale(1.03);
}

.tpa .tpa-rel-t {
    display: -webkit-box;
    min-height: 44px;
    margin: 27px 0 10px;
    overflow: hidden;
    font-family: Roboto, sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 22px;
    letter-spacing: 1px;
    text-transform: uppercase;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .2s;
}

.tpa .tpa-rel-card:hover .tpa-rel-t {
    color: #ff7a3d;
}

.tpa .tpa-rel-r {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
}

.tpa .tpa-rel-x {
    display: -webkit-box;
    overflow: hidden;
    color: #A6A6A6;
    font-size: 16px;
    line-height: 22px;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    transition: color .2s;
}

.tpa .tpa-rel-card:hover .tpa-rel-x {
    color: #ccc;
}

.tpa .tpa-rel-all {
    margin-top: 16px;
}

/* ===== Планшет ===== */
@media (max-width: 1080px) {
    .tpa .tpa-body {
        display: flex;
        flex-direction: column;
        gap: 28px;
        padding-top: 32px;
    }

    /* оглавление — перед текстом, свёрнутое; карточка расчёта не нужна: есть призыв и форма */
    .tpa .tpa-aside {
        order: -1;
    }

    .tpa .tpa-stick {
        position: static;
    }

    .tpa .tpa-card {
        display: none;
    }

    .tpa .tpa-toc ol {
        max-height: none;
    }

    .tpa .tpa-toc-h {
        position: relative;
        margin: 0;
        padding-right: 28px;
        cursor: pointer;
        pointer-events: auto;
    }

    .tpa .tpa-toc-h::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 4px;
        width: 8px;
        height: 8px;
        border-right: 2px solid #ff7a3d;
        border-bottom: 2px solid #ff7a3d;
        transform: translateY(-70%) rotate(45deg);
        transition: transform .2s;
    }

    .tpa .tpa-toc.is-open .tpa-toc-h::after {
        transform: translateY(-30%) rotate(-135deg);
    }

    .tpa .tpa-toc--js ol {
        display: none;
    }

    .tpa .tpa-toc--js.is-open ol {
        display: block;
        margin-top: 10px;
    }

    .tpa .tpa-rel-ph {
        height: 200px;
    }
}

/* ===== Телефон ===== */
@media (max-width: 767px) {
    .tpa .tpa-head {
        padding-top: 16px;
    }

    .tpa .tpa-h1 {
        font-size: 28px;
    }

    .tpa .tpa-text {
        font-size: 16px;
    }

    .tpa .tpa-text h2 {
        margin-top: 40px;
        font-size: 23px;
    }

    .tpa .tpa-text h3 {
        font-size: 19px;
    }

    .tpa .tpa-mid {
        flex-direction: column;
        align-items: stretch;
        padding: 24px 20px;
    }

    .tpa .tpa-mid-t {
        font-size: 21px;
    }

    .tpa .tpa-mid .tpa-btn {
        min-width: 0;
    }

    .tpa .tpa-rel {
        padding-top: 48px;
    }

    .tpa .tpa-rel-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 36px;
    }

    .tpa .tpa-rel-ph {
        height: 220px;
    }
}
