/* =========================================
   1. НОВАЯ СЕТКА И КАРТОЧКИ (NEW DESIGN)
   ========================================= */

/* --- Сетка списка статей (Ширина) --- */
.blog-list-container {
    display: grid;
    /* ИЗМЕНЕНО: minmax(380px, 1fr) гарантирует ширину не менее 380px */
    grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 40px;
    margin-bottom: 60px;
}

/* --- Карточка статьи (Высота) --- */
.blog-card {
    background-color: var(--bg-light, #ffffff);
    border: 1px solid var(--border-card, #F0F0F0);
    border-radius: 24px;
    overflow: hidden; /* Важно: это обрезает синюю полоску снизу по форме карточки */
    display: flex;
    flex-direction: column;
    height: 100%;
    
    min-height: 620px;
    
    text-decoration: none;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0px 4px 40px rgba(0, 0, 0, 0.05);
    position: relative;
}

.blog-card::after {
    content: "";
    display: block;
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 12px; /* Высота полоски */
    background-color: var(--primary-blue, #0475D2);
    z-index: 2;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0px 10px 40px rgba(0, 0, 0, 0.08);
}

.blog-card__image-wrapper {
    /* Ширина остается с отступами (100% минус 48px) */
    width: calc(100% - 48px);
    
    /* ВЫСОТА: Уменьшена с 300px до 220px */
    height: 220px;
    
    /* Отступ сверху 24px */
    margin: 24px auto 0;
    
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    background-color: var(--bg-gray, #F3F4F6);
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card__image {
    transform: scale(1.03);
}
/* Контент карточки */
.blog-card__content {
    padding: 24px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Контейнер для тегов */
.blog-card__tags {
    margin-bottom: 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px; /* Отступы между плашками */
}

/* Стили самой плашки тега */
.blog-card__tag {
    /* Фон и рамка */
    background-color: #FFFFFF;
    border: 1px solid #DBDBDB; /* Светло-серая рамка */
    border-radius: 10px;       /* Скругление углов как на макете */
    
    /* Текст */
    color: #666666;            /* Темно-серый цвет текста */
    font-size: 14px;           /* Размер шрифта (чуть больше, чем было) */
    font-weight: 500;          /* Средняя жирность (не слишком жирный) */
    line-height: 1.2;
    
    /* Отступы внутри плашки */
    padding: 7px 14px;         /* Сверху/снизу 7px, слева/справа 14px */
    
    /* Дополнительно для красоты */
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* (Опционально) Эффект при наведении, если захотите оживить */
.blog-card__tag:hover {
    border-color: #0475D2;
    color: #0475D2;
}

/* Заголовок */
.blog-card__title {
    font-family: var(--font-main, 'Wix Madefor Display', sans-serif);
    font-size: 20px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--text-dark, #1a1a1a);
    margin: 0 0 16px 0;
}

/* Описание (анонс) */
.blog-card__desc {
    font-size: 16px;
    line-height: 1.5;
    color: var(--text-gray, #666666);
    margin-bottom: 24px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Ограничение по строкам */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card__read-more {
    color: var(--primary-blue, #0475D2);
    font-weight: 600;
    text-decoration: none;
    margin-left: 5px;
}

/* Нижняя часть (дата) */
.blog-card__footer {
    margin-top: auto;
    border-top: 1px solid var(--border-light, #EAEAEA);
    padding-top: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.blog-card__date {
    font-size: 14px;
    color: var(--primary-blue, #0475D2);
    font-weight: 500;
}

/* =========================================
   2. НОВАЯ ПАГИНАЦИЯ (NEW PAGINATION)
   ========================================= */

.mp-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 50px;
    margin-bottom: 40px;
}

.mp-pagination {
    display: flex;
    align-items: center;
    gap: 12px; /* Расстояние между блоком цифр и стрелками */
}

/* Общие стили для стрелок и контейнера цифр */
.mp-page-arrow,
.mp-pagination-numbers {
    height: 48px; /* Высота элементов */
    border: 1px solid var(--border-light, #EAEAEA);
    border-radius: 12px;
    background-color: #fff;
    box-sizing: border-box;
}

/* Стили для стрелок (Назад / Вперед) */
.mp-page-arrow {
    width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dark, #1a1a1a);
    font-size: 20px;
    line-height: 1;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    user-select: none;
}

.mp-page-arrow:hover {
    border-color: var(--primary-blue, #0475D2);
    color: var(--primary-blue, #0475D2);
    background-color: #fff;
}

/* Если стрелка отключена (например, на 1 странице нет кнопки назад) */
.mp-page-arrow.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: default;
}

/* Контейнер для цифр (длинный блок) */
.mp-pagination-numbers {
    display: flex;
    align-items: center;
    padding: 0 10px;
    gap: 5px;
}

/* Ссылки с цифрами */
.mp-page-link {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--text-dark, #1a1a1a);
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mp-page-link:hover {
    background-color: var(--bg-gray, #F3F4F6);
    color: var(--primary-blue, #0475D2);
}

/* Активная страница (Синий квадрат) */
.mp-page-link.active {
    background-color: var(--primary-blue, #0475D2);
    color: #ffffff;
}

.mp-page-link.active:hover {
    background-color: var(--hover-blue, #0061B0);
    color: #ffffff;
}

/* Троеточие (...) */
.mp-page-dots {
    color: var(--text-gray, #666);
    padding: 0 5px;
    font-size: 16px;
    line-height: 1;
}

/* Адаптив для новой пагинации */
@media (max-width: 576px) {
    .mp-pagination {
        gap: 8px;
    }
    .mp-page-arrow, .mp-pagination-numbers {
        height: 40px;
    }
    .mp-page-arrow {
        width: 40px;
    }
    .mp-page-link {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}

/* Адаптив сетки */
@media (max-width: 768px) {
    .blog-list-container {
        grid-template-columns: 1fr; /* Одна колонка на мобильном */
        gap: 20px;
    }
    
    .blog-card__image-wrapper {
        height: 200px;
    }
}