/**
 * Общие стили для блога
 * Используется на главной странице и в разделе /blog/
 */

/* ========== Карточки статей ========== */
.blog-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

.blog-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

/* ========== Обертка изображения ========== */
.blog-img-wrapper {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.blog-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.blog-card:hover .blog-img-wrapper img {
    transform: scale(1.08);
}

/* ========== Оверлей при наведении ========== */
.blog-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(91, 33, 182, 0.92), rgba(74, 26, 154, 0.92));
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.blog-card:hover .blog-overlay {
    opacity: 1;
}

/* ========== Кнопка в оверлее ========== */
.btn-blog-read {
    background: white;
    color: #5B21B6;
    font-weight: 600;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 50px;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-blog-read:hover {
    background: #f8f9fa;
    color: #5B21B6;
    transform: scale(1.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.btn-blog-read i {
    margin-left: 0.5rem;
    transition: transform 0.3s ease;
}

.btn-blog-read:hover i {
    transform: translateX(4px);
}

/* ========== Тело карточки ========== */
.blog-card-body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    /*height: 100%;*/
}

/* ========== Бейдж категории ========== */
.blog-category-badge {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.45rem 0.9rem;
    font-weight: 600;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 0.75rem;
}

.blog-category-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.blog-category-badge.bg-info {
    background-color: #0dcaf0 !important;
    color: #000 !important;
}

.blog-category-badge.bg-warning {
    background-color: #ffc107 !important;
    color: #000 !important;
}

/* ========== Заголовок статьи ========== */
.blog-card-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    min-height: 2.8rem;
}

.blog-card-title a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card-title a:hover {
    color: #5B21B6;
}

/* ========== Описание статьи ========== */
.blog-card-excerpt {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    flex-grow: 1; /* ← ВОТ ПРОБЛЕМА! Удалите эту строку */
}

/* ========== Метаданные (дата, просмотры) ========== */
.blog-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    margin-top: auto;
    border-top: 1px solid #e9ecef;
    font-size: 0.875rem;
    color: #6c757d;
}

.blog-card-meta span {
    display: inline-flex;
    align-items: center;
}

.blog-card-meta i {
    margin-right: 0.35rem;
    font-size: 1rem;
}

/* ========== Фильтры категорий ========== */
.blog-category-filter {
    margin-bottom: 2.5rem;
}

.blog-category-filter .btn {
    margin: 0.25rem;
    padding: 0.65rem 1.5rem;
    font-weight: 500;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.blog-category-filter .btn i {
    margin-right: 0.5rem;
}

.blog-category-filter .btn .badge {
    margin-left: 0.5rem;
}

/* ========== Заголовок секции ========== */
.blog-section-header {
    text-align: center;
    margin-bottom: 3rem;
}

.blog-section-header h1,
.blog-section-header h2 {
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.blog-section-header .lead {
    color: #6c757d;
    font-size: 1.1rem;
}

.blog-section-header i {
    color: #5B21B6;
}

/* ========== Пустое состояние ========== */
.blog-empty-state {
    text-align: center;
    padding: 4rem 2rem;
}

.blog-empty-state i {
    font-size: 4rem;
    color: #5B21B6;
    opacity: 0.5;
    margin-bottom: 1.5rem;
}

.blog-empty-state h4 {
    margin-bottom: 1rem;
}

/* ========== Пагинация ========== */
.blog-pagination .pagination {
    margin-top: 3rem;
}

.blog-pagination .page-link {
    color: #5B21B6;
    border-radius: 8px;
    margin: 0 0.25rem;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.blog-pagination .page-link:hover {
    background-color: #5B21B6;
    border-color: #5B21B6;
    color: white;
}

.blog-pagination .page-item.active .page-link {
    background-color: #5B21B6;
    border-color: #5B21B6;
}

/* ========== Адаптивность ========== */
@media (max-width: 768px) {
    .blog-img-wrapper {
        height: 180px;
    }
    
    .blog-card-title {
        font-size: 1rem;
        min-height: auto;
    }
    
    .blog-card-body {
        padding: 1.25rem;
    }
    
    .blog-card-excerpt {
        font-size: 0.9rem;
    }
    
    .btn-blog-read {
        padding: 0.6rem 1.25rem;
        font-size: 0.9rem;
    }
}

/* ========== Анимация появления ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.blog-card {
    animation: fadeInUp 0.5s ease;
}

/* Задержка для эффекта каскада */
.blog-card:nth-child(1) { animation-delay: 0.1s; }
.blog-card:nth-child(2) { animation-delay: 0.2s; }
.blog-card:nth-child(3) { animation-delay: 0.3s; }
.blog-card:nth-child(4) { animation-delay: 0.1s; }
.blog-card:nth-child(5) { animation-delay: 0.2s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }