/* blog.css - стили для блога */

/* Импортируем основные переменные из style.css */
:root {
    --admin-bg: #0f172a;
    --admin-card: rgba(30, 41, 59, 0.8);
    --admin-border: rgba(59, 130, 246, 0.2);
    --admin-accent: #3b82f6;
    --admin-success: #10b981;
    --admin-warning: #f59e0b;
    --admin-danger: #ef4444;
}

/* Базовые стили */
.dark {
    background-color: var(--admin-bg);
    color: #fff;
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

/* Контейнер */
.blog-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Хедер блога */
.blog-header {
    margin-bottom: 3rem;
    text-align: center;
}

.blog-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #60a5fa, #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 0.5rem;
}

.blog-header p {
    color: #94a3b8;
    font-size: 1.1rem;
}

/* Карточки постов */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.post-card {
    background: var(--admin-card);
    border: 1px solid var(--admin-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(59, 130, 246, 0.4);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    flex: 1;
}

.post-card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #1e293b, #0f172a);
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.post-card:hover .post-card-image img {
    transform: scale(1.05);
}

.post-card-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.post-card-meta {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.post-card-category {
    color: #60a5fa;
    background: rgba(96, 165, 250, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-block;
}

.post-card-date {
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-card-views {
    color: #94a3b8;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.post-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 0.75rem;
    line-height: 1.3;
    flex: 1;
}

.post-card-excerpt {
    color: #cbd5e1;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.post-card-footer {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.post-card-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.post-card-tag {
    color: #94a3b8;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
}

.post-card-read {
    color: #60a5fa;
    font-weight: 600;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.pagination-link {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.pagination-link:hover,
.pagination-link.active {
    background: rgba(59, 130, 246, 0.2);
    border-color: #3b82f6;
    color: #60a5fa;
}

/* Кнопки */
.back-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #60a5fa;
    text-decoration: none;
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    background: rgba(96, 165, 250, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.2);
    font-weight: 600;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.back-button:hover {
    background: rgba(96, 165, 250, 0.2);
    transform: translateX(-3px);
    border-color: #3b82f6;
}

/* Состояние когда нет постов */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #64748b;
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state-title {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #94a3b8;
}

.empty-state-description {
    color: #64748b;
    max-width: 400px;
    margin: 0 auto;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.post-card {
    animation: fadeIn 0.5s ease-out;
    animation-fill-mode: both;
}

/* Задержки для анимации карточек */
.post-card:nth-child(1) { animation-delay: 0.1s; }
.post-card:nth-child(2) { animation-delay: 0.2s; }
.post-card:nth-child(3) { animation-delay: 0.3s; }
.post-card:nth-child(4) { animation-delay: 0.4s; }
.post-card:nth-child(5) { animation-delay: 0.5s; }

/* Мобильная адаптация */
@media (max-width: 768px) {
    .blog-container {
        padding: 1rem;
    }

    .blog-header h1 {
        font-size: 2rem;
    }

    .posts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .post-card-content {
        padding: 1rem;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .post-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .post-card-footer {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }

    .pagination-link {
        padding: 0.5rem 0.75rem;
        font-size: 0.75rem;
    }
}

/* Плавный скролл */
html {
    scroll-behavior: smooth;
}

/* Улучшаем читаемость текста */
.post-card-title,
.post-card-excerpt {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Эффект градиентной обводки для карточек при наведении */
.post-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899);
    border-radius: 18px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.post-card:hover::before {
    opacity: 0.3;
}