/* Member post feed - /forums/user/N/posts/ (minibb#62, 2026-09-22).
   Built by bb_func_userposts.php, linked only on that page through
   $extra_css. Colours come from default.css tokens, the same set
   css/user_profile.css takes, so dark mode is that file's
   [data-theme="dark"] block plus the pairs below and nothing here writes a
   second dark selector for anything the tokens already cover.

   The page has no script at all. Expanding a post is a checkbox: the per-card
   .ufeed-x sits before the body, #ufeed-all sits before the list, and both are
   read with ~ . That is why "Развернуть все" costs nothing - it used to be one
   HTTP request per post. */

.ufeed {
    --ufd-card: var(--cell-bg-1);
    --ufd-line: var(--border-color);
    --ufd-muted: var(--secondary-text);
    --ufd-accent: var(--link-color);
    --ufd-soft: color-mix(in srgb, var(--link-color) 11%, transparent);
    --ufd-band: var(--tb-surface);
    --ufd-btn-bg: #775454;
    --ufd-btn-ink: #FFFFFF;
    --ufd-online: var(--ok);

    display: flex;
    flex-direction: column;
    gap: 14px;
    box-sizing: border-box;
    width: 95%;
    max-width: 1400px;
    margin: 6px auto 24px;
    color: var(--text-color);
    font-size: 15px;
    line-height: 1.45;
}

[data-theme="dark"] .ufeed {
    --ufd-btn-bg: #bb8f8f;
    --ufd-btn-ink: #1a1a1a;
}

.ufeed a { color: var(--ufd-accent); text-decoration: none; }
.ufeed a:hover { text-decoration: underline; }
.ufeed h1 { margin: 0; }

/* The two state checkboxes. Kept in the layout and focusable - a hidden
   input takes no keyboard focus, and then the only way to open a post is a
   mouse. They are 1px and transparent, and the label they drive shows the
   focus ring. */
.ufeed-allx,
.ufeed-x {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    margin: 0;
    pointer-events: none;
}

/* ---- identity strip ----
   The compact half of the profile hero: who this is, in four numbers, with
   the way back. The avatar is drawn at 52px from an 80px file - every
   uploaded avatar is 80x80 at most (minibb#59). */
