/**
 * Блог: лента, карточка, страница статьи (перенесено из nano-copy).
 *
 * Цвета — токены темы: карточки и текст меняются вместе со светлой
 * и тёмной темой. Прямыми оставлены только цвета кнопок соцсетей
 * (фирменные) и затемнение героя статьи над фотографией.
 */

/* ─── Hero ─── */
.blog-hero {
    text-align: center;
    padding: 60px 0 40px;
}
.blog-hero__sup {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--acc);
    margin-bottom: .5rem;
}
.blog-hero__title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--tx);
    margin-bottom: .75rem;
    line-height: 1.1;
}
.blog-hero__sub {
    color: var(--tx2);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto;
}

/* ─── Sticky CTA ─── */
.blog-cta-sticky {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--acc);
    color: var(--acc-ink);
    font-weight: 700;
    font-size: .9rem;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 24px color-mix(in srgb, var(--acc) 35%, transparent);
    transition: transform .2s, box-shadow .2s;
    white-space: nowrap;
}
.blog-cta-sticky:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px color-mix(in srgb, var(--acc) 50%, transparent);
    color: var(--acc-ink);
}
@media (max-width: 576px) {
    .blog-cta-sticky span { display: none; }
    .blog-cta-sticky { padding: 14px; border-radius: 50%; }
}

/* ─── Категории ─── */
.blog-cats {
    margin-bottom: 32px;
}
.blog-cats__scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}
.blog-cats__scroll::-webkit-scrollbar { display: none; }
.blog-cats__btn {
    background: var(--surface2);
    color: var(--tx2);
    border: 1px solid var(--line2);
    border-radius: 50px;
    padding: 7px 18px;
    font-size: .85rem;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, color .15s, border-color .15s;
    flex-shrink: 0;
}
.blog-cats__btn:hover { background: var(--line2); color: var(--tx); }
.blog-cats__btn.active { background: var(--acc); color: var(--acc-ink); border-color: var(--acc); font-weight: 600; }

/* ─── Лента (сетка) ─── */
.blog-feed {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}
.blog-feed__empty {
    grid-column: 1/-1;
    text-align: center;
    color: var(--mut);
    padding: 60px 0;
}

/* ─── Карточка ─── */
.blog-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    display: flex;
    flex-direction: column;
}
.blog-card:hover {
    transform: translateY(-4px);
    border-color: var(--line2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, .28);
}
.blog-card__link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.blog-card__img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
    background: var(--surface2);
}
.blog-card__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}
.blog-card:hover .blog-card__img { transform: scale(1.04); }
.blog-card__img-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.blog-card__cat {
    position: absolute;
    top: 12px;
    left: 12px;
    background: color-mix(in srgb, var(--bg) 75%, transparent);
    backdrop-filter: blur(6px);
    color: var(--acc);
    font-size: .72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: 4px 10px;
    border-radius: 50px;
}
.blog-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}
.blog-card__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--tx);
    margin-bottom: 10px;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card__lead {
    color: var(--tx2);
    font-size: .875rem;
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.blog-card__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    color: var(--mut);
    font-size: .78rem;
    margin-top: auto;
    margin-bottom: 16px;
}
.blog-card__read {
    display: flex;
    align-items: center;
    gap: 4px;
}
.blog-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--acc);
    font-size: .85rem;
    font-weight: 600;
    transition: gap .2s;
}
.blog-card:hover .blog-card__cta { gap: 10px; }

/* ─── Сентинел / спиннер ─── */
.blog-sentinel {
    display: flex;
    justify-content: center;
    padding: 32px 0;
}
.blog-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--line2);
    border-top-color: var(--acc);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ════════ Герой статьи ════════
   Лежит поверх фотографии: затемнение и белый текст — условие читаемости,
   а не цвета темы, поэтому здесь они заданы напрямую. */

/* ════════════════════════════════════════
   Герой статьи — full-bleed из контейнера
   ════════════════════════════════════════ */
.art-hero-wrap {
    width: 100vw;
    min-width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-bottom: 40px;
    max-width: 100%;
    overflow: hidden;
}

.art-hero-bg {
    position: relative;
    width: 100%;
    min-height: 520px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
}

.art-hero-bg--no-img {
    background: linear-gradient(135deg, var(--surface) 0%, var(--surface3) 100%);
}

.art-hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(10,9,5,.15) 0%,
        rgba(10,9,5,.55) 40%,
        rgba(10,9,5,.88) 100%
    );
}

.art-hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 60px 24px 52px;
}

