/* Стили — подключите оригинальный style.css из bludit-theme.
   Скопируйте сюда содержимое файла bludit-theme/css/style.css полностью.
   В архиве движка он уже включён. */

/* === Минимальная база, если основной CSS не подключён === */
:root {
  --bg: #f9f9f9;
  --fg: #141414;
  --card: #fff;
  --border: #e3e3e3;
  --muted: #808080;
  --secondary: #f0f0f0;
  --accent: #3b82f6;
  --radius: 0.75rem;
  --site-width: 980px;
  --nav-h: 56px;
  --font: "Geist", system-ui, sans-serif;
}
[data-theme="dark"] {
  --bg: #0f0f0f;
  --fg: #ebebeb;
  --card: #161616;
  --border: #292929;
  --secondary: #212121;
}
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.6;
}
a {
  color: inherit;
  text-decoration: none;
}
img {
  max-width: 100%;
  display: block;
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
.site-container {
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 0 1rem;
}
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--nav-h);
  gap: 1rem;
}
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.logo-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}
.logo-text {
  font-size: 14px;
  font-weight: 600;
}
.navbar-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  flex-wrap: wrap;
}
.nav-toggle {
  display: none;
}
.nav-toggle-icon-close {
  display: none;
}
body.mobile-nav-open .nav-toggle-icon-open {
  display: none;
}
body.mobile-nav-open .nav-toggle-icon-close {
  display: inline-flex;
}
.nav-link {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--muted);
}
.nav-link:hover,
.nav-link-active {
  color: var(--fg);
  background: var(--secondary);
}
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.search-input {
  background: var(--secondary);
  border: none;
  outline: none;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
}
.dropdown {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 180px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  z-index: 200;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}
.dropdown-menu.show {
  display: block;
}
.dropdown-item {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13.5px;
}
.dropdown-item:hover {
  background: var(--secondary);
}
.page-home,
.page-single {
  padding: 2.5rem 0;
}
.hero {
  margin-bottom: 2rem;
}
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--secondary);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 0.75rem;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
}
.hero-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.5rem;
}
.hero-desc {
  font-size: 15px;
  color: var(--muted);
  max-width: 600px;
}
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 1.25rem 0 2rem;
}
.filter-btn {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--muted);
  border: 1px solid var(--border);
  background: var(--card);
}
.filter-btn:hover {
  color: var(--fg);
}
.filter-btn-active {
  color: var(--fg);
  background: var(--secondary);
  border-color: transparent;
}
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}
.post-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}
.post-card:hover {
  border-color: rgba(128, 128, 128, 0.3);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.post-cover {
  display: block;
  width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
}
.post-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.post-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0) 40%,
    rgba(0, 0, 0, 0.55) 100%
  );
  pointer-events: none;
  z-index: 1;
}
.post-card:hover .post-cover img {
  transform: scale(1.04);
}
/* Текст на обложке (опционально, для оверлей-варианта) */
.post-cover.has-overlay::after {
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.15) 45%,
    rgba(0, 0, 0, 0.75) 100%
  );
}
.post-cover-text {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  z-index: 2;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.post-cover-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #fff;
}
.post-cover-title {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: #fff;
  /* Ограничим 2 строками */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-cover .sticky-corner {
  z-index: 2;
}
.post-card-body {
  padding: 1.25rem;
}
.post-meta-top {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 0.6rem;
}
.post-category {
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--secondary);
  color: var(--fg);
}
.post-date {
  font-size: 12px;
  color: var(--muted);
}
.post-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.post-excerpt {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.post-tag {
  font-size: 12px;
  color: var(--muted);
  margin-right: 6px;
}
.post-read-more {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--accent);
}
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 2.5rem;
}
.pagination-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 13.5px;
  background: var(--card);
}
.pagination-info {
  font-size: 13px;
  color: var(--muted);
}
.single-post {
  max-width: 720px;
  margin: 0 auto;
}
.single-meta-top {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 1rem;
}
.single-title {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}
.single-desc {
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}
.single-cover {
  margin: 1.5rem 0 2rem;
  border-radius: var(--radius);
  overflow: hidden;
}
.single-cover img {
  width: 100%;
  height: auto;
}
.single-content {
  font-size: 16px;
  line-height: 1.75;
}
.single-content h1,
.single-content h2,
.single-content h3 {
  margin: 2rem 0 1rem;
  line-height: 1.3;
}
.single-content p {
  margin-bottom: 1.2rem;
}
.single-content ul,
.single-content ol {
  margin: 0 0 1.2rem 1.5rem;
}
.single-content blockquote {
  border-left: 3px solid var(--border);
  padding-left: 1rem;
  color: var(--muted);
  margin: 1.5rem 0;
}
.single-content figure {
  margin: 1.5rem 0;
}
.single-content figure img {
  border-radius: var(--radius);
}
.single-content figcaption {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}
.single-content pre {
  background: var(--secondary);
  padding: 1rem;
  border-radius: var(--radius);
  overflow-x: auto;
  font-size: 13px;
}
.single-content .embed {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  margin: 1.5rem 0;
}
.single-content .embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius);
}
.back-link {
  max-width: 720px;
  margin: 2rem auto 0;
}
.back-link a {
  color: var(--muted);
  font-size: 14px;
}
.back-link a:hover {
  color: var(--fg);
}
.site-footer {
  border-top: 1px solid var(--border);
  margin-top: 4rem;
  padding: 2rem 0;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  text-align: center;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 13.5px;
  color: var(--muted);
}
.footer-links a:hover {
  color: var(--fg);
}
.footer-copy {
  font-size: 12.5px;
  color: var(--muted);
}

