/* SEO AutoBlog - Modern Tech UI v8.0 */
/* Современный дизайн с градиентами, улучшенной типографией и интерактивностью */

:root {
  /* Современная цветовая палитра */
  --primary: #0a0e27;
  --primary-light: #1a1f3a;
  --primary-lighter: #2d3561;
  
  /* Акцентные цвета: Gradient Blue -> Purple */
  --accent: #6366f1;
  --accent-dark: #4f46e5;
  --accent-light: #818cf8;
  --accent-purple: #a855f7;
  
  /* Статус-цвета */
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  
  /* Фоны */
  --bg: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-dark: #0a0e27;
  --bg-dark-secondary: #1a1f3a;
  
  /* Текст */
  --text: #0f172a;
  --text-secondary: #475569;
  --text-light: #64748b;
  --text-lighter: #94a3b8;
  --text-white: #f1f5f9;
  
  /* Границы и тени */
  --border: #e2e8f0;
  --border-light: #cbd5e1;
  --shadow: 0 1px 3px 0 rgba(15, 23, 42, 0.05);
  --shadow-md: 0 4px 12px 0 rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 10px 25px 0 rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 20px 40px 0 rgba(15, 23, 42, 0.15);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.2);
  
  /* Размеры */
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --max-width: 1280px;
  --max-width-article: 900px;
  
  /* Переходы */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0e27;
    --bg-secondary: #1a1f3a;
    --bg-tertiary: #2d3561;
    --text: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-light: #94a3b8;
    --text-lighter: #64748b;
    --border: #2d3561;
    --border-light: #475569;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px 0 rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px 0 rgba(0, 0, 0, 0.5);
    --shadow-xl: 0 20px 40px 0 rgba(0, 0, 0, 0.6);
  }
}

/* Сброс и базовые стили */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  font-size: 16px;
  font-weight: 400;
  overflow-x: hidden;
}

/* Типография */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

h2 {
  font-size: 2rem;
  color: var(--text);
}

h3 {
  font-size: 1.5rem;
  color: var(--text);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-lg);
}

/* Заголовок сайта */
.site-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10000;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.99);
  width: 100%;
}

@media (prefers-color-scheme: dark) {
  .site-header {
    background: rgba(10, 14, 39, 0.95);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: var(--max-width);
  margin: 0 auto;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: var(--transition);
}

.site-logo:hover {
  transform: scale(1.05);
}

.site-nav {
  display: flex;
  gap: 32px;
  align-items: center;
}

.site-nav a {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
  position: relative;
  padding: 8px 0;
}

.site-nav a:hover {
  color: var(--accent);
}

.site-nav a.active {
  color: var(--accent);
  font-weight: 600;
}

.site-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-purple) 100%);
  transition: width 0.3s ease;
}

.site-nav a:hover::after,
.site-nav a.active::after {
  width: 100%;
}

@media (max-width: 768px) {
  .site-nav {
    gap: 16px;
    font-size: 0.9rem;
  }
}

/* Индикатор чтения — см. ниже основное определение */

/* Кнопка Наверх */
.back-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  z-index: 9998;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 900;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  font-size: 1.5rem;
  color: var(--text);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top:hover {
  background: var(--accent);
  color: white;
  transform: translateY(-5px);
}

/* Кнопка мобильного меню */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius);
  transition: var(--transition);
  line-height: 1;
  z-index: 200;
}

.mobile-menu-toggle:hover {
  background: var(--bg-secondary);
  color: var(--accent);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    flex-direction: column;
    gap: 0;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 150;
  }

  .site-nav.open,
  .site-nav.active {
    display: flex;
  }

  .site-nav a {
    padding: 14px 24px;
    font-size: 1rem;
    border-bottom: 1px solid var(--border);
  }

  .site-nav a:last-child {
    border-bottom: none;
  }

  .site-nav a::after {
    display: none;
  }

  .header-inner {
    position: relative;
  }
}

/* Герой-секция */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 120px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: 
    radial-gradient(circle at 20% 50%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: 20px;
  line-height: 1.1;
  letter-spacing: -1px;
  background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  opacity: 0.95;
  max-width: 600px;
  margin: 0 auto 40px;
  line-height: 1.6;
}

.hero-search {
  display: flex;
  gap: 12px;
  max-width: 550px;
  margin: 0 auto;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-search input {
  flex: 1;
  min-width: 200px;
  padding: 14px 18px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  outline: none;
  background: white;
  color: var(--text);
  box-shadow: var(--shadow-lg);
  transition: var(--transition);
}

.hero-search input:focus {
  box-shadow: var(--shadow-xl), var(--shadow-glow);
  transform: translateY(-2px);
}

.hero-search button {
  padding: 14px 32px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-lg);
}

.hero-search button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* Основной контент */
.main-content {
  max-width: var(--max-width);
  margin: 80px auto;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
}

@media (max-width: 1024px) {
  .main-content {
    grid-template-columns: 1fr;
    margin: 60px auto;
    gap: 40px;
  }
}

/* Сетка постов */
.posts-grid {
  display: grid;
  gap: 32px;
}

.post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}

.post-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-purple) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.post-card:hover::before {
  opacity: 1;
}

.post-card-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.post-category {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 14px;
  width: fit-content;
  box-shadow: var(--shadow-md);
}

.post-card h2 {
  font-size: 1.4rem;
  margin-bottom: 14px;
  line-height: 1.3;
  font-weight: 700;
}

.post-card h2 a {
  color: var(--text);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: var(--transition);
}

.post-card h2 a:hover {
  text-decoration: underline;
}

.post-excerpt {
  color: var(--text-light);
  font-size: 0.95rem;
  margin-bottom: 20px;
  line-height: 1.7;
  flex: 1;
}

.post-meta {
  display: flex;
  gap: 20px;
  font-size: 0.85rem;
  color: var(--text-lighter);
  align-items: center;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-top: 12px;
  transition: var(--transition);
}

.read-more:hover {
  gap: 10px;
  color: var(--accent-purple);
}

/* Боковая панель */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.widget {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
}

.widget:hover {
  box-shadow: var(--shadow-lg);
}

.widget h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--accent);
  color: var(--text);
}

.category-list {
  list-style: none;
}

.category-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

.category-list li:last-child {
  border-bottom: none;
}

