/* Стили нового блога glushak.ru/blog. Подключается только на странице статьи.
   Не конфликтует с боевым style.min.css — все правила под .blog-post* / .blog-*. */

/* Палитра сайта Glushak: красный #db2d2e, тёмный #323232,
   светлая панель #f6f6f6, границы #e3e3e3, серый текст #6c757d,
   шрифт Open Sans (глобальный). Стиль строгий технический: прямые углы,
   красный акцент слева, светлые панели. */

/* Единая ширина колонки статьи: обложка, мета, автор и текст — одной ширины, по центру */
.blog-entry.blog-post { max-width: 860px; margin-left: auto; margin-right: auto; }

/* ============================ Обложка ============================ */
.blog-post__cover {
    margin: 0 0 28px;
    border: 1px solid #e3e3e3;
    line-height: 0;
}
.blog-post__cover img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    object-position: center;
    display: block;
}
@media (max-width: 992px) { .blog-post__cover img { height: 320px; } }
@media (max-width: 600px) { .blog-post__cover img { height: 210px; } }

/* ============================ Мета ============================ */
.blog-post__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 22px;
    margin-bottom: 24px;
    color: #909090;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.blog-post__meta-item { white-space: nowrap; }

/* ===================== Карточка автора ===================== */
.blog-author {
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 22px 24px;
    margin: 0 0 34px;
    background: #f6f6f6;
    border: 1px solid #e3e3e3;
    border-left: 3px solid #db2d2e;
}
.blog-author__avatar img {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 2px solid #db2d2e;
    padding: 2px;
    background: #fff;
}
.blog-author__label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #db2d2e;
    margin-bottom: 4px;
}
.blog-author__name { font-weight: 700; font-size: 19px; line-height: 1.2; color: #323232; }
.blog-author__role { font-size: 14px; color: #db2d2e; margin-top: 2px; }
.blog-author__bio  { font-size: 14px; line-height: 1.55; color: #6c757d; margin-top: 8px; }

/* ===================== Контент статьи ===================== */
.blog-post__content {
    font-size: 16.5px;
    line-height: 1.75;
    color: #363636;
    /* ширину задаёт родитель .blog-post (860px), чтобы текст, обложка и автор совпадали */
}
.blog-post__content > *:first-child { margin-top: 0; }

.blog-post__content p { margin: 0 0 18px; }
.blog-post__content img { max-width: 100%; height: auto; }
.blog-post__content a { color: #db2d2e; text-decoration: underline; text-underline-offset: 2px; }
.blog-post__content a:hover { color: #b31f20; }

/* Лид — первый абзац крупнее и заметнее */
.blog-post__content > p:first-of-type {
    font-size: 19px;
    line-height: 1.6;
    color: #2c2c2c;
}

/* Заголовки */
.blog-post__content h2 {
    position: relative;
    margin: 40px 0 16px;
    padding-left: 16px;
    font-size: 26px;
    line-height: 1.25;
    color: #323232;
    font-weight: 700;
    text-transform: none;      /* тема сайта делает заголовки капсом — возвращаем нормальный регистр */
}
.blog-post__content h2::before {
    content: "";
    position: absolute;
    left: 0; top: .12em; bottom: .12em;
    width: 4px;
    background: #db2d2e;
}
.blog-post__content h3 {
    margin: 28px 0 10px;
    font-size: 20px;
    line-height: 1.3;
    color: #323232;
    font-weight: 700;
    text-transform: none;
}

/* Заголовок-герой статьи (в шапке страницы) — тоже без капса */
h1.blog-post__hero-title { text-transform: none; }

/* Списки — красные маркеры, ритм.
   ВАЖНО: тема сайта задаёт `ul li{list-style:square inside}` и `ol li{list-style:decimal inside}`
   прямо на li — перебиваем на самом li, иначе родной маркер дублирует наш кастомный. */
.blog-post__content ul,
.blog-post__content ol { margin: 0 0 20px; padding-left: 0; }
.blog-post__content li { list-style: none; }
.blog-post__content ul > li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
}
.blog-post__content ul > li::before {
    content: "";
    position: absolute;
    left: 4px; top: .62em;
    width: 7px; height: 7px;
    background: #db2d2e;
}
.blog-post__content ol { list-style: none; counter-reset: item; }
.blog-post__content ol > li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 12px;
    counter-increment: item;
}
.blog-post__content ol > li::before {
    content: counter(item);
    position: absolute;
    left: 0; top: .1em;
    width: 26px; height: 26px;
    background: #323232;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-align: center;
    line-height: 26px;
}
.blog-post__content strong { color: #232323; font-weight: 700; }

/* Таблицы (обёртка .blog-table даёт горизонтальный скролл на мобиле) */
.blog-table { margin: 0 0 24px; overflow-x: auto; border: 1px solid #e3e3e3; }
.blog-post__content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    min-width: 520px;
}
.blog-post__content thead th {
    background: #db2d2e;
    color: #fff;
    text-align: left;
    font-weight: 700;
}
.blog-post__content th,
.blog-post__content td {
    padding: 11px 14px;
    border: 1px solid #e3e3e3;
    vertical-align: top;
}
.blog-post__content tbody tr:nth-child(even) { background: #f6f6f6; }
.blog-post__content tbody td:first-child { font-weight: 600; color: #2c2c2c; }

/* Цитата — акцентная врезка */
.blog-post__content blockquote {
    margin: 0 0 24px;
    padding: 18px 22px;
    background: #f6f6f6;
    border-left: 3px solid #db2d2e;
    font-size: 17px;
    font-style: italic;
    color: #2c2c2c;
}
/* Тема сайта вешает большую серую кавычку blockquote::before — убираем, чтобы не налезала */
.blog-post__content blockquote::before { content: none; }
.blog-post__content blockquote p:last-child { margin-bottom: 0; }

/* ===================== Блоки статьи ===================== */

/* Врезка «Коротко о главном» (база, структурная) */
.blog-summary {
    margin: 0 0 30px;
    padding: 22px 24px;
    background: #f6f6f6;
    border: 1px solid #e3e3e3;
    border-left: 4px solid #db2d2e;
}
.blog-summary__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #db2d2e;
}
.blog-summary ul { margin: 0; }
.blog-summary li { margin-bottom: 8px; }
.blog-summary li:last-child { margin-bottom: 0; }

/* Оглавление (база, автоподстановка по H2) */
.blog-toc {
    margin: 0 0 32px;
    padding: 20px 24px;
    background: #fff;
    border: 1px solid #e3e3e3;
}
.blog-toc__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #909090;
}
.blog-toc ol { margin: 0; list-style: none; counter-reset: toc; }
.blog-toc li {
    counter-increment: toc;
    margin-bottom: 8px;
    padding-left: 30px;
    position: relative;
}
.blog-toc li:last-child { margin-bottom: 0; }
.blog-toc li::before {
    content: counter(toc, decimal-leading-zero);
    position: absolute;
    left: 0; top: 0;
    color: #db2d2e;
    font-weight: 700;
    font-size: 14px;
}
.blog-toc a { color: #323232; text-decoration: none; }
.blog-toc a:hover { color: #db2d2e; }

/* Врезки-callout (уникальные, пишет модель) */
.blog-callout {
    margin: 0 0 26px;
    padding: 18px 22px 18px 24px;
    background: #f6f6f6;
    border: 1px solid #e3e3e3;
    border-left: 4px solid #909090;
}
.blog-callout__title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #6c757d;
}
.blog-callout p:last-child,
.blog-callout ul:last-child,
.blog-callout ol:last-child { margin-bottom: 0; }

.blog-callout--warning { border-left-color: #db2d2e; background: #fbeeee; }
.blog-callout--warning .blog-callout__title { color: #db2d2e; }

.blog-callout--tip { border-left-color: #323232; background: #f2f4f6; }
.blog-callout--tip .blog-callout__title { color: #323232; }

/* Врезка с параметрами (уникальная, пишет модель) */
.blog-spec {
    margin: 0 0 28px;
    border: 1px solid #e3e3e3;
    border-top: 3px solid #db2d2e;
}
.blog-spec__title {
    margin: 0;
    padding: 12px 20px;
    background: #323232;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.blog-spec__grid { display: grid; grid-template-columns: 1fr 1fr; }
.blog-spec__item {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 12px 20px;
    border-top: 1px solid #e3e3e3;
}
.blog-spec__item:nth-child(-n+2) { border-top: none; }
.blog-spec__item:nth-child(odd) { border-right: 1px solid #e3e3e3; }
.blog-spec__key { color: #6c757d; font-size: 14px; }
.blog-spec__val { font-weight: 700; color: #232323; text-align: right; }

/* CTA — запись на диагностику (статичный блок конструктора) */
.blog-cta {
    margin: 34px 0 6px;
    padding: 28px 30px;
    background: #323232;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    border-left: 4px solid #db2d2e;
}
.blog-cta__text { color: #fff; }
.blog-cta__title { margin: 0 0 6px; font-size: 21px; font-weight: 700; line-height: 1.25; }
.blog-cta__subtitle { margin: 0; color: #c7c7c7; font-size: 15px; }
.blog-cta__btn {
    display: inline-block;
    background: #db2d2e;
    color: #fff;
    padding: 14px 30px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.blog-cta__btn:hover { background: #b31f20; }
/* Текст кнопки: перебиваем темовое `.blog-post__content a{color:#db2d2e}` (спецификой),
   иначе красный текст на красном фоне — кнопка выглядит пустой */
.blog-post__content a.blog-cta__btn,
.blog-post__content a.blog-cta__btn:hover { color: #fff; text-decoration: none; }

/* ===================== Мобильная адаптация ===================== */
@media (max-width: 600px) {
    .blog-post__content { font-size: 16px; }
    .blog-post__content > p:first-of-type { font-size: 17.5px; }
    .blog-post__content h2 { font-size: 22px; }
    .blog-post__content h3 { font-size: 18px; }
    .blog-spec__grid { grid-template-columns: 1fr; }
    .blog-spec__item:nth-child(2) { border-top: 1px solid #e3e3e3; }
    .blog-spec__item:nth-child(odd) { border-right: none; }
    .blog-cta { flex-direction: column; align-items: flex-start; }
    .blog-cta__btn { width: 100%; text-align: center; }
    .blog-author {
        flex-direction: column;
        text-align: center;
        border-left: 1px solid #e3e3e3;
        border-top: 3px solid #db2d2e;
    }
}

/* Блок «Читайте также» (связанные статьи) */
.blog-related {
    max-width: 860px;
    margin: 48px auto 0;
    padding-top: 32px;
    border-top: 1px solid #e3e3e3;
}
.blog-related__title {
    font-size: 22px;
    color: #323232;
    margin: 0 0 20px;
}
.blog-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.blog-related__card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e3e3e3;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, border-color .2s;
}
.blog-related__card:hover {
    border-color: #db2d2e;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}
.blog-related__img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}
.blog-related__body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.blog-related__name {
    font-weight: 600;
    line-height: 1.35;
    color: #323232;
}
.blog-related__meta {
    font-size: 13px;
    color: #6c757d;
}
