/* ==== Faceted Browse LIST rows: force 3 columns and correct order ==== */
.faceted-browse-page ul.resource-list>li.item.resource {
    /* kill any old flex layout */
    display: grid !important;
    grid-auto-flow: column;
    /* thumb | content | button */
    grid-template-columns: 160px 1fr 160px !important;
    gap: 16px;
    align-items: flex-start;

    /* card chrome (optional; keep if you like) */
    padding: 16px;
    border: 1px solid #ececec;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .08);
}

/* Make sure children aren’t reordered by legacy rules */
.faceted-browse-page ul.resource-list>li.item.resource .resource__thumbnail,
.faceted-browse-page ul.resource-list>li.item.resource .resource__content,
.faceted-browse-page ul.resource-list>li.item.resource .resource__actions {
    order: 0 !important;
    /* defeats any old flex order */
    float: none !important;
    /* defeats float-based layouts */
}

/* Explicit column placement (defensive, in case source order varies) */
.faceted-browse-page ul.resource-list>li.item.resource .resource__thumbnail {
    grid-column: 1;
}

.faceted-browse-page ul.resource-list>li.item.resource .resource__content {
    grid-column: 2;
    min-width: 0;
}

.faceted-browse-page ul.resource-list>li.item.resource .resource__actions {
    grid-column: 3;
    align-self: stretch;          /* make the cell match the row height */
    justify-self: end;            /* stay at the right edge */
    display: flex;
    align-items: center;          /* now vertical-center inside the full-height cell */
   j ustify-content: flex-end;    /* keep content flushed right */
}

/* Neutralize the small thumbnail caps from base styles ONLY for list thumbs */
.faceted-browse-page ul.resource-list>li.item.resource .resource__thumbnail img {
    max-width: none !important;
    max-height: none !important;

    width: 160px !important;
    height: 250px !important;
    /* 2:3 frame */
    object-fit: cover !important;
    object-position: top !important;
    display: block;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.faceted-browse-page ul.resource-list > li.item.resource {
  align-items: stretch;
}

/* Middle column: text behavior */
.faceted-browse-page ul.resource-list>li.item.resource .resource-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.faceted-browse-page ul.resource-list>li.item.resource .resource-name:hover {
    text-decoration: underline;
}

.faceted-browse-page ul.resource-list>li.item.resource .description {
    font-size: .95rem;
    color: #4b5563;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    /* 2-line clamp */
    overflow: hidden;
    white-space: normal;
    margin-top: 2px;
}

/* Right button */
.faceted-browse-page ul.resource-list>li.item.resource .resource__actions .lexo-button {
    background: #394f68;
    color: #fff !important;
    padding: .6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

.faceted-browse-page ul.resource-list>li.item.resource .resource__actions .lexo-button:hover {
    background: #2d3b50;
}

/* Responsive: smaller thumb and stack actions under content */
@media (max-width: 900px) {
    .faceted-browse-page ul.resource-list>li.item.resource {
        grid-template-columns: 100px 1fr !important;
        gap: 12px;
        padding: 12px;
    }

    .faceted-browse-page ul.resource-list>li.item.resource .resource__thumbnail img {
        width: 100px !important;
        height: 140px !important;
    }

    .faceted-browse-page ul.resource-list>li.item.resource .resource__actions {
        grid-column: 1 / -1;
        justify-content: flex-start;
        margin-top: 8px;
    }
}