.art-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: color-mix(in srgb, var(--acc) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--acc) 35%, transparent);
    border-radius: 50px;
    padding: 4px 14px;
    margin-bottom: 20px;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
}

.art-hero-badge__link {
    color: var(--acc);
    text-decoration: none;
}
.art-hero-badge__link:hover { color: #fff; }
.art-hero-badge__sep { color: color-mix(in srgb, var(--acc) 50%, transparent); }

.art-hero-title {
    font-size: clamp(1.7rem, 4vw, 2.8rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    margin-bottom: 16px;
    max-width: 760px;
}

.art-hero-lead {
    font-size: clamp(.95rem, 2vw, 1.1rem);
    color: rgba(255,255,255,.78);
    line-height: 1.6;
    max-width: 680px;
    margin-bottom: 24px;
}

.art-hero-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,.55);
    font-size: .82rem;
}
.art-hero-meta__sep { opacity: .5; }

/* Хлебные крошки */
.art-hero-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 14px 24px;
    max-width: 860px;
    margin: 0 auto;
    font-size: .8rem;
}
.art-hero-breadcrumbs__link {
    color: var(--tx2);
    text-decoration: none;
}
.art-hero-breadcrumbs__link:hover { color: var(--acc); }
.art-hero-breadcrumbs__sep { color: var(--mut); }
.art-hero-breadcrumbs__current {
    color: var(--tx2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* Адаптив */
@media (max-width: 768px) {
    .art-hero-bg { min-height: 380px; }
    .art-hero-inner { padding: 40px 16px 36px; }
    .art-hero-breadcrumbs { padding: 10px 16px; }
    .art-hero-breadcrumbs__current { max-width: 160px; }
}
@media (max-width: 480px) {
    .art-hero-bg { min-height: 300px; }
    .art-hero-title { font-size: 1.5rem; }
}


/* ════════ Страница статьи ════════ */
/* ─── Общий враппер ─── */
.art-wrap {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 0 80px;
}


/* ─── Layout: контент + сайдбар ─── */
.art-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 48px;
    max-width: 900px;
    margin: 0 auto;
}
@media (min-width: 1100px) {
    .art-layout {
        grid-template-columns: 220px 1fr;
        max-width: 1100px;
        align-items: start;
    }
    .art-toc-sidebar { order: -1; }
}

/* ─── Оглавление (десктоп) ─── */
.art-toc-sidebar {
    display: none;
}
@media (min-width: 1100px) {
    .art-toc-sidebar {
        display: block;
        position: sticky;
        top: 80px;
    }
}
.art-toc {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
}
.art-toc__title {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--mut);
    margin-bottom: 12px;
}
.art-toc__list {
    padding-left: 0;
    list-style: none;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.art-toc__list li { padding: 0; }
.art-toc__list a {
    display: block;
    font-size: .82rem;
    color: var(--tx2);
    text-decoration: none;
    padding: 5px 8px;
    border-radius: 6px;
    transition: background .15s, color .15s;
    line-height: 1.35;
}
.art-toc__list a:hover, .art-toc__list a.active {
    background: var(--surface2);
    color: var(--acc);
}
.art-toc__list .toc-h3 a { padding-left: 18px; font-size: .78rem; color: var(--mut); }
.art-toc__list .toc-h3 a:hover { color: var(--acc); }


/* ─── Тело статьи ─── */
.art-body {
    color: var(--tx);
    font-size: 1.05rem;
    line-height: 1.78;
    word-break: break-word;
}
.art-body h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--tx);
    margin: 2.2em 0 .6em;
    line-height: 1.25;
}
.art-body h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tx);
    margin: 1.8em 0 .5em;
}
.art-body p { margin-bottom: 1.1em; }
.art-body a { color: var(--acc); }
.art-body a:hover { color: var(--tx); }
.art-body blockquote {
    border-left: 3px solid var(--acc);
    margin: 1.5em 0;
    padding: .8em 1.2em;
    background: var(--surface);
    border-radius: 0 8px 8px 0;
    color: var(--tx2);
    font-style: italic;
}
.art-body ul, .art-body ol {
    padding-left: 1.6em;
    margin-bottom: 1.2em;
}
.art-body li { margin-bottom: .4em; }
.art-body img {
    max-width: 100%;
    border-radius: 12px;
    margin: 1.5em 0;
}
.art-body iframe {
    max-width: 100%;
    width: 100%;
    border-radius: 12px;
    margin: 1.5em 0;
    display: block;
}
.art-embed {
    margin: 1.5em 0;
}
.art-embed__ratio {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--bg);
}
.art-embed__ratio iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    margin: 0;
}
.art-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: .9rem;
}
.art-body th, .art-body td {
    padding: 10px 14px;
    border: 1px solid var(--line);
    text-align: left;
}
.art-body th { background: var(--surface); color: var(--tx); }
.art-body code {
    background: var(--surface2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: .88em;
    color: var(--acc);
}
.art-body pre {
    background: var(--surface2);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 1.5em 0;
}
.art-body pre code { background: none; padding: 0; color: var(--tx); }

/* ─── Теги ─── */
.art-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 40px 0 32px;
}
.art-tag {
    background: var(--surface2);
    border: 1px solid var(--line2);
    border-radius: 50px;
    color: var(--tx2);
    font-size: .8rem;
    padding: 5px 14px;
    text-decoration: none;
    transition: border-color .15s, color .15s;
}
.art-tag:hover { border-color: var(--acc); color: var(--acc); }

