/*
 * УЛУЧШЕНИЯ СТРАНИЦ АВТОРОВ
 * Правильная структура с sidebar'ом справа и современным дизайном
 */

/* ==========================================
   ОСНОВНАЯ СТРУКТУРА СТРАНИЦЫ АВТОРА
   ========================================== */

.author-page-main {
    padding: 2rem 0;
    background: #f8fafc;
}

.author-content-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
}

/* ==========================================
   HEADER АВТОРА
   ========================================== */

.author-header {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.author-info {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.author-details {
    flex: 1;
}

.author-name {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 0.5rem;
}

.author-role {
    font-size: 1.1rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.author-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.posts-count {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color, #4a90e2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
}

.author-website {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color, #4a90e2);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.author-website:hover {
    color: var(--primary-color, #357abd);
    text-decoration: underline;
}

/* ==========================================
   СЕКЦИЯ СТАТЕЙ АВТОРА
   ========================================== */

.author-posts {
    background: white;
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.section-title i {
    color: var(--primary-color, #4a90e2);
}

/* ==========================================
   СЕТКА СТАТЕЙ
   ========================================== */

.posts-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.author-post-card {
    display: flex;
    background: #f8fafc;
    border: 2px solid #e1e8ed;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0;
}

.author-post-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color, #4a90e2);
}

/* Изображение статьи */
.post-thumbnail {
    flex-shrink: 0;
    width: 200px;
    height: 150px;
    position: relative;
    overflow: hidden;
}

.post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.author-post-card:hover .post-thumbnail img {
    transform: scale(1.05);
}

/* Категории удалены с карточек статей автора */

/* Контент статьи */
.post-content {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
}

.post-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.post-title a {
    color: var(--text-primary, #2c3e50);
    text-decoration: none;
    transition: color 0.3s ease;
}

.post-title a:hover {
    color: var(--primary-color, #4a90e2);
}

.post-excerpt {
    color: var(--text-secondary, #6b7280);
    line-height: 1.6;
    margin-bottom: 1rem;
    flex: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.post-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
}

.post-meta i {
    color: var(--primary-color, #4a90e2);
}

.read-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color, #4a90e2);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    align-self: flex-start;
    transition: all 0.3s ease;
}

.read-more-btn:hover {
    background: var(--primary-color, #357abd);
    transform: translateY(-1px);
}

/* ==========================================
   ПАГИНАЦИЯ
   ========================================== */

.author-pagination {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e1e8ed;
}

.author-pagination .nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.author-pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    color: var(--text-primary, #2c3e50);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.author-pagination .page-numbers:hover,
.author-pagination .page-numbers.current {
    background: var(--primary-color, #4a90e2);
    color: white;
    border-color: var(--primary-color, #4a90e2);
}

/* ==========================================
   SIDEBAR АВТОРА
   ========================================== */

.author-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sidebar-widget {
    background: white;
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* ФОРМА ПОДПИСКИ В СТИЛЕ КАК В СТАТЬЯХ */
.sidebar-widget.newsletter-widget {
    background: linear-gradient(135deg, #f8faff, #eef7ff);
    border: 2px solid #e1e8ed;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.sidebar-widget.newsletter-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100px;
    height: 100px;
    background: radial-gradient(circle, rgba(74, 144, 226, 0.1), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.newsletter-widget .widget-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.newsletter-description {
    font-size: 0.9rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

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

.subscription-form .form-group {
    margin: 0;
}

.subscription-form .email-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 0.9rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

.subscription-form .email-input:focus {
    outline: none;
    border-color: var(--primary-color, #4a90e2);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
    transform: translateY(-1px);
}

.subscription-form .subscribe-btn {
    background: linear-gradient(135deg, var(--primary-color, #4a90e2), #357abd);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

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

.subscription-form .subscribe-btn:active {
    transform: translateY(0);
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Категории */
.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

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

.categories-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem;
    background: #f8fafc;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-primary, #2c3e50);
    transition: all 0.3s ease;
}

.categories-list a:hover {
    background: var(--primary-color, #4a90e2);
    color: white;
    transform: translateX(4px);
}

.category-count {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
}

.categories-list a:hover .category-count {
    color: rgba(255, 255, 255, 0.8);
}

/* Популярные статьи */
.popular-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.popular-post-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.popular-post-item:hover {
    background: #f1f5f9;
    transform: translateX(2px);
}

.popular-post-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #e1e8ed, #f1f5f9);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #6b7280);
}

.popular-post-content h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.3;
}

.popular-post-content a {
    color: var(--text-primary, #2c3e50);
    text-decoration: none;
    transition: color 0.3s ease;
}

.popular-post-content a:hover {
    color: var(--primary-color, #4a90e2);
}

.popular-date {
    font-size: 0.8rem;
    color: var(--text-secondary, #6b7280);
}

/* ==========================================
   СООБЩЕНИЕ "НЕТ СТАТЕЙ"
   ========================================== */

.no-posts-found {
    background: white;
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

.no-posts-content i {
    font-size: 4rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 1.5rem;
    display: block;
}

.no-posts-content h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #2c3e50);
    margin-bottom: 1rem;
}

.no-posts-content p {
    color: var(--text-secondary, #6b7280);
    margin-bottom: 2rem;
    line-height: 1.6;
}

.back-home-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--primary-color, #4a90e2);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: var(--primary-color, #357abd);
    transform: translateY(-2px);
}

/* ==========================================
   СКРЫТИЕ ДУБЛИРУЮЩИХ ЭЛЕМЕНТОВ
   ========================================== */

/* Скрываем стандартные WordPress виджеты в sidebar'е */
body.author .widget_search,
body.author .widget_recent_entries,
body.author .widget_recent_comments,
body.author .widget_archives,
body.author .widget_categories,
body.author .widget_rss,
body.author .widget_tag_cloud,
body.author .widget_calendar {
    display: none !important;
}

/* Скрываем дублирующие элементы по тексту заголовков */
body.author .widget h2:contains("Поиск"),
body.author .widget h3:contains("Поиск"),
body.author .widget h2:contains("Свежие записи"),
body.author .widget h3:contains("Свежие записи"),
body.author .widget h2:contains("Свежие комментарии"),
body.author .widget h3:contains("Свежие комментарии"),
body.author .widget h2:contains("Архивы"),
body.author .widget h3:contains("Архивы"),
body.author .widget h2:contains("Рубрики"),
body.author .widget h3:contains("Рубрики") {
    display: none !important;
}

/* Скрываем родительские виджеты, если заголовок скрыт */
body.author .widget:has(h2:contains("Поиск")),
body.author .widget:has(h3:contains("Поиск")),
body.author .widget:has(h2:contains("Свежие записи")),
body.author .widget:has(h3:contains("Свежие записи")),
body.author .widget:has(h2:contains("Свежие комментарии")),
body.author .widget:has(h3:contains("Свежие комментарии")),
body.author .widget:has(h2:contains("Архивы")),
body.author .widget:has(h3:contains("Архивы")),
body.author .widget:has(h2:contains("Рубрики")),
body.author .widget:has(h3:contains("Рубрики")) {
    display: none !important;
}

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

@media (max-width: 1024px) {
    .author-content-layout {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }
    
    .author-header {
        padding: 2rem;
    }
    
    .author-info {
        gap: 1.5rem;
    }
    
    .post-thumbnail {
        width: 160px;
        height: 120px;
    }
}

@media (max-width: 768px) {
    .author-content-layout {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .author-header {
        padding: 1.5rem;
    }
    
    .author-info {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }
    
    .author-avatar img {
        width: 100px;
        height: 100px;
    }
    
    .author-name {
        font-size: 1.5rem;
    }
    
    .author-posts {
        padding: 1.5rem;
    }
    
    .author-post-card {
        flex-direction: column;
    }
    
    .post-thumbnail {
        width: 100%;
        height: 200px;
    }
    
    .posts-grid {
        gap: 1.5rem;
    }
    
    .sidebar-widget {
        padding: 1.25rem;
    }
}

@media (max-width: 480px) {
    .author-page-main {
        padding: 1rem 0;
    }
    
    .author-header {
        padding: 1rem;
    }
    
    .author-posts {
        padding: 1rem;
    }
    
    .post-content {
        padding: 1rem;
    }
    
    .author-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .sidebar-widget {
        padding: 1rem;
    }
    
    .popular-post-item {
        padding: 0.75rem;
        gap: 0.75rem;
    }
    
    .popular-post-image {
        width: 50px;
        height: 50px;
    }
}

/* ==========================================
   АНИМАЦИИ
   ========================================== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.author-header,
.author-posts,
.sidebar-widget {
    animation: fadeInUp 0.6s ease-out;
}

.author-post-card {
    animation: fadeInUp 0.6s ease-out;
}

/* Задержка для последовательного появления элементов */
.author-post-card:nth-child(1) { animation-delay: 0.1s; }
.author-post-card:nth-child(2) { animation-delay: 0.2s; }
.author-post-card:nth-child(3) { animation-delay: 0.3s; }
.author-post-card:nth-child(4) { animation-delay: 0.4s; }
.author-post-card:nth-child(5) { animation-delay: 0.5s; }

/* ==========================================
   ПЕРЕМЕННЫЕ ДЛЯ ТЕМИЗАЦИИ
   ========================================== */

body.author {
    --primary-color: #4a90e2;
    --secondary-color: #f39c12;
    --text-primary: #2c3e50;
    --text-secondary: #6b7280;
}