.category-list a {
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition);
}

.category-list a:hover {
  color: var(--accent);
  padding-left: 4px;
}

.category-list .count {
  color: white;
  font-size: 0.75rem;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  padding: 4px 10px;
  border-radius: 12px;
  font-weight: 600;
}

/* Главное изображение поста (Featured Image) */
.post-featured-image {
  width: 100%;
  max-height: 480px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  display: block;
  box-shadow: var(--shadow-lg);
}

.post-card-image {
  width: 100%;
  height: 200px;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  display: block;
}

@media (max-width: 768px) {
  .post-featured-image {
    max-height: 280px;
    margin-bottom: 20px;
  }

  .post-card-image {
    height: 160px;
  }
}

/* Страница статьи */
.article-page {
  max-width: 1280px;
  margin: 80px auto;
  padding: 0 20px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 48px;
  align-items: start;
}

/* Breadcrumbs wrapper - вне grid */
#breadcrumb-wrapper {
  margin-bottom: 20px;
}

.article-main {
  min-width: 0;
}

.article-sidebar {
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  scrollbar-width: thin;
}

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
  .article-sidebar {
    position: static;
    max-height: none;
    overflow-y: visible;
  }
}

.article-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 2px solid var(--border);
}

.article-header h1 {
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  line-height: 1.2;
  margin-bottom: 24px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.article-meta {
  display: flex;
  gap: 28px;
  color: var(--text-light);
  font-size: 0.9rem;
  flex-wrap: wrap;
  align-items: center;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.article-content {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text);
}

.article-content h2 {
  font-size: 1.9rem;
  margin: 56px 0 24px;
  color: var(--text);
  border-bottom: 2px solid var(--border);
  padding-bottom: 14px;
  font-weight: 800;
  scroll-margin-top: 100px;
}

.article-content h3 {
  font-size: 1.4rem;
  margin: 40px 0 18px;
  color: var(--text);
  font-weight: 700;
  scroll-margin-top: 100px;
}

.article-content p {
  margin-bottom: 24px;
}

.article-content ul,
.article-content ol {
  margin: 24px 0 24px 28px;
}

.article-content li {
  margin-bottom: 12px;
}

.article-content table,
.article-table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.article-content th {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  padding: 16px 18px;
  text-align: left;
  font-weight: 700;
}

.article-content td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

.article-content tr:nth-child(even) td {
  background: var(--bg-secondary);
}

.article-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 24px 28px;
  margin: 32px 0;
  background: var(--bg-secondary);
  border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
  font-style: italic;
  color: var(--text-light);
  box-shadow: var(--shadow-md);
}

.article-content code {
  background: var(--bg-tertiary);
  padding: 4px 10px;
  border-radius: 4px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--text);
}

.article-content pre {
  background: var(--primary);
  color: #f1f5f9;
  padding: 28px;
  border-radius: var(--radius-lg);
  overflow-x: auto;
  margin: 32px 0;
  box-shadow: var(--shadow-lg);
  line-height: 1.5;
}

.article-content pre code {
  background: none;
  color: inherit;
  padding: 0;
}

.article-content img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  margin: 24px auto;
  display: block;
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .article-content img {
    border-radius: var(--radius);
    margin: 16px auto;
  }
}

/* Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-md);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
}

.btn-primary:hover {
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent);
}

/* Подвал */
.site-footer {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: white;
  padding: 72px 20px 28px;
  margin-top: 100px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 48px;
  margin-bottom: 48px;
}

.footer-col h4 {
  color: white;
  margin-bottom: 18px;
  font-size: 1rem;
  font-weight: 700;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.8);
  display: block;
  margin-bottom: 10px;
  font-size: 0.9rem;
  transition: var(--transition);
}

.footer-col a:hover {
  color: white;
  text-decoration: none;
  margin-left: 4px;
}

.footer-col p {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1.6;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.8;
}

/* Адаптивный дизайн */
@media (max-width: 768px) {
  .hero {
    padding: 80px 20px;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .main-content {
    margin: 40px auto;
    gap: 24px;
  }

  .article-page {
    margin: 40px auto;
  }

  .article-content h2 {
    font-size: 1.5rem;
    margin: 32px 0 16px;
  }

  .article-content h3 {
    font-size: 1.2rem;
    margin: 24px 0 12px;
  }
}

@media (max-width: 480px) {
  body {
    font-size: 15px;
  }

  .hero {
    padding: 60px 16px;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  .hero-search {
    flex-direction: column;
  }

  .hero-search input,
  .hero-search button {
    width: 100%;
  }

  .main-content {
    padding: 0 16px;
  }
}

/* Доступность */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Теги и категории */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.tag {
  display: inline-block;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  color: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: var(--transition);
  box-shadow: var(--shadow);
}

.tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Хлебные крошки */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text-light);
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

.breadcrumbs a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--text-light);
}

/* Оглавление (Table of Contents) */
.article-toc {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  width: 100%;
}

.article-toc h3 {
  margin: 0 0 12px 0;
  font-size: 1rem;
  color: var(--text);
}

.article-toc ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.article-toc li {
  margin: 8px 0;
  padding-left: 16px;
}

.article-toc li:before {
  content: "→";
  margin-right: 8px;
  color: var(--accent);
}

.article-toc a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

.article-toc a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.article-toc a.active {
  color: var(--accent-dark);
  font-weight: 600;
}

/* Спиннер загрузки */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-light);
  gap: 12px;
}

/* Пагинация */
.pagination-container {
  display: flex;
  justify-content: center;
  margin-top: 60px;
  margin-bottom: 40px;
}

.pagination-list {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  flex-wrap: wrap;
  justify-content: center;
}

.pagination-item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius);
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  cursor: pointer;
}

.pagination-item:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tertiary);
  transform: translateY(-2px);
}

.pagination-item.active {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-glow);
}

.blog-filters {
  margin-bottom: 40px;
  background: var(--bg-secondary);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.search-box {
  display: flex;
  gap: 12px;
  max-width: 600px;
  margin: 0 auto;
}

.search-box input {
  flex: 1;
  height: 48px;
  padding: 0 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--bg);
  font-size: 1rem;
  color: var(--text);
}

.search-box input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  outline: none;
}

.search-box .btn {
  height: 48px;
  padding: 0 24px;
  white-space: nowrap;
}

