/* LOVICE — page-blog.css | хаб блога + страница статьи + виджет «Из блога» | тема Neon Sunset */

/* =====================================================================
   ВИДЖЕТ «ИЗ БЛОГА» (на лендингах, из js/layout.js)
   ===================================================================== */
.blog-teaser { padding: 80px 0; position: relative; }
/* шапка — по центру, единообразно с блоком «Все инструменты Lovice» */
.blog-teaser__head { margin-bottom: 34px; }
.blog-teaser__head .section-sub { max-width: 640px; margin-left: auto; margin-right: auto; }

/* карточки: flex вместо grid — чтобы неполный ряд (1–2 статьи) центрировался,
   а полный ряд аккуратно раскладывался по 3 в ряд.
   Двойной класс — приоритет над базовым .blog-grid (grid, 4 колонки, определён ниже). */
.blog-grid.blog-grid--teaser {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 18px;
}
.blog-grid.blog-grid--teaser .bcard { width: calc((100% - 2 * 18px) / 3); min-width: 260px; }

/* «Все статьи →» — центрированная кнопка под карточками */
.blog-teaser__foot { text-align: center; margin-top: 36px; }
.blog-teaser__all {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--acc-soft); font-weight: 600; font-size: .95rem;
    padding: 10px 22px; border: 1px solid var(--line); border-radius: 100px;
    transition: color .18s, border-color .18s, transform .18s; white-space: nowrap;
}
.blog-teaser__all:hover { color: var(--acc); border-color: var(--acc-soft); transform: translateY(-1px); }

@media (max-width: 900px) { .blog-grid.blog-grid--teaser .bcard { width: calc((100% - 18px) / 2); } }
@media (max-width: 560px) { .blog-grid.blog-grid--teaser .bcard { width: 100%; } }


/* =====================================================================
   BLOG HERO
   ===================================================================== */
.blog-hero {
    position: relative;
    padding: 43px 0 40px;
    overflow: hidden;
}
/* тёплая подсветка-подложка у шапки блога (совпадает с ambient-глоу сайта) */
.blog-hero::before {
    content: "";
    position: absolute; inset: 0; z-index: -2; pointer-events: none;
    background:
        radial-gradient(700px 320px at 50% -8%, rgba(255, 77, 109, 0.16), transparent 62%),
        radial-gradient(560px 300px at 78% 4%, rgba(255, 138, 61, 0.12), transparent 60%),
        radial-gradient(520px 300px at 20% 8%, rgba(255, 77, 109, 0.08), transparent 60%);
}
.blog-hero__glow {
    position: absolute; top: -160px; left: 50%; transform: translateX(-50%);
    width: 860px; height: 520px; pointer-events: none; z-index: -1;
    background:
        radial-gradient(closest-side, rgba(255, 77, 109, 0.42), transparent 72%),
        radial-gradient(closest-side at 62% 46%, rgba(255, 138, 61, 0.30), transparent 70%);
    filter: blur(26px);
}
.blog-hero__inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.blog-hero__eyebrow {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 15px; border-radius: 100px;
    font-size: .82rem; font-weight: 600; color: var(--ink);
    margin-bottom: 22px;
    background: linear-gradient(118deg, rgba(255, 77, 109, 0.14), rgba(255, 138, 61, 0.12));
    border: 1px solid var(--line);
    box-shadow: 0 6px 22px rgba(226, 58, 92, 0.18);
}
.blog-hero__eyebrow-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--acc); box-shadow: 0 0 12px var(--acc);
}
.blog-hero__title {
    font-family: 'Manrope', sans-serif; font-weight: 800;
    font-size: clamp(2.5rem, 6vw, 3.9rem); line-height: 1.1; letter-spacing: -.02em;
    margin: 0 0 16px;
}
.blog-hero__subtitle {
    max-width: 660px; color: var(--ink-soft);
    font-size: 1.05rem; line-height: 1.6; margin: 0 0 34px;
}

/* Поиск */
.blog-search {
    position: relative; display: flex; align-items: stretch; gap: 10px;
    width: 100%; max-width: 640px; margin-bottom: 22px;
}
.blog-search__ico {
    position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
    color: var(--ink-mute); pointer-events: none; z-index: 1;
}
.blog-search__input {
    flex: 1; min-width: 0; box-sizing: border-box;
    background: var(--glass); border: 1px solid var(--line);
    border-radius: 16px; padding: 12px 18px 12px 46px;
    color: var(--ink); font-family: inherit; font-size: 1.02rem; outline: none;
    transition: border-color .2s, box-shadow .2s;
}
.blog-search__input::placeholder { color: var(--ink-mute); }
.blog-search__input:focus { border-color: var(--acc); box-shadow: 0 0 0 3px var(--acc-glow); }
.blog-search__btn {
    flex: 0 0 auto; cursor: pointer; border: none;
    padding: 0 26px; border-radius: 16px;
    background: var(--acc-grad); color: var(--on-acc);
    font-family: inherit; font-size: 1rem; font-weight: 700; white-space: nowrap;
    box-shadow: 0 6px 18px var(--acc-glow);
    transition: transform .18s, box-shadow .18s, filter .18s;
}
.blog-search__btn:hover { transform: translateY(-1px); box-shadow: 0 9px 24px var(--acc-glow); filter: brightness(1.04); }
.blog-search__btn:active { transform: translateY(0); }

