/*
 * УЛУЧШЕНИЯ ДЛЯ СТРАНИЦ КАТЕГОРИЙ
 * Современные стили для страниц категорий с улучшенной шапкой и сайдбаром
 */

/* ==========================================
   ШАПКА КАТЕГОРИИ - УЛУЧШЕННАЯ ВЕРСИЯ
   ========================================== */

.category-header {
    background: linear-gradient(135deg, var(--category-color, var(--primary-color)), var(--secondary-color)) !important;
    color: white !important;
    padding: 4rem 0 3rem !important;
    margin-bottom: 0 !important;
    position: relative;
    overflow: hidden;
}

/* Декоративные элементы для шапки */
.category-header::before {
    content: '';
    position: absolute;
    top: 0;
    right: -10%;
    width: 40%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    transform: skewX(-15deg);
    z-index: 1;
}

.category-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.category-hero {
    display: flex !important;
    align-items: center !important;
    gap: 2rem !important;
    margin-bottom: 1.5rem !important;
    position: relative;
    z-index: 2;
}

.category-icon {
    font-size: 4rem !important;
    opacity: 0.9 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.category-title {
    font-size: 2.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3) !important;
    line-height: 1.2 !important;
}

.category-description {
    font-size: 1.1rem !important;
    margin: 1rem 0 !important;
    opacity: 0.9 !important;
    max-width: 600px !important;
    line-height: 1.4 !important;
}

.category-stats {
    display: flex;
    gap: 2rem;
    margin-top: 2rem;
    position: relative;
    z-index: 2;
}

.category-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.category-stat i {
    font-size: 1.2rem;
    opacity: 0.8;
}

.category-stat-number {
    font-weight: 600;
    font-size: 1.1rem;
}

.category-stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ==========================================
   УЛУЧШЕННЫЙ САЙДБАР
   ========================================== */

/* Центрирование блока подписки в сайдбаре */
.category-sidebar,
.sidebar.category-sidebar {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
}

/* Если блок подписки находится в футере */
.site-footer .category-subscription,
.footer .category-subscription,
footer .category-subscription {
    width: 280px !important;
    max-width: 280px !important;
    margin: 0 auto 2rem auto !important;
}

.category-sidebar .widget {
    background: var(--bg-white);
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

.category-sidebar .widget:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.category-sidebar .widget-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
    position: relative;
}

.category-sidebar .widget-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 30%;
    height: 2px;
    background: var(--secondary-color);
}

/* Стили для связанных категорий */
.related-categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-categories-list li {
    margin-bottom: 0.75rem;
}

.related-categories-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--gray-50);
    border-radius: var(--border-radius);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.related-categories-list a:hover {
    background: var(--primary-light);
    border-left-color: var(--primary-color);
    transform: translateX(4px);
}

.related-categories-list .category-name {
    flex: 1;
}

.related-categories-list .category-count {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 24px;
    text-align: center;
}

/* Форма подписки - УЛУЧШЕННЫЙ КОМПАКТНЫЙ ДИЗАЙН */
.category-subscription {
    background: linear-gradient(135deg, #f8faff, #eef7ff);
    border: 2px solid #d1e7ff;
    padding: 2rem 1.5rem;
    border-radius: 20px;
    text-align: center;
    margin: 0 auto 2rem auto !important;
    box-shadow: 0 6px 24px rgba(74, 144, 226, 0.12);
    transition: all 0.3s ease;
    width: 360px !important;
    max-width: 360px !important;
    position: relative;
    overflow: hidden;
}

.category-subscription:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 32px rgba(74, 144, 226, 0.18);
}

/* Декоративный элемент для формы подписки */
.category-subscription::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.1), rgba(74, 144, 226, 0.05));
    border-radius: 0 20px 0 50px;
    z-index: 1;
}

.category-subscription > * {
    position: relative;
    z-index: 2;
}

.subscription-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.subscription-title::before {
    content: "🔔";
    font-size: 1.2rem;
}

.subscription-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: center;
}

.subscription-input {
    width: 100%;
    max-width: 300px;
    padding: 0.75rem 1rem;
    border: 2px solid #d1e7ff;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
    box-shadow: 0 3px 8px rgba(74, 144, 226, 0.08);
}

.subscription-input:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: scale(1.02);
}

.subscription-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.subscription-btn {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 160px;
    justify-content: center;
}

.subscription-btn:hover {
    background: linear-gradient(135deg, #357abd, #2868a3);
    transform: translateY(-1px);
    box-shadow: 0 5px 12px rgba(74, 144, 226, 0.4);
}

.subscription-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.subscription-note {
    font-size: 0.8rem;
    color: #6b7280;
    margin: 0.5rem 0 0;
    line-height: 1.3;
    max-width: 260px;
}

/* ==========================================
   ПОЛНОЕ СКРЫТИЕ ЛИШНИХ БЛОКОВ
   ========================================== */

/* Скрываем ВСЕ лишние блоки на страницах категорий */
body.category .footer .widget_recent_entries,
body.category .footer .widget_recent_comments, 
body.category .footer .widget_archive,
body.category .footer .widget_categories,
body.category .footer .widget_meta,
body.category .footer .widget_search,
body.category .footer .widget_tag_cloud,
body.category .footer .widget_calendar,
body.category .footer .widget_rss,
body.category .footer .widget_pages {
    display: none !important;
}

/* Скрываем любые дублирующие блоки */
body.category .site-footer .footer-widgets,
body.category .footer-widgets {
    display: none !important;
}

/* Удаляем стили для блоков, которые больше не используются */
.related-categories-list,
.popular-posts-list,
.sidebar-widget.related-widget,
.sidebar-widget.toc-widget {
    display: none !important;
}

/* ==========================================
   АДАПТИВНОСТЬ
   ========================================== */

@media (max-width: 1024px) {
    .category-hero {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
    }
    
    .category-icon {
        font-size: 3rem !important;
    }
    
    .category-title {
        font-size: 2rem !important;
    }
    
    .category-stats {
        justify-content: center;
        flex-wrap: wrap;
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .category-header {
        padding: 2rem 0 !important;
    }
    
    .category-title {
        font-size: 1.75rem !important;
    }
    
    .category-description {
        font-size: 1rem !important;
    }
    
    .category-stats {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .category-stat {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
    
    .category-sidebar .widget {
        padding: 1.5rem;
    }
    
    .category-subscription {
        width: 320px !important;
        max-width: 320px !important;
        padding: 1.5rem 1.25rem;
    }
    
    .subscription-form {
        gap: 0.6rem;
    }
    
    .subscription-input {
        max-width: 220px;
        font-size: 0.85rem;
    }
    
    .subscription-btn {
        font-size: 0.85rem;
        padding: 0.5rem 1rem;
        min-width: 120px;
    }
    
    .related-categories-list a:hover {
        transform: none;
    }
}

@media (max-width: 480px) {
    .category-header {
        padding: 1.5rem 0 !important;
    }
    
    .category-title {
        font-size: 1.5rem !important;
    }
    
    .category-hero {
        gap: 1rem;
    }
    
    .category-sidebar .widget {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .category-subscription {
        width: 300px !important;
        max-width: 300px !important;
        padding: 1.25rem 1rem;
    }
    
    .subscription-title {
        font-size: 1rem;
    }
    
    .subscription-input {
        max-width: 200px;
        padding: 0.5rem 0.75rem;
    }
    
    .subscription-btn {
        padding: 0.5rem 0.875rem;
        font-size: 0.8rem;
        min-width: 110px;
    }
    
    .subscription-note {
        font-size: 0.75rem;
    }
}