/* Связанные статьи */
.related-posts {
  margin: 48px 0;
  padding: 32px 0;
  border-top: 2px solid var(--border);
  border-bottom: 2px solid var(--border);
}

.related-posts h3 {
  margin: 0 0 24px 0;
  font-size: 1.3rem;
  color: var(--text);
}

.related-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.related-post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.related-post-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.related-post-card-header {
  padding: 16px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent) 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
}

.related-post-card-img {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

.related-post-card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.related-post-card-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
  line-height: 1.4;
}

.related-post-card-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 12px;
  flex: 1;
}

.related-post-card-meta {
  font-size: 0.8rem;
  color: var(--text-lighter);
}

/* Тосты (уведомления) */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.toast {
  background: white;
  color: var(--text);
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  pointer-events: auto;
  border-left: 4px solid var(--info);
}

.toast-success {
  border-left-color: var(--success);
}

.toast-error {
  border-left-color: var(--danger);
  background: #fef2f2;
}

.toast-warning {
  border-left-color: var(--warning);
  background: #fffbeb;
}

.toast-info {
  border-left-color: var(--info);
}

@keyframes slideIn {
  from {
    transform: translateX(400px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Адаптивность для тегов и элементов */
@media (max-width: 768px) {
  .tags {
    gap: 6px;
  }
  
  .tag {
    padding: 5px 12px;
    font-size: 0.8rem;
  }
  
  .article-toc {
    padding: 16px;
    margin: 16px 0;
  }
  
  .related-posts-grid {
    grid-template-columns: 1fr;
  }
  
  .pagination {
    gap: 4px;
  }
  
  .pagination a,
  .pagination span {
    min-width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Admin Panel Enhancements */
.pagination {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 8px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: all 0.2s;
  cursor: pointer;
}

.pagination a:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #1e293b;
  transform: translateY(-1px);
}

.pagination a.active {
  background: #3b82f6;
  color: white;
  border-color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.2);
}

.pagination span {
  border: none;
  background: transparent;
  min-width: 24px;
  cursor: default;
}

.badge-secondary {
  background: #e2e8f0;
  color: #475569;
}


/* =============================================
   НОВЫЕ КОМПОНЕНТЫ v2.0
   ============================================= */

/* --- HERO СЕКЦИЯ (улучшенная) --- */
.hero-v2 {
  background: linear-gradient(135deg, var(--primary) 0%, #1e1b4b 50%, var(--primary-light) 100%);
  color: white;
  padding: 100px 20px 80px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-v2::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99, 102, 241, 0.25) 0%, transparent 55%),
    radial-gradient(ellipse at 80% 20%, rgba(168, 85, 247, 0.2) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 90%, rgba(6, 182, 212, 0.1) 0%, transparent 45%);
  pointer-events: none;
}

.hero-v2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: ellipse(55% 100% at 50% 100%);
}

.hero-v2-inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  margin: 0 auto;
}

.hero-v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid rgba(99, 102, 241, 0.4);
  color: #c7d2fe;
  padding: 8px 18px;
  border-radius: 30px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin-bottom: 24px;
  backdrop-filter: blur(10px);
}

.hero-v2 h1 {
  font-size: clamp(2.2rem, 6vw, 4rem);
  font-weight: 900;
  line-height: 1.1;
  margin-bottom: 20px;
  background: linear-gradient(135deg, #ffffff 0%, #c7d2fe 50%, #e9d5ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -1.5px;
}

.hero-v2 p {
  font-size: clamp(1rem, 2.5vw, 1.2rem);
  color: rgba(255,255,255,0.8);
  max-width: 560px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

.hero-v2-search {
  display: flex;
  gap: 10px;
  max-width: 520px;
  margin: 0 auto 40px;
  flex-wrap: wrap;
  justify-content: center;
}

.hero-v2-search input {
  flex: 1;
  min-width: 220px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  outline: none;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  box-shadow: 0 8px 32px rgba(0,0,0,0.2);
  transition: var(--transition);
}

.hero-v2-search input:focus {
  background: white;
  box-shadow: 0 8px 32px rgba(0,0,0,0.25), 0 0 0 3px rgba(99,102,241,0.4);
}

.hero-v2-search button {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
}

.hero-v2-search button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}

.hero-v2-stats {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
}

.hero-stat {
  text-align: center;
}

.hero-stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, #fff 0%, #c7d2fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-stat-label {
  font-size: 0.8rem;
  color: rgba(255,255,255,0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 2px;
}

/* --- СЕКЦИЯ СТАТИСТИКИ --- */
.stats-section {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  padding: 60px 20px;
  margin: 60px 0;
}

.stats-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 32px;
  text-align: center;
}

.stat-card {
  color: white;
}

.stat-card-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  display: block;
}

.stat-card-value {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card-label {
  font-size: 0.9rem;
  opacity: 0.85;
  font-weight: 500;
}

/* --- FEATURED POSTS СЕКЦИЯ --- */
.featured-section {
  max-width: var(--max-width);
  margin: 0 auto 60px;
  padding: 0 20px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.section-title {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text);
  position: relative;
  padding-left: 16px;
}

.section-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 70%;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-purple) 100%);
  border-radius: 2px;
}

.featured-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

@media (max-width: 900px) {
  .featured-grid {
    grid-template-columns: 1fr;
  }
}

.featured-post-main {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
  position: relative;
}

.featured-post-main:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
  border-color: var(--accent);
}

.featured-post-main .post-img {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.featured-post-main .post-img-placeholder {
  width: 100%;
  height: 280px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
}

.featured-post-main .post-body {
  padding: 28px;
}

.featured-post-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.side-post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  transition: var(--transition);
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.side-post-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.side-post-number {
  font-size: 2rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  min-width: 40px;
}

.side-post-content h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 6px;
  line-height: 1.4;
}

.side-post-content h3 a {
  color: var(--text);
  text-decoration: none;
  transition: var(--transition);
}

.side-post-content h3 a:hover {
  color: var(--accent);
}

.side-post-meta {
  font-size: 0.8rem;
  color: var(--text-lighter);
}

