/* ============================================================================
   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: block;
  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 {
  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;
}

/* ---- Per-card share button (sits at the right edge of the meta row, so the
   image stays the visually-last element of the card). The heart carries the
   margin-left:auto so the heart + share pair sits flush at the top-right. ---- */
.news-card-heart,
.news-card-share {
  flex: 0 0 auto;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 50%;
  color: rgba(216, 208, 233, 0.55);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}
.news-card-heart { margin-left: auto; }
.news-card-share { margin-right: -4px; }
.news-card-share svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.news-card-share:active { transform: scale(0.9); color: #c4b5fd; background: rgba(196, 181, 253, 0.12); }

/* Heart / bookmark — outline by default, fills red when bookmarked, pops on tap. */
.news-card-heart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; transition: fill 160ms ease, stroke 160ms ease; }
.news-card-heart:active { transform: scale(0.9); }
.news-card-heart.is-bookmarked { color: #ff3040; }
.news-card-heart.is-bookmarked svg { fill: #ff3040; stroke: #ff3040; }
.news-card-heart.heart-pop svg { animation: newsHeartPop 0.45s cubic-bezier(0.34, 1.56, 0.64, 1); }
@keyframes newsHeartPop {
  0%   { transform: scale(1); }
  30%  { transform: scale(1.4); }
  55%  { transform: scale(0.9); }
  100% { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .news-card-heart.heart-pop svg { animation: none; }
}

/* ---- Card image — full width, UNDERNEATH the title + description (last in the
   card). Natural aspect ratio of the source (≈16:9 typical); only very tall
   portraits get capped + cover-cropped so one image can't dominate the feed. ---- */
.news-card-media {
  width: 100%;
  margin-top: 14px;
  border-radius: 14px;
  overflow: hidden;
  background: #15121f;
  line-height: 0;
}
.news-card-media img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: cover;
}

/* ---- 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 (vertical: text lines, then a 16:9 media block) ---- */
.news-skel {
  display: block;
  padding: 18px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.news-skel-main { display: flex; flex-direction: column; gap: 9px; }
.news-skel-media { width: 100%; aspect-ratio: 16 / 9; border-radius: 14px; margin-top: 14px; }
.news-skel-line { height: 12px; border-radius: 6px; }
.news-skel-line.short { width: 38%; height: 10px; }
.news-skel-line.mid { width: 64%; }
.news-skel-media,
.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-media, .news-skel-line { animation: none; }
}

/* ---- Category swipe (anywhere-horizontal swipe between chips) ---- */
/* Clip the off-screen incoming/outgoing pages so they never trigger a horizontal
   scrollbar or bleed past the screen edges (mirrors body.discover-hub-swiping). */
/* `clip` (Safari 16+) clips horizontally WITHOUT turning <body> into a scroll
   container — so the window's vertical scroll model is untouched; `hidden` is the
   fallback for older WebKit. */
body.news-feed-swiping { overflow-x: hidden; overflow-x: clip; }
body.news-feed-swiping [data-news-list],
body.news-feed-swiping .news-swipe-incoming {
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}
.news-swipe-incoming { -webkit-overflow-scrolling: touch; }
.news-swipe-incoming-list { display: flex; flex-direction: column; }
/* the incoming layer is appended to <body> (viewport-fixed), OUTSIDE .news-feed,
   so the blanket ".news-feed *" tracking reset below doesn't reach it — re-apply. */
.news-swipe-incoming,
.news-swipe-incoming * { letter-spacing: 0; }
.news-swipe-incoming .news-card { animation: none; }   /* no entrance pop on preview cards */

/* 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; }

/* ============================================================================
   v11.646 — FOLLOWING: Tailor chip, per-card follow button, Following empty
   states, and the Tailor (manage) bottom sheet. Editorial-dark, single lavender
   accent. ========================================================================= */

/* Tailor chip (always last in the chip row) — opens the manage sheet. */
.news-chip-tailor {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #c4b5fd;
  border-color: rgba(167, 139, 250, 0.30);
}
.news-chip-tailor svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }

/* Per-card follow (the + / ✓ next to heart + share). Carries the right-push so
   follow + heart + share sit flush at the meta row's right edge. */
.news-card-follow {
  flex: 0 0 auto;
  margin-left: auto;
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: 0;
  padding: 4px;
  border-radius: 50%;
  color: rgba(216, 208, 233, 0.5);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 150ms ease, background 150ms ease, transform 150ms ease;
}
.news-card-follow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.news-card-follow:active { transform: scale(0.9); }
.news-card-follow.is-following { color: #a78bfa; }
.news-card-meta .news-card-follow ~ .news-card-heart { margin-left: 4px; }

/* Following empty / call-to-action. */
.news-empty-cta {
  margin-top: 8px;
  align-self: center;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  background: #a78bfa;
  color: #0c0a14;
  font: 600 13.5px/1 'Sohne', 'DM Sans', sans-serif;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease, background 150ms ease;
}
.news-empty-cta:active { transform: scale(0.97); background: #b9a6fb; }

/* ---- Tailor (manage) bottom sheet ---- */
html.news-manage-lock, html.news-manage-lock body { overflow: hidden; }
.news-manage-root { position: fixed; inset: 0; z-index: 5000; }
.news-manage-backdrop {
  position: absolute; inset: 0;
  background: rgba(4, 3, 10, 0.62);
  opacity: 0;
  transition: opacity 300ms ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.news-manage-root.is-open .news-manage-backdrop { opacity: 1; }
.news-manage-sheet {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #16131f, #0c0a13);
  border-top: 1px solid rgba(167, 139, 250, 0.18);
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -18px 50px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 340ms cubic-bezier(0.22, 1, 0.36, 1);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  font-family: 'Sohne', 'DM Sans', sans-serif;
  letter-spacing: 0;
}
.news-manage-root.is-open .news-manage-sheet { transform: translateY(0); }
.news-manage-grip { width: 38px; height: 4px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); margin: 10px auto 4px; flex: 0 0 auto; }
.news-manage-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 6px 18px 13px; border-bottom: 1px solid rgba(255, 255, 255, 0.06); flex: 0 0 auto; }
.news-manage-title { margin: 0; font: 600 19px/1.2 'Sohne', 'DM Sans', sans-serif; color: #ffffff; }
.news-manage-tag { margin: 4px 0 0; font: 400 13px/1.4 'Sohne', 'DM Sans', sans-serif; color: rgba(216, 208, 233, 0.6); }
.news-manage-close {
  flex: 0 0 auto; appearance: none; -webkit-appearance: none; border: 0;
  background: rgba(255, 255, 255, 0.06); color: #d8d0e9;
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease, background 150ms ease;
}
.news-manage-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.news-manage-close:active { transform: scale(0.92); }
.news-manage-body { overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 18px 28px; }
.news-manage-section + .news-manage-section { margin-top: 24px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.news-manage-h3 { margin: 0 0 3px; font: 600 16px/1.2 'Sohne', 'DM Sans', sans-serif; color: #ffffff; }
.news-manage-sub { margin: 0 0 13px; font: 400 12.8px/1.45 'Sohne', 'DM Sans', sans-serif; color: rgba(216, 208, 233, 0.55); }
.news-manage-subhead { margin: 16px 0 9px; font: 600 11px/1 'Sohne', 'DM Sans', sans-serif; text-transform: uppercase; letter-spacing: 0.08em; color: #9a8ec8; }
.news-manage-none { font: 400 13px/1.4 'Sohne', 'DM Sans', sans-serif; color: rgba(216, 208, 233, 0.5); }

.news-topic-add { display: flex; gap: 8px; margin-bottom: 12px; }
.news-topic-input {
  flex: 1 1 auto; min-width: 0; appearance: none; -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04);
  color: #ffffff; border-radius: 12px; padding: 11px 14px;
  font: 400 14px/1 'Sohne', 'DM Sans', sans-serif;
}
.news-topic-input::placeholder { color: rgba(216, 208, 233, 0.4); }
.news-topic-input:focus { outline: none; border-color: rgba(167, 139, 250, 0.5); background: rgba(167, 139, 250, 0.06); }
.news-topic-addbtn {
  flex: 0 0 auto; appearance: none; -webkit-appearance: none; border: 0; border-radius: 12px;
  padding: 0 18px; background: #a78bfa; color: #0c0a14;
  font: 600 13.5px/1 'Sohne', 'DM Sans', sans-serif; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: transform 150ms ease;
}
.news-topic-addbtn:active { transform: scale(0.96); }

.news-manage-yours { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 2px; }
.news-yourchip {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(167, 139, 250, 0.16); border: 1px solid rgba(167, 139, 250, 0.4); color: #ede9ff;
  border-radius: 999px; padding: 7px 8px 7px 13px; font: 500 13px/1 'Sohne', 'DM Sans', sans-serif;
}
.news-yourchip-x {
  appearance: none; -webkit-appearance: none; border: 0; background: rgba(255, 255, 255, 0.1); color: #ede9ff;
  width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent;
}
.news-yourchip-x svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }

.news-suggest-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.news-suggest-chip {
  display: inline-flex; align-items: center; gap: 5px; appearance: none; -webkit-appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.12); background: rgba(255, 255, 255, 0.04); color: rgba(244, 241, 251, 0.9);
  border-radius: 999px; padding: 8px 13px 8px 10px; font: 500 13px/1 'Sohne', 'DM Sans', sans-serif;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 150ms ease, border-color 150ms ease, color 150ms ease, transform 150ms ease;
}
.news-suggest-chip:active { transform: scale(0.96); }
.news-suggest-ind { display: inline-flex; align-items: center; justify-content: center; }
.news-suggest-ind svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.news-suggest-chip.is-following { background: rgba(167, 139, 250, 0.18); border-color: rgba(167, 139, 250, 0.45); color: #ffffff; }

.news-outlet-list { display: flex; flex-direction: column; gap: 8px; }
.news-outlet-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  appearance: none; -webkit-appearance: none; border: 1px solid rgba(255, 255, 255, 0.09); background: rgba(255, 255, 255, 0.03);
  border-radius: 14px; padding: 13px 15px; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}
.news-outlet-row:active { transform: scale(0.99); }
.news-outlet-name { font: 500 14.5px/1 'Sohne', 'DM Sans', sans-serif; color: #f4f1fb; }
.news-outlet-pill {
  flex: 0 0 auto; font: 600 12px/1 'Sohne', 'DM Sans', sans-serif; color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.4); border-radius: 999px; padding: 6px 13px; transition: all 150ms ease;
}
.news-outlet-row.is-following { background: rgba(167, 139, 250, 0.10); border-color: rgba(167, 139, 250, 0.3); }
.news-outlet-row.is-following .news-outlet-pill { background: #a78bfa; color: #0c0a14; border-color: #a78bfa; }

@media (prefers-reduced-motion: reduce) {
  .news-manage-sheet, .news-manage-backdrop { transition: none; }
}