/* === АДМИНКА === */
.admin-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 800px) {
  .admin-shell {
    grid-template-columns: 1fr;
  }
}
.admin-sidebar {
  background: var(--card);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.admin-sidebar h2 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.admin-menu a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--fg);
}
.admin-menu a:hover,
.admin-menu a.active {
  background: var(--secondary);
}
.admin-main {
  padding: 2rem;
  max-width: 980px;
}
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.admin-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
}
.admin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1rem;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
}
.admin-table th,
.admin-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.admin-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.admin-table a {
  color: var(--accent);
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  cursor: pointer;
}
.btn:hover {
  background: var(--secondary);
}
.btn-primary {
  background: var(--fg);
  color: var(--bg);
  border-color: transparent;
}
.btn-primary:hover {
  opacity: 0.85;
  background: var(--fg);
}
.btn-danger {
  color: #ef4444;
  border-color: #ef4444;
  background: transparent;
}
.btn-danger:hover {
  background: rgba(239, 68, 68, 0.08);
}
.form-row {
  margin-bottom: 1rem;
}
.form-row label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--fg);
}
.form-row input[type="text"],
.form-row input[type="password"],
.form-row input[type="email"],
.form-row textarea,
.form-row select {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--fg);
  font-size: 14px;
}
.form-row textarea {
  min-height: 80px;
  resize: vertical;
}
.form-row .hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.form-actions {
  display: flex;
  gap: 8px;
  margin-top: 1.5rem;
}
.alert {
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 1rem;
  font-size: 14px;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.editor-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  min-height: 300px;
  background: var(--bg);
}
.avatar-preview {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--secondary);
  margin-bottom: 0.5rem;
}

/* === Логотип === */
.navbar-logo .logo-img,
.footer-logo .logo-img {
  width: 32px !important;
  height: 32px !important;
  min-width: 32px;
  min-height: 32px;
  max-width: 32px;
  max-height: 32px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  display: block;
  background: var(--card);
}
.navbar-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.logo-icon {
  width: 32px;
  height: 32px;
  min-width: 32px;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--fg);
  color: var(--bg);
  font-weight: 700;
}

/* === Иконки общие === */
.icon {
  vertical-align: middle;
  flex-shrink: 0;
  display: inline-block;
}
.nav-link svg,
.dropdown-item svg,
.filter-btn svg,
.btn svg,
.footer-links a svg {
  vertical-align: -3px;
  margin-right: 4px;
}
.search-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 10px;
  color: var(--muted);
  pointer-events: none;
  display: flex;
}
.search-input {
  padding-left: 32px !important;
}
.theme-toggle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  width: 34px;
  height: 34px;
}
.admin-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
}
.admin-menu a svg {
  color: var(--muted);
}
.admin-menu a.active svg,
.admin-menu a:hover svg {
  color: var(--fg);
}
.footer-links a {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.share-buttons span svg,
.share-btn svg {
  vertical-align: -2px;
}
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.post-sticky-badge,
.post-reading-time {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* === Прогресс чтения === */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0;
  background: var(--accent);
  z-index: 999;
  transition: width 0.1s ease-out;
}

/* === Sticky-постов === */
.post-card.is-sticky {
  border-color: var(--accent);
}
.post-card.is-sticky .post-cover {
  position: relative;
}
.sticky-corner {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--bg);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.post-sticky-badge {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
}
.post-reading-time {
  font-size: 12px;
  color: var(--muted);
}

/* === Облако тегов === */
.tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 1rem 0;
}
.tag-cloud-item {
  padding: 6px 14px;
  background: var(--secondary);
  border-radius: 999px;
  color: var(--fg);
  transition: background 0.15s;
}
.tag-cloud-item:hover {
  background: var(--border);
}
.tag-count {
  color: var(--muted);
  font-size: 0.75em;
  margin-left: 4px;
}