/* --- NEWSLETTER БЛОК --- */
.newsletter-section {
  background: linear-gradient(135deg, var(--primary) 0%, #1e1b4b 100%);
  padding: 80px 20px;
  margin: 60px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.newsletter-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 50%, rgba(99,102,241,0.2) 0%, transparent 50%),
    radial-gradient(circle at 70% 50%, rgba(168,85,247,0.15) 0%, transparent 50%);
  pointer-events: none;
}

.newsletter-inner {
  position: relative;
  z-index: 1;
  max-width: 560px;
  margin: 0 auto;
}

.newsletter-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.newsletter-section h2 {
  font-size: clamp(1.6rem, 4vw, 2.2rem);
  font-weight: 800;
  color: white;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.newsletter-section p {
  color: rgba(255,255,255,0.75);
  margin-bottom: 28px;
  font-size: 1rem;
  line-height: 1.6;
}

.newsletter-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.newsletter-form input {
  flex: 1;
  min-width: 220px;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  background: rgba(255,255,255,0.95);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.newsletter-form input:focus {
  background: white;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.4);
}

.newsletter-form button {
  padding: 14px 28px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 4px 20px rgba(99,102,241,0.4);
  white-space: nowrap;
}

.newsletter-form button:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(99,102,241,0.5);
}

.newsletter-note {
  margin-top: 12px;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.5);
}

/* --- КАТЕГОРИИ БЛОК (улучшенный) --- */
.categories-section {
  max-width: var(--max-width);
  margin: 0 auto 60px;
  padding: 0 20px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.category-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 16px;
  text-align: center;
  text-decoration: none;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
  background: var(--bg-secondary);
}

.category-card-icon {
  font-size: 2rem;
  display: block;
}

.category-card-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.category-card-count {
  font-size: 0.75rem;
  color: var(--text-lighter);
  background: var(--bg-tertiary);
  padding: 3px 10px;
  border-radius: 12px;
}

/* --- УЛУЧШЕННЫЙ FOOTER --- */
.site-footer-v2 {
  background: linear-gradient(180deg, var(--primary) 0%, #050714 100%);
  color: white;
  padding: 80px 20px 0;
  margin-top: 80px;
}

.footer-v2-top {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 60px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

@media (max-width: 900px) {
  .footer-v2-top {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .footer-v2-top {
    grid-template-columns: 1fr;
  }
}

.footer-v2-brand .site-logo {
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  text-decoration: none;
}

.footer-v2-brand p {
  font-size: 0.9rem;
  color: rgba(255,255,255,0.6);
  line-height: 1.7;
  margin-bottom: 20px;
}

.footer-social-links {
  display: flex;
  gap: 12px;
}

.footer-social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-size: 1rem;
  transition: var(--transition);
  color: rgba(255,255,255,0.7);
}

.footer-social-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: translateY(-3px);
}

.footer-v2-col h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 20px;
}

.footer-v2-col a {
  display: block;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-decoration: none;
  transition: var(--transition);
}

.footer-v2-col a:hover {
  color: white;
  padding-left: 4px;
}

.footer-v2-bottom {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.4);
}

.footer-v2-bottom-links {
  display: flex;
  gap: 20px;
}

.footer-v2-bottom-links a {
  color: rgba(255,255,255,0.4);
  text-decoration: none;
  transition: var(--transition);
}

.footer-v2-bottom-links a:hover {
  color: rgba(255,255,255,0.8);
}

/* --- МОДУЛЬ КОММЕНТАРИЕВ --- */
.comments-section {
  margin-top: 60px;
  padding-top: 48px;
  border-top: 2px solid var(--border);
}

.comments-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.comments-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 10px;
}

.comments-count-badge {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
}

/* Авторизация комментаторов */
.comment-auth-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
  margin-bottom: 32px;
}

.comment-auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 24px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  padding: 4px;
}

.comment-auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: none;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.comment-auth-tab.active {
  background: white;
  color: var(--accent);
  box-shadow: var(--shadow-md);
}

@media (prefers-color-scheme: dark) {
  .comment-auth-tab.active {
    background: var(--bg-dark-secondary);
  }
}

.comment-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-auth-form input {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 0.95rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: var(--transition);
}

.comment-auth-form input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.username-check {
  font-size: 0.8rem;
  margin-top: -8px;
  padding: 0 4px;
}

.username-check.available { color: var(--success); }
.username-check.taken { color: var(--danger); }

/* Залогиненный пользователь */
.comment-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}

.comment-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  flex-shrink: 0;
}

.comment-user-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.comment-user-badge {
  font-size: 0.75rem;
  color: var(--text-lighter);
  margin-top: 2px;
}

.comment-verified-icon {
  color: var(--accent);
  font-size: 0.9rem;
}

/* Форма комментария */
.comment-form-wrapper {
  margin-bottom: 40px;
}

.comment-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.comment-form textarea {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 120px;
  outline: none;
  transition: var(--transition);
  line-height: 1.6;
}

.comment-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.comment-form-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.comment-char-count {
  font-size: 0.8rem;
  color: var(--text-lighter);
}

.comment-char-count.warning { color: var(--warning); }
.comment-char-count.danger { color: var(--danger); }

/* Список комментариев */
.comments-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.comment-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 24px;
  transition: var(--transition);
}

.comment-item:hover {
  border-color: var(--border-light);
  box-shadow: var(--shadow-md);
}

.comment-item.reply {
  margin-left: 40px;
  background: var(--bg-secondary);
  border-style: dashed;
}

@media (max-width: 600px) {
  .comment-item.reply {
    margin-left: 16px;
  }
}

.comment-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.comment-author-name {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
}

.comment-author-name a {
  color: var(--accent);
  text-decoration: none;
}

.comment-author-name a:hover {
  text-decoration: underline;
}

.comment-date {
  font-size: 0.8rem;
  color: var(--text-lighter);
  margin-left: auto;
}

.comment-body {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 14px;
}

.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.comment-like-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-light);
  transition: var(--transition);
}

.comment-like-btn:hover,
.comment-like-btn.liked {
  border-color: var(--danger);
  color: var(--danger);
  background: rgba(239,68,68,0.05);
}

.comment-reply-btn {
  background: none;
  border: none;
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 0;
  transition: var(--transition);
  font-weight: 600;
}

.comment-reply-btn:hover {
  color: var(--accent-dark);
}

.replies-list {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.reply-form {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-lg);
  display: none;
}

.reply-form.active {
  display: block;
}

