/* ==========================================================================
   Pocket Flame — Blog app
   Список статей (по макету Figma 7534-27696, десктоп).
   Токены/шрифт Montserrat приходят из родительской темы site:pflame2026v2.

   Раскладка страницы (макс. 15 статей на странице):
     1  — большая статья (картинка + текст сбоку)
     2-4  — ряд из 3
     5-7  — ряд из 3
     8-9  — ряд из 2
     10   — на всю ширину (картинка сверху, текст снизу)
     11-13 — ряд из 3
     14-15 — ряд из 2
   ========================================================================== */

/* ==========================================================================
   Оболочка страницы блога (в .container родительской темы)
   ========================================================================== */

/* страница блога всегда тянется на весь вьюпорт — футер прижат к низу экрана */
main.pflame-page:has(.blog--pflame) {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}
main.pflame-page:has(.blog--pflame) > .container.container--first {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
}

.blog--pflame {
    flex: 1 0 auto;
    display: flex;
    flex-direction: column;
    font-family: var(--font-sans, "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    color: #171717;
    padding-bottom: 40px;
}

.blog--pflame .blog__body { flex: 1 0 auto; }

.blog--pflame .breadcrumbs {
    font-size: 12px;
    color: rgba(23, 23, 23, 0.5);
    margin-bottom: 20px;
}
.blog--pflame .breadcrumbs a { color: inherit; text-decoration: none; }
.blog--pflame .breadcrumbs a:hover { color: var(--color-btn-main--default, #ef773d); }
.blog--pflame .breadcrumbs .chevron { margin: 0 6px; opacity: 0.5; }

/* хлебные крошки над названием блога — по макету Figma 7531-27176 */
.blog--pflame .blog-crumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 12px;
    font-weight: 400;
    line-height: normal;
    color: #171717;
}
.blog--pflame .blog-crumbs__link {
    color: #171717;
    text-decoration: none;
    transition: color 0.2s ease;
}
.blog--pflame .blog-crumbs__link:hover { color: var(--color-btn-main--default, #ef773d); }
.blog--pflame .blog-crumbs__sep,
.blog--pflame .blog-crumbs__current { color: #a4a4a4; }

.blog-page__title {
    margin: 20px 0;
    color: #171717;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 32px;
    font-weight: 600;
    line-height: normal;
}

.blog-list__title {
    margin: 0 0 32px;
    font-weight: 700;
    font-size: 32px;
    line-height: 1.15;
}

.blog-list__found {
    margin: 0 0 32px;
    font-size: 16px;
    line-height: 1.4;
    color: rgba(23, 23, 23, 0.6);
}

/* поиск по блогу — Figma 7531-27515 */
.blog--pflame .blog-search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 72px;
    margin: 20px 0;
    padding: 0 20px;
    border-radius: 20px;
    background: #f6f7fa;
}
.blog--pflame .blog-search__submit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: rgba(23, 23, 23, 0.4);
}
.blog--pflame .blog-search__submit .icon {
    width: 20px;
    height: 20px;
}
.blog--pflame .blog-search__input {
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    appearance: none;
    -webkit-appearance: none;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: normal;
    color: #171717;
}
.blog--pflame .blog-search__input::placeholder { color: rgba(23, 23, 23, 0.4); opacity: 1; }
.blog--pflame .blog-search__input::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.blog--pflame .blog-search__input:focus { outline: none; }
.blog--pflame .blog-search__clear {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    background: none;
    cursor: pointer;
    color: rgba(23, 23, 23, 0.4);
    transition: color .15s ease;
}
.blog--pflame .blog-search__clear:hover { color: rgba(23, 23, 23, 0.7); }
.blog--pflame .blog-search__clear[hidden] { display: none; }
.blog--pflame .blog-search__clear .icon { width: 12px; height: 12px; }

/* навигация по блогам + поиск */
.blog__nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 32px;
}
.blog__tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.blog__tab a {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #171717;
    background: var(--color-surface, #f6f7fa);
}
.blog__tab a:hover { background: var(--color-neutral-soft, #efefef); }
.blog__tab.is-active a { background: var(--color-btn-main--default, #ef773d); color: #fff; }

.blog__search { position: relative; }
.blog__search input {
    width: 260px;
    max-width: 100%;
    height: 42px;
    padding: 0 42px 0 16px;
    border: 1px solid var(--color-border, #a4a4a4);
    border-radius: 999px;
    font: inherit;
    font-size: 14px;
    background: #fff;
}
.blog__search input:focus { outline: none; border-color: var(--color-btn-main--default, #ef773d); }
.blog__search button {
    position: absolute;
    top: 0;
    right: 0;
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: none;
    cursor: pointer;
    color: rgba(23, 23, 23, 0.6);
}

.blog__body { min-width: 0; }
.blog__plugin { margin-top: 32px; }

/* одиночная статья — контент максимум 900px по центру */
.blog--pflame .post {
    max-width: 900px;
    margin: 0 auto;
}
/* тело статьи */
.blog--pflame .post .article-content figure {
    margin: 60px 0;
}
.blog--pflame .post .article-content > figure img {
    width: 100%;
    aspect-ratio: 900 / 565;
    object-fit: cover;
    border-radius: 20px;
}
.blog--pflame .post .article-content figcaption {
    color: rgba(23, 23, 23, 0.40);
    font-family: Montserrat;
    font-size: 16px;
    font-style: normal;
    font-weight: 600;
    line-height: normal;
    margin-top: 12px;
}
/* подзаголовки тела статьи */
.blog--pflame .post .article-content > h2,
.blog--pflame .post .article-content > h3 {
    color: #171717;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-weight: 600;
    line-height: 32px;
}
.blog--pflame .post .article-content > h2 {
    margin: 60px 0 0;
    font-size: 24px;
}
.blog--pflame .post .article-content > h3 {
    margin: 40px 0 0;
    font-size: 20px;
}

/* параграфы и списки тела статьи (кроме блока автора) */
.blog--pflame .post .article-content > p,
.blog--pflame .post .article-content > ul,
.blog--pflame .post .article-content > ol {
    margin: 40px 0 0;
    color: #171717;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 18px;
    font-weight: 500;
    line-height: 32px;
}
.blog--pflame .post .article-content > p:first-child,
.blog--pflame .post .article-content > ul:first-child,
.blog--pflame .post .article-content > ol:first-child {
    margin-top: 0;
}

/* Списки: li — обычный блочный элемент (НЕ flex), чтобы вложенные <p>/<strong>/<br>
   и любой блочный контент внутри пункта не ломали раскладку. Маркер/номер —
   абсолютно позиционированный ::before, центрируется по вертикали ВСЕГО li
   (top: 50% + translateY(-50%)): у многострочного пункта точка/цифра по центру. */
.blog--pflame .post .article-content > ul,
.blog--pflame .post .article-content > ol {
    list-style: none;
    padding-left: 0;
}
.blog--pflame .post .article-content > ol {
    counter-reset: article-ol;
}
.blog--pflame .post .article-content > ul > li,
.blog--pflame .post .article-content > ol > li {
    position: relative;
    padding-left: 32px;
}
.blog--pflame .post .article-content > ol > li {
    counter-increment: article-ol;
}
.blog--pflame .post .article-content > ul > li::before,
.blog--pflame .post .article-content > ol > li::before {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
}

/* ul — кружок 13×13, #EF773D */
.blog--pflame .post .article-content > ul > li::before {
    content: "";
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background-color: #EF773D;
}

/* ol — номера тем же цветом и шрифтом, что абзац (свой счётчик, т.к. list-style снят) */
.blog--pflame .post .article-content > ol > li::before {
    content: counter(article-ol) ".";
    white-space: nowrap;
    color: #EF773D;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
}
.blog--pflame .post .article-content strong,
.blog--pflame .post .article-content b {
    font-weight: 700;
}
/* заголовок статьи + дата — Figma 7546-28912 */
.blog--pflame .post > h1 {
    margin: 0 0 12px;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 32px;
    font-weight: 600;
    line-height: normal;
    color: #171717;
}
.blog--pflame .post .credentials {
    margin: 0 0 40px;
}
.blog--pflame .post .credentials .date {
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: normal;
    color: #171717;
}

/* блок «Об авторе» — Figma 7546-28915 (подставляется вместо %author%) */
.blog--pflame .post-author {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 60px 0;
}
.blog--pflame .post-author__title {
    margin: 0;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: normal;
    color: #171717;
}
.blog--pflame .post-author__row {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.blog--pflame .post-author__photo {
    flex-shrink: 0;
    width: 210px;
    height: 190px;
    border-radius: 20px;
    object-fit: cover;
    display: block;
}
.blog--pflame .post-author__text {
    margin: 0;
    max-width: 440px;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 16px;
    font-weight: 500;
    line-height: 24px;
    color: #171717;
}

@media (max-width: 768px) {
    /* одиночная статья на мобильном — Figma 7546-* */
    .blog--pflame .post > h1 { font-size: 24px; }
    .blog--pflame .post .credentials { margin-bottom: 20px; }
    .blog--pflame .post .credentials .date { font-size: 16px; }

    /* блок «Об авторе»: аватар слева, текст справа, gap 20px */
    .blog--pflame .post-author { margin: 36px 0; }
    .blog--pflame .post-author__title { font-size: 20px; }
    .blog--pflame .post-author__row { flex-direction: row; }
    .blog--pflame .post-author__photo {
        width: 70px;
        height: 70px;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 16px;
    }
    .blog--pflame .post-author__text { max-width: 368px; font-size: 12px; line-height: 133%; }

    .blog--pflame .post .article-content figure { margin: 20px 0; }
    /* контентные картинки — 304×292; аватар автора не трогаем (он тоже внутри .article-content) */
    .blog--pflame .post .article-content img:not(.post-author__photo) {
        width: 100%;
        aspect-ratio: 304 / 292;
        max-height: 350px;
        object-fit: cover;
    }
    .blog--pflame .post .article-content > figure img { border-radius: 16px; }
    .blog--pflame .post .article-content figcaption { font-size: 12px; margin-top: 8px; }

    .blog--pflame .post .article-content > h2 { font-size: 20px; margin-top: 36px; }
    .blog--pflame .post .article-content > h3 { font-size: 18px; margin-top: 20px; }

    .blog--pflame .post .article-content > p { font-size: 14px; margin-top: 20px; line-height: 142%; }

    .blog--pflame .post .article-content > ul,
    .blog--pflame .post .article-content > ol { margin-top: 20px; }
    .blog--pflame .post .article-content > ul > li,
    .blog--pflame .post .article-content > ol > li { font-size: 14px; line-height: 142%; }
    .blog--pflame .post .article-content > ul > li + li,
    .blog--pflame .post .article-content > ol > li + li { margin-top: 20px; }

    .blog--pflame .post .article-content > ul > li::before { width: 8px; height: 8px; }
    .blog--pflame .post .article-content > ol > li::before { font-size: 18px; font-weight: 700; }
}

@media (min-width: 769px) and (max-width: 1220px) {
    /* одиночная статья — планшет — Figma 7546-* */
    .blog--pflame .post > h1 { font-size: 24px; }
    .blog--pflame .post .credentials { margin-bottom: 40px; }
    .blog--pflame .post .credentials .date { font-size: 20px; }

    /* блок «Об авторе» */
    .blog--pflame .post-author { margin: 40px 0; }
    .blog--pflame .post-author__title { font-size: 20px; }
    .blog--pflame .post-author__photo {
        width: 128px;
        height: 128px;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    .blog--pflame .post-author__text { font-size: 14px; line-height: 128%; max-width: 368px; }

    .blog--pflame .post .article-content figure { margin: 40px 0; }
    /* контентные картинки — 768×562, не выше 562px; аватар автора не трогаем */
    .blog--pflame .post .article-content img:not(.post-author__photo) {
        width: 100%;
        aspect-ratio: 768 / 562;
        max-height: 562px;
        object-fit: cover;
    }

    .blog--pflame .post .article-content > h2 { font-size: 20px; margin-top: 40px; }
    .blog--pflame .post .article-content > h3 { font-size: 18px; }

    .blog--pflame .post .article-content > p { font-size: 15px; line-height: 150%; margin-top: 40px; }

    .blog--pflame .post .article-content > ul,
    .blog--pflame .post .article-content > ol { margin-top: 40px; }
    .blog--pflame .post .article-content > ul > li,
    .blog--pflame .post .article-content > ol > li { font-size: 15px; line-height: 150%; }
    .blog--pflame .post .article-content > ul > li + li,
    .blog--pflame .post .article-content > ol > li + li { margin-top: 20px; }

    .blog--pflame .post .article-content > ul > li::before { width: 12px; height: 12px; }
    .blog--pflame .post .article-content > ol > li::before { font-size: 18px; line-height: 177%; }
}

@media (min-width: 1221px) {
    /* одиночная статья — десктоп (1221px и шире) — Figma 7546-* */
    .blog--pflame .post > h1 { font-size: 32px; }
    .blog--pflame .post .credentials .date { font-size: 24px; }

    /* блок «Об авторе» */
    .blog--pflame .post-author { margin: 60px 0; }
    .blog--pflame .post-author__title { font-size: 24px; }
    .blog--pflame .post-author__photo {
        width: 210px;
        height: 190px;
        aspect-ratio: auto;
        object-fit: cover;
    }
    .blog--pflame .post-author__text { font-size: 16px; max-width: 440px; }

    .blog--pflame .post .article-content figure { margin: 60px 0; }
    /* контентные картинки — 900×562, не выше 562px; аватар автора не трогаем */
    .blog--pflame .post .article-content img:not(.post-author__photo) {
        width: 100%;
        aspect-ratio: 900 / 562;
        max-height: 562px;
        object-fit: cover;
    }
    .blog--pflame .post .article-content figcaption { font-size: 16px; }

    .blog--pflame .post .article-content > h2 { font-size: 24px; line-height: 133%; margin-top: 60px; }
    .blog--pflame .post .article-content > h3 { font-size: 20px; margin-top: 40px; }

    .blog--pflame .post .article-content > p { font-size: 18px; line-height: 177%; margin-top: 40px; }

    .blog--pflame .post .article-content > ul,
    .blog--pflame .post .article-content > ol { margin-top: 40px; }
    .blog--pflame .post .article-content > ul > li,
    .blog--pflame .post .article-content > ol > li { font-size: 18px; line-height: 177%; }
    .blog--pflame .post .article-content > ul > li + li,
    .blog--pflame .post .article-content > ol > li + li { margin-top: 20px; }
}
/* хлебные крошки — тот же центрированный блок 900px, ссылки прижаты к его левому краю */
.blog--pflame .blog-crumbs--post {
    width: 100%;
    max-width: 900px;
    margin: 0 auto 20px;
    justify-content: flex-start;
}

.blog-list__empty {
    margin: 0;
    padding: 40px 0;
    font-size: 16px;
    color: rgba(23, 23, 23, 0.5);
}

.blog--pflame .welcome h1 { font-weight: 700; font-size: 28px; margin: 0 0 12px; }
.blog--pflame .welcome a { color: var(--color-btn-main--default, #ef773d); }

/* пагинация (постранично) — по макету Figma 7534-27817 */
.blog-pager { margin-top: 48px; }
.blog-pager__list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.blog-pager__item a,
.blog-pager__item > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    line-height: normal;
    text-decoration: none;
    color: #171717;
    white-space: nowrap;
}
.blog-pager__item a {
    background: #f3f4f7;
    transition: background-color 0.2s ease;
}
.blog-pager__item a:hover { background: #e6e8ee; }

/* текущая страница */
.blog-pager__item.is-current > span {
    background: #171717;
    color: #fff;
}

/* многоточие */
.blog-pager__item--gap > span {
    background: transparent;
    padding-left: 6px;
    padding-right: 6px;
    color: rgba(23, 23, 23, 0.5);
}

/* кнопка «Следующая» */
.blog-pager__arrow {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

@media (max-width: 768px) {
    .blog-pager { margin-top: 32px; }
    .blog-page__title { font-size: 24px; }
    .blog-list__title { font-size: 24px; margin-bottom: 24px; }
    .blog__nav { margin-bottom: 24px; }
    .blog__search { flex: 1 1 100%; }
    .blog__search input { width: 100%; }
}

/* ==========================================================================
   Список статей
   ========================================================================== */

.blog-list {
    --al-gap-row: 40px;
    --al-gap-col: 20px;
    --al-text: #171717;
    --al-muted: rgba(23, 23, 23, 0.4);

    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--al-gap-row) var(--al-gap-col);
    align-items: start;
    font-family: var(--font-sans, "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
    color: var(--al-text);
}
.blog-list__empty { grid-column: 1 / -1; }

/* --- карточка статьи --- */
.article-card {
    grid-column: span 2;
    display: flex;
    flex-direction: column;
    gap: var(--al-gap-col);
    min-width: 0;
    text-decoration: none;
    color: inherit;
}

/* Раскладка по позиции в списке (страница = до 15 записей, паттерн повторяется постранично):
   1 — большая; 2–7 — по 3 в ряд; 8–9 — по 2; 10 — на всю ширину; 11–13 — по 3; 14–15 — по 2;
   дальше (16+) — по 3. На поиске (.blog-list--plain) всё одинаковое, по 3. */
.blog-list:not(.blog-list--plain) > .article-card:nth-child(8),
.blog-list:not(.blog-list--plain) > .article-card:nth-child(9),
.blog-list:not(.blog-list--plain) > .article-card:nth-child(14),
.blog-list:not(.blog-list--plain) > .article-card:nth-child(15) {
    grid-column: span 3;
}
.blog-list:not(.blog-list--plain) > .article-card:nth-child(10) {
    grid-column: 1 / -1;
}

.article-card__media {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    aspect-ratio: 11 / 10;
    background: var(--color-surface, #f6f7fa);
}

.article-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.article-card__body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    word-break: break-word;
}

.article-card__date {
    font-weight: 600;
    font-size: 16px;
    line-height: normal;
    color: var(--al-muted);
}

.article-card__title {
    margin: 0;
    font-weight: 600;
    font-size: 24px;
    line-height: normal;
    color: var(--al-text);
    transition: color 0.3s ease;
}

.article-card__excerpt {
    margin: 0;
    font-weight: 400;
    font-size: 16px;
    line-height: normal;
    color: var(--al-text);
}

/* --- ховер --- */
@media (hover: hover) {
    .article-card:hover .article-card__img {
        transform: scale(1.04);
    }
    .article-card:hover .article-card__title {
        color: var(--color-btn-main--default, #ef773d);
    }
}

/* --- первая (большая) статья: картинка (4 колонки) + текст (2 колонки) --- */
.blog-list:not(.blog-list--plain) > .article-card:first-child {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    align-items: start;
    gap: var(--al-gap-col);
}
.blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__media {
    grid-column: span 4;
    aspect-ratio: 3 / 2;
}
.blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__body {
    grid-column: span 2;
}

/* ==========================================================================
   Адаптив
   ========================================================================== */

/* ≤768: один столбец, все карточки одинаковые — Figma 7563-36812 */
@media (max-width: 768px) {
    .blog-page__title { margin-bottom: 0; }
    .blog--pflame .blog-search { height: 52px; margin-top: 20px; }

    .blog-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    /* сбрасываем спаны паттерна — всё в один столбец */
    .blog-list > .article-card,
    .blog-list:not(.blog-list--plain) > .article-card:first-child,
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(8),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(9),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(10),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(14),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(15) {
        grid-column: 1 / -1;
    }
    /* первая статья — обычная карточка-столбец, а не картинка+текст */
    .blog-list:not(.blog-list--plain) > .article-card:first-child {
        display: flex;
        flex-direction: column;
        gap: var(--al-gap-col);
    }
    .blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__media {
        aspect-ratio: 304 / 292;
    }

    .blog-list .article-card__media {
        aspect-ratio: 304 / 292;
        height: auto;
        max-height: 300px;
    }
    .article-card__date { font-size: 14px; }
    .article-card__title { font-size: 16px; }
    .article-card__excerpt { font-size: 12px; }
}

/* 768–1220 — Figma 7563-31619
   1-я карточка на всю ширину (картинка слева / текст справа);
   дальше цикл: 4 карточки по 2 в ряд + 1 на всю ширину (картинка сверху). */
@media (min-width: 769px) and (max-width: 1219px) {
    .blog-page__title { font-size: 24px; margin-bottom: 0; }

    .blog-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 40px 8px;
    }

    /* обычная карточка = 1 колонка (в сетке 2 колонки → по 2 в ряд);
       базовый span 2 и десктопный паттерн (8,9,10,14,15) сбрасываем */
    .blog-list > .article-card,
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(8),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(9),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(10),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(14),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(15) {
        grid-column: auto;
    }

    /* на всю ширину: первая + каждая 5-я после неё (6, 11, 16 …) */
    .blog-list:not(.blog-list--plain) > .article-card:first-child,
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(5n + 6) {
        grid-column: 1 / -1;
    }

    /* первая — картинка слева, текст справа, 50/50 */
    .blog-list:not(.blog-list--plain) > .article-card:first-child {
        display: flex;
        flex-direction: row;
        gap: 20px;
        align-items: flex-start;
    }
    .blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__media,
    .blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__body {
        flex: 1 1 0;
        min-width: 0;
    }

    /* макс. высота картинок — 340 */
    .blog-list .article-card__media {
        aspect-ratio: 11 / 10;
        height: auto;
        max-height: 340px;
    }

    /* типографика всех карточек, кроме первой */
    .blog-list > .article-card:not(:first-child) .article-card__date { font-size: 14px; }
    .blog-list > .article-card:not(:first-child) .article-card__title { font-size: 20px; }
    .blog-list > .article-card:not(:first-child) .article-card__excerpt { font-size: 14px; }
}

/* 1220–1360
   сетка 6 колонок (как на десктопе); 1-я большая (картинка 2/3 слева, текст справа);
   дальше ряды по паттерну 3 / 2 / 1 (по 3 в ряд → по 2 в ряд → на всю ширину), повтор.
   Хвост страницы из 2 карточек — тоже по 2 в ряд. */
@media (min-width: 1220px) and (max-width: 1359px) {
    .blog-page__title { font-size: 32px; margin-bottom: 0; }

    .blog-list { gap: 40px 20px; }

    /* 8,9,10 в этом паттерне — обычные (по 3 в ряд), сбрасываем десктопный span 3 / full */
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(8),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(9),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(10) {
        grid-column: span 2;
    }
    /* по 2 в ряд — 5,6 / 11,12 / 17,18 … + последняя пара (14,15) */
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(6n + 5),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(6n + 6),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(14),
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(15) {
        grid-column: span 3;
    }
    /* на всю ширину — 7 / 13 / 19 … */
    .blog-list:not(.blog-list--plain) > .article-card:nth-child(6n + 7) {
        grid-column: 1 / -1;
    }

    /* картинки: первая — 806×600 (макс. высота 600), остальные — фикс. 353 */
    .blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__media {
        aspect-ratio: 806 / 600;
        height: auto;
        max-height: 600px;
    }
    .blog-list > .article-card:not(:first-child) .article-card__media {
        aspect-ratio: auto;
        height: 353px;
    }
}

/* 1360+ (десктоп)
   сетка 6 колонок; 1-я большая (картинка 2/3 слева, текст справа);
   дальше ряды: 3, 3, 2, 1, 3, 2 (= базовый паттерн). */
@media (min-width: 1360px) {
    .blog-page__title { font-size: 32px; margin-bottom: 0; }
    .blog--pflame .blog-search { height: 72px; margin: 40px 0 20px; }
    .blog-list { gap: 40px 20px; }

    /* картинки: первая — 806×600 (макс. высота 600), остальные — макс. высота 400 */
    .blog-list:not(.blog-list--plain) > .article-card:first-child .article-card__media {
        aspect-ratio: 900 / 600;
        height: auto;
        max-height: 600px;
    }
    .blog-list > .article-card:not(:first-child) .article-card__media {
        max-height: 400px;
    }
}

/* ==========================================================================
   Блок «Товары по теме» — Figma 7563-37645 / 37652 / 38100 / 38106
   Заголовок + кнопка «Перейти в каталог»; ширина как у колонки статьи (900px).
   Брейкпоинты: <768 · 768–1180 · 1180–1380 · ≥1380
   ========================================================================== */
.blog--pflame .post-catalog-cta {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 16px;
    max-width: 900px;
    margin: 40px auto 0;
}
.blog--pflame .post-catalog-cta__title {
    margin: 0;
    width: 100%;
    color: #171717;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 24px;
    font-weight: 600;
    line-height: 32px;
    overflow-wrap: break-word;
}
.blog--pflame .post-catalog-cta__btn {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    background: var(--color-btn-main--default, #ef773d);
    box-shadow: var(--shadow-xs, 0 1px 2px 0 rgba(0, 0, 0, 0.15));
    color: #fff;
    text-decoration: none;
    overflow: hidden;
    transition: background-color 0.15s ease;
}
.blog--pflame .post-catalog-cta__btn:hover {
    background: var(--color-btn-main--hover, #ff905b);
}
.blog--pflame .post-catalog-cta__btn-label {
    color: #fff;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    white-space: nowrap;
}
.blog--pflame .post-catalog-cta__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 14.142px;
    height: 14.142px;
    flex-shrink: 0;
}
.blog--pflame .post-catalog-cta__icon-rot {
    position: relative;
    display: block;
    width: 10px;
    height: 10px;
    flex: none;
    transform: rotate(-135deg);
}
.blog--pflame .post-catalog-cta__icon-rot img {
    position: absolute;
    inset: -10%;
    display: block;
    max-width: none;
    width: 100%;
    height: 100%;
}

@media (min-width: 768px) and (max-width: 1179px) {
    .blog--pflame .post-catalog-cta {
        margin-top: 60px;
        gap: 24px;
    }
    .blog--pflame .post-catalog-cta__btn {
        width: auto;
    }
}

@media (min-width: 1180px) {
    .blog--pflame .post-catalog-cta {
        margin-top: 80px;
        gap: 24px;
    }
    .blog--pflame .post-catalog-cta__title {
        font-size: 32px;
    }
    .blog--pflame .post-catalog-cta__btn {
        width: auto;
    }
}

.blog--pflame .post-catalog-cta + .post-related {
    margin-top: 40px;
}
@media (min-width: 768px) and (max-width: 1179px) {
    .blog--pflame .post-catalog-cta + .post-related {
        margin-top: 60px;
    }
}
@media (min-width: 1180px) {
    .blog--pflame .post-catalog-cta + .post-related {
        margin-top: 80px;
    }
}

/* ==========================================================================
   Блок «Статьи по теме» под записью — Figma 7546-29160
   Секция выходит из центрированной колонки .post (900px) на всю ширину блога.
   Заголовок выровнен по той же 900px-колонке, карточки — на всю ширину.
   ========================================================================== */
.blog--pflame .post-related {
    margin: 80px 0 0;
}
.blog--pflame .post-related__title {
    margin: 0 0 40px;
    color: #171717;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 32px;
    font-weight: 600;
    line-height: normal;
}
.blog--pflame .post-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}
.blog--pflame .related-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: #fff;
}
/* обёртка изображения — она задаёт пропорции/высоту карточки и скругление */
.blog--pflame .related-card__media {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 386 / 353;
    border-radius: 20px;
    overflow: hidden;
}
.blog--pflame .related-card__img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
/* лёгкий блюр поверх фото — заголовок/кнопка снаружи media, остаются чёткими */
/* было: блюр на всю карточку
.blog--pflame .related-card__media::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background: rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    pointer-events: none;
}
*/
/* блюр только снизу, плавно уходит вверх */
.blog--pflame .related-card__media::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 70%;
    z-index: 1;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0));
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    -webkit-mask-image: linear-gradient(to top, #000 40%, transparent);
    mask-image: linear-gradient(to top, #000 40%, transparent);
    pointer-events: none;
}
.blog--pflame .related-card__overlay {
    position: absolute;
    left: 30px;
    right: 30px;
    bottom: 30px;
    z-index: 2;
    max-width: 220px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
}
.blog--pflame .related-card__name {
    color: #fff;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    /* реальные заголовки записей бывают длинными — не больше 3 строк */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.blog--pflame .related-card__btn {
    display: inline-flex;
    align-items: center;
    padding: 16px 20px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    color: #fff;
    font-family: var(--font-sans, "Montserrat", system-ui, sans-serif);
    font-size: 16px;
    font-weight: 700;
    line-height: normal;
    white-space: nowrap;
    transition: background-color 0.2s ease;
}
.blog--pflame .related-card:hover .related-card__btn {
    background: rgba(255, 255, 255, 0.28);
}

@media (min-width: 1221px) {
    /* заголовок — по центру, в габаритах 900px-колонки статьи (Figma: отступ слева 230px) */
    .blog--pflame .post-related__title {
        max-width: 900px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 1221px) and (max-width: 1360px) {
    .blog--pflame .related-card__name { font-size: 24px; }
}

@media (min-width: 769px) and (max-width: 1220px) {
    .blog--pflame .post-related { margin-top: 60px; }
    .blog--pflame .post-related__title { font-size: 24px; margin-bottom: 24px; }
    .blog--pflame .related-card__overlay { left: 20px; right: 20px; bottom: 20px; max-width: 220px; gap: 12px; }
    .blog--pflame .related-card__name { font-size: 24px; }
    .blog--pflame .related-card__btn { padding: 12px 16px; font-size: 14px; }
    .blog--pflame .post-related__grid { grid-template-columns: 1fr; gap: 8px; }
    .blog--pflame .related-card__media { max-height: 360px; }
}

@media (max-width: 768px) {
    .blog--pflame .post-related { margin-top: 40px; }
    .blog--pflame .post-related__title { font-size: 24px; margin-bottom: 20px; }
    .blog--pflame .post-related__grid { grid-template-columns: 1fr; gap: 16px; }
    .blog--pflame .related-card__media { aspect-ratio: 304 / 292; max-height: 350px; }
    .blog--pflame .related-card__overlay { left: 20px; right: 20px; bottom: 20px; max-width: 260px; gap: 12px; }
    .blog--pflame .related-card__name { font-size: 24px; }
    .blog--pflame .related-card__btn { padding: 12px 16px; font-size: 14px; }
}

/* ==========================================================================
   Слайдер товаров в теле статьи — плейсхолдер %product_slider:ID,ID%
   Карточка = «как на главной»: у обёртки класс .pflame-home-carousel, поэтому
   размеры карточек/фото берутся 1:1 из components/product-card.css +
   components/products-carousel.css (грузятся в site.styles.html родительской темы).
   Здесь — только обёртка: вырывается из колонки .post (900px) до 1380px по центру
   + гасим типографские правила .article-content для картинок карточек.
   ========================================================================== */
.blog--pflame .post .article-content .post-products {
    margin: 60px 0;
}
.blog--pflame .post .article-content .post-products .products-carousel {
    margin-top: 0;
}
/* .article-content img задаёт свой aspect-ratio/max-height — для фото карточек не нужно */
.blog--pflame .post .article-content .post-products img:not(.post-author__photo) {
    aspect-ratio: auto;
    max-height: none;
}
/* иконки-кнопки поверх фото; клик всегда по <a>, а не по <svg>/<use> */
.blog--pflame .post .article-content .post-products .product-card__btn-wishlist,
.blog--pflame .post .article-content .post-products .product-card__btn-add {
    z-index: 2;
}
.blog--pflame .post .article-content .post-products .product-card__btn-wishlist svg,
.blog--pflame .post .article-content .post-products .product-card__btn-add svg {
    pointer-events: none;
}
@media (min-width: 1180px) {
    .blog--pflame .post .article-content .post-products {
        width: min(1380px, calc(100vw - 32px));
        margin-left: 50%;
        transform: translateX(-50%);
    }
}
.blog--pflame .post .article-content .article-button {
    position: relative;
    height: 52px;
    display: flex;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.15);
    padding: 0 30px 0 16px;
    width: fit-content;
    color: #FFF;
    font-family: Montserrat;
    font-size: 16px;
    font-style: normal;
    font-weight: 700;
    line-height: normal;
}
.blog--pflame .post .article-content .article-button::after {
    position: absolute;
    content: '';
    top: 50%;
    right: 14px;
    transform: translateY(-50%);
    width: 10px;
    height: 17px;
    background: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20width='10'%20height='17'%20viewBox='0%200%2010%2017'%20fill='none'%3E%3Cpath%20opacity='0.3'%20d='M1%2015.1426L8.07107%208.07151L1%201.00044'%20stroke='white'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat center / contain;
    z-index: 1;
}
@media(max-width: 768px) {
    .blog--pflame .post .article-content .article-button {
        width: 100%;
    }
}

.blog--pflame .post .article-content .article-flex * {
    margin: 0;
}
.blog--pflame .post .article-content .article-flex {
    display: flex; 
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-top: 60px;
}
@media(max-width: 768px) {
    .blog--pflame .post .article-content .article-flex {
        margin-top: 40px;
    }
}