/* BSD Widgets - Grid */

.bsdw-grid {
    display: grid;
    grid-template-columns: repeat(var(--bsdw-grid-cols, 3), 1fr);
    gap: 1.25em;
}

@media (max-width: 900px) {
    .bsdw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .bsdw-grid {
        grid-template-columns: 1fr;
    }
}

.bsdw-grid__item {
    display: block;
    border: 1px solid #e2e6ea;
    border-radius: 4px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: #fff;
}

.bsdw-grid__image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
}

.bsdw-grid__body {
    padding: 0.9em 1em;
}

.bsdw-grid__title {
    font-weight: 600;
    margin-bottom: 0.35em;
}

.bsdw-grid__text {
    font-size: 0.92em;
    opacity: 0.85;
}

/* Masonry mode: items are absolutely positioned by js/grid-masonry.js */
.bsdw-grid--masonry {
    position: relative;
    display: block;
}

.bsdw-grid--masonry .bsdw-grid__item {
    position: absolute;
    top: 0;
    width: calc((100% - (var(--bsdw-grid-cols, 3) - 1) * 1.25em) / var(--bsdw-grid-cols, 3));
    transition: top 0.2s ease, left 0.2s ease;
}
