.sl-grid {
    display: grid;
    /* grid-template-columns will be handled by inline style or default */
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin: 20px 0;
    align-items: start; /* Чтобы карточки не растягивались по высоте самую высокую */
}

/* ЗАЩИТА ОТ ГЛЮКОВ: Скрываем все элементы сетки, которые НЕ являются нашими карточками.
   Это бывает, если WordPress создал пустые <p> или <br> внутри грида. */
.sl-grid > *:not(.sl-card) {
    display: none !important;
}

.sl-card {
    display: flex;
    flex-direction: column;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid #e2e2e2; /* Default border */
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: auto; /* Высота подстраивается под контент, убираем пустое место снизу */
    color: inherit;
    position: relative;
}

/* Эффекты наведения (Scale + Shadow) */
.sl-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 30px rgba(0,0,0,0.15);
    z-index: 2;
    /* Border color change on hover will be inline */
}

/* Верхняя часть с логотипом */
.sl-image-wrap {
    height: 200px;
    background-color: #fff;
    padding: 0;
    position: relative;
    border-bottom: 1px solid #f0f0f0;
    line-height: 0; /* Убирает возможные отступы от строчных элементов */
    display: block; /* Убираем Flex, чтобы картинка вела себя предсказуемо */
}

.sl-logo {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Заполняет все пространство */
    object-position: center top; 
    transition: transform 0.5s ease;
    display: block; /* Убираем нижний отступ у картинки */
}

.sl-card:hover .sl-logo {
    transform: scale(1.1); /* Эффективный зум */
}

.sl-no-logo {
    font-size: 48px;
    color: #ddd;
}

/* Контент */
.sl-content {
    padding: 12px 20px 20px 20px; /* Уменьшили верхний отступ с 20px до 12px */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
}

.sl-category {
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 8px;
    font-weight: 600;
}

.sl-title {
    margin: 0 0 10px 0 !important;
    font-size: 18px !important;
    font-weight: 700;
    line-height: 1.3;
    color: #333;
}

.sl-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin: 0;
}
