/* Основные стили для страницы статей */
.articles-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--gray-light);
}

.page-header h1 {
    color: var(--dark-color);
    font-size: 2.8rem;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.page-subtitle {
    color: var(--text-muted);
    font-size: 1.2rem;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.page-stats {
    display: flex;
    justify-content: center;
    gap: 40px;
    flex-wrap: wrap;
    margin-top: 30px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    background: var(--gray-light);
    border-radius: var(--border-radius);
    color: var(--dark-color);
    font-weight: 500;
    font-size: 1.1rem;
}

.stat-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
}

/* Поиск и фильтры */
.articles-controls {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    margin-bottom: 30px;
}

.search-box {
    margin-bottom: 25px;
}

.search-input-group {
    display: flex;
    align-items: center;
    background: var(--gray-light);
    border-radius: 50px;
    padding: 5px;
    border: 2px solid transparent;
    transition: border-color var(--transition-speed) ease;
}

.search-input-group:focus-within {
    border-color: var(--primary-color);
}

.search-input-group i {
    color: var(--gray-dark);
    margin-left: 15px;
    font-size: 1.2rem;
}

.search-field {
    flex: 1;
    border: none;
    background: transparent;
    padding: 15px;
    font-size: 1.1rem;
    outline: none;
    color: var(--dark-color);
}

.search-button {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition-speed) ease;
}

.search-button:hover {
    background: var(--primary-hover);
}

.clear-search {
    color: var(--gray-dark);
    background: none;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 10px;
}

.clear-search:hover {
    color: var(--accent-color);
}

/* Фильтры */
.filters-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 20px;
}

@media (max-width: 768px) {
    .filters-row {
        grid-template-columns: 1fr;
    }
}

.filter-group {
    margin-bottom: 20px;
}

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

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

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    background: var(--gray-light);
    color: var(--dark-color);
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all var(--transition-speed) ease;
    border: 2px solid transparent;
}

.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.filter-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-hover);
}

