/* ============================================================
   Сетка статей — 3 карточки в ряд
   /stati/ и все архивные страницы
   ============================================================ */

.stati-section {
    padding: 48px 0 72px;
    background: #f5f7fb;
    min-height: 60vh;
}

/* Заголовок раздела */
.stati-section .stati-heading {
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 800;
    color: #11172D !important;
    margin: 0 0 8px;
    line-height: 1.25;
    display: block;
    visibility: visible;
}

/* Убираем глобальный h1::after из wp-custom-css.css — для этого заголовка он не нужен */
.stati-section .stati-heading::after {
    content: none !important;
    border: none !important;
}

.stati-section .stati-subheading {
    font-size: 16px;
    color: #6b7a8d;
    margin: 0 0 28px;
}

/* ---- Фильтр по рубрикам ---- */
.stati-filter {
    margin-bottom: 32px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;          /* Firefox */
    -ms-overflow-style: none;       /* IE / Edge */
}

.stati-filter::-webkit-scrollbar {
    display: none;                  /* Chrome / Safari */
}

.stati-filter__list {
    display: flex;
    gap: 10px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
}

.stati-filter__pill {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Manrope', sans-serif;
    color: #11172D;
    background: #fff;
    border: 2px solid #dce6f0;
    border-radius: 50px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.25s ease;
    line-height: 1.4;
}

.stati-filter__pill:hover {
    color: #005CA5;
    border-color: #005CA5;
    background: rgba(0, 92, 165, 0.06);
}

.stati-filter__pill.is-active {
    color: #fff;
    background: #005CA5;
    border-color: #005CA5;
    cursor: default;
}

/* Обёртка-контейнер */
.stati-section .stati-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Сетка */
.stati-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}


/* ---- Карточка ---- */
.stati-card {
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 2px 16px rgba(0, 92, 165, 0.07);
    transition: box-shadow 0.28s ease, transform 0.28s ease;
    text-decoration: none;
}

.stati-card:hover {
    box-shadow: 0 10px 40px rgba(0, 92, 165, 0.16);
    transform: translateY(-5px);
}

/* Обложка */
.stati-card__thumb {
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #e8eff8;
    flex-shrink: 0;
}

.stati-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.35s ease;
}

.stati-card:hover .stati-card__thumb img {
    transform: scale(1.03);
}

/* Заглушка для постов без картинки */
.stati-card__nothumb {
    aspect-ratio: 16 / 9;
    flex-shrink: 0;
    background: linear-gradient(135deg, #005CA5 0%, #1871c9 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.stati-card__nothumb svg {
    opacity: 0.25;
}

/* Тело карточки */
.stati-card__body {
    padding: 22px 24px 26px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* Мета: категория + дата */
.stati-card__meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 13px;
}

.stati-card__cat {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #005CA5;
    background: rgba(0, 92, 165, 0.09);
    padding: 3px 10px;
    border-radius: 20px;
    white-space: nowrap;
    text-decoration: none;
}

.stati-card__cat:hover {
    background: rgba(0, 92, 165, 0.18);
    color: #005CA5;
}

.stati-card__date {
    font-size: 13px;
    color: #9eb0bf;
    white-space: nowrap;
}

/* Заголовок */
.stati-card__title {
    font-size: 17px;
    font-weight: 700;
    line-height: 1.42;
    margin: 0 0 12px;
    color: #11172D;
}

.stati-card__title a {
    color: inherit;
    text-decoration: none;
}

.stati-card__title a:hover {
    color: #005CA5;
}

/* Анонс */
.stati-card__excerpt {
    font-size: 14px;
    line-height: 1.7;
    color: #5a6b7b;
    margin: 0 0 22px;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Кнопка "Читать" */
.stati-card__link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 600;
    color: #005CA5;
    text-decoration: none;
    margin-top: auto;
    line-height: 1;
}

.stati-card__link svg {
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.stati-card__link:hover {
    color: #003d75;
}

.stati-card__link:hover svg {
    transform: translateX(4px);
}

/* ---- Пагинация ---- */
.stati-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 56px;
}

.stati-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 10px;
    border-radius: 9px;
    border: 2px solid #dce6f0;
    color: #11172D;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    background: #fff;
}

.stati-pagination .page-numbers:hover {
    background: #005CA5;
    border-color: #005CA5;
    color: #fff;
}

.stati-pagination .page-numbers.current {
    background: #005CA5;
    border-color: #005CA5;
    color: #fff;
    cursor: default;
}

.stati-pagination .page-numbers.dots {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

/* Невидимые спейсеры для выравнивания последнего ряда */
.stati-grid__spacer {
    display: block;
    visibility: hidden;
    pointer-events: none;
}

/* Если в последнем ряду 1 карточка — центрируем её */
.stati-grid--center-last .stati-card:last-of-type {
    grid-column: 2;
}

/* ---- Пустой список ---- */
.stati-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6b7a8d;
    font-size: 17px;
}

/* ---- Адаптив ---- */
@media (max-width: 1024px) {
    .stati-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 22px;
    }
}

/* На мобильном шапка фиксирована (~90px высота) — сдвигаем секцию вниз */
@media (max-width: 991.98px) {
    .stati-section {
        padding-top: 140px;
    }
}

@media (max-width: 640px) {
    .stati-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .stati-section {
        padding-bottom: 52px;
    }

    .stati-card__nothumb {
        aspect-ratio: 16 / 9;
        height: auto;
    }

    .stati-section .stati-subheading {
        margin-bottom: 20px;
    }

    .stati-filter {
        margin-bottom: 24px;
    }

    .stati-filter__list {
        flex-wrap: nowrap;
    }

    .stati-filter__pill {
        padding: 7px 16px;
        font-size: 13px;
    }
}
