/**
 * BTPulse — раздел «Публикации» (публичный, визуально часть лендинга).
 * Чистый белый фон, статичное (НЕ sticky) меню. База — тема porcelain (app.css).
 * Эмодзи не используются.
 */

body.pub {
    background: #FFFFFF;
    color: #131728;
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

/* ---------------- Шапка (статичная, белая) ---------------- */
.pub-head {
    position: static;
    background: #FFFFFF;
    border-bottom: 1px solid var(--border);
}
.pub-head-inner {
    max-width: 1200px; margin: 0 auto; padding: 14px 32px;
    display: flex; align-items: center; gap: 16px;
}
.pub-head .logo {
    display: flex; align-items: center; gap: 10px; text-decoration: none;
    color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 17px;
}
.pub-head .logo .bk-aurora { --bk-core: #7C3AED; --bk-edge: rgba(76,58,208,.5); }
.pub-head nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.pub-head nav a {
    padding: 8px 13px; border-radius: 10px; color: var(--muted);
    text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.pub-head nav a:hover { color: var(--text); background: var(--surface-2); }
.pub-head nav a.active { color: var(--text); background: var(--accent-soft); }

/* ---------------- Каркас ---------------- */
.pub-wrap { max-width: 780px; margin: 0 auto; padding: 40px 32px 64px; }
.pub-wrap-wide { max-width: 920px; }
.pub-title {
    font-family: var(--font-display); font-weight: 700; font-size: 34px;
    letter-spacing: -.01em; margin-bottom: 8px;
}
.pub-sub { color: var(--muted); font-size: 15px; margin-bottom: 28px; }

/* Переключатель Лента / Каталог */
.pub-viewseg {
    display: inline-flex; gap: 3px; padding: 3px; margin-bottom: 28px;
    background: var(--surface-2); border-radius: 12px;
}
.pub-viewseg a {
    padding: 7px 16px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
    color: var(--muted); text-decoration: none;
}
.pub-viewseg a:hover { color: var(--text); }
.pub-viewseg a.active { background: #FFFFFF; color: var(--text); box-shadow: 0 1px 4px rgba(20,24,38,.12); }

/* Панель активных фильтров (тег/период) */
.pub-filterbar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    margin: -14px 0 26px; font-size: 13.5px; color: var(--muted);
}
.pub-filterbar .pub-tag { font-size: 13px; }
.pub-filter-reset { color: var(--accent); text-decoration: none; font-weight: 600; }
.pub-filter-reset:hover { text-decoration: underline; }

/* ---------------- Лента ---------------- */
.pub-feed { display: flex; flex-direction: column; }
.pub-item {
    padding: 34px 0 30px;
    border-bottom: 1px solid var(--border);
}
.pub-item:first-child { padding-top: 6px; }
.pub-item:last-child { border-bottom: none; }

.pub-meta {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--muted); margin-bottom: 10px;
}
.pub-tag {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: var(--accent-soft); color: var(--accent);
    font-size: 12.5px; font-weight: 600; text-decoration: none;
    transition: background var(--t-fast);
}
.pub-tag:hover { background: var(--accent); color: #FFFFFF; text-decoration: none; }

.pub-item-title {
    font-family: var(--font-display); font-weight: 700; font-size: 26px;
    line-height: 1.28; letter-spacing: -.01em; margin-bottom: 14px;
}
.pub-item-title a { color: var(--text); text-decoration: none; }
.pub-item-title a:hover { color: var(--accent); }

.pub-cover { display: block; margin-bottom: 18px; }
.pub-cover img {
    width: 100%; max-height: 420px; object-fit: cover;
    border-radius: var(--r-md); border: 1px solid var(--border);
}

.pub-lead {
    font-size: 18px; line-height: 1.6; color: var(--text-2);
    margin-bottom: 18px; font-weight: 500;
}

/* Тело статьи — типографика Quill-контента */
.pub-body { font-size: 16.5px; }
.pub-body p { margin: 0 0 16px; }
/* Пустая строка из редактора (<p><br></p>) — маленькая подстановка, а не полноценный абзац */
.pub-body p:empty,
.pub-body p:has(> br:only-child) { margin: 0 0 2px; font-size: 8px; line-height: 1; }
.pub-body h1, .pub-body h2, .pub-body h3, .pub-body h4 {
    font-family: var(--font-display); font-weight: 700; letter-spacing: -.01em;
    line-height: 1.3; margin: 30px 0 12px;
}
.pub-body h1 { font-size: 28px; }
.pub-body h2 { font-size: 24px; }
.pub-body h3 { font-size: 20px; }
.pub-body h4 { font-size: 17px; }
.pub-body ul, .pub-body ol { margin: 0 0 16px 24px; }
.pub-body li { margin-bottom: 6px; }
/* Quill пишет маркированный список как <ol><li data-list="bullet"> — вернуть точки вместо цифр */
.pub-body li[data-list="bullet"] { list-style-type: disc; }
.pub-body li .ql-ui { display: none; }
.pub-body blockquote {
    margin: 22px 0; padding: 4px 0 4px 18px;
    border-left: 3px solid var(--accent);
    color: var(--text-2); font-style: italic;
}
.pub-body pre {
    margin: 0 0 16px; padding: 14px 16px; overflow-x: auto;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm);
    font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
}
.pub-body code { font-family: var(--font-mono); font-size: .92em; }
.pub-body p code, .pub-body li code {
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: 6px; padding: 1px 6px;
}
.pub-body img {
    max-width: 100%; height: auto; display: block;
    margin: 22px auto; border-radius: var(--r-md); border: 1px solid var(--border);
}
.pub-body a { color: var(--accent); }
.pub-body a:hover { text-decoration: none; }
.pub-body hr { border: none; border-top: 1px solid var(--border); margin: 26px 0; }

/* Затухание превью перед «Читать далее» */
.pub-preview { position: relative; }
.pub-item[data-has-more="1"] .pub-preview::after {
    content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 72px;
    background: linear-gradient(180deg, rgba(255,255,255,0), #FFFFFF);
    pointer-events: none;
}

.pub-item-foot {
    display: flex; align-items: center; gap: 18px; margin-top: 18px;
}
.pub-item-foot .pub-more { padding: 10px 22px; font-size: 14px; }
.pub-open {
    color: var(--muted); text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.pub-open:hover { color: var(--accent); }

/* Сентинел бесконечного скролла */
.pub-sentinel { padding: 26px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.pub-spinner {
    display: inline-block; width: 18px; height: 18px; vertical-align: -4px; margin-right: 8px;
    border: 2px solid var(--border-strong); border-top-color: var(--accent);
    border-radius: 50%; animation: pub-spin .7s linear infinite;
}
@keyframes pub-spin { to { transform: rotate(360deg); } }

/* ---------------- Страница статьи ---------------- */
.pub-article-title {
    font-family: var(--font-display); font-weight: 700; font-size: 38px;
    line-height: 1.22; letter-spacing: -.015em; margin-bottom: 16px;
}
.pub-article-cover { margin: 20px 0 26px; }
.pub-article-cover img {
    width: 100%; max-height: 480px; object-fit: cover;
    border-radius: var(--r-lg); border: 1px solid var(--border);
}
.pub-back {
    display: inline-block; margin-bottom: 22px; color: var(--muted);
    text-decoration: none; font-size: 13.5px; font-weight: 500;
}
.pub-back:hover { color: var(--accent); }
.pub-more-title {
    font-family: var(--font-display); font-weight: 700; font-size: 22px;
    margin: 46px 0 6px; padding-top: 30px; border-top: 1px solid var(--border);
}
.pub-more-sub { color: var(--muted); font-size: 13.5px; margin-bottom: 20px; }

/* ---------------- Каталог ---------------- */
.pub-periods { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 28px; }
.pub-period {
    padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
    background: var(--surface-2); color: var(--muted); text-decoration: none;
}
.pub-period:hover { color: var(--text); background: var(--surface-3); }
.pub-period.active { background: var(--accent); color: #FFFFFF; }

.pub-cat-month {
    font-family: var(--font-display); font-weight: 700; font-size: 17px;
    margin: 30px 0 6px; color: var(--text);
}
.pub-cat-row {
    display: flex; align-items: baseline; gap: 14px;
    padding: 11px 0; border-bottom: 1px solid var(--border);
}
.pub-cat-row:last-child { border-bottom: none; }
.pub-cat-date {
    flex: 0 0 92px; font-family: var(--font-mono); font-size: 12.5px; color: var(--muted);
}
.pub-cat-main { flex: 1; min-width: 0; }
.pub-cat-title { color: var(--text); text-decoration: none; font-weight: 600; font-size: 15.5px; }
.pub-cat-title:hover { color: var(--accent); }
.pub-cat-lead { color: var(--muted); font-size: 13.5px; margin-top: 2px; }
.pub-cat-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 5px; }
.pub-cat-tags .pub-tag { font-size: 11.5px; padding: 2px 9px; }

.pub-empty {
    padding: 60px 0; text-align: center; color: var(--muted);
}

/* ---------------- Подвал (белый, как у лендинга) ---------------- */
.pub-foot {
    border-top: 1px solid var(--border); padding: 26px 0 34px;
    text-align: center; color: var(--muted); font-size: 13px; background: #FFFFFF;
}
.pub-foot-inner {
    max-width: 1200px; margin: 0 auto; padding: 0 32px;
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px;
}
.pub-foot-legal { font-size: 12px; opacity: .6; }
.pub-foot-links {
    max-width: 1200px; margin: 12px auto 0; padding: 0 32px;
    display: flex; justify-content: center; gap: 20px; flex-wrap: wrap; font-size: 12.5px;
}
.pub-foot-links a { color: var(--muted); text-decoration: none; }
.pub-foot-links a:hover { color: var(--text); }

/* ---------------- Адаптив ---------------- */
@media (max-width: 900px) {
    .pub-head-inner { flex-wrap: wrap; padding: 12px 18px 10px; }
    .pub-head nav { flex-wrap: wrap; }
    .pub-wrap { padding: 28px 18px 48px; }
    .pub-title { font-size: 27px; }
    .pub-item-title { font-size: 22px; }
    .pub-article-title { font-size: 28px; }
    .pub-body { font-size: 16px; }
    .pub-cat-row { flex-direction: column; gap: 3px; }
    .pub-cat-date { flex-basis: auto; }
    .pub-foot-inner { justify-content: center; text-align: center; }
}
