/* ===== BLOG.CSS - Стили для блога ===== */

/* Панель управления блогом */
.blog-controls {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 30px;
    background: var(--white);
    padding: 20px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    border: 2px solid #f0f0f0;
}

/* Поиск */
.search-container {
    position: relative;
    width: 100%;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: #999;
}

.search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    font-size: 16px;
    transition: var(--transition-base);
    box-sizing: border-box;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-input::placeholder {
    color: #999;
    font-style: italic;
}

/* Фильтры */
.filter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.filter-chip {
    background: #f0f2ff;
    border: none;
    color: var(--primary-color);
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.filter-chip:hover {
    background: #e0e4ff;
    transform: translateY(-2px);
}

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

/* Сортировка */
.sort-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-label {
    color: var(--light-text);
    font-size: 14px;
    font-weight: 500;
}

.sort-select {
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 30px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-color);
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Теги */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
}

.tags-label {
    color: var(--light-text);
    font-size: 13px;
    font-weight: 500;
    margin-right: 5px;
}

.tag {
    background: #f5f5f5;
    color: var(--light-text);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.tag:hover {
    background: #e0e0e0;
    transform: translateY(-1px);
}

.tag.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.tag.more-tag {
    background: transparent;
    color: var(--primary-color);
    border: 1px dashed var(--primary-color);
    cursor: default;
}

.tag.more-tag:hover {
    transform: none;
    background: transparent;
}

/* Посты блога */
.blog-posts {
    display: grid;
    gap: 30px;
    min-height: 300px;
}

.post-meta {
    color: var(--light-text);
    font-size: 14px;
    margin-bottom: 10px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
}

.post-category {
    background: #e3f2fd;
    color: #2196f3;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.post-tags {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.post-tag {
    background: #e8f5e9;
    color: #4caf50;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
}

.post-title {
    font-size: 24px;
    margin-bottom: 15px;
}

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

.post-title a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

.post-excerpt {
    color: #444;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 8px 0;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 5px;
    transition: transform 0.3s ease;
    display: inline-block;
}

.read-more:hover::after {
    transform: translateX(5px);
}

/* Состояния */
.no-results {
    text-align: center;
    padding: 60px 20px;
    background: var(--background-light);
    border-radius: var(--border-radius-md);
    color: var(--light-text);
}

.no-results h3 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.no-results.hidden {
    display: none;
}

.clear-search {
    display: inline-block;
    margin-top: 20px;
    padding: 10px 30px;
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: var(--transition-base);
    border: none;
    cursor: pointer;
}

.clear-search:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.posts-count {
    font-size: 14px;
    color: var(--light-text);
    margin-top: 20px;
    text-align: right;
    font-weight: 500;
}

/* Медиа-запросы */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: center;
    }
    
    .sort-group {
        justify-content: center;
    }
    
    .post-title {
        font-size: 20px;
    }
    
    .tags-container {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .post-meta {
        flex-direction: column;
        gap: 5px;
        align-items: flex-start;
    }
    
    .search-input {
        padding: 12px 15px 12px 45px;
        font-size: 14px;
    }
}