/* ============================================================================
   23-news-feed.css  (v11.592)
   Editorial-dark styling for the News Activity sub-tab (#activity-news-feed).
   Twitter cadence + an Instagram-clean card: true blacks, single lavender
   accent, Söhne type, 0.03em tracking, hairline dividers, no chrome.
   Dark-mode only (the app is dark-only going forward).
   ========================================================================== */

#activity-news-feed { font-family: 'Sohne', 'DM Sans', sans-serif; }

/* v11.594: the "What are you watching?" composer belongs to the Activity Feed
   only — hide it on the News sub-tab (Shared Watch hides it the same way in
   css/08-watch-together.css). */
#community-view.activity-subtab-news #feed-composer { display: none !important; }

.news-feed {
  position: relative;
  color: #f8f4ff;
  padding: 6px 0 0;
  overflow: visible;
}
.news-feed-body {
  display: flex;
  flex-direction: column;
  will-change: transform;
}

/* ---- Pull-to-refresh indicator (top) ---- */
.news-ptr {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 2;
  will-change: transform, opacity;
}
.news-ptr .news-spinner { width: 26px; height: 26px; }

/* ---- Circular loading spinner (lavender, app-consistent) ---- */
.news-spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid rgba(196, 181, 253, 0.22);
  border-top-color: #c4b5fd;
  box-sizing: border-box;
}
.news-spinner.is-spinning { animation: newsSpin 0.7s linear infinite; }
.news-ptr.is-ready .news-spinner { border-top-color: #ddd2ff; }
@keyframes newsSpin { to { transform: rotate(360deg); } }

/* ---- Category filter chips (horizontal scroll) ---- */
.news-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 14px;
  margin: 0 0 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  scrollbar-width: none;
}
.news-chips::-webkit-scrollbar { display: none; }
.news-chip {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.05);
  color: rgba(216, 208, 233, 0.72);
  border-radius: 999px;
  padding: 7px 14px;
  font: 500 13px/1 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}
.news-chip:active { transform: scale(0.96); }
.news-chip.active {
  background: rgba(167, 139, 250, 0.16);
  color: #ffffff;
  border-color: rgba(167, 139, 250, 0.42);
}

/* ---- Card list ---- */
.news-list { display: flex; flex-direction: column; }
/* virtual-scroll top spacer: reserves the height of pruned off-screen cards so
   the document height never changes during endless scroll (no scroll jump). */
.news-prune-spacer { flex: 0 0 auto; width: 100%; }

.news-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  animation: newsCardIn 0.34s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.news-card:active { background: rgba(255, 255, 255, 0.02); }

.news-card-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.news-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font: 500 12.5px/1 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
  color: #9990b3;
  min-width: 0;
}
.news-card-cat {
  color: #c4b5fd;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 600;
}
.news-card-source {
  color: #b8afd1;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.news-card-dot { color: rgba(216, 208, 233, 0.38); }
.news-card-time { color: rgba(255, 255, 255, 0.45); font-weight: 300; font-size: 12px; flex: 0 0 auto; }

.news-card-title {
  margin: 0;
  font: 500 16px/1.38 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0;
  color: #ffffff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-summary {
  margin: 0;
  font: 400 14.4px/1.5 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0;
  color: #f4f1fb;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-thumb {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  border-radius: 12px;
  overflow: hidden;
  background: #15121f;
}
.news-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---- Footer: infinite-scroll load spinner ---- */
.news-foot {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 0;
  padding: 0 0 36px;
}
.news-foot-load {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 0 10px;
}
.news-foot-load .news-spinner { animation: newsSpin 0.7s linear infinite; }

/* ---- Empty / error state ---- */
.news-empty {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-align: center;
  padding: 56px 18px;
}
.news-empty strong {
  color: #f8f4ff;
  font: 600 17px/1.3 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
}
.news-empty span {
  color: #9990b3;
  font: 400 14px/1.5 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0.03em;
  max-width: 320px;
  margin: 0 auto;
}

/* ---- Loading skeletons ---- */
.news-skel {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.news-skel-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 9px; padding-top: 2px; }
.news-skel-thumb { flex: 0 0 auto; width: 96px; height: 96px; border-radius: 12px; }
.news-skel-line { height: 12px; border-radius: 6px; }
.news-skel-line.short { width: 38%; height: 10px; }
.news-skel-line.mid { width: 64%; }
.news-skel-thumb,
.news-skel-line {
  background: linear-gradient(100deg, rgba(255,255,255,0.045) 30%, rgba(255,255,255,0.09) 50%, rgba(255,255,255,0.045) 70%);
  background-size: 200% 100%;
  animation: newsSkelShimmer 1.25s ease-in-out infinite;
}

@keyframes newsCardIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes newsSkelShimmer {
  0%   { background-position: 180% 0; }
  100% { background-position: -80% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .news-card { animation: none; }
  .news-skel-thumb, .news-skel-line { animation: none; }
}

/* v11.602: uniform 0 letter-spacing across ALL News-page content. Placed last
   so it's the single source of truth for tracking (overrides the per-element
   values above by source order — no !important needed). */
.news-feed,
.news-feed * { letter-spacing: 0; }