/* Табы категорий */
.blog-tabs {
    display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 16px;
}
/* свёрнутое состояние — не более 2 рядов (max-height задаёт JS) */
.blog-tabs.is-collapsed { overflow: hidden; }
.blog-tab {
    cursor: pointer; border: 1px solid var(--line); background: var(--glass);
    color: var(--ink-soft); border-radius: 100px; padding: 6px 16px;
    font-family: inherit; font-size: .85rem; font-weight: 600;
    transition: color .18s, border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.blog-tab:hover { color: var(--ink); border-color: var(--acc-soft); transform: translateY(-1px); }
.blog-tab.is-active {
    color: var(--on-acc); background: var(--acc-grad); border-color: transparent;
    box-shadow: 0 4px 12px var(--acc-glow);
}
/* кнопка «Показать ещё теги» — по центру под тегами, в стиле сайта */
.blog-tags-toggle {
    display: block; margin: 0 auto 16px; cursor: pointer;
    border: 1px solid var(--acc-soft); background: var(--glass);
    color: var(--acc-soft); border-radius: 100px; padding: 6px 18px;
    font-family: inherit; font-size: .82rem; font-weight: 700;
    transition: color .18s, border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.blog-tags-toggle:hover {
    color: var(--on-acc); background: var(--acc-grad); border-color: transparent;
    transform: translateY(-1px); box-shadow: 0 4px 12px var(--acc-glow);
}
.blog-count { color: var(--ink-mute); font-size: .88rem; margin: 4px 0 0; }

/* =====================================================================
   СЕТКА СТАТЕЙ
   ===================================================================== */
.blog-section { padding: 20px 0 72px; }
.blog-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.blog-grid--related { margin-top: 6px; }
.blog-loading { grid-column: 1 / -1; text-align: center; color: var(--ink-mute); padding: 50px 0; }

/* Карточка статьи */
.bcard {
    display: flex; flex-direction: column; overflow: hidden;
    background: var(--bg-2); border: 1px solid rgba(255, 122, 144, 0.30); border-radius: 16px;
    text-decoration: none; color: inherit;
    /* мягкое неоновое свечение рамки — по умолчанию, а не только на hover */
    box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.08), 0 6px 22px var(--acc-glow);
    transition: transform .2s, border-color .2s, box-shadow .2s;
}
.bcard:hover {
    transform: translateY(-4px); border-color: var(--acc-soft);
    box-shadow: 0 0 0 1px rgba(255, 77, 109, 0.18), 0 14px 38px var(--acc-glow), 0 14px 34px rgba(0, 0, 0, .35);
}
.bcard__cover {
    position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden;
    background: var(--bg-3);
}
/* неоново-зелёная светящаяся полоска — отделяет обложку от текста */
.bcard__cover::after {
    content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; z-index: 2;
    background: linear-gradient(90deg, var(--ok), var(--ok-soft));
    box-shadow: 0 0 10px var(--ok-glow);
}
.bcard__cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s; }
.bcard:hover .bcard__cover img { transform: scale(1.05); }
.bcard__ph {
    width: 100%; height: 100%; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; opacity: .5;
}
.bcard__cat {
    position: absolute; top: 10px; left: 10px;
    padding: 3px 9px; border-radius: 100px; font-size: .67rem; font-weight: 700;
    letter-spacing: .01em; line-height: 1.25;
    color: var(--on-acc); background: var(--acc-grad);
    box-shadow: 0 3px 9px var(--acc-glow);
}
.bcard__body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; flex: 1; }
.bcard__meta { display: flex; align-items: center; gap: 10px; color: var(--ink-mute); font-size: .8rem; }
.bcard__read::before { content: '· '; }
.bcard__title {
    font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1rem;
    line-height: 1.3; color: var(--ink);
}
.bcard__excerpt {
    color: var(--ink-soft); font-size: .88rem; line-height: 1.5;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* кнопка «Читать статью» — полноценная, во всю ширину карточки */
.bcard__more {
    margin-top: auto; display: flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; padding: 10px 14px; border-radius: 12px;
    color: var(--on-acc); font-weight: 700; font-size: .9rem;
    /* тёплый оранж-персик — из палитры сайта, но отличается от коралловго чипа */
    background: linear-gradient(118deg, #ff6a52 0%, #ff9a3d 100%);
    box-shadow: 0 4px 14px rgba(255, 122, 61, 0.28);
    transition: filter .18s, box-shadow .18s, transform .18s;
}
.bcard:hover .bcard__more { filter: brightness(1.07); box-shadow: 0 6px 18px rgba(255, 122, 61, 0.36); }
.bcard__more span { transition: transform .2s; display: inline-block; }
.bcard:hover .bcard__more span { transform: translateX(4px); }

/* Пусто */
.blog-empty {
    grid-column: 1 / -1; text-align: center; padding: 64px 20px;
    background: var(--bg-2); border: 1px dashed var(--line); border-radius: 18px;
}
.blog-empty__ico { font-size: 2.4rem; margin-bottom: 12px; }
.blog-empty__title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 1.2rem; margin: 0 0 6px; }
.blog-empty__sub { color: var(--ink-mute); margin: 0; }

@media (max-width: 1100px) {
    .blog-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .blog-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   ПАГИНАЦИЯ (хаб /blog)
   ===================================================================== */
.blog-pagination {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
    gap: 8px; margin-top: 40px;
}
.blog-pagination:empty { display: none; }
.blog-page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 42px; height: 42px; padding: 0 12px; box-sizing: border-box;
    border: 1px solid var(--line); background: var(--glass); color: var(--ink-soft);
    border-radius: 12px; font-family: inherit; font-size: .92rem; font-weight: 700;
    text-decoration: none; cursor: pointer; user-select: none;
    transition: color .18s, border-color .18s, background .18s, transform .18s, box-shadow .18s;
}
.blog-page:hover { color: var(--ink); border-color: var(--acc-soft); transform: translateY(-1px); }
.blog-page.is-active {
    color: var(--on-acc); background: var(--acc-grad); border-color: transparent;
    box-shadow: 0 4px 14px var(--acc-glow); cursor: default;
}
.blog-page--nav { padding: 0 16px; }
.blog-page--gap {
    border: none; background: none; color: var(--ink-mute); min-width: 22px;
    cursor: default; box-shadow: none;
}
.blog-page--gap:hover { transform: none; color: var(--ink-mute); }
.blog-page.is-disabled {
    opacity: .4; cursor: not-allowed; pointer-events: none;
}

@media (max-width: 560px) {
    .blog-page { min-width: 38px; height: 38px; font-size: .86rem; }
    .blog-page--nav { padding: 0 12px; }
}

/* =====================================================================
   СТРАНИЦА СТАТЬИ
   ===================================================================== */
.article { position: relative; padding-top: calc(var(--nav-h, 68px) + 6px); }

/* мягкое тёплое свечение вверху страницы статьи — «оживляет» тёмный фон */
.article::before {
    content: "";
    position: absolute; inset: 0 0 auto; height: 640px;
    z-index: 0; pointer-events: none;
    background:
        radial-gradient(720px 360px at 78% -6%, rgba(255, 122, 61, 0.10), transparent 62%),
        radial-gradient(760px 420px at 12% 2%, rgba(255, 77, 109, 0.09), transparent 58%);
}
/* контент статьи — поверх фонового свечения */
.article > * { position: relative; z-index: 1; }

/* хлебные крошки — выровнены по колонке контента (заголовок/обложка = 900px) */
.breadcrumbs { padding: 4px 0; }
.breadcrumbs__inner { max-width: 900px; margin: 0 auto; display: flex; align-items: center; justify-content: flex-start; gap: 8px; flex-wrap: wrap; }
.breadcrumbs__trail { display: flex; align-items: center; gap: 8px; color: var(--ink-mute); font-size: .92rem; flex-wrap: wrap; }
.breadcrumbs__trail a { color: var(--ink-mute); transition: color .18s; }
.breadcrumbs__trail a:hover { color: var(--ink); }
.breadcrumbs__sep { opacity: .5; }
.breadcrumbs__current { color: var(--ink-soft); max-width: 24ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* шапка статьи */
.article-head { padding: 14px 0 8px; }
.article-head__inner { max-width: 900px; margin: 0 auto; }
.article-head__title {
    font-family: 'Manrope', sans-serif; font-weight: 800;
    font-size: clamp(1.9rem, 4.2vw, 2.8rem); line-height: 1.16; letter-spacing: -.02em;
    margin: 0 0 14px;
}
.article-head__meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; color: var(--ink-mute); font-size: .9rem; }
.article-head__dot { opacity: .5; }
.article-head__age {
    color: var(--acc-soft); font-weight: 700; border: 1px solid var(--line);
    border-radius: 6px; padding: 1px 7px; font-size: .8rem;
}

/* теги статьи (под метой): подпись + чипы, переносятся по строкам */
.article-head__tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.article-head__tags-label { color: var(--ink-mute); font-size: .9rem; font-weight: 600; }
/* чип категории — акцентный (ссылка на раздел блога) */
.article-head__cat {
    display: inline-block; padding: 5px 14px; border-radius: 100px;
    font-size: .82rem; font-weight: 700; line-height: 1.2;
    color: var(--on-acc); background: var(--acc-grad); box-shadow: 0 4px 14px var(--acc-glow);
    transition: transform .18s, filter .18s;
}
.article-head__cat:hover { transform: translateY(-1px); filter: brightness(1.06); }

/* обложка */
.article-cover { max-width: 900px; margin: 20px auto 0; border-radius: 20px; overflow: hidden; border: 1px solid var(--line); box-shadow: 0 24px 60px -28px rgba(0, 0, 0, .7); }
.article-cover img { width: 100%; height: auto; display: block; aspect-ratio: 16 / 10; object-fit: cover; }

/* CTA-топ (узкая кнопка сразу под обложкой) */
.article-cta-top {
    display: block; max-width: 900px; margin: 20px auto 0; text-align: center;
    padding: 13px 20px; border-radius: 14px; font-weight: 700; font-size: .98rem;
    color: var(--on-acc); background: var(--acc-grad); box-shadow: 0 8px 22px var(--acc-glow);
    transition: transform .18s, filter .18s;
}
.article-cta-top:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* тело статьи (типографика) — колонка совпадает с обложкой/заголовком (900px) */
.article-body {
    max-width: 900px; margin: 34px auto 0; color: var(--ink);
    font-size: 1.06rem; line-height: 1.8;
}
.article-body > * + * { margin-top: 1.1em; }
.article-body h2 {
    font-family: 'Manrope', sans-serif; font-weight: 800;
    font-size: clamp(1.4rem, 2.6vw, 1.8rem); line-height: 1.25; letter-spacing: -.01em;
    margin-top: 1.8em; padding-top: .2em;
}
.article-body h3 {
    font-family: 'Manrope', sans-serif; font-weight: 700;
    font-size: clamp(1.15rem, 2vw, 1.35rem); line-height: 1.3; margin-top: 1.4em; color: var(--ink);
}
.article-body p { color: var(--ink-soft); }
.article-body a { color: var(--acc-soft); text-decoration: underline; text-underline-offset: 3px; transition: color .18s; }
.article-body a:hover { color: var(--acc); }
.article-body strong { color: var(--ink); font-weight: 700; }
.article-body ul, .article-body ol { padding-left: 1.4em; color: var(--ink-soft); }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-top: .5em; }
.article-body li::marker { color: var(--acc-soft); }
.article-body img { border-radius: 14px; border: 1px solid var(--line); margin: 1.4em auto; }
.article-body blockquote {
    border-left: 3px solid var(--acc); background: var(--glass);
    padding: 14px 18px; border-radius: 0 12px 12px 0; color: var(--ink-soft); font-style: italic;
}
.article-body table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; }
.article-body th { background: var(--bg-3); color: var(--ink); font-weight: 700; }