.reply-form textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 80px;
  outline: none;
  margin-bottom: 10px;
  transition: var(--transition);
}

.reply-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
}

.reply-form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* Загрузка комментариев */
.comments-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light);
}

.comments-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-light);
}

.comments-empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

.comments-empty p {
  font-size: 1rem;
  margin-bottom: 8px;
}

.comments-empty small {
  font-size: 0.85rem;
  color: var(--text-lighter);
}

/* Load more comments */
.load-more-comments {
  text-align: center;
  margin-top: 24px;
}

/* --- TOAST УВЕДОМЛЕНИЯ (улучшенные) --- */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  max-width: 360px;
}

.toast-item {
  background: white;
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--accent);
  pointer-events: auto;
  animation: toastIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.9rem;
  color: var(--text);
}

@media (prefers-color-scheme: dark) {
  .toast-item { background: var(--bg-dark-secondary); }
}

.toast-item.toast-success { border-left-color: var(--success); }
.toast-item.toast-error { border-left-color: var(--danger); }
.toast-item.toast-warning { border-left-color: var(--warning); }

@keyframes toastIn {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
  from { transform: translateX(0); opacity: 1; }
  to { transform: translateX(120%); opacity: 0; }
}

/* --- КНОПКИ (доп. стили) --- */
.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 14px 32px;
  font-size: 1rem;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: #dc2626;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  background: var(--bg-secondary);
}

/* --- АНИМАЦИИ ПОЯВЛЕНИЯ --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-in {
  animation: fadeInUp 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.animate-in-delay-1 { animation-delay: 0.1s; }
.animate-in-delay-2 { animation-delay: 0.2s; }
.animate-in-delay-3 { animation-delay: 0.3s; }

/* --- ПУЛЬСИРУЮЩИЙ ИНДИКАТОР --- */
.pulse-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  display: inline-block;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.7; }
}

/* --- SEO SCORE BADGE --- */
.seo-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 700;
}

.seo-score-a { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.3); }
.seo-score-b { background: rgba(6,182,212,0.1); color: var(--info); border: 1px solid rgba(6,182,212,0.3); }
.seo-score-c { background: rgba(245,158,11,0.1); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); }
.seo-score-d { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }

/* --- RESPONSIVE FIXES --- */
@media (max-width: 768px) {
  .hero-v2 { padding: 80px 20px 60px; }
  .hero-v2::after { height: 50px; }
  .stats-section { padding: 40px 20px; }
  .newsletter-section { padding: 60px 20px; }
  .comments-section { margin-top: 40px; padding-top: 32px; }
  .comment-item.reply { margin-left: 16px; }
  .footer-v2-top { grid-template-columns: 1fr 1fr; gap: 32px; }
  #toast-container { max-width: calc(100vw - 40px); }
}

@media (max-width: 480px) {
  .hero-v2 h1 { letter-spacing: -0.5px; }
  .hero-v2-stats { gap: 24px; }
  .categories-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-v2-top { grid-template-columns: 1fr; }
}

/* --- ПРОГРЕСС ЧТЕНИЯ --- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 4px !important;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-purple) 100%);
  z-index: 10000;
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  pointer-events: none;
}

/* --- КНОПКА НАВЕРХ --- */
.back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  z-index: 9998;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

/* --- МОБИЛЬНОЕ МЕНЮ --- */
.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 8px;
  border-radius: var(--radius);
  transition: var(--transition);
}

.mobile-menu-toggle:hover {
  background: var(--bg-secondary);
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 16px 20px;
    flex-direction: column;
    gap: 4px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
  }

  .site-nav.active {
    display: flex;
  }

  .site-nav a {
    padding: 10px 12px;
    border-radius: var(--radius);
    width: 100%;
  }

  .site-nav a:hover {
    background: var(--bg-secondary);
  }
}

/* --- BORDER-RADIUS EXTRA --- */
:root {
  --radius-xl: 16px;
}

/* --- DARK MODE SUPPORT (базовый) --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-dark-secondary: #1e293b;
  }
}


/* =============================================
   TRENDING БЛОК
   ============================================= */
.trending-section {
  max-width: var(--max-width);
  margin: 0 auto 40px;
  padding: 0 20px;
  display: none;
}

.trending-section .section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.trending-section .section-title {
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
}

#trending-container {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--bg);
  box-shadow: var(--shadow-md);
}

.trending-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.trending-item:last-child {
  border-bottom: none;
}

.trending-item:hover {
  background: var(--bg-secondary);
}

.trending-item:hover .trending-title {
  color: var(--accent);
}

.trending-rank {
  font-size: 1.8rem;
  font-weight: 900;
  color: var(--border);
  min-width: 36px;
  text-align: center;
  line-height: 1;
}

.trending-item:nth-child(1) .trending-rank { color: #f59e0b; }
.trending-item:nth-child(2) .trending-rank { color: #94a3b8; }
.trending-item:nth-child(3) .trending-rank { color: #cd7c2f; }

.trending-content {
  flex: 1;
  min-width: 0;
}

.trending-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}

.trending-title {
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.trending-meta {
  display: flex;
  gap: 12px;
  font-size: 0.78rem;
  color: var(--text-lighter);
}

.trending-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: var(--radius);
  flex-shrink: 0;
}

/* =============================================
   FLOATING SHARE BUTTONS
   ============================================= */
.floating-share {
  position: fixed;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.floating-share.show {
  opacity: 1;
  pointer-events: all;
}

.floating-share-inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.floating-share-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-md);
  color: var(--text);
}

.floating-share-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 1100px) {
  .floating-share {
    display: none;
  }
}

/* =============================================
   SHARE SECTION (inline)
   ============================================= */
.share-section {
  margin: 32px 0;
}

.share-section-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
}

.share-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  white-space: nowrap;
}

.share-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.share-telegram {
  background: #e8f4fd;
  color: #0088cc;
}
.share-telegram:hover {
  background: #0088cc;
  color: white;
}

.share-twitter {
  background: #e8f4fd;
  color: #1da1f2;
}
.share-twitter:hover {
  background: #1da1f2;
  color: white;
}

.share-vk {
  background: #e8f0fb;
  color: #4a76a8;
}
.share-vk:hover {
  background: #4a76a8;
  color: white;
}

.share-copy {
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}
.share-copy:hover {
  background: var(--accent);
  color: white;
}

