/* ============================================
   NBKM - Grid с колекции
   ============================================ */

/* Главен grid wrapper */
.block.block-html:has(img) > div {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin: 20px 0;
}

/* Всяка карта */
.block.block-html:has(img) > div > div {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.block.block-html:has(img) > div > div:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

/* Картинка - пълна без рязане */
.block.block-html:has(img) > div > div > div:first-child a {
    display: block;
}

.block.block-html:has(img) > div > div > div:first-child img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease;
}

.block.block-html:has(img) > div > div:hover img {
    transform: scale(1.05);
}

/* Текстова зона - заглавие */
.block.block-html:has(img) > div > div > div:last-child {
    padding: 12px 16px;
    text-align: center;
}

/* Заглавие */
.block.block-html:has(img) > div > div h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0;
    line-height: 1.4;
}

.block.block-html:has(img) > div > div h3 a {
    color: #1a1a1a;
    text-decoration: none;
}

.block.block-html:has(img) > div > div h3 a:hover {
    color: #8B0000;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
    .block.block-html:has(img) > div {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 540px) {
    .block.block-html:has(img) > div {
        grid-template-columns: 1fr;
    }
}
/* ============================================
   NBKM - Item grid - един ред текст
   ============================================ */

/* Еднаква височина на всички карти */
.item.resource {
    display: flex;
    flex-direction: column;
}

/* Заглавие - един ред с многоточие */
.resource__meta a {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Описание - скрито напълно */
.resource__meta .description.full {
    display: none;
}
/* Фиксирана височина на thumbnail - всички еднакви */
.resource__thumbnail a {
    display: block;
    overflow: hidden;
}

.resource__thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}