/* Шапка блога */
.blog-header {
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url('/img/blog-banner.webp') no-repeat center center/cover;
  color: white;
  padding: 5rem 0;
  position: relative;
  overflow: hidden;
  margin-bottom: 3rem;
  margin: 0;
}

.blog-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.blog-title {
  font-weight: 800;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
  position: relative;
}

.blog-subtitle {
  font-size: 1.4rem;
  opacity: 0.9;
  position: relative;
}

/* Поиск по блогу */
.blog-search {
  max-width: 800px;
  margin: 2rem auto 0;
}

/* Боковая панель с категориями */
.blog-sidebar {
  position: sticky;
  top: 20px;
}

.blog-sidebar .card-header {
  background-color: var(--primary);
  color: white;
  font-weight: 700;
  padding: 1rem 1.25rem;
}

.category-filters button {
  color: var(--dark);
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
  padding: 0.5rem 1rem !important;
  text-align: left;
  width: 100%;
  margin-bottom: 0.25rem;
}

.category-filters button:hover,
.category-filters button.active {
  color: var(--primary) !important;
  background-color: rgba(13, 110, 253, 0.1);
  border-left-color: var(--primary);
}

/* Сетка статей */
.articles-container {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

.article-card {
  animation: fadeIn 0.5s ease forwards;
}

.article-card .badge {
  font-size: 0.85rem;
}

/* Стили для категорий */
.article-card[data-category="diagnostics"] .badge {
  background-color: var(--primary);
}

.article-card[data-category="firmware"] .badge {
  background-color: var(--success);
}

.article-card[data-category="repair"] .badge {
  background-color: var(--warning);
}

.article-card[data-category="tips"] .badge {
  background-color: var(--info);
}

/* Кнопка "Читать далее" */
.read-more {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.3s ease;
  margin-top: auto;
}

.read-more:hover {
  color: var(--dark);
  text-decoration: underline;
}

.read-more i {
  margin-left: 5px;
  transition: all 0.3s ease;
}

.read-more:hover i {
  transform: translateX(3px);
}

/* Пагинация */
.blog-pagination .page-link {
  border-radius: 8px !important;
  margin: 0 3px;
  border: none;
  color: var(--dark);
  min-width: 40px;
  text-align: center;
  transition: all 0.3s ease;
}

.blog-pagination .page-item.active .page-link {
  background-color: var(--primary);
  color: white;
}

.blog-pagination .page-item:not(.active) .page-link:hover {
  background-color: rgba(13, 110, 253, 0.1);
  color: var(--primary);
}

/* Адаптивность */
@media (max-width: 991.98px) {
  .articles-container {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .blog-header {
    padding: 4rem 0;
  }
}

@media (max-width: 767.98px) {
  .blog-header {
    padding: 3rem 0;
  }

  .blog-title {
    font-size: 2.2rem;
  }

  .blog-subtitle {
    font-size: 1.2rem;
  }

  .articles-container {
    grid-template-columns: 1fr;
  }
}