/* =========================================================
   Velomagnit — тема для BryanCMS 1.3
   Изумрудный акцент #10b981, slate, тёмный подвал
   ========================================================= */

:root {
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --brand-400: #34d399;
  --brand-500: #10b981;
  --brand-600: #059669;
  --brand-700: #047857;
  --amber: #f59e0b;

  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r: 16px;
  --r-lg: 24px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 10px 24px -8px rgba(15, 23, 42, .16);
  --container: 1280px;
}

/* ---------- База ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  font-family: var(--font); font-size: 16px; line-height: 1.6; color: var(--slate-800);
  background: var(--slate-50); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
::selection { background: var(--brand-500); color: #fff; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: color .2s, background .2s, border-color .2s; }
button { font: inherit; cursor: pointer; }
h1 { margin: 0; color: var(--slate-900); line-height: 1.2; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }
:focus-visible { outline: 3px solid rgba(16, 185, 129, .5); outline-offset: 2px; border-radius: 6px; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .container { padding: 0 24px; } }
@media (min-width: 1024px) { .container { padding: 0 32px; } }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: -9999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 10px; box-shadow: var(--shadow-md); color: var(--slate-900); }
.skip-link:focus { left: 8px; }
.page-main { flex: 1 0 auto; padding-top: 28px; padding-bottom: 8px; }
.page-home .page-main { padding-top: 40px; }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: 12px; border: 1px solid transparent;
  font-size: 14px; font-weight: 700; line-height: 1.2; transition: all .2s;
}
.btn svg { width: 16px; height: 16px; }
.btn-block { width: 100%; }
.btn-brand { background: var(--brand-500); color: #fff; box-shadow: 0 6px 16px -6px rgba(16, 185, 129, .6); }
.btn-brand:hover { background: var(--brand-600); color: #fff; }
.btn-outline { background: #fff; color: var(--slate-700); border-color: var(--slate-200); }
.btn-outline:hover { border-color: var(--brand-500); color: var(--brand-600); }
.btn-ghost-dark { margin-top: 8px; background: rgba(255,255,255,.06); color: var(--slate-200); border-color: rgba(255,255,255,.12); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.12); color: #fff; }
/* совместимость с общими шаблонами (контакты, 404, поиск) */
.btn-accent { background: var(--brand-500); color: #fff; }
.btn-accent:hover { background: var(--brand-600); color: #fff; }

/* ---------- Прогресс чтения ---------- */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 4px; z-index: 60; pointer-events: none; }
.read-progress-bar { height: 100%; width: 0; background: var(--brand-500); transition: width .15s; }

/* ---------- Верхняя полоса ---------- */
.topbar { background: var(--slate-900); color: var(--slate-300); font-size: 12px; border-bottom: 1px solid var(--slate-800); }
.topbar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding-top: 8px; padding-bottom: 8px; }
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 14px; min-width: 0; }
.topbar-right { flex-wrap: wrap; font-weight: 500; }
.topbar-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--brand-400); white-space: nowrap; }
.pulse-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--brand-400); animation: pulse 2s ease-in-out infinite; }
.topbar-sep { color: var(--slate-500); }
.topbar-desc { min-width: 0; color: var(--slate-400); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 520px; }
.topbar-link { color: var(--slate-300); white-space: nowrap; }
.topbar-link:hover { color: var(--brand-400); }
@media (max-width: 639px) {
  .topbar-sep, .topbar-desc { display: none; }
  .topbar-row { justify-content: center; }
}

