/* ============================================================
   Блоки внутри тела новостной статьи (.prose-article)
   ------------------------------------------------------------
   Контент статей приходит из БД и опирается на классы
   custom-…, cert-st1-…, doc-checklist-…, eeat-signal. Часть из них
   никогда не имела стилей — блоки разваливались в плоские
   серые прямоугольники, а «Источники» уезжали за контейнер.
   Файл подключается последним, поэтому правила здесь
   перебивают inline-<style> статьи при равной специфичности.
   Иконки — лигатуры шрифта Material Symbols Outlined,
   он уже подключён в <head> article.php.
   ============================================================ */

.prose-article [data-icon]::before,
.prose-article .art-check-list li::before,
.prose-article .art-keypoints ul li::before,
.prose-article .doc-checklist-item::before,
.prose-article .custom-warning-block::before,
.prose-article p.eeat-signal::before,
.prose-article .custom-highlight-box::after,
.prose-article .art-keypoints h2::before {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Внутри карточек и списков текст не растягиваем по ширине:
   в узкой колонке justify рвёт строки огромными пробелами. */
.prose-article .custom-grid-item p,
.prose-article .custom-step-content p,
.prose-article .doc-checklist-item p,
.prose-article .art-check-list li,
.prose-article .art-keypoints ul li,
.prose-article .custom-highlight-box p,
.prose-article .art-contact-row {
    text-align: left;
    hyphens: none;
}

/* ---------- Иконка у заголовка (data-icon проставляет article.php) ---------- */
.prose-article h2[data-icon],
.prose-article h3[data-icon],
.prose-article h4[data-icon] {
    display: flex;
    align-items: center;
    gap: 12px;
}

.prose-article h2[data-icon]::before,
.prose-article h3[data-icon]::before,
.prose-article h4[data-icon]::before {
    content: attr(data-icon);
    flex: 0 0 auto;
    color: #8083ff;
    font-size: 30px;
}

.prose-article h3[data-icon]::before { font-size: 24px; }
.prose-article h4[data-icon]::before { font-size: 22px; }

/* ---------- Сетка карточек ---------- */
.prose-article .custom-grid,
.prose-article .custom-st1-grid,
.prose-article .custom-cards-grid {
    /* !important — легаси-правило .article-body > div:not([style*=...]) в
       article-content-styles.css имеет более высокую специфичность. */
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 268px), 1fr)) !important;
    gap: 16px;
    margin: 28px 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.prose-article .custom-grid-item {
    display: block;
    background: #fff;
    border: 1px solid rgba(128, 131, 255, .18);
    border-radius: 16px;
    padding: 22px 22px 20px;
    margin: 0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.prose-article .custom-grid-item:hover {
    transform: translateY(-2px);
    border-color: rgba(128, 131, 255, .42);
    box-shadow: 0 18px 40px rgba(15, 23, 42, .1);
}

.prose-article .custom-grid-item h3,
.prose-article .custom-grid-item h4 {
    display: block;
    margin: 0 0 8px;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.3;
    color: #0A1224;
}

/* В карточке иконка — плиткой над заголовком, а не строкой слева */
.prose-article .custom-grid-item h3[data-icon],
.prose-article .custom-grid-item h4[data-icon] {
    display: block;
}

.prose-article .custom-grid-item h3[data-icon]::before,
.prose-article .custom-grid-item h4[data-icon]::before {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 14px;
    border-radius: 13px;
    background: linear-gradient(135deg, rgba(128, 131, 255, .16), rgba(128, 131, 255, .05));
    font-size: 24px;
    overflow: hidden; /* пока шрифт иконок не загрузился, имя лигатуры не должно вылезать */
}

.prose-article .custom-grid-item p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.6;
    color: #4a5a76;
}

.prose-article .custom-grid-item p + p { margin-top: .7em; }