/* CTA-блок в конце */
.article-cta {
    position: relative; overflow: hidden; text-align: center;
    max-width: 900px; margin: 46px auto 0; padding: 40px 28px; border-radius: 22px;
}
.article-cta__glow {
    position: absolute; top: -60px; left: 50%; transform: translateX(-50%);
    width: 360px; height: 220px; background: radial-gradient(closest-side, var(--acc-glow), transparent);
    filter: blur(20px); pointer-events: none; z-index: 0;
}
.article-cta__title, .article-cta__text, .article-cta .btn { position: relative; z-index: 1; }
.article-cta__title { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(1.4rem, 3vw, 2rem); margin: 0 0 10px; }
.article-cta__text { color: var(--ink-soft); max-width: 520px; margin: 0 auto 22px; }

/* FAQ статьи */
.article-faq { max-width: 900px; margin: 46px auto 0; padding: 30px 26px; border-radius: 22px; }
.article-faq__title { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: clamp(1.4rem, 3vw, 1.9rem); margin: 0 0 20px; text-align: center; }
.article-faq__list { display: flex; flex-direction: column; gap: 12px; }

/* похожие статьи */
.article-related { max-width: 1100px; margin: 60px auto 0; }
.article-related .section-title { margin-bottom: 28px; }
.article-related .blog-grid { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 900px) {
    .article-related .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
    .article-related .blog-grid { grid-template-columns: 1fr; }
    .breadcrumbs__current { max-width: 18ch; }
}