.filter-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Активные фильтры */
.active-filters {
    background: var(--gray-light);
    border-radius: var(--border-radius);
    padding: 15px;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.active-filter {
    background: var(--primary-color);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.remove-filter {
    color: white;
    background: none;
    border: none;
    padding: 2px;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-filter:hover {
    color: var(--accent-color);
}

.clear-all-filters {
    color: var(--accent-color);
    text-decoration: none;
    font-size: 0.9rem;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Результаты поиска */
.articles-results {
    margin-top: 40px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.results-header h2 {
    color: var(--dark-color);
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.results-count {
    color: var(--primary-color);
    font-weight: bold;
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 15px;
}

.sort-label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.sort-select {
    padding: 8px 15px;
    border: 2px solid var(--gray);
    border-radius: var(--border-radius-small);
    background: white;
    color: var(--dark-color);
    font-size: 0.9rem;
    cursor: pointer;
    outline: none;
}

.sort-select:focus {
    border-color: var(--primary-color);
}

/* Список статей */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.article-item {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    display: flex;
    gap: 20px;
    border-left: 4px solid var(--primary-color);
    transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

.article-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-medium);
}

.article-number {
    background: var(--primary-color);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.article-content {
    flex: 1;
}

.article-title {
    color: var(--dark-color);
    font-size: 1.4rem;
    margin-bottom: 15px;
    line-height: 1.4;
}

.article-title a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.article-title a:hover {
    color: var(--primary-color);
}

.article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 15px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.meta-author,
.meta-date,
.meta-category,
.meta-source {
    display: flex;
    align-items: center;
    gap: 5px;
}

.meta-category {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.category-history {
    background: rgba(123, 178, 217, 0.1);
    color: var(--primary-color);
    border: 1px solid rgba(123, 178, 217, 0.3);
}

.category-architecture {
    background: rgba(255, 217, 125, 0.1);
    color: #d35400;
    border: 1px solid rgba(255, 217, 125, 0.3);
}

.category-people {
    background: rgba(255, 155, 133, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(255, 155, 133, 0.3);
}

.category-soviet {
    background: rgba(194, 24, 91, 0.1);
    color: #c2185b;
    border: 1px solid rgba(194, 24, 91, 0.3);
}

.category-transport {
    background: rgba(155, 89, 182, 0.1);
    color: #9b59b6;
    border: 1px solid rgba(155, 89, 182, 0.3);
}

.meta-source a {
    color: var(--primary-color);
    text-decoration: none;
}

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

.article-excerpt {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 20px;
    text-align: justify;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.article-tag {
    background: var(--gray-light);
    color: var(--dark-color);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.8rem;
    border: 1px solid var(--gray);
}

.article-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.read-article-btn,
.save-article-btn,
.share-article-btn {
    padding: 10px 20px;
    border-radius: var(--border-radius-small);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition-speed) ease;
    text-decoration: none;
}

.read-article-btn {
    background: var(--primary-color);
    color: white;
    border: none;
}

.read-article-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
}

.save-article-btn,
.share-article-btn {
    background: var(--gray-light);
    color: var(--dark-color);
    border: 1px solid var(--gray);
}

.save-article-btn:hover,
.share-article-btn:hover {
    background: var(--gray);
    transform: translateY(-2px);
}

/* Нет результатов */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
}

.no-results-icon {
    color: var(--gray-dark);
    margin-bottom: 20px;
}

.no-results h3 {
    color: var(--dark-color);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.no-results p {
    color: var(--text-muted);
    max-width: 500px;
    margin: 0 auto 25px;
    line-height: 1.6;
}

.back-to-all {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 25px;
    background: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-small);
    text-decoration: none;
    font-weight: 500;
    transition: background var(--transition-speed) ease;
}

.back-to-all:hover {
    background: var(--primary-hover);
}

/* Футер статей */
.articles-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-light);
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Информационные блоки */
.articles-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 50px;
}

.info-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-icon {
    background: var(--primary-color);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.info-content h3 {
    color: var(--dark-color);
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.info-content p {
    color: var(--text-color);
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.suggest-article-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 15px;
    background: rgba(123, 178, 217, 0.1);
    border-radius: var(--border-radius-small);
    transition: all var(--transition-speed) ease;
}

.suggest-article-link:hover {
    background: var(--primary-color);
    color: white;
}

/* Адаптивность */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
        text-align: center;
    }
    
    .page-stats {
        gap: 15px;
    }
    
    .stat-item {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
    
    .article-item {
        flex-direction: column;
        padding: 20px;
    }
    
    .article-number {
        align-self: center;
    }
    
    .article-meta {
        gap: 10px;
    }
    
    .article-actions {
        flex-direction: column;
    }
    
    .read-article-btn,
    .save-article-btn,
    .share-article-btn {
        width: 100%;
        justify-content: center;
    }
    
    .articles-info {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .articles-page {
        padding: 15px;
    }
    
    .articles-controls {
        padding: 15px;
    }
    
    .search-input-group {
        flex-direction: column;
        border-radius: var(--border-radius);
        padding: 15px;
    }
    
    .search-field {
        width: 100%;
        text-align: center;
    }
    
    .search-button {
        width: 100%;
        margin-top: 10px;
    }
    
    .filter-buttons {
        justify-content: center;
    }
}

/*--------------------*/
/* Избранные статьи */
.featured {
    border-left: 4px solid #ffc107;
    padding-left: 20px;
    background: linear-gradient(to right, rgba(255,193,7,0.05), transparent);
}

.featured-label {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 15px;
}

.featured-badge {
    display: inline-block;
    background: #ffc107;
    color: #000;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Информация об источнике */
.source-info {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    font-size: 14px;
    border-left: 4px solid #4a6fa5;
}

.source-info i {
    color: #4a6fa5;
    margin-right: 8px;
}

.source-info a {
    color: #4a6fa5;
    text-decoration: none;
}

.source-info a:hover {
    text-decoration: underline;
}

/* Биография автора */
.author-bio {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 12px;
    margin: 40px 0;
}

.author-bio-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.author-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
}

.author-photo-placeholder {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    color: #adb5bd;
}

.author-bio h3 {
    margin-bottom: 5px;
    color: #666;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.author-bio h4 {
    margin-bottom: 0;
    color: #333;
    font-size: 20px;
}

.author-link {
    display: inline-block;
    margin-top: 15px;
    color: #4a6fa5;
    text-decoration: none;
    font-weight: 500;
}

.author-link i {
    transition: transform 0.3s;
}

.author-link:hover i {
    transform: translateX(5px);
}

/* Навигация между статьями */
.article-navigation {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
}

.nav-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.nav-prev,
.nav-next,
.nav-back {
    display: flex;
    flex-direction: column;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    flex: 1;
}

.nav-prev:hover,
.nav-next:hover,
.nav-back:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.nav-prev span,
.nav-next span,
.nav-back span {
    font-weight: 600;
    margin: 5px 0;
}

.nav-prev small,
.nav-next small {
    color: #666;
    font-size: 12px;
}

.nav-back {
    align-items: center;
    background: #4a6fa5;
    color: white;
}

.nav-back:hover {
    background: #3a5a8c;
    color: white;
}

/* Кнопка сброса */
.reset-button {
    display: inline-block;
    padding: 12px 30px;
    background: #4a6fa5;
    color: white;
    text-decoration: none;
    border-radius: 25px;
    margin-top: 20px;
    transition: all 0.3s;
}

.reset-button:hover {
    background: #3a5a8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74,111,165,0.3);
}

/* Адаптивность */
@media (max-width: 768px) {
    .nav-links {
        flex-direction: column;
    }
    
    .nav-prev,
    .nav-next,
    .nav-back {
        width: 100%;
    }
    
    .author-bio-header {
        flex-direction: column;
        text-align: center;
    }
}

/* --- Адаптация изображений в статьях для мобильных --- */

/* Ограничиваем ширину контейнера с контентом статьи */
.article-content {
    max-width: 100%;
    overflow-x: hidden;
    word-wrap: break-word;
}

/* Главное правило для всех картинок */
.article-content img {
    max-width: 100%;      /* Картинка не шире контейнера */
    height: auto;         /* Пропорции сохраняем */
    border-radius: 8px;   /* Скругление (по желанию) */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Лёгкая тень (по желанию) */
    
    /* Убираем центрирование по умолчанию */
    display: inline-block;  /* Было block, ставим inline-block */
    margin: 10px 0;        /* Отступы сверху/снизу, но НЕ auto по бокам */
    
    /* Для старых версий */
    vertical-align: middle;
}

/* Если картинка одна и хочет быть по центру */
.article-content img.centered,
.article-content p img.centered {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

/* Если картинка обернута в ссылку */
.article-content a {
    display: inline-block;
    max-width: 100%;
}

/* Для таблиц */
.article-content table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    max-width: 100%;
}

/* Стили для миниатюр в списке статей */
.article-preview-content {
    display: flex;
    gap: 25px;
    align-items: flex-start;
}

.article-preview-image {
    flex: 0 0 200px;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f5f5f5;
}

.article-preview-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.article-preview-image a:hover img {
    transform: scale(1.05);
}

.article-preview-text {
    flex: 1;
}

.article-preview-text h2 {
    margin-top: 0;
    margin-bottom: 15px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .article-preview-content {
        flex-direction: column;
        gap: 15px;
    }
    
    .article-preview-image {
        flex: 0 0 auto;
        width: 100%;
        max-width: 100%;
    }
    
    .article-preview-image img {
        height: 200px;
    }
}

/* ===== ЭФФЕКТ ПОГРУЖЕНИЯ КАРТИНКИ В ТЕКСТ ===== */

/* Добавляем отступы для всего блока статьи */
.article-preview {
    padding-left: 30px !important;  /* Отступ слева для всего блока */
    padding-right: 30px !important; /* Отступ справа */
}

/* Отключаем flex */
.article-preview-content {
    display: block !important;
    overflow: visible;
    width: 100%;
}

/* Картинка с погружением */
.article-preview-image {
    float: left !important;
    margin: 5px 20px 15px -15px !important; /* Уменьшил отрицательный отступ */
    width: 280px !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 8px 8px 20px rgba(0,0,0,0.15);
    position: relative;
    z-index: 2;
}

/* Сама картинка */
.article-preview-image img {
    width: 100% !important;
    height: 180px !important;
    object-fit: cover !important;
    display: block !important;
}

/* Текст */
.article-preview-text {
    display: block !important;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .article-preview {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .article-preview-image {
        float: none !important;
        width: 100% !important;
        margin: 0 0 20px 0 !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    }
    
    .article-preview-image img {
        height: 200px !important;
    }
}

/* Стили для активных фильтров */
.active-filters {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6fa5;
}

.active-filters strong {
    color: #2c3e50;
    margin-right: 10px;
}

.filter-tag {
    display: inline-block;
    margin: 5px 0 5px 10px;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
}

.filter-author { background: #4a6fa5; }
.filter-category { background: #27ae60; }
.filter-date { background: #f39c12; }
.filter-search { background: #e74c3c; }

.filter-tag i {
    margin-right: 5px;
}

.reset-filters {
    color: #e74c3c;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.reset-filters:hover {
    color: #c0392b;
    text-decoration: underline;
}

/* Стили для кликабельных меток */
.meta-link {
    color: #4a6fa5;
    text-decoration: none;
    transition: color 0.2s ease;
}

.meta-link:hover {
    color: #2c3e50;
    text-decoration: underline;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .active-filters {
        padding: 10px;
    }
    
    .filter-tag {
        margin: 5px 5px 5px 0;
        padding: 4px 10px;
        font-size: 12px;
    }
    
    .meta-link {
        padding: 5px 0;
        display: inline-block;
    }
}

/* Дополнительные стили для фильтров */
.remove-filter {
    color: white;
    text-decoration: none;
    margin-left: 8px;
    font-weight: bold;
    font-size: 16px;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.remove-filter:hover {
    opacity: 1;
    color: white;
}

.filter-tag {
    display: inline-block;
    margin: 5px 0 5px 10px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 14px;
    color: white;
}

.filter-author { background: #4a6fa5; }
.filter-category { background: #27ae60; }
.filter-date { background: #f39c12; }
.filter-search { background: #e74c3c; }

.filter-tag i {
    margin-right: 5px;
}

/* Стили для шапки с фильтрами */
.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-section {
    flex: 1;
    min-width: 300px;
}

.search-form {
    width: 100%;
}

.search-wrapper {
    display: flex;
    gap: 10px;
    width: 100%;
}

.search-wrapper input {
    flex: 1;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s;
}

.search-wrapper input:focus {
    border-color: #4a6fa5;
    outline: none;
    box-shadow: 0 0 0 3px rgba(74,111,165,0.1);
}

.search-btn {
    padding: 12px 25px;
    background: #4a6fa5;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
}

.search-btn:hover {
    background: #3a5a8c;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74,111,165,0.3);
}

.reset-filter-wrapper {
    flex-shrink: 0;
}

.reset-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #fff;
    color: #e74c3c;
    border: 2px solid #e74c3c;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.reset-filter-btn i {
    font-size: 16px;
}

.reset-filter-btn:hover {
    background: #e74c3c;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(231,76,60,0.3);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .filters-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-wrapper {
        flex-direction: column;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .reset-filter-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Стили для активных фильтров (оставляем как есть) */
.active-filters {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6fa5;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.active-filters strong {
    color: #2c3e50;
    margin-right: 5px;
}

.filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 14px;
    color: white;
}

.filter-tag i {
    font-size: 12px;
}

.filter-author { background: #4a6fa5; }
.filter-category { background: #27ae60; }
.filter-date { background: #f39c12; }
.filter-search { background: #e74c3c; }

.filter-tag .remove-filter {
    color: white;
    text-decoration: none;
    margin-left: 5px;
    font-weight: bold;
    font-size: 18px;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.filter-tag .remove-filter:hover {
    opacity: 1;
}

/* Дополнительные стили для красоты (не влияют на видимость) */
.stats-bar {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    font-size: 16px;
    color: #2c3e50;
    border-left: 4px solid #4a6fa5;
}

.stats-bar strong {
    color: #4a6fa5;
    font-size: 18px;
}

.active-filters {
    margin-bottom: 25px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #4a6fa5;
}

.filter-tag {
    display: inline-block;
    margin: 5px 0 5px 10px;
    padding: 6px 15px;
    border-radius: 30px;
    font-size: 14px;
    color: white;
}

.filter-author { background: #4a6fa5; }
.filter-category { background: #27ae60; }
.filter-date { background: #f39c12; }
.filter-search { background: #e74c3c; }

.filter-tag i {
    margin-right: 5px;
}

/* Стили для пагинации */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 40px 0 20px;
    flex-wrap: wrap;
}

.pagination-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: #f8f9fa;
    color: #4a6fa5;
    border: 2px solid #4a6fa5;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.pagination-btn:hover:not(.disabled) {
    background: #4a6fa5;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74,111,165,0.3);
}

.pagination-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    border-color: #ccc;
    color: #999;
}

.pagination-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    background: #f8f9fa;
    color: #4a6fa5;
    border: 2px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s;
}

.pagination-num:hover {
    background: #e9ecef;
    border-color: #4a6fa5;
}

.pagination-num.active {
    background: #4a6fa5;
    color: white;
    border-color: #4a6fa5;
}

.pagination-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #6c757d;
    font-size: 16px;
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .pagination {
        gap: 5px;
    }
    
    .pagination-btn {
        padding: 8px 15px;
        font-size: 14px;
    }
    
    .pagination-btn span {
        display: none; /* Прячем текст "Назад"/"Вперед" на мобильных */
    }
    
    .pagination-num {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
}

/* Стили для популярных статей */
.popular-articles {
    margin: 40px 0;
    padding: 30px 0;
    border-top: 2px solid #e9ecef;
    border-bottom: 2px solid #e9ecef;
    background: linear-gradient(to bottom, #f8f9fa, transparent);
}

.popular-title {
    font-size: 24px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.popular-description {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

.popular-articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.popular-article-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.popular-article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.popular-article-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.popular-article-image {
    height: 160px;
    overflow: hidden;
    background: #f5f5f5;
}

.popular-article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.popular-article-card:hover .popular-article-image img {
    transform: scale(1.05);
}

.popular-article-info {
    padding: 15px;
}

.popular-article-info h3 {
    margin: 0 0 10px;
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    height: 44px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.popular-article-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

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

.popular-article-meta i {
    color: #4a6fa5;
    font-size: 11px;
}

.popular-article-categories {
    font-size: 12px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.popular-article-categories i {
    color: #4a6fa5;
    margin-right: 4px;
}

@media (max-width: 768px) {
    .popular-articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 15px;
    }
    
    .popular-article-image {
        height: 140px;
    }
}