/* =============================================
   ТЕГИ В САЙДБАРЕ
   ============================================= */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.post-tags-section {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

/* =============================================
   УЛУЧШЕННЫЕ КАРТОЧКИ ПОСТОВ
   ============================================= */
.post-card-image-placeholder {
  width: 100%;
  height: 180px;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  overflow: hidden;
}

.post-card-image-placeholder span {
  opacity: 0.7;
}

/* =============================================
   ПРОФИЛЬ ПОЛЬЗОВАТЕЛЯ (МОДАЛ)
   ============================================= */
.profile-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.profile-modal-inner {
  background: var(--bg);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.25s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(-10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.profile-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 1;
}

.profile-modal-header h3 {
  font-size: 1.1rem;
  font-weight: 700;
}

.profile-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-lighter);
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: var(--transition-fast);
}

.profile-modal-close:hover {
  background: var(--bg-secondary);
  color: var(--text);
}

.profile-modal-body {
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.profile-avatar-section {
  display: flex;
  align-items: center;
  gap: 16px;
}

.profile-avatar-large {
  width: 72px !important;
  height: 72px !important;
  font-size: 2rem !important;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.profile-section {
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.profile-section h5 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}

/* =============================================
   УЛУЧШЕНИЯ КОММЕНТАРИЕВ
   ============================================= */
.comment-author-name a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.comment-author-name a:hover {
  color: var(--accent);
}

/* =============================================
   SECTION HEADER (общий)
   ============================================= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* =============================================
   УЛУЧШЕНИЯ HERO STATS
   ============================================= */
.hero-v2-stats {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

/* =============================================
   RESPONSIVE TRENDING
   ============================================= */
@media (max-width: 768px) {
  .trending-thumb {
    display: none;
  }
  
  .trending-title {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  
  .share-section-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
}

/* =============================================
   УЛУЧШЕНИЯ КАРТОЧКИ ПОСТА - META
   ============================================= */
.post-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8rem;
  color: var(--text-lighter);
  margin: 10px 0;
}

/* =============================================
   КНОПКА ПРОФИЛЯ В КОММЕНТАРИЯХ
   ============================================= */
.comment-user-info {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(99, 102, 241, 0.05) 100%);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  margin-bottom: 16px;
}

.comment-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.comment-user-badge {
  font-size: 0.78rem;
  color: var(--text-lighter);
  margin-top: 2px;
}

/* =============================================
   УЛУЧШЕНИЯ AUTH ФОРМ
   ============================================= */
.comment-auth-form input,
.comment-auth-form textarea {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  font-family: inherit;
  font-size: 0.9rem;
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  box-sizing: border-box;
}

.comment-auth-form input:focus,
.comment-auth-form textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

.comment-auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* =============================================
   УЛУЧШЕНИЯ ХЛЕБНЫХ КРОШЕК
   ============================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.breadcrumbs a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s;
}

.breadcrumbs a:hover {
  color: var(--accent-dark);
}

.breadcrumbs span {
  color: var(--text-secondary);
  font-weight: 500;
}

/* =============================================
   УЛУЧШЕНИЯ КНОПОК
   ============================================= */
.btn-secondary {
  background: var(--bg-secondary);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-tertiary);
  border-color: var(--border-light);
}

/* =============================================
   АНИМАЦИЯ ПОЯВЛЕНИЯ КАРТОЧЕК
   ============================================= */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-in {
  animation: fadeInUp 0.5s ease both;
}

/* =============================================
   УЛУЧШЕНИЯ САЙДБАРА - ТЕГИ ВИДЖЕТ
   ============================================= */
#tags-widget .tag {
  font-size: 0.78rem;
  padding: 4px 10px;
}

.widget[style*="display:none"] {
  display: none !important;
}

/* =============================================
   УЛУЧШЕНИЯ МЕТА СТАТЬИ
   ============================================= */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  color: var(--text-lighter);
  margin: 12px 0 0;
}

.article-meta-item {
  display: flex;
  align-items: center;
  gap: 4px;
}

.article-meta-item a {
  color: var(--accent);
  text-decoration: none;
}

.article-meta-item a:hover {
  text-decoration: underline;
}

/* --- ПРОГРЕСС-БАР ЧТЕНИЯ КОНТЕЙНЕР --- */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  z-index: 9999;
  background: transparent;
  pointer-events: none;
}
#reading-progress {
  height: 3px !important;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-purple) 50%, #ec4899 100%);
  width: 0%;
  transition: width 0.1s linear;
  border-radius: 0 2px 2px 0;
  box-shadow: 0 0 8px rgba(99, 102, 241, 0.6);
}

/* =============================================
   HERO PARTICLES ANIMATION
   ============================================= */
.hero-v2 {
  position: relative;
  overflow: hidden;
}
.hero-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}
.hero-particles span {
  position: absolute;
  display: block;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  animation: floatParticle linear infinite;
}
.hero-particles span:nth-child(1)  { width:20px; height:20px; left:10%;  top:20%; animation-duration:8s;  animation-delay:0s; }
.hero-particles span:nth-child(2)  { width:14px; height:14px; left:25%;  top:60%; animation-duration:12s; animation-delay:2s; }
.hero-particles span:nth-child(3)  { width:30px; height:30px; left:40%;  top:10%; animation-duration:10s; animation-delay:1s; }
.hero-particles span:nth-child(4)  { width:10px; height:10px; left:55%;  top:70%; animation-duration:9s;  animation-delay:3s; }
.hero-particles span:nth-child(5)  { width:22px; height:22px; left:70%;  top:30%; animation-duration:11s; animation-delay:0.5s; }
.hero-particles span:nth-child(6)  { width:16px; height:16px; left:80%;  top:80%; animation-duration:7s;  animation-delay:4s; }
.hero-particles span:nth-child(7)  { width:25px; height:25px; left:90%;  top:50%; animation-duration:13s; animation-delay:1.5s; }
.hero-particles span:nth-child(8)  { width:12px; height:12px; left:5%;   top:85%; animation-duration:9s;  animation-delay:2.5s; }
.hero-particles span:nth-child(9)  { width:18px; height:18px; left:60%;  top:15%; animation-duration:14s; animation-delay:0.8s; }
.hero-particles span:nth-child(10) { width:8px;  height:8px;  left:35%;  top:90%; animation-duration:6s;  animation-delay:3.5s; }

