/* Feed v2: tabs, order, trending tags, folded posts, the "new posts" pill. The base look is the existing .sk-panel-flat card. */

.feed-bar-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.feed-sort { display: inline-flex; gap: 2px; }
.feed-sort-btn { padding: 6px 11px; border: 0; border-radius: 9px; background: transparent; color: var(--g-500); font-size: 13px; font-weight: 500; cursor: pointer; transition: color var(--sk-dur-fast), background var(--sk-dur-fast); }
.feed-sort-btn:hover { color: var(--g-200); }
.feed-sort-btn[data-active="true"] { color: var(--g-50); background: rgba(255,255,255,.07); }
.feed-sort[data-thumb="on"] .feed-sort-btn[data-active="true"] { background: transparent; }
.feed-sort > .sk-thumb { background: rgba(255,255,255,.07); box-shadow: none; }

.feed-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; }
.feed-tags-label { margin-right: 4px; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--g-500); }
.feed-tag { padding: 3px 10px; border: 0; border-radius: 999px; background: var(--g-800); box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); color: var(--g-300); font-size: 12.5px; cursor: pointer; transition: background var(--sk-dur-fast), color var(--sk-dur-fast); }
.feed-tag:hover { color: var(--g-50); }
.feed-tag b { margin-left: 6px; font-weight: 600; color: var(--g-500); }
.feed-tag[data-active="true"] { background: rgba(255,106,31,.16); box-shadow: inset 0 0 0 1px rgba(255,106,31,.62); color: var(--signal-hi); }
.feed-tag[data-active="true"] b { color: var(--signal-hi); }

/* long posts are folded to six lines */
.feed-clamp { display: -webkit-box; -webkit-line-clamp: 6; -webkit-box-orient: vertical; overflow: hidden; }
.feed-fold { margin-top: 4px; padding: 0; border: 0; background: none; color: var(--signal-hi); font-size: 12.5px; font-weight: 500; cursor: pointer; }
.feed-fold:hover { text-decoration: underline; text-underline-offset: 3px; }
.feed-link { color: var(--signal-hi); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.feed-link:hover { color: #ffa064; }

.feed-earlier, .feed-reply { padding: 0; border: 0; background: none; font-size: 12px; color: var(--g-500); cursor: pointer; }
.feed-earlier { color: var(--signal-hi); font-weight: 500; text-align: left; }
.feed-reply:hover { color: var(--g-200); }
.feed-earlier:hover { text-decoration: underline; text-underline-offset: 3px; }

/* a post lit up after it was found by a link, or just published */
@keyframes feedFlash { 0% { box-shadow: inset 0 0 0 2px rgba(255,106,31,.9); } 100% { box-shadow: inset 0 0 0 2px rgba(255,106,31,0); } }
.feed-flash { animation: feedFlash 2s ease-out; }

/* posts that arrived while the reader was far down */
.feed-newpill { position: fixed; top: 76px; left: 50%; z-index: 35; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border: 0; border-radius: 999px; background: var(--lit); color: var(--signal-ink); font-size: 13px; font-weight: 600; box-shadow: var(--sh-lit), 0 8px 22px rgba(0,0,0,.5); cursor: pointer; animation: feedPill .22s var(--sk-ease-out); }
.feed-newpill:hover { background: var(--lit-hover); }
@keyframes feedPill { from { opacity: 0; transform: translate(-50%, -10px); } to { opacity: 1; transform: translate(-50%, 0); } }
@media (min-width: 768px) { .feed-newpill { left: calc(50% + 128px); } }

.feed-shared { padding-left: 12px; border-left: 3px solid var(--signal); }
.feed-shared-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.feed-more { display: flex; justify-content: center; padding: 14px 0 2px; }

@media (prefers-reduced-motion: reduce) { .feed-flash, .feed-newpill { animation: none !important; } }

/* ---- the composer, docked at the bottom of the screen -------------------------------------------------------
   One quiet line while the feed scrolls under it; it opens up (counter, hint, room to grow) when you write. */
.feed-dock { position: sticky; bottom: 0; z-index: 25; margin-top: 12px; padding: 22px 0 max(12px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(14,14,16,0) 0%, var(--canvas) 38%); pointer-events: none; }
.feed-dock-card { pointer-events: auto; position: relative; padding: 9px 10px 9px 12px; border-radius: 18px; background: var(--plate);
  box-shadow: var(--sh-plate), 0 0 0 1px var(--hair-2), 0 -10px 30px -12px rgba(0,0,0,.65); transition: box-shadow var(--sk-dur-base) var(--sk-ease-standard); }
.feed-dock[data-open="true"] .feed-dock-card { box-shadow: var(--sh-plate), 0 0 0 1px rgba(255,106,31,.5), 0 -12px 34px -12px rgba(0,0,0,.7); }
.feed-dock-row { display: flex; align-items: flex-end; gap: 10px; }
.feed-dock-avatar { flex-shrink: 0; padding-bottom: 4px; }
.feed-dock-input { flex: 1; min-width: 0; resize: none; overflow: hidden; line-height: 1.5; padding: 10px 14px; border-radius: 14px; font-size: 14px; color: var(--g-100); }
.feed-dock-input::placeholder { color: var(--g-500); }
.feed-dock-attach { flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: 12px;
  background: transparent; color: var(--g-500); cursor: pointer; transition: color var(--sk-dur-fast), background var(--sk-dur-fast); }
.feed-dock-attach:hover { color: var(--signal-hi); background: rgba(255,255,255,.06); }
.feed-dock-send { flex-shrink: 0; height: 40px; padding: 0 16px; border-radius: 12px; }
.feed-dock-meta { display: none; justify-content: space-between; gap: 12px; padding: 6px 4px 0 52px; font-size: 11.5px; color: var(--g-500); }
.feed-dock[data-open="true"] .feed-dock-meta { display: flex; }
.feed-dock-preview { position: relative; display: inline-block; margin: 2px 0 10px 48px; }
.feed-dock-preview img { max-height: 120px; border-radius: 10px; object-fit: cover; }
.feed-dock-x { position: absolute; top: -7px; right: -7px; display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 0; border-radius: 50%;
  background: var(--key); color: var(--g-200); box-shadow: var(--sh-key); cursor: pointer; }

/* phone: no avatar, the send key is just an arrow */
@media (max-width: 640px) {
  .feed-dock-avatar { display: none; }
  .feed-dock-meta { padding-left: 4px; }
  .feed-dock-send { width: 40px; padding: 0; }
  .feed-dock-send-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
/* a toast must not sit on top of the dock's send key */
body:has(.feed-dock) .sk-toast-stack { bottom: 92px; }
@media (prefers-reduced-motion: reduce) { .feed-dock-card { transition: none; } }
