/*
 * Epil: блог — шапка ленты с темами и поиском, лента статей, боковая колонка, читаемая статья.
 * Виджеты epil_blog_* + стили поверх виджетов Listivo («Популярные посты», статья, «Похожие статьи»).
 */
:root {
    --eb-accent: #d86eec;
    --eb-accent-dark: #b44fc9;
    --eb-accent-soft: #fbeefe;
    --eb-text: var(--e-global-color-lcolor1, #374b5c);
    --eb-muted: var(--e-global-color-lcolor2, #73818c);
    --eb-line: var(--e-global-color-lcolor3, #d5e3ee);
    --eb-soft: var(--e-global-color-lcolor4, #f2f4f8);
    --eb-star: #ffb800;
    --eb-radius: 20px;
    --eb-shadow: 0 10px 30px rgba(15, 23, 42, .06);
}

/* ===== Шапка ленты ===== */
.epil-blog-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
    align-items: end;
    gap: 16px 32px;
    margin: 8px 0 4px;
    color: var(--eb-text);
}

html body .epil-blog-hero__title {
    margin: 0 0 8px;
    font-family: var(--epil-font-heading, inherit);
    font-size: 32px;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.01em;
    color: var(--eb-text);
}

.epil-blog-hero__lead {
    max-width: 620px;
    margin: 0;
    color: var(--eb-muted);
    font-size: 16px;
    line-height: 1.55;
}

.epil-blog-hero__search {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 6px 0 16px;
    border: 1px solid var(--eb-line);
    border-radius: 14px;
    background: #fff;
    box-shadow: var(--eb-shadow);
}

.epil-blog-hero__search:focus-within {
    border-color: var(--eb-accent);
}

.epil-blog-hero__search svg {
    flex: 0 0 auto;
    width: 18px;
    height: 18px;
    color: var(--eb-muted);
}

html body .epil-blog-hero__search input[type=search] {
    flex: 1 1 auto;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
    color: var(--eb-text);
    font-size: 15px;
    outline: none;
}

html body .epil-blog-hero__search button {
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    background: var(--eb-accent);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

html body .epil-blog-hero__search button:hover {
    background: var(--eb-accent-dark);
}

/* Чипсы тем */
.epil-blog-topics {
    grid-column: 1 / -1;
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.epil-blog-topics::-webkit-scrollbar {
    display: none;
}

.epil-blog-topics--wrap {
    flex-wrap: wrap;
    margin-top: 0;
    overflow: visible;
}

html body .epil-blog-topic {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    height: 38px;
    padding: 0 14px;
    border: 1px solid var(--eb-line);
    border-radius: 999px;
    background: #fff;
    color: var(--eb-text);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.epil-blog-topic em {
    color: var(--eb-muted);
    font-size: 12px;
    font-style: normal;
    font-weight: 500;
}

html body .epil-blog-topic:hover {
    border-color: var(--eb-accent);
    color: var(--eb-accent-dark);
}

html body .epil-blog-topic.is-active {
    border-color: var(--eb-accent);
    background: var(--eb-accent-soft);
    color: var(--eb-accent-dark);
}

.epil-blog-topics--wrap .epil-blog-topic {
    height: 32px;
    padding: 0 12px;
    font-size: 13px;
}

/* ===== Лента ===== */
.epil-blog-feed {
    display: grid;
    gap: 24px;
    color: var(--eb-text);
}

.epil-blog-feed__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
}

.epil-blog-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: var(--eb-radius);
    background: #fff;
    box-shadow: var(--eb-shadow);
    transition: box-shadow .2s ease, transform .2s ease;
}

.epil-blog-card:hover {
    box-shadow: 0 16px 36px rgba(15, 23, 42, .12);
    transform: translateY(-2px);
}

html body .epil-blog-card__img {
    position: relative;
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--eb-accent-soft), #ecd5f7);
}

.epil-blog-card__img img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}

.epil-blog-card:hover .epil-blog-card__img img {
    transform: scale(1.04);
}

.epil-blog-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 10px;
    padding: 20px 22px 22px;
}

html body .epil-blog-card__topic {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--eb-accent-soft);
    color: var(--eb-accent-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .02em;
    text-decoration: none;
}

html body .epil-blog-card__title {
    margin: 0;
    font-family: var(--epil-font-heading, inherit);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
}

html body .epil-blog-card__title a {
    color: var(--eb-text);
    text-decoration: none;
}

html body .epil-blog-card__title a:hover {
    color: var(--eb-accent-dark);
}

.epil-blog-card__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--eb-muted);
    font-size: 14px;
    line-height: 1.6;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.epil-blog-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: auto 0 0;
    padding-top: 4px;
    color: var(--eb-muted);
    font-size: 13px;
}

