/* =========================================================
   Sadovod74 — тема для BryanCMS 1.3
   Тёмно-зелёный + салатовый акцент, системный шрифт
   ========================================================= */

:root {
  --primary-dark: #1d2e0b;
  --primary: #355413;
  --primary-hover: #477019;
  --accent: #a8e748;
  --accent-hover: #96d932;
  --accent-light: #f1fce0;
  --bg-body: #f5f7f2;
  --bg-card: #ffffff;
  --text-main: #1b2412;
  --text-muted: #586649;
  --border-color: #dce3d3;
  --shadow-sm: 0 2px 6px rgba(29, 46, 11, .06);
  --shadow-md: 0 6px 18px rgba(29, 46, 11, .11);
  --radius: 8px;
}

/* ---------- База ---------- */
*, *::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: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg-body); color: var(--text-main); line-height: 1.55; font-size: 15px; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-decoration: none; transition: color .2s ease; }
a:hover { color: var(--primary-hover); }
ul { list-style: none; margin: 0; padding: 0; }
button { font: inherit; cursor: pointer; }
h1 { margin: 0; color: var(--primary-dark); line-height: 1.2; }
svg { width: 1em; height: 1em; flex: 0 0 auto; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.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: 1000; background: #fff; padding: 8px 14px; border-radius: 6px; box-shadow: var(--shadow-md); }
.skip-link:focus { left: 8px; }
.page-main { flex: 1 0 auto; padding-top: 24px; }

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

/* ---------- Верхняя панель ---------- */
.top-bar { background: var(--primary-dark); color: #d6e8be; font-size: 13px; padding: 6px 0; }
.top-bar .container { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 16px; }
.top-bar-text { min-width: 0; }
.top-bar-links { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.top-bar a { color: var(--accent); }
.top-bar a:hover { color: #fff; }
@media (max-width: 680px) { .top-bar-text { display: none; } .top-bar .container { justify-content: center; } }

/* ---------- Шапка ---------- */
.site-header { background: var(--bg-card); border-bottom: 1px solid var(--border-color); padding: 18px 0; }
.header-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px 20px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--primary-dark); }
.logo-img { max-height: 52px; width: auto; }
.logo-icon {
  width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%); color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(168, 231, 72, .35);
}
.logo-icon svg { width: 26px; height: 26px; }
.logo-text { display: flex; flex-direction: column; min-width: 0; }
.logo-name { font-size: 25px; font-weight: 800; letter-spacing: -.5px; line-height: 1.1; color: var(--primary-dark); overflow-wrap: anywhere; }
.logo:hover .logo-name { color: var(--primary); }
.tagline { font-size: 13px; color: var(--text-muted); }

.search-form { display: flex; max-width: 380px; width: 100%; }
.search-form input {
  flex: 1; min-width: 0; padding: 10px 14px; font: inherit; font-size: 14px; color: var(--text-main);
  background: var(--bg-body); border: 1px solid var(--border-color); border-right: none; border-radius: var(--radius) 0 0 var(--radius); outline: none;
}
.search-form input:focus { border-color: var(--primary); background: #fff; }
.search-form button { padding: 0 18px; background: var(--accent); color: var(--primary-dark); border: 1px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; font-weight: 700; transition: background-color .2s; }
.search-form button:hover { background: var(--accent-hover); }
@media (max-width: 760px) { .search-form { max-width: none; } }

/* ---------- Главное меню с выпадающими подрубриками (BryanCMS 1.4) ---------- */
.main-nav { position: sticky; top: 0; z-index: 100; background: var(--primary); border-bottom: 3px solid var(--accent); box-shadow: var(--shadow-sm); }
.nav-bar { position: relative; }
.nav-toggle { display: none; }
.nav-list { display: flex; flex-wrap: wrap; }
.nav-item { position: relative; display: flex; align-items: stretch; }
.nav-link { display: flex; align-items: center; padding: 13px 16px; color: #fff; font-weight: 600; font-size: 14px; white-space: nowrap; transition: background-color .2s, color .2s; }
.nav-item.has-children > .nav-link { padding-right: 4px; }
.sub-toggle { display: inline-flex; align-items: center; justify-content: center; width: 28px; padding: 0 10px 0 2px; border: 0; background: transparent; color: inherit; }
.sub-toggle svg { width: 12px; height: 12px; transition: transform .2s; }
.nav-item > .sub-toggle { color: #fff; }

/* Подсветка пункта: наведение, фокус, открыт, текущая рубрика */
.nav-item:hover, .nav-item:focus-within, .nav-item.open, .nav-item.active, .nav-item.active-parent { background: var(--accent); }
.nav-item:hover > .nav-link, .nav-item:focus-within > .nav-link, .nav-item.open > .nav-link,
.nav-item.active > .nav-link, .nav-item.active-parent > .nav-link, .nav-link.active,
.nav-item:hover > .sub-toggle, .nav-item:focus-within > .sub-toggle, .nav-item.open > .sub-toggle, .nav-item.active > .sub-toggle { color: var(--primary-dark); }
.nav-link.active { background: var(--accent); }
.nav-item:hover > .sub-toggle svg, .nav-item.open > .sub-toggle svg { transform: rotate(180deg); }

/* Выпадающее подменю */
.dropdown-menu {
  position: absolute; top: 100%; left: 0; z-index: 200; min-width: 245px; max-width: 320px; padding: 6px 0;
  background: var(--bg-card); border: 1px solid var(--border-color); border-top: 3px solid var(--accent);
  border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-md);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.nav-item:hover > .dropdown-menu, .nav-item:focus-within > .dropdown-menu, .nav-item.open > .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu.align-right { left: auto; right: 0; }
.dropdown-menu .menu-item { position: relative; display: flex; align-items: center; flex-wrap: wrap; }
.dropdown-menu a { flex: 1 1 0; min-width: 0; display: block; padding: 9px 16px; color: var(--text-main); font-size: 14px; border-bottom: 1px solid #f2f5ed; transition: background-color .2s, padding-left .2s, color .2s; }
.dropdown-menu .menu-item:last-child > a { border-bottom: none; }
.dropdown-menu a:hover, .dropdown-menu .menu-item.active > a { background: var(--accent-light); color: var(--primary-dark); padding-left: 20px; }
.dropdown-menu .menu-item.active > a { font-weight: 700; }
.dropdown-menu .sub-toggle { align-self: stretch; color: var(--text-muted); width: 32px; padding: 0 10px; }
.dropdown-menu .sub-toggle svg { transform: rotate(-90deg); }
/* Третий уровень — сбоку */
.dropdown-sub { top: -9px; left: 100%; border-top-width: 1px; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0; transform: translateX(8px); }
.dropdown-sub.open-left { left: auto; right: 100%; border-left-width: 1px; border-right: 3px solid var(--accent); border-radius: var(--radius) 0 0 var(--radius); transform: translateX(-8px); }
.menu-item:hover > .dropdown-sub, .menu-item:focus-within > .dropdown-sub, .menu-item.open > .dropdown-sub { opacity: 1; visibility: visible; transform: translateX(0); }

/* ---------- Телефон и узкий планшет: меню под кнопкой, подменю — аккордеон ---------- */
@media (max-width: 1000px) {
  .nav-toggle {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 12px 0; border: 0;
    background: transparent; color: #fff; font-size: 15px; font-weight: 700; text-align: left;
  }
  .nav-toggle-icon { position: relative; width: 18px; height: 2px; background: currentColor; transition: background .2s; }
  .nav-toggle-icon::before, .nav-toggle-icon::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: currentColor; transition: transform .2s, top .2s; }
  .nav-toggle-icon::before { top: -6px; }
  .nav-toggle-icon::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::before { top: 0; transform: rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-icon::after { top: 0; transform: rotate(-45deg); }

  .nav-list { display: none; flex-direction: column; flex-wrap: nowrap; max-height: calc(100vh - 60px); overflow-y: auto; padding-bottom: 10px; }
  .nav-list.is-open { display: flex; }
  .nav-item { flex-wrap: wrap; border-top: 1px solid rgba(168, 231, 72, .18); }
  .nav-item:hover, .nav-item:focus-within { background: transparent; }
  .nav-item:hover > .nav-link, .nav-item:focus-within > .nav-link, .nav-item:hover > .sub-toggle, .nav-item:focus-within > .sub-toggle { color: #fff; }
  .nav-item.active, .nav-item.open { background: transparent; }
  .nav-item.active > .nav-link, .nav-link.active { background: transparent; color: var(--accent); }
  .nav-item.open > .nav-link, .nav-item.open > .sub-toggle { color: var(--accent); }
  .nav-link { flex: 1 1 0; min-width: 0; padding: 12px 4px; white-space: normal; }
  .nav-item > .sub-toggle { width: 48px; padding: 0; color: #fff; }
  .nav-item:hover > .sub-toggle svg { transform: none; }
  .nav-item.open > .sub-toggle svg { transform: rotate(180deg); }

  /* Подменю в потоке, раскрывается только по кнопке (li.open) */
  .dropdown-menu, .dropdown-sub {
    position: static; flex: 0 0 100%; min-width: 0; max-width: none; margin: 0 0 10px; padding: 4px 0;
    display: none; opacity: 1; visibility: visible; transform: none; box-shadow: none;
    border: 0; border-left: 3px solid var(--accent); border-radius: 0 var(--radius) var(--radius) 0;
  }
  .nav-item:hover > .dropdown-menu, .nav-item:focus-within > .dropdown-menu, .menu-item:hover > .dropdown-sub, .menu-item:focus-within > .dropdown-sub { display: none; }
  .nav-item.open > .dropdown-menu, .menu-item.open > .dropdown-sub { display: block; }
  .dropdown-sub { margin: 0 0 6px 14px; background: var(--accent-light); }
  .dropdown-menu .sub-toggle { width: 44px; }
  .dropdown-menu .sub-toggle svg { transform: none; }
  .dropdown-menu .menu-item.open > .sub-toggle svg { transform: rotate(180deg); }
  .dropdown-menu a { padding: 10px 14px; }
  .dropdown-menu a:hover { padding-left: 14px; }
}

/* ---------- Слайдер ---------- */
.hero-slider { position: relative; margin: 24px 0; height: 360px; overflow: hidden; border-radius: var(--radius); background: var(--primary-dark); box-shadow: var(--shadow-md); touch-action: pan-y; }
.slide { position: absolute; inset: 0; display: flex; align-items: flex-end; opacity: 0; visibility: hidden; transition: opacity .6s ease, 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; }
.slide::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20, 33, 7, .93) 0%, rgba(29, 46, 11, .4) 60%, transparent 100%); }
.slide-content { position: relative; z-index: 2; width: 100%; max-width: 780px; padding: 32px 44px 40px; color: #fff; }
.slide-badge { display: inline-block; max-width: 100%; margin-bottom: 10px; padding: 4px 10px; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; background: var(--accent); color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slide-badge:hover { background: var(--accent-hover); color: var(--primary-dark); }
.slide-title { font-size: 28px; font-weight: 700; line-height: 1.25; margin-bottom: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.slide-title a { color: #fff; }
.slide-title a:hover { color: var(--accent); }
.slide-excerpt { margin: 0 0 18px; color: #e4f2d0; font-size: 15px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.btn-slide { display: inline-block; padding: 10px 20px; border-radius: 6px; font-size: 14px; font-weight: 700; background: var(--accent); color: var(--primary-dark); transition: background-color .2s, transform .2s; }
.btn-slide:hover { background: var(--accent-hover); color: var(--primary-dark); transform: translateY(-1px); }
.slider-arrow { position: absolute; top: 50%; z-index: 3; transform: translateY(-50%); width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; background: rgba(29, 46, 11, .55); border: 1px solid rgba(168, 231, 72, .5); color: var(--accent); transition: background .2s, color .2s; }
.slider-arrow:hover { background: var(--accent); color: var(--primary-dark); }
.slider-arrow svg { width: 20px; height: 20px; }
.slider-prev { left: 16px; }
.slider-next { right: 16px; }
.slider-dots { position: absolute; right: 24px; bottom: 18px; z-index: 3; display: flex; gap: 8px; }
.slider-dot { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 5px; background: rgba(255,255,255,.45); transition: width .2s, background .2s; }
.slider-dot.active { width: 26px; background: var(--accent); }
@media (min-width: 681px) { .slide-content { padding-left: 72px; padding-right: 72px; } }
@media (max-width: 680px) {
  .hero-slider { height: 320px; }
  .slide-content { padding: 20px 20px 44px; }
  .slide-title { font-size: 20px; }
  .slide-excerpt { font-size: 14px; }
  .slider-arrow { display: none; }
  .slider-dots { left: 20px; right: auto; bottom: 16px; }
}

/* ---------- Сетка: контент + сайдбар ---------- */
.main-layout { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 24px; margin-bottom: 40px; align-items: start; }
.content { min-width: 0; }
.section-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.section-title { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; color: var(--primary-dark); }
.section-title::before { content: ""; display: inline-block; width: 10px; height: 20px; flex: 0 0 10px; border-radius: 3px; background: var(--accent); }
.section-note { font-size: 13px; font-weight: 600; color: var(--text-muted); }

/* Карточки — 3 колонки */
.articles-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.article-card { display: flex; flex-direction: column; min-width: 0; overflow: hidden; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.article-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent); }
.article-thumb { position: relative; display: block; height: 165px; overflow: hidden; background: var(--accent-light); }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; }
.article-cat-badge { position: absolute; top: 10px; left: 10px; z-index: 1; max-width: calc(100% - 20px); padding: 3px 9px; border-radius: 4px; font-size: 11px; font-weight: 700; background: var(--primary-dark); color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.article-body { display: flex; flex-direction: column; flex: 1; padding: 16px; }
.article-meta { margin-bottom: 6px; font-size: 12px; color: var(--text-muted); }
.article-title { margin-bottom: 8px; font-size: 16px; font-weight: 700; line-height: 1.35; overflow-wrap: anywhere; }
.article-title a { color: var(--text-main); }
.article-title a:hover { color: var(--primary); }
.article-excerpt { flex: 1; margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.article-footer { margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f4ea; font-size: 13px; font-weight: 700; }
.empty { grid-column: 1 / -1; padding: 36px 20px; text-align: center; color: var(--text-muted); background: #fff; border: 1px dashed var(--border-color); border-radius: var(--radius); }

/* ---------- Пагинация (генерирует CMS) ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 28px; }
.pagination .page-numbers { padding: 8px 14px; font-size: 14px; font-weight: 600; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: 6px; color: var(--primary); }
.pagination a.page-numbers:hover { background: var(--accent-light); border-color: var(--accent); }
.pagination .page-numbers.current { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); font-weight: 700; }
.pagination .page-numbers.dots { background: none; border-color: transparent; color: var(--text-muted); padding: 8px 4px; }

/* ---------- Сайдбар ---------- */
.sidebar { min-width: 0; }
.sidebar-inner { display: flex; flex-direction: column; gap: 22px; }
.page-post .sidebar-inner { position: sticky; top: 72px; }
@media (max-width: 1000px) { .page-post .sidebar-inner { position: static; } }
.widget { padding: 18px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-sm); min-width: 0; }
.widget-title { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; padding-bottom: 10px; border-bottom: 2px solid var(--accent); font-size: 16px; font-weight: 700; color: var(--primary-dark); }
.cat-list li { margin-bottom: 6px; }
.cat-list li:last-child { margin-bottom: 0; }
.cat-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 6px; border-left: 3px solid transparent; background: var(--bg-body); color: var(--primary-dark); font-weight: 600; font-size: 14px; transition: all .2s ease; }
.cat-name { min-width: 0; overflow-wrap: anywhere; }
.cat-list a:hover, .cat-list a.active { background: var(--accent-light); border-left-color: var(--accent); padding-left: 15px; }
.cat-count { flex: 0 0 auto; padding: 2px 8px; border-radius: 12px; font-size: 12px; font-weight: 700; color: var(--text-muted); background: var(--bg-card); border: 1px solid var(--border-color); transition: all .2s ease; }
.cat-list a:hover .cat-count, .cat-list a.active .cat-count { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }
.tags-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-item { display: inline-block; max-width: 100%; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; color: var(--text-main); background: var(--bg-body); border: 1px solid var(--border-color); overflow-wrap: anywhere; transition: all .2s; }
.tag-item:hover { background: var(--accent); color: var(--primary-dark); border-color: var(--accent); }
.archive-list li { margin-bottom: 7px; font-size: 13.5px; }
.archive-list a { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 3px 0; color: var(--text-main); }
.archive-list a:hover { color: var(--primary); }
.archive-count { font-size: 12px; color: #7b8a6b; }
.latest-list li + li { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f4ea; }
.latest-list a { display: block; }
.latest-title { display: block; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--text-main); }
.latest-list a:hover .latest-title { color: var(--primary); }
.latest-list time { display: block; margin-top: 2px; font-size: 12px; color: var(--text-muted); }

/* ---------- Хлебные крошки ---------- */
.breadcrumbs { margin: 0 0 16px; font-size: 13px; color: var(--text-muted); }
.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(--border-color); }
.breadcrumbs a { white-space: nowrap; }
.breadcrumbs li[aria-current] { flex: 1 1 0; }
.breadcrumbs li[aria-current] span { display: block; min-width: 0; color: var(--text-main); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Заголовок ленты ---------- */
.listing-header { margin-bottom: 18px; padding: 20px; background: var(--bg-card); border: 1px solid var(--border-color); border-left: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.listing-kicker { margin-bottom: 4px; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary); }
.listing-title { font-size: 26px; font-weight: 800; overflow-wrap: anywhere; }
.listing-desc { margin: 6px 0 0; color: var(--text-muted); }
.author-head { display: flex; align-items: center; gap: 16px; }
.author-head .author-avatar { width: 72px; height: 72px; font-size: 26px; }
.search-big { position: relative; display: flex; gap: 8px; max-width: 560px; margin-top: 14px; }
.search-big > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-muted); }
.search-big input { flex: 1; min-width: 0; padding: 10px 14px 10px 40px; font: inherit; font-size: 14px; background: var(--bg-body); border: 1px solid var(--border-color); border-radius: var(--radius); color: var(--text-main); }
.search-big input:focus { outline: none; border-color: var(--primary); background: #fff; }

/* Кнопки для служебных страниц */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 20px; border-radius: 6px; border: 1px solid transparent; font-size: 14px; font-weight: 700; transition: background .2s, color .2s, border-color .2s; }
.btn-accent, .btn-brand { background: var(--accent); color: var(--primary-dark); }
.btn-accent:hover, .btn-brand:hover { background: var(--accent-hover); color: var(--primary-dark); }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border-color); }
.btn-outline:hover { border-color: var(--accent); background: var(--accent-light); }

/* Аватары (генерирует 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(--accent-light); color: var(--primary); font-weight: 800; text-transform: uppercase; border: 1px solid var(--border-color); }

/* ---------- Статья ---------- */
.post-card { min-width: 0; padding: 22px; background: var(--bg-card); border: 1px solid var(--border-color); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
@media (min-width: 681px) { .post-card { padding: 32px; } }
.page-wide { max-width: 960px; margin: 0 auto 40px; }
.post-header { margin-bottom: 20px; }
.post-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; color: var(--text-muted); }
.kicker-sep { color: var(--border-color); }
.badge-soft { display: inline-block; max-width: 100%; padding: 3px 10px; border-radius: 4px; font-size: 12px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; background: var(--accent); color: var(--primary-dark); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.badge-soft:hover { background: var(--accent-hover); color: var(--primary-dark); }
.post-title { font-size: 26px; font-weight: 800; letter-spacing: -.3px; line-height: 1.22; margin-bottom: 14px; overflow-wrap: anywhere; }
@media (min-width: 681px) { .post-title { font-size: 32px; } }
.page-lead { margin: 0; font-size: 16px; color: var(--text-muted); }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 0; border-top: 1px solid #edf1e7; border-bottom: 1px solid #edf1e7; font-size: 13px; color: var(--text-muted); }
.post-meta-left, .post-meta-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.post-author { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; color: var(--primary-dark); }
.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: var(--radius); }
@media (min-width: 681px) { .post-cover img { height: 380px; } }

/* Оглавление (генерирует CMS) */
.toc-box { margin: 0 0 24px; padding: 16px 18px; background: var(--accent-light); border: 1px solid #dff3bd; border-left: 4px solid var(--accent); border-radius: var(--radius); }
.toc-title { margin-bottom: 8px; font-size: 13px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary-dark); }
.toc-list { display: flex; flex-direction: column; gap: 5px; font-size: 14px; }
.toc-item { position: relative; padding-left: 16px; }
.toc-item::before { content: ""; position: absolute; left: 0; top: .55em; width: 7px; height: 7px; border-radius: 2px; background: var(--primary); }
.toc-subitem { padding-left: 32px; font-size: 13px; }
.toc-list a { color: var(--primary-dark); }
.toc-list a:hover { color: var(--primary-hover); text-decoration: underline; }

/* Текст статьи */
.prose { font-size: 16px; line-height: 1.7; color: var(--text-main); overflow-wrap: break-word; }
.prose > *:first-child { margin-top: 0; }
.prose > *:last-child { margin-bottom: 0; }
.prose p { margin: 0 0 1.1em; }
.prose a { color: var(--primary); text-decoration: underline; text-decoration-color: rgba(53, 84, 19, .35); text-underline-offset: 3px; }
.prose a:hover { color: var(--primary-hover); text-decoration-color: currentColor; }
.prose strong, .prose b { color: var(--primary-dark); }
.prose h2 { display: flex; align-items: flex-start; gap: 10px; margin: 1.8em 0 .7em; font-size: 22px; line-height: 1.3; color: var(--primary-dark); scroll-margin-top: 70px; }
.prose h2::before { content: ""; flex: 0 0 8px; height: 1.1em; margin-top: .1em; border-radius: 3px; background: var(--accent); }
.prose h3 { margin: 1.5em 0 .6em; font-size: 18px; line-height: 1.35; color: var(--primary-dark); scroll-margin-top: 70px; }
.prose h4 { margin: 1.3em 0 .5em; font-size: 16px; color: var(--primary-dark); }
.prose ul, .prose ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin-bottom: .4em; padding-left: 4px; }
.prose ul > li::marker { color: var(--primary); }
.prose ol > li::marker { color: var(--primary); font-weight: 700; }
.prose blockquote { margin: 1.4em 0; padding: 14px 18px; border-left: 4px solid var(--accent); background: var(--accent-light); border-radius: 0 var(--radius) var(--radius) 0; color: var(--primary-dark); }
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius); margin: 1.4em auto; cursor: zoom-in; }
.prose picture { display: block; }
.prose figure { margin: 1.5em 0; }
.prose figure img, .prose figure picture img { margin: 0; width: 100%; }
.prose figcaption { margin-top: 6px; font-size: 13px; text-align: center; color: var(--text-muted); }
.prose code { padding: 2px 6px; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88em; background: var(--accent-light); color: var(--primary-dark); }
.prose pre { margin: 1.4em 0; padding: 14px 16px; overflow-x: auto; border-radius: var(--radius); background: var(--primary-dark); color: #e4f2d0; 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.4em 0; border-collapse: collapse; font-size: 14px; }
.prose th, .prose td { padding: 9px 12px; border: 1px solid var(--border-color); text-align: left; vertical-align: top; }
.prose th { background: var(--primary); color: #fff; font-weight: 700; }
.prose tr:nth-child(even) td { background: #f8faf5; }
.prose iframe, .prose video { max-width: 100%; border: 0; border-radius: var(--radius); 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: 2px; margin: 2em 0; background: var(--border-color); }

.post-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--border-color); }
.post-tags-label { margin-right: 4px; font-size: 13px; font-weight: 700; color: var(--text-muted); }
.post-share { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 18px; }
.post-share-label { font-size: 13px; color: var(--text-muted); }
.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: 6px; font-size: 13px; font-weight: 600; color: var(--primary-dark); background: var(--bg-body); border: 1px solid var(--border-color); transition: all .2s; }
.share-btn:hover { background: var(--accent); border-color: var(--accent); }
.share-copy svg { width: 16px; height: 16px; }

.author-box { display: flex; gap: 14px; align-items: flex-start; margin-top: 24px; padding: 18px; border-radius: var(--radius); background: var(--bg-body); border: 1px solid var(--border-color); }
.author-box .author-avatar { width: 60px; height: 60px; font-size: 22px; }
.author-box-label { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary); }
.author-box-name { display: inline-block; margin: 2px 0 6px; font-size: 16px; font-weight: 800; color: var(--primary-dark); }
.author-box-bio { margin: 0; font-size: 14px; color: var(--text-muted); }