/* ---------- Шапка ---------- */
.site-header { position: sticky; top: 0; z-index: 40; background: rgba(255,255,255,.95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-bottom: 1px solid rgba(226, 232, 240, .8); box-shadow: var(--shadow-sm); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 80px; }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--slate-900); }
.brand-logo { max-height: 48px; width: auto; }
.brand-icon {
  width: 48px; height: 48px; flex: 0 0 48px; border-radius: 16px; display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(to top right, var(--brand-600), var(--brand-400));
  box-shadow: 0 6px 14px -4px rgba(16, 185, 129, .35); transition: transform .2s;
}
.brand-icon svg { width: 28px; height: 28px; }
.brand:hover .brand-icon { transform: scale(1.05); }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-size: 24px; font-weight: 900; letter-spacing: -.03em; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .2s; }
.brand:hover .brand-name { color: var(--brand-600); }
.brand-tagline { font-size: 11px; font-weight: 500; letter-spacing: .04em; text-transform: uppercase; color: var(--slate-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.header-search { position: relative; display: none; width: 290px; flex: 0 0 auto; }
.header-search svg, .mobile-search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--slate-400); pointer-events: none; }
.header-search input, .mobile-search input {
  width: 100%; padding: 10px 16px 10px 40px; font: inherit; font-size: 14px; color: var(--slate-800);
  background: var(--slate-100); border: 1px solid transparent; border-radius: 12px; transition: all .2s;
}
.header-search input::placeholder, .mobile-search input::placeholder { color: var(--slate-400); }
.header-search input:hover { background: var(--slate-50); }
.header-search input:focus, .mobile-search input:focus { outline: none; background: #fff; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }

.header-buttons { display: flex; align-items: center; gap: 6px; }
.icon-btn { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 12px; background: transparent; color: var(--slate-600); }
.icon-btn:hover { background: var(--slate-100); color: var(--brand-600); }
.icon-btn svg { width: 22px; height: 22px; }
.burger .ico-close, .burger[aria-expanded="true"] .ico-open { display: none; }
.burger[aria-expanded="true"] .ico-close { display: block; }

.mobile-search { padding-bottom: 16px; }
.mobile-search[hidden] { display: none; }
.mobile-search form { position: relative; }
.mobile-search input { border-color: var(--slate-200); }

/* Навигация: одна строка, лишнее прокручивается — ничего не переносится и не разъезжается */
.main-nav { display: none; border-top: 1px solid var(--slate-100); background: #fff; }
.main-nav-scroll { position: relative; display: flex; align-items: center; gap: 4px; padding: 4px 0; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 32px), transparent); }
.main-nav-scroll::-webkit-scrollbar { display: none; }
.main-nav-scroll.no-fade { -webkit-mask-image: none; mask-image: none; }
.main-nav-link { flex: 0 0 auto; padding: 10px 14px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--slate-700); white-space: nowrap; }
.main-nav-link:hover { color: var(--brand-600); background: var(--slate-50); }
.main-nav-link.active { color: var(--brand-600); background: var(--brand-50); }

.mobile-menu { border-top: 1px solid var(--slate-200); background: #fff; box-shadow: 0 20px 25px -5px rgba(15, 23, 42, .1); }
.mobile-menu[hidden] { display: none; }
.mobile-menu .container { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; padding-bottom: 20px; max-height: calc(100vh - 140px); overflow-y: auto; }
.mobile-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 10px; font-size: 16px; font-weight: 500; color: var(--slate-700); }
.mobile-link > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-link:hover { background: var(--slate-100); }
.mobile-link.active { background: var(--brand-50); color: var(--brand-600); font-weight: 600; }
.mobile-count { flex: 0 0 auto; font-size: 12px; color: var(--slate-400); }
.mobile-sep { height: 1px; margin: 8px 0; background: var(--slate-100); }

@media (min-width: 1024px) {
  .header-search, .main-nav { display: block; }
  .header-buttons, .mobile-search, .mobile-menu { display: none !important; }
}
@media (max-width: 420px) {
  .brand-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 14px; }
  .brand-name { font-size: 20px; }
  .brand-tagline { font-size: 9.5px; }
  .header-row { height: 72px; gap: 8px; }
}

