/* =========================================================
   Оформление статей блога (класс .cm-art в тексте статьи).
   Подключается автоматически только на страницах со статьёй
   (см. /bitrix/php_interface/cm_blog.php).
   ========================================================= */

.cm-art {
    --art-red: var(--theme-base-color, #dc2f2f);
    --art-text: #2b2b2b;
    --art-muted: #6b6b6b;
    --art-line: #e6e6e9;
    --art-soft: #f7f7f8;
    --art-tint: #fff4f4;
    max-width: 920px;
    color: var(--art-text);
    font-size: 17px;
    line-height: 1.65;
}

.cm-art *, .cm-art *::before, .cm-art *::after { box-sizing: border-box; }

.cm-art p { margin: 0 0 16px; }
.cm-art a { color: var(--art-red); text-decoration: underline; text-underline-offset: 2px; }
.cm-art a:hover { text-decoration: none; }

.cm-art h2 {
    margin: 44px 0 16px;
    font-size: 28px;
    line-height: 1.25;
    font-weight: 800;
    color: var(--art-text);
    scroll-margin-top: 110px;
}

.cm-art h3 { margin: 0 0 8px; font-size: 18px; line-height: 1.35; font-weight: 800; color: var(--art-text); }

.cm-art ul, .cm-art ol { margin: 0 0 18px; padding-left: 22px; }
.cm-art li { margin-bottom: 8px; }

/* вступление и «коротко» */
.cm-art__lead { font-size: 19px; line-height: 1.6; color: #3d4350; }

.cm-art__short {
    margin: 24px 0;
    padding: 22px 24px;
    border-radius: 16px;
    border-left: 4px solid var(--art-red);
    background: var(--art-tint);
}

.cm-art__short-title, .cm-art__toc-title, .cm-art__col-title, .cm-art__cta-title {
    margin: 0 0 10px !important;
    font-size: 18px;
    font-weight: 800;
    color: var(--art-text);
}

.cm-art__short ul { margin: 0; }
.cm-art__short li:last-child { margin-bottom: 0; }

/* содержание */
.cm-art__toc {
    margin: 24px 0 8px;
    padding: 20px 24px;
    border-radius: 16px;
    background: var(--art-soft);
}

.cm-art__toc ol { margin: 0; columns: 2; column-gap: 32px; }
.cm-art__toc li { break-inside: avoid; margin-bottom: 6px; }
.cm-art__toc a { color: var(--art-text); text-decoration: none; border-bottom: 1px solid var(--art-line); }
.cm-art__toc a:hover { color: var(--art-red); border-color: var(--art-red); }

/* лента истории */
.cm-art__timeline {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin: 8px 0 18px;
}

.cm-art__timeline > div {
    padding: 16px;
    border-radius: 14px;
    background: var(--art-soft);
    border-top: 3px solid var(--art-red);
}

.cm-art__timeline b { display: block; font-size: 22px; line-height: 1.2; color: var(--art-red); }
.cm-art__timeline span { display: block; margin-top: 6px; font-size: 14px; line-height: 1.45; color: var(--art-muted); }

/* таблица */
.cm-art__table-wrap { margin: 0 0 20px; overflow-x: auto; border: 1px solid var(--art-line); border-radius: 14px; }

.cm-art__table { width: 100%; min-width: 600px; border-collapse: collapse; font-size: 15px; line-height: 1.5; }

.cm-art__table th, .cm-art__table td {
    padding: 12px 16px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--art-line) !important;
    text-align: left;
    vertical-align: top;
}

.cm-art__table th {
    background: var(--art-soft) !important;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--art-muted);
}

.cm-art__table tr:last-child td { border-bottom: 0 !important; }
.cm-art__table td:first-child { font-weight: 700; white-space: nowrap; }
.cm-art__table td:last-child { white-space: nowrap; color: var(--art-muted); }

/* плюсы и минусы */
.cm-art__cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 0 0 20px; }

.cm-art__col { padding: 22px 24px; border-radius: 16px; border: 1px solid var(--art-line); }
.cm-art__col ul { margin: 0; padding-left: 20px; font-size: 16px; }
.cm-art__col li:last-child { margin-bottom: 0; }
.cm-art__col--plus { background: #f3faf5; border-color: #d6eedc; }
.cm-art__col--minus { background: #fffaf0; border-color: #f3e5c6; }

/* карточки товаров */
.cm-art__products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0 0 24px;
}

.cm-art a.cm-art__product {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border: 1px solid var(--art-line);
    border-radius: 16px;
    background: #ffffff;
    color: var(--art-text);
    text-decoration: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.cm-art a.cm-art__product:hover { border-color: var(--art-red); box-shadow: 0 10px 30px rgba(0, 0, 0, .07); }

.cm-art__product-img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    margin-bottom: 14px;
    border-radius: 12px;
    background: #ffffff;
}

.cm-art__product-img img { max-width: 100%; max-height: 200px; width: auto; height: auto; object-fit: contain; }

.cm-art__product-cat { font-size: 13px; color: var(--art-muted); }
.cm-art__product-name { margin: 2px 0 8px; font-size: 17px; font-weight: 800; line-height: 1.3; }
.cm-art__product-specs { flex: 1 1 auto; font-size: 14px; line-height: 1.5; color: #3d4350; }

.cm-art__product-more {
    margin-top: 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--art-red);
}

.cm-art__product-more::after { content: " \2192"; }

/* призыв */
.cm-art__cta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px 32px;
    margin: 32px 0;
    padding: 26px 28px;
    border-radius: 18px;
    background: var(--art-tint);
}

.cm-art__cta p:last-child { margin: 0; font-size: 16px; color: #3d4350; }

.cm-art a.cm-art__cta-btn {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    min-height: 52px;
    padding: 0 26px;
    border-radius: 12px;
    background: var(--art-red);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
}

.cm-art a.cm-art__cta-btn:hover { filter: brightness(1.08); }

/* вопросы */
.cm-art__faq { display: grid; gap: 10px; margin: 0 0 24px; }

.cm-art__faq-item { padding: 18px 22px; border: 1px solid var(--art-line); border-radius: 14px; }
.cm-art__faq-item p { margin: 0; font-size: 16px; color: #3d4350; }

.cm-art__sources { margin-top: 28px; font-size: 13px; line-height: 1.55; color: var(--art-muted); }
.cm-art__sources a { color: inherit; }

/* ---------- планшет и телефон ---------- */

@media (max-width: 991px) {
    .cm-art__products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cm-art__timeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .cm-art { font-size: 16px; }
    .cm-art__lead { font-size: 17px; }
    .cm-art h2 { margin-top: 36px; font-size: 23px; }
    .cm-art__toc ol { columns: 1; }
    .cm-art__short, .cm-art__toc, .cm-art__col { padding: 18px; }
    .cm-art__cols { grid-template-columns: 1fr; }
    .cm-art__timeline { grid-template-columns: 1fr 1fr; }
    .cm-art__products { grid-template-columns: 1fr 1fr; gap: 10px; }
    .cm-art a.cm-art__product { padding: 12px; }
    .cm-art__product-img { height: 140px; }
    .cm-art__product-img img { max-height: 140px; }
    .cm-art__product-name { font-size: 15px; }
    .cm-art__product-specs { font-size: 13px; }
    .cm-art__cta { flex-direction: column; align-items: stretch; padding: 22px 18px; }
    .cm-art a.cm-art__cta-btn { justify-content: center; }
}