/* === Страница автора === */
.author-page {
  text-align: center;
  padding: 2rem 0;
}
.author-card {
  max-width: 500px;
  margin: 0 auto;
  padding: 2rem;
}
.author-avatar {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1rem;
  display: block;
}
.author-avatar-placeholder {
  background: linear-gradient(135deg, #60a5fa, #8b5cf6);
  color: #fff;
  font-size: 2.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.author-name {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}
.author-bio {
  color: var(--muted);
  line-height: 1.6;
}
.author-byline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 1rem;
  color: var(--fg);
  font-size: 14px;
}
.author-byline-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.author-byline:hover {
  color: var(--accent);
}

/* === Поделиться === */
.share-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.share-buttons span {
  color: var(--muted);
}
.share-btn {
  padding: 6px 12px;
  background: var(--secondary);
  border-radius: 8px;
  color: var(--fg);
  font-size: 13px;
  border: none;
  cursor: pointer;
  transition:
    background 0.15s,
    color 0.15s,
    transform 0.1s;
}
.share-btn:hover {
  background: var(--border);
  transform: translateY(-1px);
}
.share-btn.share-tg:hover {
  background: #229ed9;
  color: #fff;
}
.share-btn.share-wa:hover {
  background: #25d366;
  color: #fff;
}
.share-btn.share-vk:hover {
  background: #0077ff;
  color: #fff;
}
.share-btn.share-tw:hover {
  background: #1da1f2;
  color: #fff;
}
.share-btn.share-copy:hover {
  background: var(--accent);
  color: #fff;
}
.share-btn.share-native:hover {
  background: var(--fg);
  color: var(--bg);
}
.share-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

/* === Связанные статьи === */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
}

/* === Переключатель темы === */
.theme-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
  cursor: pointer;
}
.theme-toggle:hover {
  color: var(--fg);
  background: var(--secondary);
}
.theme-icon-light {
  display: none;
}
.theme-icon-dark {
  display: inline;
}
[data-theme="dark"] .theme-icon-light {
  display: inline;
}
[data-theme="dark"] .theme-icon-dark {
  display: none;
}

/* === Editor.js блоки === */
.ejs-checklist {
  list-style: none;
  padding: 0;
  margin: 1rem 0;
}
.ejs-check-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 4px 0;
}
.ejs-check-item.is-checked span {
  text-decoration: line-through;
  color: var(--muted);
}
.ejs-warning {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 1.5rem 0;
  color: #78350f;
}
[data-theme="dark"] .ejs-warning {
  background: #422006;
  color: #fcd34d;
}
.ejs-warning-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.ejs-table-wrap {
  overflow-x: auto;
  margin: 1.5rem 0;
}
.ejs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.ejs-table th,
.ejs-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  text-align: left;
}
.ejs-table th {
  background: var(--secondary);
  font-weight: 600;
}
.ejs-image.with-border img {
  border: 1px solid var(--border);
  padding: 4px;
  border-radius: 8px;
}
.ejs-image.stretched img {
  width: 100%;
  max-width: none;
}
.ejs-image.with-background {
  background: var(--secondary);
  padding: 1rem;
  border-radius: 8px;
}
.single-content mark,
.single-content .cdx-marker {
  background: #fef08a;
  padding: 0 2px;
  border-radius: 2px;
}
[data-theme="dark"] .single-content mark,
[data-theme="dark"] .single-content .cdx-marker {
  background: #713f12;
  color: #fef08a;
}
.single-content .inline-code,
.single-content code:not(pre code) {
  background: var(--secondary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, monospace;
}
.single-content u {
  text-decoration: underline;
}
.ejs-link {
  display: flex;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  text-decoration: none;
  color: var(--fg);
  transition: background 0.15s;
}
.ejs-link:hover {
  background: var(--secondary);
}
.ejs-link img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.ejs-link-title {
  font-weight: 600;
  margin-bottom: 4px;
}
.ejs-link-desc {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.ejs-link-url {
  font-size: 12px;
  color: var(--accent);
}

/* Editor.js адаптация под тёмную тему админки */
[data-theme="dark"] .ce-popover,
[data-theme="dark"] .ce-toolbar__plus,
[data-theme="dark"] .ce-toolbar__settings-btn {
  background: var(--card);
  color: var(--fg);
  border-color: var(--border);
}

.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}
.login-box h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  text-align: center;
}