/* Крупная карточка — первая статья */
.epil-blog-card--lead {
    display: grid;
    grid-template-columns: 55% minmax(0, 1fr);
}

.epil-blog-card--lead .epil-blog-card__img {
    aspect-ratio: auto;
    min-height: 320px;
}

.epil-blog-card--lead .epil-blog-card__body {
    justify-content: center;
    gap: 14px;
    padding: 32px;
}

html body .epil-blog-card--lead .epil-blog-card__title {
    font-size: 24px;
    line-height: 1.3;
}

.epil-blog-card--lead .epil-blog-card__excerpt {
    font-size: 15px;
    -webkit-line-clamp: 3;
}

.epil-blog-card--lead .epil-blog-card__meta {
    margin-top: 0;
}

.epil-blog-feed__empty {
    padding: 40px 24px;
    border-radius: var(--eb-radius);
    background: #fff;
    text-align: center;
}

.epil-blog-feed__empty p {
    margin: 0 0 10px;
    font-weight: 700;
}

html body .epil-blog-feed__empty a {
    color: var(--eb-accent-dark);
    font-weight: 600;
}

/* Пагинация */
.epil-blog-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

html body .epil-blog-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--eb-line);
    border-radius: 12px;
    background: #fff;
    color: var(--eb-text);
    font-weight: 700;
    text-decoration: none;
}

html body .epil-blog-pagination .page-numbers.current {
    border-color: var(--eb-accent);
    background: var(--eb-accent);
    color: #fff;
}

html body .epil-blog-pagination a.page-numbers:hover {
    border-color: var(--eb-accent);
    color: var(--eb-accent-dark);
}

html body .epil-blog-pagination .page-numbers.dots {
    border: 0;
    background: none;
}

/* ===== Боковая колонка ===== */
.epil-blog-box {
    padding: 22px;
    border-radius: var(--eb-radius);
    background: #fff;
    box-shadow: var(--eb-shadow);
    color: var(--eb-text);
}

html body .epil-blog-box__title {
    margin: 0 0 14px;
    font-family: var(--epil-font-heading, inherit);
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

html body .epil-blog-studios__list {
    display: grid;
    gap: 4px;
    margin: 0 0 16px;
    padding: 0;
    list-style: none;
}

.epil-blog-studios__list li {
    margin: 0;
}

html body .epil-blog-studio {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    margin: 0 -8px;
    border-radius: 12px;
    color: var(--eb-text);
    text-decoration: none;
    transition: background-color .15s ease;
}

html body .epil-blog-studio:hover {
    background: var(--eb-soft);
}

.epil-blog-studio__img {
    position: relative;
    flex: 0 0 56px;
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--eb-accent-soft), #ecd5f7);
}

.epil-blog-studio__img img {
    width: 100%;
    height: 100%;
    border-radius: 12px;
    object-fit: cover;
}

.epil-blog-studio__place {
    position: absolute;
    top: -6px;
    left: -6px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: var(--eb-text);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
}

.epil-blog-studio__place--1 {
    background: #f5b301;
}

.epil-blog-studio__place--2 {
    background: #9aa7b4;
}

.epil-blog-studio__place--3 {
    background: #cd7f4a;
}

.epil-blog-studio__body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

.epil-blog-studio__name {
    display: -webkit-box;
    overflow: hidden;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.epil-blog-studio__rating {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--eb-muted);
    font-size: 13px;
}

.epil-blog-studio__rating svg {
    width: 14px;
    height: 14px;
    fill: var(--eb-star);
}

.epil-blog-studio__rating b {
    color: var(--eb-text);
}

.epil-blog-studio__rating em {
    font-style: normal;
}

.epil-blog-studios__actions {
    display: grid;
    gap: 8px;
}

html body .epil-blog-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    border: 1.5px solid var(--eb-accent);
    border-radius: 12px;
    background: #fff;
    color: var(--eb-accent-dark);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

html body .epil-blog-btn:hover {
    background: var(--eb-accent-soft);
    color: var(--eb-accent-dark);
}

html body .epil-blog-btn--primary {
    background: var(--eb-accent);
    color: #fff;
}