/* ---------- Слайдер ---------- */
.hero { margin-top: 24px; }
.slider {
  position: relative; overflow: hidden; border-radius: var(--r-lg);
  background: var(--slate-900); box-shadow: 0 20px 40px -16px rgba(15, 23, 42, .45);
  height: 360px; touch-action: pan-y;
}
@media (min-width: 640px) { .slider { height: 420px; } }
@media (min-width: 768px) { .slider { height: 480px; } }
.slide { position: absolute; inset: 0; display: flex; align-items: center; opacity: 0; visibility: hidden; transition: opacity .6s ease-in-out, visibility .6s; }
.slide.is-active { opacity: 1; visibility: visible; z-index: 1; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; filter: brightness(.45); }
.slide-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(15, 23, 42, .55), rgba(15, 23, 42, 0) 70%); }
.slide-content { position: relative; z-index: 1; width: 100%; max-width: 880px; padding: 0 24px 28px; color: #fff; }
@media (min-width: 640px) { .slide-content { padding: 0 72px; } }
@media (min-width: 768px) { .slide-content { padding: 0 80px; } }
.slide-badge {
  display: inline-block; max-width: 100%; margin-bottom: 14px; padding: 4px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #fff; background: var(--brand-500);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.slide-badge:hover { color: #fff; background: var(--brand-600); }
.slide-title { font-size: 24px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; text-shadow: 0 2px 8px rgba(0,0,0,.25); margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.slide-title a { color: #fff; }
.slide-title a:hover { color: var(--brand-100); }
@media (min-width: 640px) { .slide-title { font-size: 32px; } }
@media (min-width: 768px) { .slide-title { font-size: 40px; } }
@media (min-width: 1200px) { .slide-title { font-size: 46px; } }
.slide-excerpt { margin: 0 0 20px; font-size: 14px; line-height: 1.65; color: var(--slate-200); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (min-width: 640px) { .slide-excerpt { font-size: 16px; } }
@media (min-width: 768px) { .slide-excerpt { -webkit-line-clamp: 3; } }
.slide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.slide-btn { display: inline-flex; align-items: center; gap: 8px; padding: 12px 22px; border-radius: 12px; font-size: 14px; font-weight: 700; color: #fff; background: var(--brand-500); box-shadow: 0 10px 15px -3px rgba(0,0,0,.25); transition: all .2s; }
.slide-btn:hover { background: var(--brand-600); color: #fff; }
.slide-btn.is-light { background: #fff; color: var(--slate-900); }
.slide-btn.is-light:hover { background: var(--brand-500); color: #fff; }
.slide-btn svg { width: 16px; height: 16px; }
.slide-time { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: rgba(255,255,255,.75); }
.slide-time svg { width: 15px; height: 15px; }
@media (max-width: 420px) { .slide-time { display: none; } .slide-btn { padding: 10px 18px; } }

.slider-arrow {
  position: absolute; top: 50%; z-index: 3; transform: translateY(-50%);
  width: 44px; height: 44px; border: 0; border-radius: 50%; display: none; align-items: center; justify-content: center;
  color: #fff; background: rgba(0,0,0,.4); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); transition: background .2s;
}
.slider-arrow:hover { background: rgba(0,0,0,.7); }
.slider-arrow svg { width: 22px; height: 22px; }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }
@media (min-width: 640px) { .slider-arrow { display: flex; } }
.slider-dots { position: absolute; left: 50%; bottom: 18px; z-index: 3; transform: translateX(-50%); display: flex; gap: 10px; }
.slider-dot { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.5); transition: all .3s; }
.slider-dot:hover { background: #fff; }
.slider-dot.active { width: 32px; background: var(--brand-500); }

/* ---------- Сетка ---------- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start; }
@media (min-width: 1024px) { .layout { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); } }
.content { min-width: 0; }

.feed-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 16px; margin-bottom: 28px; border-bottom: 1px solid var(--slate-200); }
.feed-title { display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--slate-900); line-height: 1.2; }
.feed-dot { width: 12px; height: 12px; flex: 0 0 12px; border-radius: 50%; background: var(--brand-500); }
.feed-sub { margin: 4px 0 0; font-size: 14px; color: var(--slate-500); }
.feed-count { font-size: 12px; font-weight: 600; color: var(--slate-500); white-space: nowrap; }
.feed-count b { color: var(--brand-600); }

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
@media (min-width: 768px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: #fff; border: 1px solid var(--slate-200); border-radius: var(--r); box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.card-media { position: relative; display: block; height: 192px; overflow: hidden; background: var(--slate-100); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-media img { transform: scale(1.05); }
.badge {
  position: absolute; top: 12px; left: 12px; max-width: calc(100% - 24px);
  padding: 4px 10px; border-radius: 6px; font-size: 11px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
  color: #fff; background: var(--brand-600); box-shadow: 0 1px 3px rgba(0,0,0,.2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 12px; color: var(--slate-400); }
.card-date { color: var(--slate-600); font-weight: 500; }
.card-time { display: inline-flex; align-items: center; gap: 4px; }
.card-time svg { width: 14px; height: 14px; }
.card-title { font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--slate-900); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-title a:hover, .card:hover .card-title a { color: var(--brand-600); }
.card-excerpt { margin: 8px 0 0; font-size: 14px; line-height: 1.6; color: var(--slate-600); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid var(--slate-100); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.card-title { margin-bottom: 16px; }
.card-excerpt { margin-top: -8px !important; margin-bottom: 16px !important; }
.card-author { display: flex; align-items: center; gap: 8px; min-width: 0; font-weight: 500; color: var(--slate-700); }
.card-author span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-author .author-avatar { width: 28px; height: 28px; font-size: 11px; }
.card-author:hover { color: var(--brand-600); }
.card-more { font-weight: 600; color: var(--brand-600); white-space: nowrap; }
.card-more:hover { color: var(--brand-700); }
.empty { grid-column: 1 / -1; padding: 40px 24px; text-align: center; color: var(--slate-500); background: #fff; border: 1px dashed var(--slate-300); border-radius: var(--r); }

/* Аватары (генерирует CMS) */
.author-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; }
.author-avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--slate-200); color: var(--slate-600); font-weight: 700; text-transform: uppercase; }

/* ---------- Пагинация (генерирует CMS) ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin-top: 32px; padding-top: 24px; font-size: 14px; font-weight: 600; }
.pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; color: var(--slate-700); background: #fff; border: 1px solid var(--slate-200); }
.pagination a.page-numbers:hover { background: var(--slate-100); color: var(--brand-600); }
.pagination .page-numbers.current { background: var(--brand-600); border-color: var(--brand-600); color: #fff; font-weight: 700; box-shadow: var(--shadow-sm); }
.pagination .page-numbers.dots { background: none; border: 0; color: var(--slate-400); min-width: 20px; padding: 0 2px; }
.pagination .prev, .pagination .next { font-weight: 500; }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.sidebar-inner { display: flex; flex-direction: column; gap: 32px; }
@media (min-width: 1024px) { .page-post .sidebar-inner { position: sticky; top: 150px; } }
.widget { min-width: 0; padding: 24px; background: #fff; border: 1px solid rgba(226, 232, 240, .9); border-radius: var(--r); box-shadow: var(--shadow-sm); }
.widget-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-bottom: 14px; margin-bottom: 16px; border-bottom: 1px solid var(--slate-100); }
.widget-title { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; letter-spacing: -.01em; color: var(--slate-900); }
.widget-title svg { width: 16px; height: 16px; color: var(--brand-600); }
.widget-note { font-size: 12px; font-weight: 600; color: var(--slate-400); white-space: nowrap; }

.cat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.cat-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 12px; }
.cat-item-name { min-width: 0; font-weight: 500; color: var(--slate-700); overflow-wrap: anywhere; transition: color .2s; }
.cat-item-count { flex: 0 0 auto; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--slate-600); background: var(--slate-100); transition: all .2s; }
.cat-item:hover, .cat-item.active { background: var(--brand-50); }
.cat-item:hover .cat-item-name, .cat-item.active .cat-item-name { color: var(--brand-600); }
.cat-item:hover .cat-item-count, .cat-item.active .cat-item-count { background: var(--brand-500); color: #fff; }

.mini-posts { display: flex; flex-direction: column; gap: 16px; }
.mini-post { display: flex; align-items: flex-start; gap: 14px; }
.mini-post img { width: 64px; height: 64px; flex: 0 0 64px; border-radius: 12px; object-fit: cover; transition: opacity .2s; }
.mini-post:hover img { opacity: .9; }
.mini-post-body { display: flex; flex-direction: column; min-width: 0; }
.mini-post-date { font-size: 11px; font-weight: 600; color: var(--slate-400); }
.mini-post-date.is-fresh { color: var(--brand-600); }
.mini-post-title { margin-top: 2px; font-size: 13px; font-weight: 700; line-height: 1.4; color: var(--slate-800); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s; }
.mini-post:hover .mini-post-title { color: var(--brand-600); }

.archive-list { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.archive-list li + li { border-top: 1px solid var(--slate-100); }
.archive-list a { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; color: var(--slate-700); }
.archive-list a:hover { color: var(--brand-600); }
.archive-name { display: inline-flex; align-items: center; gap: 8px; }
.archive-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--slate-300); }
.archive-dot.is-fresh { background: var(--brand-500); }
.archive-count { padding: 2px 8px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; font-weight: 500; color: var(--slate-400); background: var(--slate-50); white-space: nowrap; }

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { display: inline-block; max-width: 100%; padding: 6px 12px; border-radius: 8px; font-size: 12px; font-weight: 500; color: var(--slate-700); background: var(--slate-100); overflow-wrap: anywhere; transition: all .2s; }
.tag-item.is-hot { font-weight: 600; color: var(--brand-700); background: var(--brand-50); }
.tag-item:hover { background: var(--brand-500); color: #fff; }

.widget-dark { position: relative; overflow: hidden; color: #fff; background: linear-gradient(to bottom right, var(--slate-800), var(--slate-900)); border: 0; box-shadow: 0 14px 30px -12px rgba(15, 23, 42, .5); scroll-margin-top: 160px; }
.widget-dark::after { content: ""; position: absolute; right: -24px; bottom: -24px; width: 96px; height: 96px; border-radius: 50%; background: rgba(16, 185, 129, .2); filter: blur(20px); pointer-events: none; }
.dark-kicker { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-400); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dark-title { font-size: 18px; font-weight: 700; line-height: 1.35; }
.dark-text { margin: 8px 0 16px; font-size: 12px; line-height: 1.65; color: var(--slate-300); }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { margin-bottom: 22px; font-size: 12px; color: var(--slate-400); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li { display: flex; align-items: center; min-width: 0; max-width: 100%; }
.breadcrumbs li + li::before { content: "/"; margin: 0 8px; color: var(--slate-300); }
.breadcrumbs a { color: var(--slate-500); white-space: nowrap; }
.breadcrumbs a:hover { color: var(--brand-600); }
.breadcrumbs li[aria-current] { flex: 1 1 0; }
.breadcrumbs li[aria-current] span { color: var(--slate-800); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; min-width: 0; }

/* ---------- Заголовок ленты ---------- */
.listing-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--slate-200); }
.listing-kicker { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.listing-title { font-size: 28px; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
@media (min-width: 640px) { .listing-title { font-size: 34px; } }
.listing-desc { margin: 8px 0 0; max-width: 720px; font-size: 15px; color: var(--slate-500); }
.author-head { display: flex; align-items: center; gap: 18px; }
.author-head .author-avatar { width: 80px; height: 80px; font-size: 30px; }
.search-big { position: relative; display: flex; gap: 8px; max-width: 600px; margin-top: 20px; }
.search-big > svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--slate-400); }
.search-big input { flex: 1; min-width: 0; padding: 12px 16px 12px 44px; font: inherit; font-size: 15px; color: var(--slate-800); background: #fff; border: 1px solid var(--slate-200); border-radius: 12px; }
.search-big input:focus { outline: none; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }

/* ---------- Статья ---------- */
.post-card { min-width: 0; padding: 24px; background: #fff; border: 1px solid rgba(226, 232, 240, .9); border-radius: var(--r); box-shadow: var(--shadow-sm); }
@media (min-width: 640px) { .post-card { padding: 36px; } }
.page-wide { max-width: 960px; margin: 0 auto; }
.post-header { margin-bottom: 24px; }
.post-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 12px; color: var(--slate-400); }
.kicker-sep { color: var(--slate-300); }
.badge-soft { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 6px; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--brand-700); background: var(--brand-50); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.badge-soft:hover { background: var(--brand-100); }
.post-title { font-size: 26px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; margin-bottom: 16px; overflow-wrap: anywhere; }
@media (min-width: 640px) { .post-title { font-size: 32px; } }
@media (min-width: 1024px) { .post-title { font-size: 38px; } }
.page-lead { margin: 0; font-size: 17px; color: var(--slate-500); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--slate-100); border-bottom: 1px solid var(--slate-100); font-size: 12px; color: var(--slate-400); }
.post-meta-left, .post-meta-right { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.post-meta-right { color: var(--slate-500); }
.post-meta-right a:hover { color: var(--brand-600); }
.post-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--slate-800); }
.post-author:hover { color: var(--brand-600); }
.post-author .author-avatar { width: 28px; height: 28px; font-size: 12px; }
.post-cover { margin: 0 0 24px; }
.post-cover img { width: 100%; height: 260px; object-fit: cover; border-radius: 14px; }
@media (min-width: 640px) { .post-cover img { height: 380px; } }

/* Оглавление (генерирует CMS) */
.toc-box { margin: 0 0 28px; padding: 16px 18px; background: var(--slate-50); border: 1px solid var(--slate-200); border-radius: 12px; }
.toc-title { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--slate-900); }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.toc-item { position: relative; padding-left: 16px; }
.toc-item::before { content: ""; position: absolute; left: 0; top: .6em; width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); }
.toc-list a { color: var(--slate-600); }
.toc-list a:hover { color: var(--brand-600); }
.toc-subitem { padding-left: 32px; font-size: 13px; }
.toc-subitem > a::before { content: "— "; color: var(--slate-300); }

