/* Flex “grid” */
.spec-grid {
    --spec-gap: 18px;
    --spec-per-row: 3;

    display: flex;
    flex-wrap: wrap;
    gap: var(--spec-gap);
    align-items: stretch;
}

/* 3 per row using flex-basis */
.spec-grid__item {
    flex: 0 0 calc((100% - (var(--spec-gap) * (var(--spec-per-row) - 1))) / var(--spec-per-row));
    min-width: 200px;
}

/* Card */
.spec-grid__card {
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

/* Image */
.spec-grid__imageLink {
    display: flex;
    justify-content: center;
    display: block;
    text-decoration: none;
}

.spec-grid__img {
    width: 100%;
    height: 350px!important;
    object-fit: cover;
    display: block;
}

.spec-grid__img--placeholder {
    background: #eef6f4;
}

/* Body */
.spec-grid__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1 1 auto;
}

.spec-grid__name {
    font-family: "Bree Serif", Sans-serif;
    margin: 0;
    font-size: 1.3rem;
    line-height: 1.2;
    font-weight: 600;
}

.spec-grid__name a {
    color: inherit;
    text-decoration: none;
}

.spec-grid__name a:hover {
    text-decoration: underline;
}

/* Tags */
.spec-grid__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.spec-grid__tag {
    display: inline-flex;
    padding: 6px 10px;
    border-radius: 999px;
    background: #a8c7c1;
    color: #0e2b26;
    font-size: 0.95rem;
    line-height: 1;
    font-weight: 400;
}

/* Short desc */
.spec-grid__desc {
    font-size: 0.95rem;
    line-height: 1.45;
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    line-clamp: 4;
}

/* Button */
.spec-grid__actions {
    margin-top: auto;
}

.spec-grid__btn {
    font-family: "Bree Serif", Sans-serif;
    display: inline-block;
    padding: 10px 14px;
    border-radius: 12px;
    background: #2b6f66;
    color: #fff;
    text-decoration: none;
    font-weight: 400;
    font-size: 0.95rem;
}

.spec-grid__btn:hover {
    opacity: 0.92;
}

/* Responsive fallback */
@media (max-width: 1024px) {
    .spec-grid__item {
        flex: 0 0 calc((100% - var(--spec-gap)) / 2);
    }
}

@media (max-width: 640px) {
    .spec-grid__item {
        flex: 1 1 100%;
        min-width: 0;
    }
    .spec-grid__img {
        height: 200px;
    }
}
