/* =========================
   Блок категории
========================= */
.category-block {
    max-width: 1400px;
    margin: 24px auto;
    padding: 20px 20px 30px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Заголовок категории */
.category-title {
    margin: 0 0 8px;
    font-size: 24px;
    color: #5a2b7a;
    text-align: left;
}

.category-title::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 4px;
    background: linear-gradient(90deg, #0057b7, #ffd700);
    border-radius: 2px;
}

/* =========================
   Фильтр городов
========================= */
.category-cities-filter {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: -30px 0 12px;
    max-width: 100%;
    overflow: hidden;
}

.cities-filter-label {
    width: 100%;
    text-align: center;
    font-size: 12px;
    color: #999;
    white-space: nowrap;
}

.cities-filter-list {
      display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    overflow-x: auto;
    max-width: 100%;
    padding-bottom: 8px;
    justify-content: flex-start;

    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  /* Safari fix */
    min-width: 0;              /* важно для flex-children */
    -webkit-overflow-scrolling: touch;
}

.cities-filter-list::-webkit-scrollbar {
    height: 4px;
}

.cities-filter-list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 4px;
}

.city-filter-btn {
    flex-shrink: 0;
    padding: 3px 8px;
    font-size: 13px;
    color: #555;
    border: 1px dashed #ccc;
    border-radius: 14px;
    text-decoration: none;
    white-space: nowrap;
    transition: all .2s ease;
}

.city-filter-btn:hover {
    color: #000;
    border-color: #777;
    background: #f7f7f7;
}

/* =========================
   Сетка новостей
========================= */
.cat-block {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

/* Карточки */
.cat-card {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease;
}

.cat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.08);
}

.cat-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.cat-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.cat-title {
    font-size: 18px;
    margin: 8px 12px 0;
    color: #333;
}

.cat-card-link:hover .cat-title {
    color: #5a2b7a;
    text-decoration: underline;
}

.cat-date {
    font-size: 14px;
    color: #666;
    margin: 4px 12px 12px;
}

/* =========================
   Разделительные линии
========================= */
.cat-card:not(:nth-child(3n))::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: -20px;
    width: 1px;
    background: linear-gradient(
        to bottom,
        rgba(90,43,122,0),
        rgba(90,43,122,.2) 50%,
        rgba(90,43,122,0)
    );
    pointer-events: none;
}

.cat-card:nth-child(n + 4)::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -20px;
    height: 1px;
    background: linear-gradient(
        to right,
        rgba(90,43,122,0),
        rgba(90,43,122,.2) 50%,
        rgba(90,43,122,0)
    );
    pointer-events: none;
}

/* =========================
   Пагинация
========================= */
.cat-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    margin-bottom: 20px;
    width: 100%;
}

.cat-pagination ul.page-numbers {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 0;
    gap: 10px;
    flex-wrap: wrap;
}

.cat-pagination ul.page-numbers li {
    display: flex;
}

.cat-pagination ul.page-numbers li a,
.cat-pagination ul.page-numbers li span {
    display: block;
    padding: 8px 14px;
    font-size: 16px;
    color: #5a2b7a;
    background: #f0f0f0;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.cat-pagination ul.page-numbers li a:hover {
    background: #5a2b7a;
    color: #fff;
}

.cat-pagination ul.page-numbers li span.current {
    background: #5a2b7a;
    color: #fff;
    pointer-events: none;
}
/* ===== Описание категории ===== */
.category-description {
    background-color: #f9f9f9;      /* Светлый фон */
    border-left: 4px solid #0073e6; /* Акцентная цветная полоска слева */
    padding: 20px 25px;             /* Внутренние отступы */
    font-size: 16px;                /* Удобный размер текста */
    line-height: 1.7;               /* Межстрочный интервал для читаемости */
    color: #333;                    /* Темный текст */
    border-radius: 8px;             /* Закругленные углы */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Лёгкая тень */
    transition: background-color 0.3s ease, transform 0.3s ease;
}

/* Подсветка при наведении */
.category-description:hover {
    background-color: #f1f5ff;      /* Лёгкое изменение фона */
    transform: translateY(-2px);    /* Небольшое поднятие при наведении */
}

/* Ссылки внутри описания */
.category-description a {
    color: #0073e6;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.category-description a:hover {
    color: #005bb5;
    text-decoration: none;
}


/* =========================
   Адаптив
========================= */
@media (max-width: 992px) {
    .cat-block {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    html, body {
        max-width: 100%;
        overflow-x: hidden;
    }

    .cat-block {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .cat-card::before,
    .cat-card::after {
        display: none;
    }

    .city-filter-btn {
        font-size: 12px;
        padding: 2px 6px;
    }

   .cat-pagination ul.page-numbers li a,
    .cat-pagination ul.page-numbers li span {
        padding: 6px 10px;
        font-size: 14px;
    }
}