/* ==========================================================================
   Blur-up превью загружаемых картинок
   ========================================================================== */
img.blur-up {
  filter: blur(14px);
  transform: scale(1.04);
  transition:
    filter 0.4s ease,
    transform 0.4s ease,
    opacity 0.3s ease;
  opacity: 0.85;
  background: var(--secondary);
}
img.blur-up.is-loaded {
  filter: blur(0);
  transform: scale(1);
  opacity: 1;
}
/* Контейнер с равномерным фоном на время загрузки */
.post-cover,
.single-cover,
.ss-item img {
  background: var(--secondary);
}
.post-cover img,
.single-cover img,
.single-content figure img {
  /* Поддержим прозрачные PNG */
  background: transparent;
}

/* ==========================================================================
   PWA install button
   ========================================================================== */
.pwa-install-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.35);
  z-index: 90;
  animation: pwa-pop 0.4s ease;
}
.pwa-install-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(59, 130, 246, 0.5);
}
@keyframes pwa-pop {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}
@media (max-width: 720px) {
  .pwa-install-btn {
    bottom: 14px;
    right: 14px;
    padding: 10px 14px;
    font-size: 13px;
  }
}

/* ==========================================================================
   Мгновенный поиск (выпадашка)
   ========================================================================== */
.search-wrap {
  position: relative;
}
.search-suggest {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 380px;
  max-width: calc(100vw - 24px);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding: 8px;
  z-index: 200;
  display: none;
}
.search-suggest.is-open {
  display: block;
}
.ss-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.ss-section-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px 6px;
}
.ss-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 8px 4px;
}
.ss-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--fg);
  font-size: 12.5px;
  font-weight: 500;
  border: 1px solid transparent;
  transition:
    border-color 0.15s,
    background 0.15s;
}
.ss-chip:hover,
.ss-chip.is-active {
  border-color: var(--accent);
}
.ss-chip-tag {
  color: var(--accent);
}
.ss-item {
  display: flex;
  gap: 10px;
  padding: 8px;
  border-radius: 8px;
  transition: background 0.12s;
  color: var(--fg);
}
.ss-item:hover,
.ss-item.is-active {
  background: var(--secondary);
}
.ss-item img,
.ss-no-cover {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
  background: var(--secondary);
}
.ss-item-body {
  min-width: 0;
  flex: 1;
}
.ss-item-title {
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ss-item-meta {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 3px;
}
.ss-all {
  display: block;
  text-align: center;
  padding: 10px;
  margin-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  border-radius: 0 0 8px 8px;
}
.ss-all:hover,
.ss-all.is-active {
  background: var(--secondary);
}
.search-suggest mark {
  background: rgba(59, 130, 246, 0.2);
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
}

/* На мобильных выпадашка во всю ширину контейнера */
@media (max-width: 720px) {
  .search-suggest {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    border-radius: 0 0 12px 12px;
    border-top: none;
    max-height: calc(100vh - var(--nav-h) - 20px);
  }
}

/* ==========================================================================
   Лайки
   ========================================================================== */
.like-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 2rem 0 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.like-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition:
    background 0.15s,
    border-color 0.15s,
    color 0.15s,
    transform 0.1s;
  position: relative;
}
.like-btn:hover {
  border-color: #ef4444;
  color: #ef4444;
}
.like-btn:active {
  transform: scale(0.96);
}
.like-btn .like-icon-fill {
  display: none;
  color: #ef4444;
}
.like-btn.is-liked {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.like-btn.is-liked .like-icon-outline {
  display: none;
}
.like-btn.is-liked .like-icon-fill {
  display: inline-flex;
}
.like-btn.is-bumping .like-icon-fill,
.like-btn.is-bumping .like-icon-outline {
  animation: like-bump 0.4s ease;
}
@keyframes like-bump {
  0% {
    transform: scale(1);
  }
  30% {
    transform: scale(1.4);
  }
  60% {
    transform: scale(0.95);
  }
  100% {
    transform: scale(1);
  }
}
.like-count {
  font-variant-numeric: tabular-nums;
  min-width: 16px;
  text-align: left;
}
.like-hint {
  font-size: 13px;
  color: var(--muted);
}

/* Мини-счётчик лайков в карточках */
.post-likes {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.post-likes svg {
  color: #ef4444;
}
.post-views {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted);
}
.post-views svg {
  color: var(--muted);
  opacity: 0.85;
}

/* ==========================================================================
   Подписка на новые статьи
   ========================================================================== */
.subscribe-block {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.5rem 1.75rem;
  margin: 2rem 0 1.5rem;
  background: var(--secondary);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.subscribe-text {
  flex: 1;
  min-width: 220px;
}
.subscribe-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.subscribe-desc {
  font-size: 13.5px;
  color: var(--muted);
}
.subscribe-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  position: relative;
}
.subscribe-input {
  background: var(--card);
  border: 1px solid var(--border);
  outline: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 14px;
  min-width: 220px;
  color: var(--fg);
  transition: border-color 0.15s;
}
.subscribe-input:focus {
  border-color: var(--accent);
}
.subscribe-btn {
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition:
    opacity 0.15s,
    transform 0.1s;
}
.subscribe-btn:hover:not(:disabled) {
  opacity: 0.9;
}
.subscribe-btn:active {
  transform: translateY(1px);
}
.subscribe-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}
.subscribe-status {
  width: 100%;
  font-size: 13px;
  min-height: 18px;
  margin-top: 4px;
}
.subscribe-status.is-success {
  color: #10b981;
}
.subscribe-status.is-error {
  color: #ef4444;
}
.subscribe-status.is-loading {
  color: var(--muted);
}