@keyframes floatParticle {
  0%   { transform: translateY(0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  90%  { opacity: 1; }
  100% { transform: translateY(-120px) rotate(360deg); opacity: 0; }
}

.hero-v2-inner {
  position: relative;
  z-index: 1;
}

/* =============================================
   FEATURES SECTION
   ============================================= */
.features-section {
  padding: 80px 20px;
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
}
.features-header {
  text-align: center;
  margin-bottom: 56px;
}
.features-badge {
  display: inline-block;
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(139,92,246,0.12) 100%);
  color: var(--accent, #6366f1);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 50px;
  padding: 6px 18px;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}
.features-header h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 800;
  margin-bottom: 12px;
  background: linear-gradient(135deg, var(--text, #0f172a) 0%, var(--accent, #6366f1) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.features-header p {
  font-size: 1.05rem;
  color: var(--text-light, #64748b);
  max-width: 560px;
  margin: 0 auto;
}
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.feature-card {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 20px;
  padding: 32px 28px;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  position: relative;
  overflow: hidden;
}
.feature-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent, #6366f1) 0%, var(--accent-purple, #8b5cf6) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.feature-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(99,102,241,0.12);
  border-color: rgba(99,102,241,0.3);
}
.feature-card:hover::before {
  opacity: 1;
}
.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 16px;
  display: block;
}
.feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text, #0f172a);
}
.feature-card p {
  font-size: 0.9rem;
  color: var(--text-light, #64748b);
  line-height: 1.6;
  margin-bottom: 16px;
}
.feature-link {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--accent, #6366f1);
  text-decoration: none;
  transition: gap 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.feature-link:hover {
  text-decoration: underline;
}

/* =============================================
   COMMENT MODE SWITCHER (ADMIN)
   ============================================= */
.comment-mode-switcher {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.comment-mode-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  border: 2px solid var(--border, #e2e8f0);
  border-radius: 14px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  background: var(--bg, #fff);
}
.comment-mode-option:hover {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.04);
}
.comment-mode-option.active {
  border-color: var(--accent, #6366f1);
  background: rgba(99,102,241,0.07);
}
.mode-icon {
  font-size: 1.8rem;
  flex-shrink: 0;
  width: 44px;
  text-align: center;
}
.mode-title {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text, #0f172a);
}
.mode-desc {
  font-size: 0.82rem;
  color: var(--text-light, #64748b);
  margin-top: 2px;
}

/* =============================================
   УЛУЧШЕННЫЙ NEWSLETTER
   ============================================= */
.newsletter-section {
  position: relative;
  z-index: 1;
  overflow: hidden;
}

/* =============================================
   АНИМАЦИЯ СЧЁТЧИКОВ HERO
   ============================================= */
@keyframes countUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.hero-stat-value {
  animation: countUp 0.6s ease forwards;
}

/* =============================================
   RESPONSIVE FEATURES
   ============================================= */
@media (max-width: 768px) {
  .features-section {
    padding: 50px 16px;
  }
  .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .feature-card {
    padding: 24px 20px;
  }
  .comment-mode-switcher {
    gap: 8px;
  }
}


/* ===== LATEST POSTS SECTION ===== */
.latest-posts-section {
  padding: 80px 20px;
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
}

.latest-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.latest-post-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.latest-post-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.15);
  border-color: var(--accent);
}

.latest-post-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-tertiary);
}

.latest-post-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.latest-post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}

.latest-post-category {
  display: inline-block;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
  color: var(--accent);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.latest-post-date {
  font-size: 0.8rem;
  color: var(--text-lighter);
}

.latest-post-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-post-excerpt {
  font-size: 0.9rem;
  color: var(--text-light);
  line-height: 1.5;
  margin-bottom: 16px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.latest-post-link {
  display: inline-block;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.2s ease;
  font-size: 0.95rem;
}

.latest-post-link:hover {
  color: var(--accent-purple);
}

@media (max-width: 768px) {
  .latest-posts-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
  }

  .latest-posts-section {
    padding: 60px 20px;
  }
}

@media (max-width: 480px) {
  .latest-posts-grid {
    grid-template-columns: 1fr;
  }

  .latest-post-image {
    height: 160px;
  }

  .latest-post-content {
    padding: 16px;
  }
}


/* ===== MODERN FOOTER V4 ===== */
.site-footer-v4 {
  background: #0f172a;
  color: #f8fafc;
  padding: 80px 0 0;
  margin-top: 100px;
  font-family: inherit;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-container {
  max-width: var(--max-width, 1200px);
  margin: 0 auto;
  padding: 0 20px;
}

.footer-main-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.2fr 1.2fr;
  gap: 40px;
  padding-bottom: 60px;
}

.footer-brand-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: white;
}

.footer-logo .logo-icon {
  font-size: 1.8rem;
}

.footer-logo .logo-text {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.footer-tagline {
  color: #94a3b8;
  line-height: 1.6;
  font-size: 0.95rem;
  max-width: 320px;
}

.footer-social {
  display: flex;
  gap: 12px;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1.1rem;
}

.social-btn:hover {
  background: var(--accent, #6366f1);
  transform: translateY(-3px);
  box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.3);
}

.footer-nav-section {
  display: flex;
  flex-direction: column;
}

.footer-heading {
  color: white;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 24px;
  position: relative;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: white;
  padding-left: 4px;
}

.footer-random-posts {
  display: flex;
  flex-direction: column;
}

.footer-posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-post-item {
  display: flex;
  gap: 12px;
  text-decoration: none;
  align-items: center;
}

.footer-post-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  border: 1px solid rgba(255,255,255,0.1);
}

.footer-post-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-post-title {
  color: #e2e8f0;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.3;
  transition: color 0.2s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.footer-post-item:hover .footer-post-title {
  color: var(--accent, #6366f1);
}

.footer-post-date {
  color: #64748b;
  font-size: 0.75rem;
}

.footer-newsletter-section {
  display: flex;
  flex-direction: column;
}

.footer-newsletter-v4 {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.footer-newsletter-v4 input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  font-size: 0.9rem;
  outline: none;
}

.footer-newsletter-v4 button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.footer-bottom-v4 {
  padding: 30px 0;
  border-top: 1px solid rgba(255,255,255,0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #64748b;
  font-size: 0.85rem;
}

.footer-legal {
  display: flex;
  gap: 20px;
}

.footer-legal a {
  color: #64748b;
  text-decoration: none;
}

.footer-legal a:hover {
  color: white;
}

@media (max-width: 1024px) {
  .footer-main-grid {
    grid-template-columns: 1fr 1fr;
    gap: 40px;
  }
}

@media (max-width: 640px) {
  .footer-main-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .footer-bottom-v4 {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
  .footer-legal {
    justify-content: center;
  }
}

/* Fix for broken layout on scroll */
#reading-progress-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: transparent;
  z-index: 10000;
  pointer-events: none;
}

#reading-progress {
  height: 100%;
  background: var(--accent);
  width: 0;
  transition: width 0.1s ease;
}

/* Splide.js Carousel Styles */
#latest-posts-carousel {
  padding: 20px 0 40px;
}

.splide__slide {
  padding: 10px;
}

.latest-posts-section {
  max-width: var(--max-width);
  margin: 60px auto;
  padding: 0 20px;
}

.latest-post-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.latest-post-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--accent);
}

