/* ============================================================
   Feed (Контент) page — layout, masonry, empty state, live strip
   ============================================================ */

/* ---------- Layout ---------- */
.feed-page {
    padding-block: var(--space-5) var(--space-9);
}

.feed-page .page-title {
    margin-bottom: var(--space-5);
}

/* ---------- Header row: tabs (left) + filters (right) ---------- */
.feed-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    margin-bottom: var(--space-6);
    flex-wrap: wrap;
}

.feed-tabs {
    display: inline-flex;
}

/* ---------- Feed content fade-in on htmx swap ---------- */
.feed-anim {
    animation: fade-up 200ms var(--ease-out);
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .feed-anim {
        animation: none;
    }
}

/* ---------- Video / Stream grid ---------- */
.feed-grid {
    /* align-items defaults to stretch so cards in a row match height */
}

/* ---------- Posts / Boosty masonry (CSS multi-column, no JS) ----------
   Pure CSS columns fill top-to-bottom per column (column-major order). The
   container height is always the exact, browser-computed content height, so
   the load-more button and footer can never overlap mid-load — unlike a
   JS-measured grid whose height lags a frame behind inserted cards. Cards opt
   out of column breaks via `break-inside: avoid` (see post/boosty card CSS). */
.feed-masonry {
    columns: 3;
    column-gap: var(--space-5);
}
@media (max-width: 1024px) {
    .feed-masonry {
        columns: 2;
    }
}
@media (max-width: 640px) {
    .feed-masonry {
        columns: 1;
    }
}

/* JS-enhanced posts masonry: left-to-right reading order.
   `initFeedMasonry` places each card into the currently shortest flex column,
   so the order reads left-to-right (first row 1,2,3 …) instead of the
   column-major order CSS columns produce, while keeping column heights
   balanced. Heights stay browser-computed, so load-more can't overlap. */
.feed-masonry--cols {
    columns: auto;
    display: flex;
    align-items: flex-start;
    gap: var(--space-5);
}
.feed-masonry__col {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-5);
}
/* Column gap handles vertical spacing once enhanced. */
.feed-masonry--cols .post-card {
    margin-bottom: 0;
}

/* ---------- Empty state ---------- */
.feed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    padding: var(--space-8) var(--space-4);
    text-align: center;
}

.feed-empty__icon {
    width: 56px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    color: var(--text-faint);
    margin-bottom: var(--space-4);
    flex-shrink: 0;
}

.feed-empty__text {
    color: var(--text-muted);
    font-size: var(--fs-md);
    font-weight: 500;
    margin: 0;
}

/* ---------- Live strip (feed page) ---------- */
.live-strip {
    margin-bottom: var(--space-5);
    padding: var(--space-3) var(--space-4);
    background: var(--surface-2);
    border-radius: var(--r-lg);
}

.live-strip__inner {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.live-strip__label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--live);
    white-space: nowrap;
}

.live-strip__avatars {
    display: flex;
    gap: var(--space-2);
}

.live-strip__item {
    position: relative;
}

.live-strip__avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--r-full);
    object-fit: cover;
}

.live-strip__dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 10px;
    height: 10px;
    border-radius: var(--r-full);
    background: var(--live);
    border: 2px solid var(--surface-2);
}