/* Блок подписки после статьи */
.post-subscribe {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  margin-top: 2.5rem;
  background: linear-gradient(135deg, var(--secondary), var(--card));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  flex-wrap: wrap;
}
.post-subscribe-icon {
  font-size: 2rem;
  flex-shrink: 0;
}
.post-subscribe-text {
  flex: 1;
  min-width: 200px;
}
.post-subscribe-title {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 2px;
}
.post-subscribe-desc {
  font-size: 13.5px;
  color: var(--muted);
}

/* ==========================================================================
   Адаптивный дизайн
   ========================================================================== */

/* Мобильная лента категорий (скрыта на десктопе) */
.mobile-cats {
  display: none;
  position: sticky;
  top: var(--nav-h);
  z-index: 90;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: transform 0.25s ease;
  will-change: transform;
}
/* Плавное скрытие/появление шапки и ленты на мобильных */
.navbar {
  transition: transform 0.25s ease;
  will-change: transform;
}
body.nav-hidden .navbar {
  transform: translateY(-100%);
}
body.nav-hidden .mobile-cats {
  transform: translateY(calc(-100% - var(--nav-h)));
}
.mobile-cats-track {
  display: flex;
  gap: 6px;
  padding: 8px 14px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.mobile-cats-track::-webkit-scrollbar {
  display: none;
}
.mobile-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  scroll-snap-align: start;
  transition:
    background 0.15s,
    color 0.15s;
}
.mobile-cat:hover {
  color: var(--fg);
}
.mobile-cat.is-active {
  background: var(--fg);
  color: var(--bg);
}
.mobile-cat svg {
  flex-shrink: 0;
  opacity: 0.85;
}