.ufeed-id {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    background: var(--ufd-card);
    border: 1px solid var(--ufd-line);
    border-radius: 14px;
    padding: 12px 16px;
}
.ufeed-avatar-wrap { flex: none; display: block; line-height: 0; }
.ufeed-avatar {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    display: block;
}
.ufeed-avatar-letter {
    display: grid;
    place-items: center;
    font-size: 24px;
    font-weight: 600;
    color: #fff;
    line-height: 1;
}
.ufeed-hue-0 { background: #8a5a5a; }
.ufeed-hue-1 { background: #5a7a8a; }
.ufeed-hue-2 { background: #6b7d4f; }
.ufeed-hue-3 { background: #8a6f3f; }
.ufeed-hue-4 { background: #6d5a8a; }
.ufeed-hue-5 { background: #4f7d6d; }
.ufeed-hue-6 { background: #8a4f6b; }
.ufeed-hue-7 { background: #5d6b7d; }

.ufeed-idmain { flex: 1 1 260px; min-width: 0; }
.ufeed-name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ufeed-name { font-size: 21px; font-weight: 600; line-height: 26px; letter-spacing: -0.01em; }

.ufeed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    line-height: 18px;
    border-radius: 999px;
    white-space: nowrap;
}
.ufeed-chip-rank { padding: 3px 10px; font-weight: 600; background: var(--ufd-soft); color: var(--ufd-accent); }
.ufeed-chip-mood { padding: 2px 10px 2px 3px; border: 1px solid var(--ufd-line); color: var(--ufd-muted); }
.ufeed-chip-mood img { border-radius: 50%; }

.ufeed-seen { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ufd-muted); }
.ufeed-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ufd-online); }

.ufeed-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 3px; font-size: 13px; color: var(--ufd-muted); }
.ufeed-stats b { color: var(--text-color); font-weight: 600; font-variant-numeric: tabular-nums; }

.ufeed-idactions { display: flex; gap: 8px; flex-wrap: wrap; margin-left: auto; }
.ufeed-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ufd-line);
    border-radius: 9px;
    padding: 7px 13px;
    font-size: 13.5px;
    color: var(--ufd-accent);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
}
.ufeed-btn:hover { border-color: var(--ufd-accent); text-decoration: none; }

/* ---- tools ---- */
.ufeed-tools { display: flex; flex-direction: column; gap: 10px; }
.ufeed-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ufeed-search input[type="search"] {
    flex: 1 1 240px;
    min-width: 0;
    background: var(--ufd-card);
    border: 1px solid var(--ufd-line);
    border-radius: 9px;
    padding: 8px 12px;
    font: inherit;
    font-size: 14px;
    color: var(--text-color);
}
.ufeed-search input[type="search"]:focus { outline: 2px solid var(--ufd-accent); outline-offset: 1px; }
.ufeed-sbtn {
    border: 0;
    border-radius: 9px;
    padding: 9px 16px;
    font: inherit;
    font-size: 14px;
    background: var(--ufd-btn-bg);
    color: var(--ufd-btn-ink);
    cursor: pointer;
}
.ufeed-clear { font-size: 13px; color: var(--ufd-muted); }

.ufeed-fchips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ufeed-fchip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid var(--ufd-line);
    border-radius: 999px;
    padding: 4px 12px;
    font-size: 13px;
    color: var(--ufd-muted);
    white-space: nowrap;
}
.ufeed-fchip span { font-variant-numeric: tabular-nums; opacity: .7; font-size: 12px; }
.ufeed-fchip:hover { border-color: var(--ufd-accent); text-decoration: none; }
.ufeed-fchip-on { background: var(--ufd-soft); border-color: color-mix(in srgb, var(--link-color) 38%, transparent); color: var(--ufd-accent); font-weight: 600; }
.ufeed-fmore { display: inline-block; }
.ufeed-fmore summary { cursor: pointer; font-size: 13px; color: var(--ufd-muted); padding: 4px 8px; list-style: none; }
.ufeed-fmore summary::-webkit-details-marker { display: none; }
.ufeed-fmore[open] { display: block; width: 100%; }
.ufeed-fmore .ufeed-fchips { margin-top: 8px; }

.ufeed-count { margin: 0; font-size: 13px; color: var(--ufd-muted); font-variant-numeric: tabular-nums; }

/* ---- the cards ---- */
.ufeed-list { display: flex; flex-direction: column; gap: 10px; }
.ufeed-post {
    position: relative;
    background: var(--ufd-card);
    border: 1px solid var(--ufd-line);
    border-radius: 14px;
    padding: 12px 16px 10px;
}
.ufeed-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.ufeed-sec {
    font-size: 12px;
    color: var(--ufd-muted);
    border: 1px solid var(--ufd-line);
    border-radius: 999px;
    padding: 1px 9px;
    white-space: nowrap;
}
.ufeed-title { font-weight: 600; font-size: 15px; color: var(--text-color); }
.ufeed-title:hover { color: var(--ufd-accent); }
.ufeed-time { margin-left: auto; font-size: 12.5px; color: var(--ufd-muted); white-space: nowrap; }

.ufeed-body { overflow-wrap: anywhere; }
/* Only the responsive pair, and deliberately nothing else. A max-height here
   squashed pictures: the stored post HTML sizes many images with width/height
   attributes, and clamping the height while width stays auto keeps the old
   width - a 1400px book grid came back the right height and the wrong shape.
   A post that is one big picture stays one big picture; the height clamp on
   this page is on the CARD, by how much text there is. */
.ufeed-body img { max-width: 100%; height: auto; }
.ufeed-body .quote {
    border-left: 2px solid var(--ufd-line);
    padding: 2px 0 2px 10px;
    margin: 0 0 8px;
    color: var(--ufd-muted);
    font-size: 14px;
}

