/* ===== ОСНОВНАЯ СЕТКА ===== */
.blog-grid {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-bottom: 2rem;
}

/* ===== КАРТОЧКА ПОСТА ===== */
.blog-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* ===== ШАПКА КАРТОЧКИ ===== */
.blog-card-header {
    padding: 1.1rem 1.5rem 0.5rem;
}

.blog-card-author {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.2rem;
}

.blog-card-dates {
    font-size: 0.8rem;
    color: #666;
}

/* ===== ИЗОБРАЖЕНИЕ ===== */
.blog-card-image {
    position: relative;
    overflow: hidden;
    margin-top: 0.8rem;
    border-radius: 8px;
}

.blog-card-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    display: block;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.03);
}

/* ===== ОСНОВНОЙ КОНТЕНТ ===== */
.blog-card-main {
    padding: 1.1rem 1.5rem 1.3rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.blog-card-title {
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.4;
}

.blog-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.blog-card-title a:hover {
    color: #667eea;
}

.blog-card-excerpt {
    margin: 0.4rem 0 0.2rem;
    font-size: 0.95rem;
    color: #444;
    line-height: 1.6;
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* ===== ПОДВАЛ КАРТОЧКИ ===== */
.blog-card-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.6rem;
}

.read-more {
    color: #667eea;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.3s ease, transform 0.3s ease;
}

.read-more:hover {
    color: #764ba2;
    transform: translateX(5px);
}

.read-time {
    font-size: 0.8rem;
    color: #888;
}

.views {
    font-size: 0.85rem;
    color: #666;
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination-btn {
    padding: 0.8rem 1.5rem;
    background: #667eea;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.3s ease;
}

.pagination-btn:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

.pagination-info {
    color: #666;
    font-weight: 500;
}

/* ===== ПУСТОЙ СПИСОК ===== */
.no-posts {
    text-align: center;
    padding: 4rem;
    grid-column: 1 / -1;
}

.no-posts h3 {
    color: #666;
    margin-bottom: 1rem;
}

.no-posts p {
    color: #888;
}

.no-posts form {
    display: inline-block;
    margin-top: 1rem;
}

/* ===== КНОПКИ ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
}

.btn-primary {
    background: #667eea;
    color: #fff;
}

.btn-primary:hover {
    background: #764ba2;
    transform: translateY(-2px);
}

/* ===== АДАПТИВ ===== */

/* Планшеты (768px - 1024px) */
@media (max-width: 1024px) {
    .blog-grid {
        max-width: 90%;
        gap: 1.8rem;
    }

    .blog-card-main {
        padding: 1rem 1.2rem;
    }

    .blog-card-title {
        font-size: 1.2rem;
    }
}

/* Телефоны (до 768px) */
@media (max-width: 768px) {
    .blog-grid {
        max-width: 95%;
        gap: 1.5rem;
        padding: 0 0.5rem;
    }

    .blog-card {
        border-radius: 12px;
    }

    .blog-card-header {
        padding: 0.8rem 1rem 0.3rem;
    }

    .blog-card-author {
        font-size: 0.85rem;
    }

    .blog-card-dates {
        font-size: 0.75rem;
    }

    .blog-card-main {
        padding: 0.8rem 1rem 1rem;
        gap: 0.5rem;
    }

    .blog-card-title {
        font-size: 1.1rem;
        line-height: 1.3;
    }

    .blog-card-excerpt {
        font-size: 0.9rem;
        line-height: 1.5;
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }

    .blog-card-image {
        margin-top: 0.5rem;
        border-radius: 6px;
    }

    .blog-card-footer {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .read-more {
        font-size: 0.9rem;
    }

    .views {
        font-size: 0.8rem;
    }

    .pagination {
        gap: 1rem;
        margin-top: 2rem;
    }

    .pagination-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }

    .pagination-info {
        font-size: 0.85rem;
    }

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

    .no-posts h3 {
        font-size: 1.2rem;
    }

    .no-posts p {
        font-size: 0.9rem;
    }

    .btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.9rem;
    }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .blog-grid {
        max-width: 100%;
        gap: 1.2rem;
        padding: 0 0.3rem;
    }

    .blog-card {
        border-radius: 10px;
    }

    .blog-card-header {
        padding: 0.6rem 0.8rem 0.2rem;
    }

    .blog-card-author {
        font-size: 0.8rem;
    }

    .blog-card-dates {
        font-size: 0.7rem;
    }

    .blog-card-main {
        padding: 0.6rem 0.8rem 0.8rem;
        gap: 0.4rem;
    }

    .blog-card-title {
        font-size: 1rem;
        line-height: 1.3;
    }

    .blog-card-excerpt {
        font-size: 0.85rem;
        line-height: 1.4;
        text-align: justify;
        text-justify: inter-word;
        hyphens: auto;
        -webkit-hyphens: auto;
        -ms-hyphens: auto;
    }

    .blog-card-image {
        margin-top: 0.3rem;
        border-radius: 4px;
    }

    .blog-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 0.4rem;
        margin-top: 0.4rem;
    }

    .read-more {
        text-align: center;
        font-size: 0.85rem;
        padding: 0.4rem 0;
    }

    .views {
        text-align: center;
        font-size: 0.75rem;
    }

    .pagination {
        flex-direction: column;
        gap: 0.8rem;
        margin-top: 1.5rem;
    }

    .pagination-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }

    .pagination-info {
        font-size: 0.8rem;
        order: -1;
    }

    .no-posts {
        padding: 1.5rem 0.8rem;
    }

    .no-posts h3 {
        font-size: 1rem;
    }

    .no-posts p {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
    }
}