/* Защита от переполнений в контенте поста */
.single-content img,
.single-content video,
.single-content iframe {
  max-width: 100%;
  height: auto;
}
.single-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}
.single-content pre {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.single-content code:not(pre code) {
  word-break: break-word;
  overflow-wrap: anywhere;
}
.single-content a {
  word-break: break-word;
}

/* Большие десктопы: 3 колонки */
@media (min-width: 1100px) {
  .posts-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Планшеты (до 900px) */
@media (max-width: 900px) {
  :root {
    --nav-h: 56px;
  }
  .navbar-inner {
    gap: 0.5rem;
  }
  .navbar-nav {
    gap: 4px;
  }
  .nav-link {
    padding: 6px 10px;
    font-size: 13px;
  }
  /* Скрываем второстепенные пункты на планшетах */
  .navbar-actions .nav-link[title="Войти"],
  .navbar-actions .nav-link[title="Админка"] {
    display: none;
  }
}

/* Мобильные устройства и планшеты (до 980px) */
@media (max-width: 980px) {
  body {
    font-size: 15px;
  }
  .site-container {
    padding: 0 14px;
  }
  /* Показываем мобильную ленту категорий */
  .mobile-cats {
    display: block;
  }
  /* Скрываем дубль-фильтры на главной и категории — лента сверху их заменяет */
  .page-home > .filter-bar {
    display: none;
  }
  /* Бургер */
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    color: var(--fg);
    cursor: pointer;
    border-radius: 8px;
    order: 3;
  }
  .nav-toggle:hover {
    background: var(--secondary);
  }
  /* Мобильное выпадающее меню */
  .navbar-nav {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px;
    gap: 2px;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
    z-index: 99;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
  }
  body.mobile-nav-open .navbar-nav {
    display: flex;
  }
  .navbar-nav .nav-link {
    display: block;
    padding: 12px 14px;
    font-size: 15px;
    border-radius: 8px;
    min-height: 44px;
    line-height: 20px;
  }
  /* Dropdown «More» — без абсолюта внутри мобильного меню */
  .navbar-nav .dropdown {
    width: 100%;
  }
  .navbar-nav .dropdown-toggle {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    cursor: pointer;
  }
  .navbar-nav .dropdown-menu {
    position: static;
    width: 100%;
    box-shadow: none;
    border: none;
    background: var(--secondary);
    padding: 4px;
    margin-top: 4px;
  }
  .navbar-nav .dropdown-item {
    padding: 12px 14px;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 8px;
  }
  /* Шапка: оставляем логотип, поиск-иконку, тему, бургер */
  .navbar-inner {
    gap: 6px;
  }
  .navbar-actions {
    gap: 4px;
  }
  .navbar-actions .search-wrap {
    flex: 1;
    min-width: 0;
    max-width: 220px;
  }
  .search-input {
    width: 100%;
    padding: 9px 10px 9px 32px !important;
    font-size: 14px;
    min-height: 40px;
  }
  /* Сетка: 1 колонка */
  .posts-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  /* Типографика */
  .hero-title {
    font-size: 1.6rem;
  }
  .hero-desc {
    font-size: 14px;
  }
  .single-title {
    font-size: 1.6rem !important;
    line-height: 1.25;
  }
  .single-content {
    font-size: 16px;
  }
  .single-content h1 {
    font-size: 1.5rem;
  }
  .single-content h2 {
    font-size: 1.3rem;
  }
  .single-content h3 {
    font-size: 1.15rem;
  }
  /* Отступы страниц */
  .page-home,
  .page-single {
    padding: 1.25rem 0;
  }
  .hero {
    margin-bottom: 1.25rem;
  }
  .filter-bar {
    margin: 1rem 0 1.25rem;
    gap: 6px;
  }
  .related-posts {
    margin-top: 2rem !important;
  }
  /* Touch-friendly кнопки и формы */
  .filter-btn,
  .pagination-btn,
  .btn {
    min-height: 40px;
    padding: 10px 14px;
    font-size: 14px;
  }
  .dropdown-item {
    min-height: 40px;
    padding: 10px 12px;
  }
  .theme-toggle,
  .icon-btn {
    width: 40px;
    height: 40px;
  }
  .form-row input[type="text"],
  .form-row input[type="email"],
  .form-row input[type="password"],
  .form-row textarea,
  .form-row select,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  textarea {
    font-size: 16px; /* предотвращает зум iOS */
    min-height: 40px;
  }
  /* Footer */
  .footer-inner {
    gap: 0.75rem;
  }
  .footer-links {
    gap: 8px 14px;
    font-size: 13px;
    justify-content: center;
  }
  /* Карточка статьи */
  .post-card-body {
    padding: 1rem;
  }
  /* Таблицы и код */
  .ejs-table td,
  .ejs-table th {
    padding: 8px 10px;
    font-size: 13px;
  }
  .single-content pre {
    font-size: 12.5px;
    padding: 0.75rem;
  }
  /* Ссылочный embed-блок */
  .ejs-link {
    flex-direction: column;
    gap: 8px;
  }
  .ejs-link img {
    width: 100%;
    height: 180px;
  }
  /* Автор */
  .author-avatar {
    width: 88px;
    height: 88px;
  }
}

/* Очень узкие экраны */
@media (max-width: 380px) {
  .site-container {
    padding: 0 12px;
  }
  .logo-text {
    display: none;
  }
  .navbar-actions .search-wrap {
    display: none;
  }
  .hero-title {
    font-size: 1.4rem;
  }
  .single-title {
    font-size: 1.4rem !important;
  }
}
