/*
 * The post rows inside the feed panel.
 *
 * The panel itself — the region, its divider, its header, its close button and its footer — is
 * assets/sidebar.css, shared with the chat. This is only what a post looks like, which is the feed's
 * equivalent of the .chat-row block in assets/style.css.
 */

/* The pane is absolutely positioned over the panel's body (see .side-pane), so it has to lay its own
   children out — otherwise the status line sits on top of the list instead of under it.

   `:not([hidden])` is not decoration. `.side-pane[hidden] { display: none }` in assets/sidebar.css has
   exactly the same specificity as this selector, and this file is loaded after that one, so without it
   this rule won the tie and gave every *inactive* pane `display: flex` — all three tabs' lists laid
   out on top of each other, with the hidden ones' status lines over the visible one's posts. */
.side-pane[data-kind="posts"]:not([hidden]) {
    display: flex;
    flex-direction: column;
}

.feed-list {
    flex: 1;
    /* Without this the list refuses to shrink below its content and scrolls the panel instead of
       itself, taking the header out of view with it. */
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    /* The scrollbar is a dark sliver rather than the browser's default light one, which reads as a
       bright stripe down the edge of a translucent panel. */
    scrollbar-width: thin;
    scrollbar-color: rgba(157, 78, 221, 0.4) transparent;
}

/* The whole row is the link, so the thumbnail is clickable too. */
.feed-post {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 9px;
    border: 1px solid transparent;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: background 0.18s ease, border-color 0.18s ease;
}

.feed-post:hover {
    background: rgba(157, 78, 221, 0.12);
    border-color: var(--card-hover-border);
}

/* 16:9, because that is what a video thumbnail is and most of these are videos. A fixed box rather
   than letting the image size itself: rows of different heights make the list impossible to scan, and
   a thumbnail that fails to load is removed entirely rather than collapsing the row by a few pixels. */
.feed-thumb {
    flex: 0 0 auto;
    width: 96px;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
}

.feed-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
    /* Without this the flex item refuses to shrink below its text and the row overflows the panel. */
    min-width: 0;
    flex: 1;
}

.feed-meta {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.68rem;
    color: var(--text-muted);
}

.feed-mark {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

/* Monochrome, like the chat's marks — see --platform-ink in assets/style.css. The glyph itself is
   built by feed.js with `fill="currentColor"`, which is what makes this rule do anything: without
   that attribute an inline svg path renders solid black whatever `color` says, and the mark was
   invisible against this panel. */
.feed-mark[data-provider] {
    color: var(--platform-ink);
}

.feed-platform {
    font-weight: 600;
}

/* Pushed to the far end of the row, so the dates line up down the list. */
.feed-when {
    margin-left: auto;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}

.feed-title {
    font-family: var(--font-heading);
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-main);
    /* Two lines, then an ellipsis: a long video title should not push the next post off the screen. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

.feed-excerpt {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}

/* A narrow panel has no room for a 96px thumbnail and two columns of text. */
@media (max-width: 420px) {
    .feed-thumb {
        width: 72px;
    }
}