.latest-post-image {
  height: 200px;
  background-size: cover;
  background-position: center;
  transition: transform 0.5s ease;
}

.latest-post-card:hover .latest-post-image {
  transform: scale(1.05);
}

.latest-post-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.latest-post-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  color: var(--text-light);
  margin-bottom: 10px;
}

.latest-post-category {
  color: var(--accent);
  font-weight: 600;
  text-transform: uppercase;
}

.latest-post-title {
  font-size: 1.25rem;
  margin-bottom: 10px;
  line-height: 1.4;
  color: var(--text);
}

.latest-post-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
  flex: 1;
}

.latest-post-link {
  font-weight: 600;
  color: var(--accent);
  display: inline-block;
  transition: var(--transition);
}

.latest-post-link:hover {
  text-decoration: none;
  transform: translateX(5px);
}

.splide__pagination__page.is-active {
  background: var(--accent);
}

.splide__arrow {
  background: var(--bg);
  border: 1px solid var(--border);
  opacity: 0.8;
  transition: var(--transition);
}

.splide__arrow:hover {
  background: var(--accent);
  color: white;
  opacity: 1;
}

/* SEO Improvements: Breadcrumbs & TOC */
.breadcrumb-container {
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.breadcrumb-container a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}

.breadcrumb-container a:hover {
  text-decoration: underline;
}

.breadcrumb-separator {
  color: var(--text-lighter);
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 500;
}

/* Table of Contents (TOC) */
.toc-container {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--shadow);
}

.toc-title {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-item {
  margin-bottom: 8px;
  line-height: 1.4;
}

.toc-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  transition: var(--transition-fast);
  display: block;
}

.toc-link:hover {
  color: var(--accent);
  transform: translateX(5px);
}

.toc-item-h2 { font-weight: 500; }
.toc-item-h3 { padding-left: 20px; font-size: 0.9rem; color: var(--text-light); }

/* Sidebar TOC */
.sidebar-toc {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  border-left: 3px solid var(--accent);
  padding: 16px 20px;
  margin-bottom: 24px;
}

.sidebar-toc-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-lighter);
  margin-bottom: 12px;
  font-weight: 700;
}

.sidebar-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-toc-item {
  margin: 0;
}

.sidebar-toc-link {
  display: block;
  padding: 8px 0;
  font-size: 0.9rem;
  color: var(--text-light);
  text-decoration: none;
  transition: var(--transition-fast);
  border-left: 2px solid transparent;
  margin-left: 0;
  padding-left: 12px;
}

.sidebar-toc-link:hover, .sidebar-toc-link.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 500;
}

.sidebar-toc-h3 .sidebar-toc-link {
  padding-left: 24px;
  font-size: 0.85rem;
}

/* Desktop Sidebar */
@media (min-width: 1024px) {
  .article-sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 0;
  }
  
  .sidebar-toc {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border-left: 3px solid var(--accent);
    padding: 16px 20px;
  }
}

/* ============================================
   SSR BREADCRUMB NAV (Server-side rendered)
   ============================================ */
nav.breadcrumb ol {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  padding: 0;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-light);
}
nav.breadcrumb ol li {
  display: flex;
  align-items: center;
}
nav.breadcrumb ol li:not(:last-child)::after {
  content: '›';
  margin: 0 6px;
  color: var(--text-lighter);
}
nav.breadcrumb ol li a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition-fast);
}
nav.breadcrumb ol li a:hover {
  text-decoration: underline;
}
nav.breadcrumb ol li:last-child span {
  color: var(--text);
  font-weight: 500;
}

/* ============================================
   PERFORMANCE OPTIMIZATIONS (SEO v8.0)
   ============================================ */

/* Prevent Layout Shift for images */
img {
  content-visibility: auto;
}

/* Optimize rendering of post cards */
.post-card {
  contain: layout style;
}

/* Optimize sidebar rendering */
.article-sidebar {
  contain: layout;
}

/* Optimize header for scroll performance */
.site-header {
  contain: layout style;
  will-change: transform;
}

/* Print styles for SEO */
@media print {
  .site-header, .site-nav, .sidebar, .article-sidebar,
  .back-to-top, #toast-container, .newsletter-section,
  .trending-section, .categories-section {
    display: none !important;
  }
  body {
    font-size: 12pt;
    color: #000;
    background: #fff;
  }
  a {
    color: #000;
    text-decoration: underline;
  }
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  .article-content {
    max-width: 100%;
  }
  h1, h2, h3 {
    page-break-after: avoid;
    -webkit-text-fill-color: #000;
    background: none;
    color: #000;
  }
}

/* Accessibility improvements */
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Skip to content link for accessibility */
.skip-to-content {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--accent);
  color: white;
  padding: 12px 24px;
  z-index: 99999;
  font-weight: 600;
  border-radius: 0 0 8px 0;
  transition: top 0.2s;
}
.skip-to-content:focus {
  top: 0;
}

/* Improve text rendering for SEO content */
.article-content {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Ensure proper heading hierarchy colors for dark mode */
@media (prefers-color-scheme: dark) {
  .article-header h1 {
    background: linear-gradient(135deg, var(--accent-light) 0%, #c084fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