.post-nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 24px; }
@media (min-width: 681px) { .post-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.post-nav-item { display: block; min-width: 0; padding: 14px 16px; border-radius: var(--radius); background: var(--bg-body); border: 1px solid var(--border-color); transition: all .2s; }
.post-nav-item:hover { border-color: var(--accent); background: var(--accent-light); }
.post-nav-label { display: block; margin-bottom: 4px; font-size: 12px; color: var(--text-muted); }
.post-nav-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; font-weight: 700; color: var(--primary-dark); }
@media (min-width: 681px) { .post-nav-item.is-right { text-align: right; } }

/* ---------- Комментарии (готовый блок CMS, классы .bc-*) ---------- */
.post-card .bc-comments { margin: 28px 0 0; padding-top: 22px; border-top: 2px solid var(--primary); }
.bc-comments .bc-title { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 18px; font-weight: 800; color: var(--primary-dark); }
.bc-comments .bc-title span { opacity: 1; padding: 1px 8px; border-radius: 12px; font-size: 12px; background: var(--accent); color: var(--primary-dark); }
.bc-comments .bc-list { display: flex; flex-direction: column; gap: 10px; }
.bc-comments .bc-thread { padding: 14px; border: 1px solid var(--border-color); border-radius: var(--radius); background: var(--bg-body); }
.bc-comments .bc-avatar { flex-basis: 36px; height: 36px; font-size: 13px; color: var(--primary-dark); background: var(--accent-light); border: 1px solid var(--border-color); }
.bc-comments .bc-admin .bc-avatar { background: var(--primary); color: var(--accent); border-color: var(--primary); }
.bc-comments .bc-badge { background: var(--primary); color: var(--accent); }
.bc-comments .bc-reply { margin: 10px 0 0 42px; padding: 12px; border-radius: 6px; background: #fff; border: 1px solid var(--border-color); }
.bc-comments .bc-name { color: var(--primary-dark); }
.bc-comments .bc-text { color: var(--text-main); }
.bc-comments .bc-reply-btn { opacity: 1; color: var(--primary); font-weight: 600; text-decoration: none; }
.bc-comments .bc-form { margin-top: 18px; padding: 18px; border-radius: var(--radius); background: #fff; border: 1px solid var(--border-color); }
.bc-comments .bc-form-title { font-size: 15px; font-weight: 800; color: var(--primary-dark); }
.bc-comments .bc-field input, .bc-comments .bc-field textarea { border: 1px solid var(--border-color); border-radius: 6px; background: var(--bg-body); color: var(--text-main); }
.bc-comments .bc-field input:focus, .bc-comments .bc-field textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.bc-comments .bc-check input { accent-color: var(--primary); }
.bc-comments .bc-submit { border-radius: 6px; background: var(--accent); color: var(--primary-dark); font-weight: 700; }
.bc-comments .bc-submit:hover { background: var(--accent-hover); }

/* ---------- Контакты ---------- */
.contact-card { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; padding: 20px; border-radius: var(--radius); background: var(--accent-light); border: 1px solid #dff3bd; }
@media (min-width: 768px) { .contact-card { flex-direction: row; align-items: center; } }
.contact-icon { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; display: flex; align-items: center; justify-content: center; background: var(--primary); color: var(--accent); }
.contact-icon svg { width: 22px; height: 22px; }
.contact-body { flex: 1; min-width: 0; }
.contact-label { font-size: 11px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; color: var(--primary); }
.contact-mail { display: inline-block; margin: 2px 0 4px; font-size: 21px; font-weight: 800; color: var(--primary-dark); word-break: break-all; }
.contact-note { margin: 0; font-size: 13px; color: var(--text-muted); }

/* ---------- 404 ---------- */
.notfound { max-width: 640px; margin: 8px auto 48px; display: flex; flex-direction: column; align-items: center; text-align: center; }
.notfound-code { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 92px; font-weight: 900; line-height: 1; color: var(--primary-dark); }
.nf-leaf { width: 92px; height: 92px; border-radius: 20px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary), var(--accent)); color: var(--primary-dark); box-shadow: 0 6px 18px rgba(168, 231, 72, .35); }
.nf-leaf svg { width: 50px; height: 50px; }
.notfound .search-big { width: 100%; margin: 20px 0 14px; }
.notfound + .feed-head, .notfound ~ .feed-head { margin-bottom: 18px; padding-bottom: 10px; border-bottom: 2px solid var(--primary); }
.feed-title { font-size: 20px; font-weight: 700; color: var(--primary-dark); }

/* ---------- Футер ---------- */
.site-footer { margin-top: 24px; padding: 40px 0 20px; background: var(--primary-dark); border-top: 4px solid var(--accent); color: #d6e8be; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr; gap: 32px; padding-bottom: 28px; border-bottom: 1px solid rgba(168, 231, 72, .18); }
.footer-title { margin-bottom: 14px; font-size: 16px; font-weight: 700; color: var(--accent); }
.footer-col p { margin: 0 0 10px; color: #c7deb0; font-size: 13.5px; line-height: 1.6; }
.footer-links li { margin-bottom: 8px; }
.footer-links a, .footer-mail a { color: #c7deb0; font-size: 13.5px; overflow-wrap: anywhere; }
.footer-links a:hover, .footer-mail a:hover { color: var(--accent); text-decoration: underline; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 18px; font-size: 12.5px; color: #9cb582; }

/* ---------- Cookie (152-ФЗ) ---------- */
.cookie-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 999; max-width: 960px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 20px; border-radius: var(--radius); background: var(--primary-dark); border: 1px solid var(--accent); color: #fff; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.cookie-banner[hidden] { display: none; }
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-btn { flex: 0 0 auto; padding: 8px 18px; border: 0; border-radius: 6px; background: var(--accent); color: var(--primary-dark); font-weight: 700; white-space: nowrap; }
.cookie-btn:hover { background: var(--accent-hover); }

/* ---------- Toast и лайтбокс ---------- */
.toast { position: fixed; right: 20px; bottom: 20px; z-index: 1001; padding: 11px 16px; border-radius: var(--radius); background: var(--primary-dark); color: var(--accent); font-size: 13px; font-weight: 700; 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: 1002; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(10, 18, 4, .85); }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(1100px, 100%); max-height: 88vh; object-fit: contain; border-radius: var(--radius); }
.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; background: var(--accent); color: var(--primary-dark); }
.lightbox-close svg { width: 20px; height: 20px; }

/* ---------- Адаптивность (как в шаблоне) ---------- */
@media (max-width: 1100px) { .articles-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 1024px) {
  .main-layout { grid-template-columns: minmax(0, 1fr); }
  .page-post .sidebar-inner { position: static; }
}
@media (max-width: 680px) {
  .articles-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .cookie-banner { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
.home-main { flex: 1 0 auto; }

/* Подрубрики на странице рубрики (1.4) */
.subcats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.subcat { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 5px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; background: var(--accent-light); border: 1px solid #dff3bd; color: var(--primary-dark); overflow-wrap: anywhere; }
.subcat span { padding: 0 6px; border-radius: 10px; font-size: 11px; background: #fff; color: var(--text-muted); }
.subcat:hover { background: var(--accent); border-color: var(--accent); color: var(--primary-dark); }
.subcat-up { background: #fff; border-color: var(--border-color); }
.kicker-parent { font-weight: 700; color: var(--primary); }

/* Средние экраны: меню рубрик остаётся в одну строку */
@media (min-width: 1001px) and (max-width: 1240px) {
  .nav-link { padding: 13px 10px; font-size: 13.5px; }
  .nav-item.has-children > .nav-link { padding-right: 2px; }
  .nav-item > .sub-toggle { width: 22px; padding: 0 8px 0 0; }
}
/* Выпадашки крайних правых пунктов раскрываются влево, чтобы не выходить за экран */
@media (min-width: 1001px) {
  .nav-list > .nav-item:nth-last-child(-n+2) > .dropdown-menu { left: auto; right: 0; }
  .nav-list > .nav-item:nth-last-child(-n+2) .dropdown-sub { left: auto; right: 100%; border-left-width: 1px; border-right: 3px solid var(--accent); border-radius: var(--radius) 0 0 var(--radius); }
}

/* Ветка до текущей подрубрики внутри выпадашки */
.dropdown-menu .menu-item.active-parent > a { color: var(--primary-dark); font-weight: 700; background: #f8fcf1; }
@media (max-width: 1000px) { .nav-item.active-parent > .nav-link { color: var(--accent); } .nav-item.active-parent { background: transparent; } }
