/* =========================================================
   КОНТЕНТНЫЕ БЛОКИ — новости, статьи, текст на главной.
   Подключается и на сайте, и в классическом редакторе.

   ЕДИНАЯ ШКАЛА — та же, что у всей темы (main.css):
     шрифт   — var(--font-body), системный, везде один;
     H1      — как .mfo-h1: 800, clamp(28px, 4vw, 44px);
     H2      — как .mfo-h2: 800, clamp(22px, 3vw, 30px), линия снизу;
     H3      — 800, 18px;
     текст   — 400, 16px / 1.65, цвет --c-ink-soft (как описания на сайте);
     цифры   — как .mfo-stat-card-val: 800, 26px, --c-ink;
     подписи — 13px, --c-ink-soft;
     заголовки карточек — 800, 16px (как «Как собран список»);
     метки   — 700, 12px.
   Других размеров и начертаний в блоках нет.
   ========================================================= */

.mfo-article,
.mfo-home-text,
.mce-content-body {
    --b-font: var(--font-body, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif);
    --b-ink: var(--c-ink, #16233d);
    --b-soft: var(--c-ink-soft, #5c6b85);
    --b-text: var(--c-text, #2b3548);
    --b-primary: var(--c-primary, #2563eb);
    --b-primary-dark: var(--c-primary-dark, #1d4ed8);
    --b-border: var(--c-border, #dbe4f3);
    --b-card: var(--c-card, #ffffff);
    --b-radius: var(--radius, 14px);
    font-family: var(--b-font);
    font-size: 16px;
    line-height: 1.65;
    color: var(--b-text);
}

/* ---------- Базовая типографика ---------- */
.mfo-article, .mfo-home-text { max-width: 820px; }
.mfo-article p, .mfo-home-text p { margin: 0 0 16px; }
.mfo-article strong, .mfo-home-text strong { color: var(--b-ink); font-weight: 700; }
/* Только обычные ссылки в тексте (без класса). Карточки, кнопки и виджеты
   темы внутри статьи (топ предложений, каталог) сохраняют свой вид. */
.mfo-article a:not([class]), .mfo-home-text a:not([class]) { color: var(--b-primary); text-decoration: underline; text-underline-offset: 3px; }

.mfo-article h2:not([class]), .mfo-home-text h2:not([class]) {
    font-family: var(--b-font); font-weight: 800; font-size: clamp(22px, 3vw, 30px); line-height: 1.25;
    color: var(--b-ink); margin: 36px 0 18px; padding: 0 0 14px; border-bottom: 2px solid var(--b-border);
}
.mfo-home-text h2:first-child { margin-top: 0; }
.mfo-article h3:not([class]), .mfo-home-text h3:not([class]) {
    font-family: var(--b-font); font-weight: 800; font-size: 18px; line-height: 1.35;
    color: var(--b-ink); margin: 30px 0 12px;
}

/* Лид — тот же шрифт и начертание, просто чуть крупнее и темнее */
.mfo-article > p:first-child,
.is-style-mfo-lead { font-size: 17px; color: var(--b-ink); }

/* Обычные списки */
.mfo-article ul:not([class*="is-style-mfo"]), .mfo-home-text ul:not([class*="is-style-mfo"]) { list-style: none; padding-left: 0; margin: 0 0 18px; }
.mfo-article ul:not([class*="is-style-mfo"]) > li, .mfo-home-text ul:not([class*="is-style-mfo"]) > li { position: relative; padding-left: 20px; margin-bottom: 8px; }
.mfo-article ul:not([class*="is-style-mfo"]) > li::before, .mfo-home-text ul:not([class*="is-style-mfo"]) > li::before { content: ""; position: absolute; left: 3px; top: 10px; width: 6px; height: 6px; border-radius: 50%; background: var(--b-primary); }
.mfo-article ol:not([class*="is-style-mfo"]) { padding-left: 22px; margin: 0 0 18px; }
.mfo-article ol:not([class*="is-style-mfo"]) > li { margin-bottom: 8px; }

/* Старые цитаты автоматически становятся плашкой «Важно» */
.mfo-article blockquote {
    margin: 22px 0; padding: 16px 20px; border: 1px solid #ccdcfb; border-radius: var(--b-radius);
    background: #f1f6ff; font-style: normal; font-size: 15px; color: var(--b-text);
}
.mfo-article blockquote p:last-child { margin-bottom: 0; }

.mfo-article table { width: 100%; border-collapse: collapse; margin: 0 0 20px; font-size: 14px; }
.mfo-article th, .mfo-article td { padding: 10px 12px; border-bottom: 1px solid var(--b-border); text-align: left; }
.mfo-article th { color: var(--b-ink); font-weight: 700; background: #f1f6ff; }

/* ---------- Шапка статьи ---------- */
.mfo-article-head { max-width: 820px; margin-bottom: 24px; }
.mfo-article-crumbs { font-size: 13px; color: var(--c-ink-soft); margin-bottom: 12px; }
.mfo-article-crumbs a { color: var(--c-ink-soft); text-decoration: none; }
.mfo-article-crumbs a:hover { color: var(--c-primary); }
.mfo-article-title { font-family: var(--font-body); font-weight: 800; font-size: clamp(26px, 3.4vw, 36px); line-height: 1.15; letter-spacing: -0.01em; color: var(--c-ink); margin: 0 0 14px; }
.mfo-article-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.mfo-article-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--c-ink); background: #fff; border: 1px solid #bfd4fb; border-radius: 11px; padding: 6px 10px; }

/* ---------- Цифры: как карточки в шапке главной ---------- */
.mfo-b-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 22px 0 26px; }
.mfo-b-stat { background: var(--b-card); border: 1px solid var(--b-border); border-radius: var(--b-radius); padding: 18px 20px; box-shadow: 0 4px 14px rgba(22, 35, 61, .05); }
.mfo-b-stat p { margin: 0 !important; }
.mfo-b-stat .mfo-b-stat-val { font-family: var(--b-font); font-weight: 800; font-size: 26px; line-height: 1.15; color: var(--b-ink); }
.mfo-b-stat .mfo-b-stat-label { font-size: 13px; line-height: 1.45; color: var(--b-soft); margin-top: 4px !important; }

/* ---------- Карточки: как «Как собран список» ---------- */
.mfo-b-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 16px 0 22px; }
.mfo-b-cards:has(> :nth-child(4):last-child) { grid-template-columns: repeat(2, 1fr); }
.mfo-b-card { background: var(--b-card); border: 1px solid var(--b-border); border-radius: 16px; padding: 18px 20px; box-shadow: 0 4px 14px rgba(22, 35, 61, .05); }
.mfo-b-card p { margin: 0 0 6px !important; font-size: 14px; line-height: 1.6; color: var(--b-text); }
.mfo-b-card p:last-child { margin-bottom: 0 !important; }
.mfo-b-card .mfo-b-card-tag { display: inline-block; font-size: 12px; font-weight: 700; line-height: 1.3; color: var(--b-primary-dark); background: #f1f6ff; border: 1px solid #ccdcfb; border-radius: 8px; padding: 3px 8px; margin-bottom: 10px !important; }
.mfo-b-card .mfo-b-card-title { font-family: var(--b-font); font-size: 16px; font-weight: 800; line-height: 1.35; color: var(--b-ink); }

/* ---------- Плашки: цвета как в «Как собран список» ---------- */
.mfo-b-callout { position: relative; margin: 20px 0; padding: 16px 20px 16px 54px; border-radius: 16px; border: 1px solid #ccdcfb; background: #f1f6ff; }
.mfo-b-callout::before { content: "ℹ️"; position: absolute; left: 18px; top: 15px; font-size: 20px; line-height: 1; }
.mfo-b-callout p { font-size: 15px; }
.mfo-b-callout > :last-child { margin-bottom: 0 !important; }
.mfo-b-callout .mfo-b-callout-title { font-family: var(--b-font); font-weight: 800; font-size: 16px; color: var(--b-ink); margin: 0 0 4px !important; }
.mfo-b-callout--warn { background: #fff8eb; border-color: #f6dcaa; }
.mfo-b-callout--warn::before { content: "⚠️"; }
.mfo-b-callout--tip { background: #effaf4; border-color: #c8ead7; }
.mfo-b-callout--tip::before { content: "💡"; }

/* ---------- Списки-стили ---------- */
.is-style-mfo-check, .is-style-mfo-cross, .is-style-mfo-timeline, .is-style-mfo-steps { list-style: none !important; padding-left: 0 !important; margin: 0 0 20px; }
.is-style-mfo-check > li, .is-style-mfo-cross > li { position: relative; padding-left: 30px; margin-bottom: 10px; }
.is-style-mfo-check > li::before, .is-style-mfo-cross > li::before { position: absolute; left: 0; top: 3px; width: 20px; height: 20px; border-radius: 50%; font-family: var(--b-font); font-size: 12px; font-weight: 800; line-height: 20px; text-align: center; }
.is-style-mfo-check > li::before { content: "✓"; background: #dcf5e4; color: var(--c-green, #16a34a); }
.is-style-mfo-cross > li::before { content: "✕"; background: #fde4e4; color: var(--c-red, #c93636); font-size: 11px; }

.is-style-mfo-steps { counter-reset: mfo-step; }
.is-style-mfo-steps > li { position: relative; counter-increment: mfo-step; padding: 14px 18px 14px 58px; margin-bottom: 10px; background: var(--b-card); border: 1px solid var(--b-border); border-radius: var(--b-radius); }
.is-style-mfo-steps > li::before { content: counter(mfo-step); position: absolute; left: 18px; top: 14px; width: 26px; height: 26px; border-radius: 8px; background: var(--b-primary-dark); color: #fff; font-family: var(--b-font); font-weight: 800; font-size: 13px; line-height: 26px; text-align: center; }

.is-style-mfo-timeline { position: relative; }
.is-style-mfo-timeline::before { content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px; width: 2px; background: var(--b-border); }
.is-style-mfo-timeline > li { position: relative; padding-left: 30px; margin-bottom: 16px; }
.is-style-mfo-timeline > li::before { content: ""; position: absolute; left: 1px; top: 5px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--b-primary); box-sizing: border-box; }
.is-style-mfo-timeline > li > strong:first-child { display: block; font-size: 13px; font-weight: 800; color: var(--b-primary-dark); }

/* ---------- Плюсы / минусы, было / стало ---------- */
.mfo-b-compare { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 20px 0 24px; }
.mfo-b-compare-col { border-radius: 16px; padding: 16px 20px; border: 1px solid var(--b-border); background: var(--b-card); }
.mfo-b-compare-col > :last-child { margin-bottom: 0 !important; }
.mfo-b-compare-col--plus { background: #effaf4; border-color: #c8ead7; }
.mfo-b-compare-col--minus { background: #fff4f4; border-color: #f3d0d0; }
.mfo-b-compare .mfo-b-compare-title { font-family: var(--b-font); font-weight: 800; font-size: 16px; color: var(--b-ink); margin: 0 0 8px !important; }

/* ---------- Коротко ---------- */
.mfo-b-summary { margin: 0 0 26px; padding: 18px 20px; border-radius: 16px; background: var(--b-card); border: 1px solid var(--b-border); box-shadow: 0 4px 14px rgba(22, 35, 61, .05); }
.mfo-b-summary .mfo-b-summary-title { font-family: var(--b-font); font-size: 13px; font-weight: 800; color: var(--b-ink); margin: 0 0 10px !important; }
.mfo-b-summary > :last-child { margin-bottom: 0 !important; }

/* ---------- Призыв к действию: как синие блоки темы ---------- */
.mfo-b-cta { margin: 30px 0; padding: 22px 24px; border-radius: 16px; background: var(--b-primary-dark); }
.mfo-b-cta p { margin: 0 0 14px !important; font-size: 15px; color: rgba(255, 255, 255, .88); }
.mfo-b-cta p:last-child { margin-bottom: 0 !important; }
.mfo-b-cta .mfo-b-cta-title { font-family: var(--b-font); font-size: 20px; font-weight: 800; line-height: 1.3; color: #fff; margin-bottom: 6px !important; }
.mfo-b-cta a.mfo-b-cta-btn { display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--b-primary-dark) !important; font-family: var(--b-font); font-size: 14px; font-weight: 700; text-decoration: none !important; border-radius: var(--radius-sm, 8px); padding: 11px 18px; }
.mfo-b-cta a.mfo-b-cta-btn:hover { background: #f1f6ff; }

/* ---------- Редактор ---------- */
.mce-content-body.mfo-article { margin: 16px auto; padding: 0 16px; }

@media (max-width: 640px) {
    .mfo-article, .mfo-home-text { font-size: 15px; }
    .mfo-b-compare, .mfo-b-cards:has(> :nth-child(4):last-child) { grid-template-columns: 1fr; }
    .mfo-b-stat .mfo-b-stat-val { font-size: 22px; }
}

/* Название в карточке — ссылка на страницу компании, без подчёркивания */
.mfo-b-card .mfo-b-card-title a { color: inherit; text-decoration: none; }
.mfo-b-card .mfo-b-card-title a:hover { color: var(--b-primary); }

/* ---------- Источники ---------- */
.mfo-b-sources { margin: 8px 0 0; }
.mfo-b-sources .mfo-b-sources-title { font-family: var(--b-font); font-weight: 800; font-size: clamp(22px, 3vw, 30px); line-height: 1.25; color: var(--b-ink); margin: 0 0 18px !important; padding: 0 0 14px; border-bottom: 2px solid var(--b-border); }
.mfo-b-sources-list { list-style: none !important; padding: 0 !important; margin: 0 !important; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.mfo-b-sources-list > li { margin: 0 !important; padding: 0 !important; }
.mfo-b-sources-list > li::before { content: none !important; }
.mfo-b-source { display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 16px; background: var(--b-card); border: 1px solid var(--b-border); border-radius: var(--b-radius); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.mfo-b-source:hover { border-color: #bfd4fb; box-shadow: 0 4px 14px rgba(22, 35, 61, .07); }
.mfo-b-source-badge { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 10px; background: #f1f6ff; border: 1px solid #ccdcfb; color: var(--b-primary-dark); font-family: var(--b-font); font-weight: 800; font-size: 13px; }
.mfo-b-source-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mfo-b-source-name { font-family: var(--b-font); font-size: 14px; font-weight: 700; line-height: 1.4; color: var(--b-ink); }
.mfo-b-source-meta { font-size: 12px; line-height: 1.4; color: var(--b-soft); }
.mfo-b-source-arrow { margin-left: auto; flex: 0 0 auto; color: var(--b-soft); font-size: 14px; }
.mfo-b-source:hover .mfo-b-source-arrow, .mfo-b-source:hover .mfo-b-source-name { color: var(--b-primary); }
@media (max-width: 640px) { .mfo-b-sources-list { grid-template-columns: 1fr; } }

/* ---------- Две колонки в одной нейтральной карточке ---------- */
.mfo-b-split { display: grid; grid-template-columns: 1fr 1fr; margin: 18px 0 20px; background: var(--b-card); border: 1px solid var(--b-border); border-radius: 16px; box-shadow: 0 4px 14px rgba(22, 35, 61, .05); }
.mfo-b-split-col { padding: 18px 20px; }
.mfo-b-split-col + .mfo-b-split-col { border-left: 1px solid var(--b-border); }
.mfo-b-split-col > :last-child { margin-bottom: 0 !important; }
.mfo-b-split .mfo-b-split-title { display: flex; align-items: center; gap: 8px; font-family: var(--b-font); font-weight: 800; font-size: 16px; color: var(--b-ink); margin: 0 0 12px !important; }
.mfo-b-split .mfo-b-split-note { font-size: 13px; margin: 10px 0 0 !important; }
.mfo-b-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.mfo-b-dot--green { background: var(--c-green, #16a34a); }
.mfo-b-dot--amber { background: var(--c-amber, #d97706); }
.mfo-b-dot--red { background: var(--c-red, #c93636); }

/* Чипы с названиями */
.mfo-b-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 !important; }
.mfo-b-chip { display: inline-block; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--b-ink); background: var(--c-bg, #f4f7fc); border: 1px solid var(--b-border); border-radius: 8px; padding: 5px 10px; }
.mfo-b-chip--more { color: var(--b-soft); font-weight: 400; background: transparent; border-style: dashed; }

@media (max-width: 640px) {
    .mfo-b-split { grid-template-columns: 1fr; }
    .mfo-b-split-col + .mfo-b-split-col { border-left: 0; border-top: 1px solid var(--b-border); }
}

/* Плюсы/минусы и было/стало — без цветной заливки, цвет только точкой в заголовке */
.mfo-b-compare-col--plus, .mfo-b-compare-col--minus { background: var(--b-card); border-color: var(--b-border); }
.mfo-b-compare-col--plus .mfo-b-compare-title::before,
.mfo-b-compare-col--minus .mfo-b-compare-title::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; vertical-align: middle; }
.mfo-b-compare-col--plus .mfo-b-compare-title::before { background: var(--c-green, #16a34a); }
.mfo-b-compare-col--minus .mfo-b-compare-title::before { background: var(--c-red, #c93636); }

/* Виджеты темы внутри статьи (шорткоды [mfo_top_offers] и т. п.):
   без лишних отступов секции — встают ровно по краю текста. */
.mfo-article .mfo-section { padding: 0; margin: 30px 0; }
.mfo-article .mfo-wrap { padding: 0; max-width: none; }
.mfo-article .mfo-section p, .mfo-article .mfo-offer p { margin: 0; }
/* В колонке текста карточек меньше места — по 2 в ряд, суммы не переносим */
.mfo-article .mfo-offers-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.mfo-article .mfo-offer-val { white-space: nowrap; }
@media (max-width: 640px) { .mfo-article .mfo-offers-grid { grid-template-columns: 1fr; } }

/* ---------- Иконка новости и обложка в шапке статьи ---------- */
.mfo-article-titlerow { display: flex; align-items: center; gap: 18px; margin-bottom: 14px; }
.mfo-article-titlerow .mfo-article-title { margin: 0; }
.mfo-article-titlerow .mfo-news-icon { width: 68px; height: 68px; border-radius: 18px; }
.mfo-article-titlerow .mfo-news-icon svg { width: 38px; height: 38px; }
.mfo-article-cover { max-width: 820px; margin: 0 0 26px; }
.mfo-article-cover img { width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--c-border, #dbe4f3); display: block; }
@media (max-width: 640px) {
    .mfo-article-titlerow { align-items: flex-start; gap: 12px; }
    .mfo-article-titlerow .mfo-news-icon { width: 48px; height: 48px; border-radius: 14px; }
    .mfo-article-titlerow .mfo-news-icon svg { width: 28px; height: 28px; }
}

/* ---------- График «Когда открылись МФО» ---------- */
.mfo-b-years { margin: 22px 0 26px; padding: 18px 20px 14px; background: var(--b-card); border: 1px solid var(--b-border); border-radius: 16px; box-shadow: 0 4px 14px rgba(22, 35, 61, .05); }
.mfo-b-years-head { margin-bottom: 14px; }
.mfo-b-years .mfo-b-years-title { font-family: var(--b-font); font-weight: 800; font-size: 16px; color: var(--b-ink); margin: 0 !important; }
.mfo-b-years .mfo-b-years-sub { font-size: 13px; color: var(--b-soft); margin: 2px 0 0 !important; }
.mfo-b-years-bars { display: flex; align-items: stretch; gap: 10px; height: 170px; }
.mfo-b-years-col { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 6px; text-decoration: none !important; border-radius: 10px; padding: 4px 0 0; transition: background .15s; }
.mfo-b-years-col:hover { background: #f1f6ff; }
.mfo-b-years-num { font-family: var(--b-font); font-weight: 800; font-size: 15px; color: var(--b-ink); line-height: 1; }
.mfo-b-years-bar { width: 100%; max-width: 54px; border-radius: 8px 8px 4px 4px; background: #d6e3fb; transition: background .15s; }
.mfo-b-years-col:hover .mfo-b-years-bar { background: #bcd1f8; }
.mfo-b-years-col.is-peak .mfo-b-years-bar,
.mfo-b-years-col.is-peak:hover .mfo-b-years-bar { background: var(--b-primary); }
.mfo-b-years-col.is-latest .mfo-b-years-bar { background: repeating-linear-gradient(135deg, #d6e3fb 0 6px, #c4d6f9 6px 12px); }
.mfo-b-years-year { font-size: 13px; font-weight: 700; color: var(--b-soft); padding-bottom: 2px; }
.mfo-b-years-col.is-peak .mfo-b-years-year, .mfo-b-years-col.is-peak .mfo-b-years-num { color: var(--b-primary-dark); }
@media (max-width: 640px) {
    .mfo-b-years-bars { gap: 4px; height: 140px; }
    .mfo-b-years-year { font-size: 11px; }
    .mfo-b-years-num { font-size: 13px; }
}

/* Источники — значок в круге с мягким кольцом (как иконки блока «Как мы отбираем» и FAQ) */
.mfo-b-source-badge { width: 38px; height: 38px; margin: 4px; border: 0; border-radius: 50%; background: #2563eb; color: #fff; font-size: 12px; letter-spacing: -.01em; box-shadow: 0 0 0 4px #dce8ff; }
.mfo-b-source-badge--1 { background: #6a45d6; box-shadow: 0 0 0 4px #e9e0ff; }
.mfo-b-source-badge--2 { background: #118a73; box-shadow: 0 0 0 4px #d3f1e8; }