/* ---------- Экспертная ремарка E-E-A-T ---------- */
.prose-article p.eeat-signal {
    position: relative;
    margin: 26px 0;
    padding: 20px 24px 20px 58px;
    background: linear-gradient(180deg, #F8F9FF 0%, #F3F4FF 100%);
    border: 1px solid rgba(128, 131, 255, .22);
    border-left: 4px solid #8083ff;
    border-radius: 0 14px 14px 0;
    color: #31406b;
    font-size: 16px;
    line-height: 1.7;
}

.prose-article p.eeat-signal::before {
    content: 'verified';
    position: absolute;
    left: 18px;
    top: 19px;
    font-size: 25px;
    color: #8083ff;
}

/* ---------- Предупреждение / важное ---------- */
.prose-article .custom-warning-block {
    display: block !important;
    position: relative;
    margin: 28px 0 !important;
    padding: 24px 26px 24px 60px !important;
    background: linear-gradient(180deg, #FFFAF1 0%, #FFF5E6 100%);
    border: 1px solid rgba(217, 119, 6, .26);
    border-left: 4px solid #F59E0B;
    border-radius: 0 16px 16px 0;
    box-shadow: 0 10px 30px rgba(180, 120, 20, .08);
}

.prose-article .custom-warning-block::before {
    content: 'warning';
    position: absolute;
    left: 18px;
    top: 24px;
    font-size: 26px;
    color: #D97706;
}

.prose-article .custom-warning-block h3,
.prose-article .custom-warning-block h4 {
    margin: 0 0 12px;
    font-family: 'Manrope', sans-serif;
    font-size: 19px;
    line-height: 1.3;
    color: #8A4B08;
}

.prose-article .custom-warning-block p {
    margin: 0 0 12px;
    color: #5D4522;
    font-size: 16px;
    line-height: 1.7;
}

.prose-article .custom-warning-block p:last-child { margin-bottom: 0; }

/* ---------- Пошаговый процесс ---------- */
.prose-article .custom-process-steps {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px;
    margin: 28px 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.prose-article .custom-process-step {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin: 0;
    padding: 18px 22px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .05);
}

.prose-article .custom-step-number {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, #8083ff 0%, #5a5ee0 100%);
    color: #fff;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 15px;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(128, 131, 255, .38);
}

.prose-article .custom-step-content { flex: 1 1 auto; min-width: 0; }

.prose-article .custom-step-content h4 {
    margin: 0 0 6px;
    font-family: 'Manrope', sans-serif;
    font-weight: 700;
    font-size: 17px;
    line-height: 1.35;
    color: #0A1224;
}

.prose-article .custom-step-content p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: #4a5a76;
}

/* ---------- Чек-лист документов ---------- */
.prose-article .cert-st1-section {
    display: block !important;
    margin: 26px 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
}

.prose-article .doc-checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin: 10px 0;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 14px;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.prose-article .doc-checklist-item::before {
    content: 'task_alt';
    flex: 0 0 auto;
    margin-top: 3px;
    font-size: 22px;
    color: #8083ff;
}

.prose-article .doc-checklist-item p {
    margin: 0;
    font-size: 15.5px;
    line-height: 1.65;
    color: #4a5a76;
}

.prose-article .doc-checklist-item p strong {
    font-family: 'Manrope', sans-serif;
    font-size: 16px;
}

/* ---------- Список с галочками (из строк с ✅) ---------- */
.prose-article ul.art-check-list {
    margin: 1em 0 1.4em;
    padding-left: 0;
    list-style: none;
}

.prose-article ul.art-check-list li {
    position: relative;
    margin-bottom: .6em;
    padding-left: 30px;
    font-size: 16.5px;
    line-height: 1.65;
    color: #334155;
}

.prose-article ul.art-check-list li::before {
    content: 'check_circle';
    position: absolute;
    left: 0;
    top: 1px;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: #16A34A;
    font-size: 20px;
}

/* ---------- «Главное коротко» — ключевые тезисы в рамке ---------- */
.prose-article .art-keypoints {
    display: block !important;
    margin: 32px 0 !important;
    padding: 26px 28px !important;
    background: linear-gradient(180deg, #F8F9FF 0%, #F1F3FF 100%);
    border: 1px solid rgba(128, 131, 255, .26);
    border-radius: 18px;
    box-shadow: 0 18px 44px rgba(15, 23, 42, .07);
}

.prose-article .art-keypoints h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    padding-bottom: 0;
    font-size: 22px;
}

.prose-article .art-keypoints h2::after { display: none; }

.prose-article .art-keypoints h2::before {
    content: 'bookmark_added';
    flex: 0 0 auto;
    color: #8083ff;
    font-size: 26px;
}

.prose-article .art-keypoints ul {
    margin: 0;
    padding-left: 0;
    list-style: none;
}

.prose-article .art-keypoints ul li {
    position: relative;
    margin-bottom: .75em;
    padding-left: 32px;
    font-size: 16.5px;
    line-height: 1.65;
    color: #22314f;
}

.prose-article .art-keypoints ul li:last-child { margin-bottom: 0; }

.prose-article .art-keypoints ul li::before {
    content: 'check_circle';
    position: absolute;
    left: 0;
    top: 1px;
    width: auto;
    height: auto;
    border-radius: 0;
    background: none;
    color: #8083ff;
    font-size: 20px;
}

/* ---------- Контактный блок / призыв оставить заявку ---------- */
.prose-article .custom-highlight-box {
    display: block !important;
    position: relative;
    overflow: hidden;
    margin: 30px 0 !important;
    padding: 30px 34px !important;
    background: linear-gradient(135deg, #131A3C 0%, #212752 55%, #2E3269 100%);
    border: none;
    border-radius: 20px;
    box-shadow: 0 26px 58px rgba(19, 26, 60, .28);
    color: #fff;
}

.prose-article .custom-highlight-box::after {
    content: 'support_agent';
    position: absolute;
    right: -14px;
    bottom: -26px;
    font-size: 158px;
    color: rgba(255, 255, 255, .07);
    pointer-events: none;
}

.prose-article .custom-highlight-box h2,
.prose-article .custom-highlight-box h3,
.prose-article .custom-highlight-box h4 {
    position: relative;
    z-index: 1;
    margin: 0 0 16px;
    padding-bottom: 0;
    font-family: 'Manrope', sans-serif;
    font-weight: 800;
    font-size: 23px;
    line-height: 1.3;
    /* .article-body h3 в article-content-styles.css объявлен через !important */
    color: #fff !important;
}

.prose-article .custom-highlight-box h2::after,
.prose-article .custom-highlight-box h3::after { display: none; }

.prose-article .custom-highlight-box p {
    position: relative;
    z-index: 1;
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.7;
    color: rgba(255, 255, 255, .9);
}

.prose-article .custom-highlight-box p:last-child { margin-bottom: 0; }

.prose-article .custom-highlight-box a {
    color: #fff;
    font-weight: 700;
    border-bottom: 1px solid rgba(255, 255, 255, .45);
}

.prose-article .custom-highlight-box a:hover { border-bottom-color: #fff; }

/* Контакты строками с иконками */
.prose-article .art-contact-row {
    position: relative;
    z-index: 1;
    display: flex !important;
    align-items: center;
    gap: 12px;
    margin: 0 0 10px !important;
    padding: 0 !important;
    background: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
}

.prose-article .art-contact-row:last-child { margin-bottom: 0 !important; }

.prose-article .art-contact-row .art-contact-ico {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .1);
    overflow: hidden;
    font-family: 'Material Symbols Outlined';
    font-size: 20px;
    color: #fff;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

.prose-article .art-contact-row .art-contact-label {
    display: block;
    font-size: 12px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

.prose-article .art-contact-row a {
    font-family: 'Manrope', sans-serif;
    font-size: 18px;
    font-weight: 800;
    border-bottom: none;
}

.prose-article .art-contact-row a:hover { border-bottom: 1px solid rgba(255, 255, 255, .6); }

/* ---------- Сравнительная таблица ---------- */
.prose-article .art-table-scroll {
    display: block !important;
    margin: 28px 0 !important;
    padding: 0 !important;
    background: none !important;
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.prose-article .art-table-scroll > table { margin: 0; }

.prose-article table.custom-comparison-table {
    width: 100%;
    min-width: 520px;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 16px;
    overflow: hidden;
    background: #fff;
}

.prose-article table.custom-comparison-table th {
    padding: 15px 20px;
    text-align: left;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
    line-height: 1.4;
    vertical-align: top;
}

.prose-article table.custom-comparison-table td {
    padding: 15px 20px;
    border-top: 1px solid rgba(15, 23, 42, .07);
    font-size: 15.5px;
    line-height: 1.6;
    color: #4a5a76;
    vertical-align: top;
}

.prose-article table.custom-comparison-table tbody tr:nth-child(even) td { background: #FAFBFF; }

.prose-article table.custom-comparison-table td:first-child {
    width: 36%;
    font-weight: 600;
    color: #0A1224;
}

/* ---------- Источники ---------- */
.prose-article .art-sources {
    display: block !important;
    margin: 30px 0 0 !important;
    padding: 22px 26px !important;
    background: #F8FAFC;
    border: 1px solid rgba(15, 23, 42, .08);
    border-radius: 16px;
    box-shadow: none;
}

.prose-article .art-sources h2 {
    margin: 0 0 12px;
    padding-bottom: 0;
    font-size: 18px;
    letter-spacing: .04em;
    text-transform: uppercase;
    color: #64748B;
}

.prose-article .art-sources h2::after { display: none; }

.prose-article .art-sources ul { margin: 0; }

.prose-article .art-sources ul li { margin-bottom: .4em; font-size: 15.5px; }

.prose-article .art-sources ul li::before { background: #CBD5E1; }

/* ---------- Мобильная адаптация ----------
   article-content-styles.css на ширине ≤768px принудительно
   переводит прямых потомков .article-body в display:block,
   поэтому здесь возвращаем flex/grid с !important. */
@media (max-width: 768px) {
    .prose-article .custom-grid,
    .prose-article .custom-st1-grid,
    .prose-article .custom-cards-grid,
    .prose-article .custom-process-steps {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 14px;
        margin: 24px 0 !important;
        padding: 0 !important;
    }

    .prose-article .custom-grid-item,
    .prose-article .doc-checklist-item,
    .prose-article .custom-process-step {
        padding: 18px !important;
        margin: 0 0 12px !important;
    }

    .prose-article .custom-process-step { display: flex !important; }

    .prose-article .doc-checklist-item { display: flex !important; margin: 0 0 10px !important; }

    .prose-article .custom-highlight-box {
        padding: 24px 20px !important;
        margin: 24px 0 !important;
    }

    .prose-article .custom-highlight-box::after { font-size: 118px; }

    .prose-article .custom-warning-block {
        padding: 20px 18px 20px 52px !important;
        margin: 24px 0 !important;
    }

    .prose-article .custom-warning-block::before { left: 15px; top: 21px; font-size: 23px; }

    .prose-article p.eeat-signal {
        padding: 18px 18px 18px 50px;
        font-size: 15.5px;
    }

    .prose-article p.eeat-signal::before { left: 15px; top: 17px; font-size: 22px; }

    .prose-article .art-keypoints { padding: 20px 18px !important; margin: 26px 0 !important; }

    .prose-article .art-keypoints h2 { font-size: 20px; }

    .prose-article .art-sources { padding: 18px !important; margin: 24px 0 0 !important; }

    .prose-article h2[data-icon]::before { font-size: 25px; }
}