/* Текст статьи */
.prose { font-size: 16px; line-height: 1.75; color: var(--slate-700); overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.15em; }
.prose a { color: var(--brand-600); text-decoration: underline; text-decoration-color: rgba(5, 150, 105, .35); text-underline-offset: 3px; }
.prose a:hover { color: var(--brand-700); text-decoration-color: currentColor; }
.prose strong, .prose b { color: var(--slate-900); font-weight: 700; }
.prose h2 { margin: 1.8em 0 .7em; font-size: 22px; font-weight: 800; letter-spacing: -.01em; line-height: 1.3; color: var(--slate-900); scroll-margin-top: 160px; }
.prose h2::before { content: ""; display: block; width: 40px; height: 4px; margin-bottom: 12px; border-radius: 4px; background: var(--brand-500); }
@media (min-width: 640px) { .prose h2 { font-size: 24px; } }
.prose h3 { margin: 1.5em 0 .6em; font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--slate-900); scroll-margin-top: 160px; }
.prose h4 { margin: 1.4em 0 .5em; font-size: 16px; font-weight: 700; color: var(--slate-900); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose li { margin-bottom: .45em; padding-left: 4px; }
.prose ul > li::marker { color: var(--brand-500); }
.prose ol > li::marker { color: var(--brand-600); font-weight: 700; }
.prose blockquote { margin: 1.5em 0; padding: 16px 20px; border-left: 4px solid var(--brand-500); background: var(--brand-50); border-radius: 0 12px 12px 0; font-style: italic; color: var(--slate-700); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: 12px; margin: 1.5em auto; cursor: zoom-in; }
.prose picture { display: block; }
.prose figure { margin: 1.6em 0; }
.prose figure img, .prose figure picture img { margin: 0; width: 100%; }
.prose figcaption { margin-top: 8px; font-size: 12px; text-align: center; color: var(--slate-400); }
.prose code { padding: 2px 6px; border-radius: 6px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--slate-100); color: var(--brand-700); }
.prose pre { margin: 1.4em 0; padding: 16px 18px; overflow-x: auto; border-radius: 12px; background: var(--slate-900); color: #e2e8f0; font-size: 14px; }
.prose pre code { padding: 0; background: none; color: inherit; }
.prose table { display: block; width: 100%; max-width: 100%; overflow-x: auto; margin: 1.5em 0; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 10px 14px; border: 1px solid var(--slate-200); text-align: left; vertical-align: top; }
.prose th { background: var(--slate-100); color: var(--slate-900); font-weight: 700; }
.prose tr:nth-child(even) td { background: var(--slate-50); }
.prose iframe, .prose video { max-width: 100%; border: 0; border-radius: 12px; margin: 1.4em 0; }
.prose iframe[src*="youtube"], .prose iframe[src*="rutube"], .prose iframe[src*="vk.com"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.prose hr { border: 0; height: 1px; margin: 2em 0; background: var(--slate-200); }

.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--slate-200); }
.post-tags-label { margin-right: 6px; font-size: 12px; font-weight: 600; color: var(--slate-400); }
.post-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 20px; }
.post-share-label { font-size: 12px; color: var(--slate-400); }
.post-share-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.share-btn { display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--slate-600); background: #fff; border: 1px solid var(--slate-200); }
.share-btn:hover { border-color: var(--brand-500); color: var(--brand-600); }
.share-copy svg { width: 16px; height: 16px; }