/* Clamped, not truncated: the whole post is in the page, so opening it is a
   style change rather than a request. The mask is a gradient over the card's
   own background, which is why it is a token and not a literal colour. */
.ufeed-clamped { max-height: 7.5em; overflow: hidden; position: relative; }
.ufeed-clamped::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 2.4em;
    background: linear-gradient(to bottom, transparent, var(--ufd-card));
    pointer-events: none;
}
.ufeed-x:checked ~ .ufeed-body.ufeed-clamped,
.ufeed-allx:checked ~ .ufeed-list .ufeed-body.ufeed-clamped { max-height: none; }
.ufeed-x:checked ~ .ufeed-body.ufeed-clamped::after,
.ufeed-allx:checked ~ .ufeed-list .ufeed-body.ufeed-clamped::after { display: none; }

.ufeed-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.ufeed-more { font-size: 13px; color: var(--ufd-accent); cursor: pointer; user-select: none; }
.ufeed-more:hover { text-decoration: underline; }
.ufeed-more-off { display: none; }
.ufeed-x:checked ~ .ufeed-foot .ufeed-more-on,
.ufeed-allx:checked ~ .ufeed-list .ufeed-more-on { display: none; }
.ufeed-x:checked ~ .ufeed-foot .ufeed-more-off,
.ufeed-allx:checked ~ .ufeed-list .ufeed-more-off { display: inline; }
.ufeed-x:focus-visible ~ .ufeed-foot .ufeed-more,
.ufeed-allx:focus-visible ~ .ufeed-id .ufeed-allbtn { outline: 2px solid var(--ufd-accent); outline-offset: 3px; border-radius: 4px; }

.ufeed-all-off { display: none; }
.ufeed-allx:checked ~ .ufeed-id .ufeed-all-on { display: none; }
.ufeed-allx:checked ~ .ufeed-id .ufeed-all-off { display: inline; }

.ufeed-react {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12.5px;
    color: var(--ufd-muted);
    border: 1px solid var(--ufd-line);
    border-radius: 999px;
    padding: 1px 9px 1px 5px;
    font-variant-numeric: tabular-nums;
}
.ufeed-open { margin-left: auto; font-size: 12.5px; color: var(--ufd-muted); }
.ufeed-open:hover { color: var(--ufd-accent); }

.ufeed-empty { padding: 28px 16px; text-align: center; color: var(--ufd-muted); }

/* ---- pager ---- */
.ufeed-pager { display: flex; gap: 6px; align-items: center; justify-content: center; flex-wrap: wrap; padding: 6px 0 2px; }
.ufeed-pg {
    min-width: 34px;
    text-align: center;
    border: 1px solid var(--ufd-line);
    border-radius: 9px;
    padding: 5px 9px;
    font-size: 13.5px;
    color: var(--ufd-muted);
    font-variant-numeric: tabular-nums;
}
.ufeed-pg:hover { border-color: var(--ufd-accent); text-decoration: none; }
.ufeed-pg-cur { background: var(--ufd-soft); border-color: color-mix(in srgb, var(--link-color) 38%, transparent); color: var(--ufd-accent); font-weight: 600; }
.ufeed-pg-gap { border: 0; min-width: 0; padding: 5px 2px; }
.ufeed-pgof { width: 100%; text-align: center; font-size: 12.5px; color: var(--ufd-muted); margin-top: 2px; }

@media (max-width: 720px) {
    .ufeed { width: 100%; padding: 0 8px; gap: 12px; }
    .ufeed-id { padding: 12px; gap: 12px; }
    .ufeed-idactions { margin-left: 0; width: 100%; }
    .ufeed-btn { flex: 1 1 auto; justify-content: center; }
    .ufeed-name { font-size: 19px; }
    .ufeed-post { padding: 11px 13px 9px; border-radius: 12px; }
    .ufeed-time { margin-left: 0; width: 100%; }
}
