/* BryanCMS Default 1.1 — эталонная тема. Без внешних шрифтов и иконок. */
:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1f2421;
  --muted: #6b716c;
  --border: #e7e4dc;
  --accent: #2f6b4f;
  --accent-soft: #e6f0ea;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 6px 24px rgba(0,0,0,.05);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;
  --container: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131614; --surface: #1b1f1c; --text: #e8ebe8; --muted: #9aa39c;
    --border: #2b312d; --accent: #7cc49e; --accent-soft: #1f2e26;
    --shadow: 0 1px 2px rgba(0,0,0,.3);
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body { margin: 0; background: var(--bg); color: var(--text); font: 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.button, .search-big button { display: inline-block; background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 11px 20px; font: 600 .95rem var(--font); cursor: pointer; }
.button:hover { text-decoration: none; filter: brightness(1.08); }
.kicker { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); font-weight: 700; }

/* Шапка */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand { font-weight: 800; font-size: 1.25rem; color: var(--text); flex-shrink: 0; }
.brand:hover { text-decoration: none; }
.brand img { max-height: 44px !important; width: auto; }
.site-nav { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: 6px; margin: 0; padding: 0; }
.site-nav a { color: var(--text); padding: 8px 12px; border-radius: 8px; font-weight: 500; font-size: .95rem; }
.site-nav a:hover, .site-nav a.active { background: var(--accent-soft); color: var(--accent); text-decoration: none; }
.search-mini input { width: 180px; border: 1px solid var(--border); background: var(--surface); color: var(--text); border-radius: 10px; padding: 8px 12px; font: inherit; font-size: .9rem; }
.nav-toggle { display: none; margin-left: auto; background: none; border: 0; padding: 10px; cursor: pointer; }
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--text); margin: 4px 0; transition: .2s; }

/* Hero */
.hero { padding: 64px 0 40px; border-bottom: 1px solid var(--border); margin-bottom: 40px; }
.hero h1 { font-family: var(--font-serif); font-size: clamp(2rem, 4.5vw, 3.2rem); max-width: 820px; }
.hero p { font-size: 1.2rem; color: var(--muted); max-width: 680px; margin: 0; }

/* Раскладка */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-top: 40px; padding-bottom: 64px; }
.hero + .layout { padding-top: 0; }

