/* ============ БАЗА ЗНАНИЙ BAXI ============ */
.wiki-page .bc {
    border-bottom: 1px solid #e6e6e6;
    padding-bottom: 22px;
    margin-bottom: 26px;
}

/* --- Панель: поиск + теги --- */
.wiki-toolbar {
    border-bottom: 1px solid #e6e6e6;
    padding-bottom: 26px;
}
.wiki-search {
    max-width: 480px;
    margin-bottom: 22px;
}
.wiki-search input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    border-bottom: 1px solid #c7ced4;
    background: transparent;
    padding: 10px 2px;
    font-size: 16px;
    color: #333;
    outline: none;
    transition: border-color .25s ease;
}
.wiki-search input::placeholder { color: #9aa4ac; }
.wiki-search input:focus { border-color: #00549f; }

.wiki-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.wiki-tag {
    display: inline-block;
    padding: 10px 22px;
    border: 1px solid #d7dde2;
    border-radius: 26px;
    background: #fff;
    color: #4c5a66;
    font-size: 15px;
    line-height: 1.2;
    text-decoration: none;
    transition: all .25s ease;
}
.wiki-tag:hover {
    border-color: #00549f;
    color: #00549f;
}
.wiki-tag.active {
    background: #00549f;
    border-color: #00549f;
    color: #fff;
}

/* --- Сетка карточек: линии рамками карточек, пустая область ряда — белая --- */
.wiki-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    background: #fff;               /* пустые ячейки ряда теперь белые */
    border-bottom: 1px solid #e6e6e6;
    margin-top: 0;
}
.wiki-card {
    display: flex;
    flex-direction: column;
    min-height: 210px;
    padding: 28px 26px 24px;
    background: #fff;
    text-decoration: none;
    transition: background .25s ease;
    border-top: 1px solid #e6e6e6;   /* горизонтальные линии */
    border-left: 1px solid #e6e6e6;  /* вертикальные линии между колонками */
}
.wiki-card:nth-child(4n + 1) { border-left: none; } /* без внешней линии слева */
/* последняя карточка неполного ряда — закрываем блок линией справа */
.wiki-card:last-child:not(:nth-child(4n)) { border-right: 1px solid #e6e6e6; }
.wiki-card:hover { background: #f2f7fb; }

.wiki-card__date {
    color: #8b959c;
    font-size: 14px;
}
.wiki-card__title {
    margin: 12px 0 18px;
    color: #1c2b36;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .25s ease;
}
.wiki-card:hover .wiki-card__title { color: #0072bc; }

/* рубрики внизу карточки — компактные плашки */
.wiki-card__tags {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.wiki-card__tag {
    background: #e9eef3;
    color: #5e7181;
    border-radius: 5px;
    padding: 4px 10px;
    font-size: 12px;
    line-height: 1.25;
    white-space: nowrap;
}

/* --- Пустой результат --- */
.wiki-empty {
    padding: 60px 0 80px;
    text-align: center;
    color: #7a8790;
    font-size: 17px;
    line-height: 1.6;
}
.wiki-empty__reset {
    display: inline-block;
    margin-top: 14px;
    color: #00549f;
    text-decoration: none;
    border-bottom: 1px solid rgba(0, 84, 159, .35);
}
.wiki-empty__reset:hover { border-bottom-color: transparent; }

/* --- Адаптив: перестроение линий под число колонок --- */
@media (max-width: 1200px) {
    .wiki-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .wiki-card:nth-child(4n + 1) { border-left: 1px solid #e6e6e6; }
    .wiki-card:nth-child(3n + 1) { border-left: none; }
    .wiki-card:last-child:not(:nth-child(4n)) { border-right: none; }
    .wiki-card:last-child:not(:nth-child(3n)) { border-right: 1px solid #e6e6e6; }
}
@media (max-width: 900px) {
    .wiki-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .wiki-search { max-width: 100%; }
    .wiki-card:nth-child(4n + 1),
    .wiki-card:nth-child(3n + 1) { border-left: 1px solid #e6e6e6; }
    .wiki-card:nth-child(2n + 1) { border-left: none; }
    .wiki-card:last-child:not(:nth-child(4n)),
    .wiki-card:last-child:not(:nth-child(3n)) { border-right: none; }
    .wiki-card:last-child:not(:nth-child(2n)) { border-right: 1px solid #e6e6e6; }
}
@media (max-width: 600px) {
    .wiki-grid { grid-template-columns: 1fr; }
    .wiki-tags { gap: 8px; }
    .wiki-tag { padding: 8px 16px; font-size: 14px; }
    .wiki-card { padding: 22px 18px 20px; min-height: 0; border-left: none; }
    .wiki-card:last-child:not(:nth-child(2n)) { border-right: none; }
    .wiki-card__tag { font-size: 11px; padding: 3px 8px; }
}