/* Forum "recent activity" preview (ForumActivityList, ActivityCard).

   A recent-activity row renders the raw body of a forum post into a small clamp box, so it needs its own
   rules: the full post styling in forum-post-content.css is far too heavy for a five line excerpt, and the
   excerpt has to survive whatever the rich text editor stored.

   Global rather than local because a client (WASM) component's scoped .razor.css never loads, and an in-body
   <style> misses the prerender first paint. Monday 12865922760. */

.forum-activity-preview {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 5; /* Desktop: 5 lines */
    word-break: break-word;
    position: relative;
}

/* Activity preview images */
.forum-activity-preview img {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    border-radius: 4px;
    margin: 0.25rem 0;
}

/* A table in the body is flattened into plain rows. Inside a few-lines-tall clamp box a real table lays its
   cells out as an unstyled grid: the text runs together and the excerpt reflows into something unreadable.
   Rows become blocks and cells become inline runs separated by a middot, which reads as ordinary prose. The
   real table styling lives in forum-post-content.css and still applies on the post itself. */
.forum-activity-preview table,
.forum-activity-preview thead,
.forum-activity-preview tbody,
.forum-activity-preview tr {
    display: block;
    width: auto;
    margin: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

/* The preview renders inside the post wrapper, so the post's own table rule reaches it, and its
   overflow: hidden made the flattened table a formatting context of its own: the line clamp stops counting
   lines at that boundary, so a long table showed every row and never got the truncated fade. Visible overflow
   puts the rows back in the preview's own flow. The radius and the fixed layout are the rest of that rule,
   undone because neither means anything on a table that is no longer laid out as one. */
.forum-activity-preview table {
    overflow: visible;
    border-radius: 0;
    table-layout: auto;
}

.forum-activity-preview tr {
    margin: 0 0 .15em;
}

.forum-activity-preview td,
.forum-activity-preview th {
    display: inline;
    padding: 0;
    border: 0;
    background: none;
}

.forum-activity-preview td:not(:last-child)::after,
.forum-activity-preview th:not(:last-child)::after {
    content: " \00B7 ";
    color: var(--mud-palette-text-secondary);
}

.forum-activity-preview th {
    font-weight: 600;
}

.forum-activity-preview p {
    margin: 0 0 .25em;
}

/* Mobile: fewer lines for better scrolling */
@media (max-width: 600px) {
    .forum-activity-preview {
        -webkit-line-clamp: 3; /* Mobile: 3 lines */
        font-size: 0.9rem;
    }

    .forum-activity-preview img {
        max-height: 100px;
    }
}