.author-box { display: flex; gap: 16px; align-items: flex-start; margin-top: 28px; padding: 20px; border-radius: 14px; background: var(--slate-50); border: 1px solid var(--slate-200); }
.author-box .author-avatar { width: 64px; height: 64px; font-size: 24px; border-radius: 16px; }
.author-box-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-600); }
.author-box-name { display: inline-block; margin: 2px 0 6px; font-size: 17px; font-weight: 800; color: var(--slate-900); }
.author-box-name:hover { color: var(--brand-600); }
.author-box-bio { margin: 0; font-size: 14px; color: var(--slate-600); }

.post-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 32px; padding-top: 24px; border-top: 1px solid var(--slate-200); }
@media (min-width: 640px) { .post-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-nav-item { display: block; min-width: 0; padding: 16px; border-radius: 14px; border: 1px solid var(--slate-200); }
.post-nav-item:hover { border-color: var(--brand-400); background: var(--slate-50); }
.post-nav-label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--slate-400); }
.post-nav-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 700; color: var(--slate-800); }
.post-nav-item:hover .post-nav-title { color: var(--brand-600); }
@media (min-width: 640px) { .post-nav-item.is-right { text-align: right; } }

/* ---------- Комментарии (готовый блок CMS, классы .bc-*) ---------- */
.post-card .bc-comments { margin: 32px 0 0; padding-top: 24px; border-top: 1px solid var(--slate-200); }
.bc-comments .bc-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 17px; font-weight: 800; color: var(--slate-900); }
.bc-comments .bc-title span { opacity: 1; font-size: 12px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--brand-50); color: var(--brand-700); }
.bc-comments .bc-list { display: flex; flex-direction: column; gap: 12px; }
.bc-comments .bc-thread { padding: 16px; border: 1px solid var(--slate-200); border-radius: 12px; background: var(--slate-50); }
.bc-comments .bc-avatar { flex-basis: 36px; height: 36px; font-size: 13px; color: var(--slate-600); background: var(--slate-200); }
.bc-comments .bc-admin .bc-avatar { background: var(--brand-500); color: #fff; }
.bc-comments .bc-badge { background: var(--brand-600); }
.bc-comments .bc-reply { margin: 12px 0 0 44px; padding: 12px; border-radius: 10px; background: #fff; border: 1px solid var(--slate-200); }
.bc-comments .bc-name { font-size: 14px; color: var(--slate-900); }
.bc-comments .bc-head time { font-size: 11px; color: var(--slate-400); }
.bc-comments .bc-text { font-size: 14px; color: var(--slate-600); }
.bc-comments .bc-reply-btn { opacity: 1; color: var(--brand-600); text-decoration: none; font-size: 12px; font-weight: 600; }
.bc-comments .bc-form { margin-top: 20px; padding: 20px; border-radius: 12px; background: #fff; border: 1px solid var(--slate-200); }
.bc-comments .bc-form-title { font-size: 15px; font-weight: 800; color: var(--slate-900); }
.bc-comments .bc-field span { font-size: 12px; color: var(--slate-700); }
.bc-comments .bc-field input, .bc-comments .bc-field textarea { border: 1px solid var(--slate-200); border-radius: 10px; background: var(--slate-50); color: var(--slate-800); font-size: 14px; }
.bc-comments .bc-field input:focus, .bc-comments .bc-field textarea:focus { outline: none; background: #fff; border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(16, 185, 129, .2); }
.bc-comments .bc-check { color: var(--slate-500); }
.bc-comments .bc-check input { accent-color: var(--brand-600); }
.bc-comments .bc-check a { color: var(--brand-600); }
.bc-comments .bc-submit { border-radius: 10px; background: var(--brand-600); font-size: 14px; }
.bc-comments .bc-submit:hover { background: var(--brand-700); }

/* ---------- Контакты ---------- */
.contact-card { display: flex; flex-direction: column; gap: 16px; margin-bottom: 28px; padding: 22px; border-radius: 14px; background: var(--brand-50); border: 1px solid var(--brand-100); }
@media (min-width: 768px) { .contact-card { flex-direction: row; align-items: center; } }
.contact-icon { width: 48px; height: 48px; flex: 0 0 48px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: #fff; background: var(--brand-500); }
.contact-icon svg { width: 22px; height: 22px; }
.contact-body { flex: 1; min-width: 0; }
.contact-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand-700); }
.contact-mail { display: inline-block; margin: 2px 0 4px; font-size: 22px; font-weight: 800; color: var(--slate-900); word-break: break-all; }
.contact-mail:hover { color: var(--brand-600); }
.contact-note { margin: 0; font-size: 13px; color: var(--slate-600); }

/* ---------- 404 ---------- */
.notfound { max-width: 680px; margin: 16px auto 56px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.notfound-code { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; font-size: 96px; font-weight: 900; line-height: 1; letter-spacing: -.04em; color: var(--slate-900); }
.nf-wheel { width: 96px; height: 96px; border-radius: 28px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(to top right, var(--brand-600), var(--brand-400)); box-shadow: 0 10px 24px -8px rgba(16, 185, 129, .5); }
.nf-wheel svg { width: 56px; height: 56px; }
.notfound .search-big { width: 100%; margin: 24px 0 16px; }

/* ---------- Подвал ---------- */
.site-footer { margin-top: 64px; padding-top: 64px; padding-bottom: 32px; background: var(--slate-900); color: var(--slate-300); border-top: 1px solid var(--slate-800); }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; padding-bottom: 48px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } }
.footer-brand { display: inline-flex; align-items: center; gap: 12px; max-width: 100%; color: #fff; }
.footer-icon { width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px; display: flex; align-items: center; justify-content: center; background: var(--brand-500); color: #fff; }
.footer-icon svg { width: 24px; height: 24px; }
.footer-name { font-size: 22px; font-weight: 900; letter-spacing: -.03em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.footer-about p { margin: 16px 0; max-width: 380px; font-size: 14px; line-height: 1.65; color: var(--slate-400); }
.footer-social { display: flex; gap: 12px; }
.footer-social a { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; border-radius: 10px; color: var(--slate-400); background: var(--slate-800); }
.footer-social a:hover { background: var(--brand-500); color: #fff; }
.footer-social svg { width: 16px; height: 16px; }
.footer-title { margin-bottom: 14px; font-size: 14px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: #fff; }
.footer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.footer-list a { color: var(--slate-400); overflow-wrap: anywhere; }
.footer-list a:hover { color: var(--brand-400); }
.footer-mail a { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--slate-500); }
.footer-bottom { display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 16px; padding-top: 32px; border-top: 1px solid var(--slate-800); font-size: 12px; color: var(--slate-500); text-align: center; }
.footer-bottom p { margin: 0; }
@media (min-width: 768px) { .footer-bottom { flex-direction: row; text-align: left; } }
.footer-bottom-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 24px; }
.footer-bottom-links a:hover { color: var(--slate-300); }

/* ---------- Toast и лайтбокс ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; padding: 12px 18px; border-radius: 12px; background: var(--slate-900); color: #fff; font-size: 13px; font-weight: 600; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(80px); pointer-events: none; transition: all .3s; }
.toast.show { opacity: 1; transform: none; }
.lightbox { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.8); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; object-fit: contain; border-radius: 14px; }
.lightbox-close { position: absolute; top: 16px; right: 16px; width: 42px; height: 42px; border-radius: 50%; border: 0; display: flex; align-items: center; justify-content: center; color: var(--slate-800); background: var(--slate-100); }
.lightbox-close svg { width: 20px; height: 20px; }

@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .4; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