html body .epil-blog-btn--primary:hover {
    background: var(--eb-accent-dark);
    color: #fff;
}

/* ===== Адаптив ===== */
@media (max-width: 1024px) {
    .epil-blog-hero {
        grid-template-columns: 1fr;
    }

    .epil-blog-card--lead {
        grid-template-columns: 1fr;
    }

    .epil-blog-card--lead .epil-blog-card__img {
        min-height: 0;
        aspect-ratio: 16 / 9;
    }

    .epil-blog-card--lead .epil-blog-card__body {
        padding: 22px;
    }
}

@media (max-width: 767px) {
    html body .epil-blog-hero__title {
        font-size: 26px;
    }

    .epil-blog-hero__lead {
        font-size: 15px;
    }

    .epil-blog-feed,
    .epil-blog-feed__grid {
        gap: 16px;
    }

    .epil-blog-feed__grid {
        grid-template-columns: 1fr;
    }

    html body .epil-blog-card--lead .epil-blog-card__title {
        font-size: 20px;
    }

    .epil-blog-card__body {
        padding: 16px 18px 18px;
    }
}

/* ===== Статья (виджет Listivo lst_blog_post_v2) ===== */
html body .listivo-single-post__title {
    margin-bottom: 12px;
    font-size: 32px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: -.01em;
}

html body .listivo-single-post__content {
    max-width: 720px;
    color: var(--eb-text);
    font-size: 17px;
    line-height: 1.75;
}

html body .listivo-single-post__content p {
    margin: 0 0 1.1em;
    font-size: inherit;
    line-height: inherit;
}

html body .listivo-single-post__content h2 {
    margin: 1.6em 0 .6em;
    font-size: 24px;
    line-height: 1.3;
}

html body .listivo-single-post__content h3 {
    margin: 1.4em 0 .5em;
    font-size: 20px;
    line-height: 1.35;
}

html body .listivo-single-post__content ul,
html body .listivo-single-post__content ol {
    margin: 0 0 1.1em;
    padding-left: 1.3em;
}

html body .listivo-single-post__content li {
    margin-bottom: .4em;
}

html body .listivo-single-post__content li::marker {
    color: var(--eb-accent-dark);
}

html body .listivo-single-post__content blockquote {
    margin: 1.4em 0;
    padding: 16px 20px;
    border-left: 4px solid var(--eb-accent);
    border-radius: 0 14px 14px 0;
    background: var(--eb-accent-soft);
    font-size: 17px;
    font-style: normal;
}

html body .listivo-single-post__content img {
    height: auto;
    border-radius: 16px;
}

html body .listivo-single-post__content a {
    color: var(--eb-accent-dark);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* «4 мин чтения» перед текстом */
html body .listivo-single-post__content .epil-blog-readtime {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--eb-soft);
    color: var(--eb-muted);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
}

.epil-blog-readtime svg {
    width: 15px;
    height: 15px;
    color: var(--eb-accent-dark);
}

html body .listivo-single-post__image img {
    border-radius: var(--eb-radius) var(--eb-radius) 0 0;
}

/* Заголовок формы комментария и другие крупные подзаголовки статьи */
html body.single-post .comment-reply-title {
    font-size: 22px;
}

/* ===== Виджеты Listivo в боковой колонке блога ===== */
html body .listivo-sidebar-widget__label {
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;
}

html body .listivo-sidebar-posts__label {
    display: -webkit-box;
    overflow: hidden;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

/* «Похожие статьи» и карточки v5 Listivo */
html body .listivo-blog-post-card-v5__heading,
html body .listivo-blog-post-card-v4__heading {
    font-size: 18px;
    line-height: 1.35;
}

/* Блок подписки внизу страниц блога */
html body.blog .listivo-heading-v2__text,
html body.category .listivo-heading-v2__text,
html body.single-post .listivo-heading-v2__text {
    font-size: 28px;
    line-height: 1.25;
}

@media (max-width: 767px) {
    html body .listivo-single-post__title {
        font-size: 26px;
    }

    html body .listivo-single-post__content {
        font-size: 16px;
        line-height: 1.7;
    }

    html body .listivo-single-post__content h2 {
        font-size: 21px;
    }

    html body .listivo-single-post__content h3 {
        font-size: 18px;
    }

    html body.blog .listivo-heading-v2__text,
    html body.category .listivo-heading-v2__text,
    html body.single-post .listivo-heading-v2__text {
        font-size: 22px;
    }
}