/* ─── Репост ─── */
.art-share {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 24px 0;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    margin-bottom: 40px;
}
.art-share__label { color: var(--mut); font-size: .85rem; margin-right: 4px; }
.art-share__btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border-radius: 50px;
    padding: 8px 16px;
    font-size: .83rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: opacity .15s, transform .15s;
}
.art-share__btn:hover { opacity: .85; transform: translateY(-1px); }
.art-share__btn--vk  { background: #0077ff; color: #fff; }
.art-share__btn--tg  { background: #26a5e4; color: #fff; }
.art-share__btn--copy { background: var(--surface2); color: var(--tx2); border: 1px solid var(--line2); }
.art-share__btn--copy.copied { color: var(--ok); border-color: var(--ok); }

/* ─── CTA блок ─── */
.art-cta-block {
    background: linear-gradient(135deg, var(--acc-bg2) 0%, var(--surface) 100%);
    border: 1px solid color-mix(in srgb, var(--acc) 30%, transparent);
    border-radius: 16px;
    padding: 32px;
    margin-top: 48px;
}
.art-cta-block__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}
.art-cta-block__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--tx);
    margin-bottom: 6px;
}
.art-cta-block__sub {
    color: var(--tx2);
    font-size: .9rem;
    margin: 0;
}
.art-cta-block__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--acc);
    color: var(--acc-ink);
    font-weight: 700;
    font-size: .95rem;
    padding: 14px 28px;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    transition: transform .2s, box-shadow .2s;
    flex-shrink: 0;
}
.art-cta-block__btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px color-mix(in srgb, var(--acc) 35%, transparent);
    color: var(--acc-ink);
}

/* ─── Похожие статьи ─── */
.art-related {
    max-width: 900px;
    margin: 60px auto 0;
}
.art-related__title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--tx);
    margin-bottom: 24px;
}
.art-related__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

/* ─── Sticky CTA (наследуем из блога) ─── */
.blog-cta-sticky {
    position: fixed;
    bottom: 28px;
    right: 24px;
    z-index: 1050;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--acc);
    color: var(--acc-ink);
    font-weight: 700;
    font-size: .9rem;
    padding: 12px 20px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 4px 24px color-mix(in srgb, var(--acc) 35%, transparent);
    transition: transform .2s, box-shadow .2s, opacity .3s;
    white-space: nowrap;
}
.blog-cta-sticky:hover { transform: translateY(-2px); box-shadow: 0 8px 32px color-mix(in srgb, var(--acc) 50%, transparent); color: var(--acc-ink); }
.blog-cta-sticky.hidden { opacity: 0; pointer-events: none; }

/* ─── Кнопка наверх ─── */
.art-to-top {
    position: fixed;
    bottom: 84px;
    right: 28px;
    z-index: 1040;
    background: var(--surface2);
    border: 1px solid var(--line2);
    color: var(--tx2);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .25s, transform .25s, background .15s;
    pointer-events: none;
}
.art-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.art-to-top:hover { background: var(--surface3); color: var(--acc); }
@media (max-width: 576px) {
    .art-to-top { bottom: 90px; right: 16px; }
    .blog-cta-sticky { padding: 14px; border-radius: 50%; }
    .blog-cta-sticky svg + * { display: none; }
}
/* Служебные классы блога: раньше их давал Bootstrap, здесь его нет. */
.blog-sentinel.d-none {
    display: none;
}

/* Разделитель из редактора. В оригинале ему давал вид Bootstrap, здесь
   его нет: без правила <hr> в колонке сжимался до двух коротких черт. */
.art-body hr,
.art-delimiter {
    display: block;
    width: 100%;
    height: 0;
    margin: 2em 0;
    border: 0;
    border-top: 1px solid var(--line2);
}
