/* Основные переменные цветов */
:root {
    --primary-color: #6B46C1;
    --primary-light: #8B5CF6;
    --primary-dark: #553C9A;
    --secondary-color: #EC4899;
    --accent-color: #F59E0B;
    --text-primary: #1F2937;
    --text-secondary: #6B7280;
    --text-light: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #F9FAFB;
    --bg-accent: #F3F4F6;
    --border-color: #E5E7EB;
    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-heavy: 0 10px 25px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color), #F472B6);
}

/* Заголовок тега */
.tag-header {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-medium);
    text-align: center;
    border: 1px solid var(--border-color);
}

.tag-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.tag-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin: 0;
}

/* Информация о теге */
.tag-info {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.tag-info h2 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.tag-info p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 1rem;
}

.tag-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

/* Сетка статей */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 3rem;
}

/* Карточка статьи */
.article-card {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(107, 70, 193, 0.3);
}

/* Изображение статьи */
.article-image {
    display: block;
    width: 100%;
    height: 200px;
    overflow: hidden;
    text-decoration: none;
    position: relative;
    background: var(--bg-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

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

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

/* Если нет изображения, показываем эмодзи */
.article-image:not(:has(img)) {
    background: linear-gradient(135deg, #f0f0f0, #e8e8e8);
    color: #999;
}

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

.article-title {
    margin-bottom: 0.75rem;
    flex: 0 0 auto;
}

.article-title a {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
    display: block;
}

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

.article-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Мета-информация статьи */
.article-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.article-category {
    background: var(--gradient-primary);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.article-views {
    color: var(--text-light);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin: 3rem 0;
    flex-wrap: wrap;
}

.pagination a,
.pagination .current {
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
    min-width: 44px;
    text-align: center;
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.pagination .current {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
    border-color: var(--primary-color);
}

/* Сообщение об отсутствии статей */
.no-articles {
    background: var(--bg-primary);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
    margin: 2rem 0;
}

.no-articles h3 {
    color: var(--text-primary);
    font-size: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.no-articles p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 1rem;
}

.no-articles a {
    display: inline-block;
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.no-articles a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Планшетный дизайн */
@media (max-width: 1024px) {
    .articles-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }

    .tag-header h1 {
        font-size: 2rem;
    }

    .tag-header,
    .tag-info {
        padding: 1.5rem;
    }
}

/* Мобильный дизайн */
@media (max-width: 768px) {
    .articles-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .article-image {
        height: 150px;
    }

    .tag-header h1 {
        font-size: 1.75rem;
    }

    .tag-header,
    .tag-info {
        padding: 1.25rem;
        margin: 1rem 0;
    }

    .article-content {
        padding: 1.25rem;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .pagination {
        gap: 0.25rem;
    }

    .pagination a,
    .pagination .current {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        min-width: 40px;
    }
}

@media (max-width: 480px) {
    .tag-header h1 {
        font-size: 1.5rem;
    }

    .article-title a {
        font-size: 1.1rem;
    }

    .article-image {
        height: 120px;
        font-size: 2rem;
    }

    .no-articles {
        padding: 2rem 1rem;
    }

    .tag-header,
    .tag-info {
        padding: 1rem;
    }
}