.content-preview {
    max-height: 150px; /* restrict preview height */
    overflow: hidden; /* cut off overflowing content */
    position: relative;
}

.content-preview img {
    max-width: 100% !important; /* force them to fit the container width */
    height: auto !important; /* keep aspect ratio */
    max-height: 100% !important; /* optional: cap height to avoid huge images */
    object-fit: contain; /* shrink inside box */
    display: block;
    margin: 0 auto; /* center images */
}
.content-preview table {
    max-width: 100%; /* tables don’t overflow */
    display: block;
    overflow-x: auto; /* scroll if too wide */
}

.content-preview::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px; /* fade effect */
    background: linear-gradient(to top, white, transparent);
}
