/* MES ARCHITECTURE: SYSTEM CORE v2.3 (DW-STYLE REPLICA)
   FONTS: Manrope (Headings & Read) + JetBrains Mono (System/UI)
   UPDATE: Радикальное усиление иерархии внутренних заголовков и фикс рендеринга Тильды
*/

:root {
    /* Цветовая палитра */
    --c-bg: #0e0e0e;
    --c-text: #cfcfcf;
    --c-white: #ffffff;
    --c-black: #111111;
    --c-accent: #DAAD38;
    --c-mes-orange: #ff9d00;
    
    /* Шрифтовая иерархия */
    --ff-heading: "Manrope", Inter, system-ui, sans-serif;
    --ff-body-read: "Manrope", Inter, sans-serif;
    --ff-system: "JetBrains Mono", monospace;
    
    /* Геометрия */
    --grid-max-width: 1200px;
    --read-max-width: 700px;
}

/* ====== 1. ГЛОБАЛЬНЫЕ СТИЛИ ====== */
body {
    background-color: var(--c-bg) !important;
    color: var(--c-text);
    font-family: var(--ff-body-read);
    -webkit-font-smoothing: antialiased;
}

/* ====== 2. МОДУЛЬ: ПОТОКИ (DW-STYLE) ====== */

/* --- А: Карточки в списке (Главная) --- */
body .t-feed .t-feed__post-title,
body .t-feed .js-feed-post-title {
    color: var(--c-white) !important;
    font-family: var(--ff-heading) !important;
    font-weight: 700 !important;
    font-size: 20px !important;
    letter-spacing: -0.4px !important;
}

/* --- Б: Внутренняя статья (Интерфейс чтения) --- */
body .t-feed__post-popup__container,
body .t-feed__post-popup__content,
body .t-feed__post-popup__text-wrapper {
    background-color: var(--c-white) !important;
}

/* Главный заголовок статьи (Desktop) */
body .t-feed__post-popup .t-feed__post-popup__title {
    color: var(--c-black) !important;
    font-family: var(--ff-heading) !important;
    font-size: 38px !important; /* Увеличили основной заголовок */
    font-weight: 800 !important;
    line-height: 1.1 !important;
    margin-bottom: 32px !important;
    letter-spacing: -1px !important;
}

/* Текст статьи (Desktop: 17px) */
body .t-feed__post-popup .t-redactor__text,
body .t-feed__post-popup .t-feed__post-popup__text-wrapper .t-text,
body .t-feed__post-popup .t-feed__post-popup__text-wrapper p {
    color: var(--c-black) !important;
    font-family: var(--ff-body-read) !important;
    font-size: 17px !important;
    line-height: 1.55 !important;
    max-width: var(--read-max-width) !important;
    margin-bottom: 26px !important;
}

/* ВНУТРЕННИЕ ЗАГОЛОВКИ (Desktop) — Тотальный перехват и усиление */
body .t-feed__post-popup__text-wrapper h1,
body .t-feed__post-popup__text-wrapper h2,
body .t-feed__post-popup__text-wrapper h3,
body .t-feed__post-popup .t-redactor__h1, 
body .t-feed__post-popup .t-redactor__h2,
body .t-feed__post-popup .t-redactor__text h1,
body .t-feed__post-popup .t-redactor__text h2,
body .t-feed__post-popup .t-redactor__text .t-name,
body .t-feed__post-popup .t-redactor__text .t-title,
body [field="text"] h1, body [field="text"] h2 {
    color: var(--c-black) !important;
    font-family: var(--ff-heading) !important;
    font-weight: 800 !important;
    font-size: 32px !important; /* Форсированный размер как в редакторе */
    line-height: 1.2 !important;
    margin-top: 64px !important; /* Большой отступ сверху для разделения */
    margin-bottom: 24px !important;
    display: block !important;
    letter-spacing: -0.6px !important;
}

/* ====== 3. ФУТЕР И UI ====== */
footer.footer, 
.f-col.brand .tag {
    font-family: var(--ff-system) !important;
}

/* ====== 4. МОБИЛЬНАЯ АДАПТАЦИЯ (DW EXACT) ====== */
@media (max-width: 640px) {
    body .t-feed__post-popup .t-feed__post-popup__title { 
        font-size: 22px !important; 
        line-height: 1.2 !important;
        margin-bottom: 18px !important;
    }

    body .t-feed__post-popup .t-feed__post-popup__text-wrapper .t-text,
    body .t-feed__post-popup .t-redactor__text p,
    body .t-feed__post-popup .t-feed__post-popup__text-wrapper p { 
        font-size: 15px !important; 
        line-height: 1.45 !important;
        margin-bottom: 18px !important;
    }
    
    body .t-feed__post-popup .t-redactor__h1, 
    body .t-feed__post-popup .t-redactor__h2,
    body .t-feed__post-popup .t-redactor__text h1,
    body .t-feed__post-popup .t-redactor__text h2 {
        font-size: 19px !important;
        margin-top: 36px !important;
        margin-bottom: 12px !important;
        font-weight: 800 !important;
    }
}