/* Ленты */
.listing-header { margin-bottom: 28px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.listing-title { font-family: var(--font-serif); font-size: clamp(1.8rem, 3.5vw, 2.5rem); margin: 4px 0 8px; }
.listing-desc { color: var(--muted); margin: 0 0 8px; }
.author-head { display: flex; gap: 16px; align-items: center; }
.cards { display: grid; gap: 22px; }
.card { display: grid; grid-template-columns: 240px 1fr; gap: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.card:not(:has(.card-thumb)) { grid-template-columns: 1fr; padding: 22px; }
.card-thumb img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.card-cat { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.card-title { font-size: 1.3rem; margin: 6px 0 8px; }
.card-title a { color: var(--text); }
.card-excerpt { color: var(--muted); margin: 0 0 12px; font-size: .97rem; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: .85rem; color: var(--muted); }
.meta a { color: var(--text); font-weight: 600; }
.empty { padding: 40px; text-align: center; background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--muted); }

/* Пагинация (HTML генерирует CMS: .pagination .page-numbers .current .dots .prev .next) */
.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; }
.pagination .page-numbers { min-width: 40px; text-align: center; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: .95rem; }
.pagination a.page-numbers:hover { border-color: var(--accent); text-decoration: none; }
.pagination .current { background: var(--accent); border-color: var(--accent); color: #fff; }
.pagination .dots { border: 0; background: none; }

/* Сайдбар */
.sidebar { display: flex; flex-direction: column; gap: 24px; }
.widget { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.widget-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 14px; }
.widget-list, .widget-posts { list-style: none; margin: 0; padding: 0; }
.widget-list li { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: .95rem; }
.widget-list li:last-child, .widget-posts li:last-child { border-bottom: 0; }
.widget-list a { color: var(--text); }
.widget-list a.active { color: var(--accent); font-weight: 700; }
.count { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.widget-posts li { padding: 9px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 2px; }
.widget-posts a { color: var(--text); font-weight: 600; font-size: .95rem; line-height: 1.35; }
.widget-posts time { color: var(--muted); font-size: .8rem; }
.widget-posts.numbered { counter-reset: n; }
.widget-posts.numbered li { padding-left: 34px; position: relative; }
.widget-posts.numbered li::before { counter-increment: n; content: counter(n); position: absolute; left: 0; top: 8px; font: 700 1.3rem var(--font-serif); color: var(--accent); }
.tag-cloud, .article-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-item { background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 999px; font-size: .85rem; }
.tag-item:hover { text-decoration: none; filter: brightness(.95); }

/* Статья */
.article { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: clamp(20px, 4vw, 48px); box-shadow: var(--shadow); }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.crumbs a { color: var(--muted); }
.article-title { font-family: var(--font-serif); font-size: clamp(1.9rem, 4vw, 2.8rem); }
.article-lead { font-size: 1.2rem; color: var(--muted); margin: 0 0 16px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color: var(--muted); font-size: .9rem; padding-bottom: 20px; border-bottom: 1px solid var(--border); margin-bottom: 24px; }
.author-chip { display: inline-flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; }
.author-avatar { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; }
.author-avatar.lg { width: 72px; height: 72px; }
.article-cover { margin: 0 0 28px; }
.article-cover img { width: 100%; border-radius: 12px; }
.toc-box { background: var(--accent-soft); border-radius: 12px; padding: 18px 22px; margin: 0 0 28px; }
.toc-title { font-weight: 700; margin-bottom: 8px; }
.toc-list { margin: 0; padding-left: 20px; }
.toc-list li { margin: 4px 0; }
.toc-subitem { margin-left: 18px !important; list-style: circle; font-size: .95rem; }
.prose { font-size: 1.08rem; line-height: 1.75; overflow-wrap: break-word; }
.prose h2 { font-size: 1.6rem; margin-top: 1.8em; }
.prose h3 { font-size: 1.3rem; margin-top: 1.5em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose img { border-radius: 10px; margin: 1.4em auto; }
.prose figure { margin: 1.6em 0; }
.prose figcaption { text-align: center; color: var(--muted); font-size: .9rem; }
.prose blockquote { margin: 1.6em 0; padding: 4px 22px; border-left: 4px solid var(--accent); color: var(--muted); font-style: italic; }
.prose pre { background: #1d211e; color: #e8ebe8; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: .9rem; }
.prose code { background: var(--accent-soft); padding: 2px 6px; border-radius: 5px; font-size: .9em; }
.prose pre code { background: none; padding: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 1.4em 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.prose iframe { max-width: 100%; border: 0; }
.article-tags { margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }
.author-box { display: flex; gap: 18px; align-items: flex-start; margin-top: 32px; padding: 22px; background: var(--bg); border-radius: 12px; }
.author-box .author-avatar { width: 64px; height: 64px; }
.author-box-name { font-weight: 700; font-size: 1.1rem; color: var(--text); }
.author-box p { margin: 6px 0 0; color: var(--muted); }
.section-title { font-family: var(--font-serif); font-size: 1.5rem; margin: 40px 0 16px; }
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.related-item { color: var(--text); font-weight: 600; line-height: 1.35; }
.related-item img { aspect-ratio: 16 / 10; object-fit: cover; width: 100%; border-radius: 10px; margin-bottom: 8px; background: var(--accent-soft); }

/* Контакты, поиск, 404 */
.contact-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; padding: 20px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 28px; }
.contact-mail { font-size: 1.2rem; font-weight: 700; }
.search-big { display: flex; gap: 8px; margin: 16px 0; max-width: 560px; }
.search-big input { flex: 1; border: 1px solid var(--border); border-radius: 10px; padding: 11px 14px; font: inherit; background: var(--surface); color: var(--text); }
.notfound { text-align: center; padding: 72px 20px; max-width: 720px; }
.notfound-code { font: 800 7rem/1 var(--font-serif); color: var(--accent); }
.notfound .search-big { margin: 24px auto; }
.notfound-list { text-align: left; max-width: 520px; margin: 0 auto; }

/* Подвал */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 32px; padding-bottom: 32px; }
.footer-brand { font-weight: 800; font-size: 1.15rem; margin-bottom: 8px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 6px 0; }
.site-footer ul a { color: var(--text); }
.footer-bottom { display: flex; justify-content: space-between; padding: 18px 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .85rem; }

/* Адаптив */
@media (max-width: 1000px) {
  .layout { grid-template-columns: 1fr; gap: 32px; }
}
@media (max-width: 760px) {
  .nav-toggle { display: block; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 68px; background: var(--surface); border-bottom: 1px solid var(--border); flex-direction: column; align-items: stretch; padding: 12px 20px 20px; }
  .site-nav.open { display: flex; }
  .site-nav ul { flex-direction: column; }
  .search-mini input { width: 100%; }
  .card { grid-template-columns: 1fr; }
  .related-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 28px; }
}
.author-avatar-empty { display: inline-flex; align-items: center; justify-content: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: .9rem; }
