/* ============================================================
   FinToolbox — News Feed (tool-specific)
   Ported from /design-reference/styles.css (.news-* block).
   Global styles (.card .tb-seg .chip .tag .page-tool .sticky-rail …)
   live in /css/styles.css.
   ============================================================ */

/* Source favicon glyph + thumbnail */
.news-favi {
  border-radius: 4px;
  display: inline-grid;
  place-items: center;
  font-weight: 800;
  letter-spacing: -0.02em;
  flex-shrink: 0;
}
.news-thumb {
  width: 92px; height: 92px;
  border-radius: 10px;
  display: grid; place-items: center;
  flex-shrink: 0;
  color: #fff; font-weight: 800; font-size: 26px;
}
.news-thumb-img {
  width: 92px; height: 92px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

/* Vote pill */
.news-vote {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  user-select: none;
}
.news-vote.v {
  flex-direction: column;
  padding: 4px 2px;
  min-width: 36px;
  height: fit-content;
}
.vote-btn {
  background: transparent;
  border: 0;
  width: 28px; height: 24px;
  display: grid; place-items: center;
  color: var(--text-3);
  border-radius: 5px;
  cursor: pointer;
  transition: color 0.12s, background 0.12s;
}
.vote-btn.up:hover { color: var(--green); background: var(--green-soft); }
.vote-btn.down:hover { color: var(--red); background: var(--red-soft); }
.vote-score {
  font-size: 13px; font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  min-width: 22px; text-align: center;
  padding: 2px 0;
}
.news-vote.up .vote-score, .news-vote.up .vote-btn.up { color: var(--green); }
.news-vote.up .vote-btn.up { background: var(--green-soft); }
.news-vote.down .vote-score, .news-vote.down .vote-btn.down { color: var(--red); }
.news-vote.down .vote-btn.down { background: var(--red-soft); }

/* Filter bar */
.news-filterbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}

/* List + cards */
.news-list { display: flex; flex-direction: column; gap: 12px; }
.news-card {
  display: grid;
  grid-template-columns: auto 92px 1fr;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.12s;
}
.news-card:hover { border-color: var(--text-4); }
.news-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.news-meta {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; color: var(--text-3);
  flex-wrap: wrap;
}
.news-source { font-weight: 600; color: var(--text-2); }
.news-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-title:hover { color: var(--green); }
.news-excerpt {
  margin: 2px 0 4px;
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-actions {
  display: flex; align-items: center; gap: 4px;
  flex-wrap: wrap;
}
.news-action {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 500;
  color: var(--text-3);
  padding: 5px 8px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-decoration: none;
}
.news-action:hover { background: var(--card-2); color: var(--text); }

/* Sources sidebar */
.news-sources { list-style: none; padding: 0; margin: 0; }
.news-source-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line-soft);
}
.news-source-row:last-child { border-bottom: 0; }
.news-source-row:hover { background: var(--card-2); }

/* Suggest modal */
.news-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 300;
  display: grid; place-items: center;
  padding: 20px;
}
.news-modal {
  width: 100%; max-width: 500px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0,0,0,0.6);
  padding: 22px;
}
.news-modal-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.news-modal-head h2 { margin: 0; font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.news-field { display: flex; flex-direction: column; gap: 5px; }
.news-field > span:first-child { font-size: 12px; font-weight: 600; color: var(--text-2); }
.news-field input, .news-field textarea, .news-field select {
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 11px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  width: 100%;
}
.news-field input:focus, .news-field textarea:focus, .news-field select:focus {
  border-color: var(--green);
  background: var(--bg-elev);
}
.news-field textarea { resize: vertical; min-height: 70px; }
.news-hint { font-size: 11px; }

/* Load more */
.news-more { align-self: center; }

/* Demo-data badge (mirrors .fg-demo-badge) */
.news-demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 10.5px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 8px; border-radius: 4px;
  background: var(--yellow-soft); color: var(--yellow);
}

/* Mobile: drop the thumbnail, keep vote + body */
@media (max-width: 640px) {
  .news-card { grid-template-columns: auto 1fr; }
  .news-thumb, .news-thumb-img { display: none; }
  .news-title { font-size: 15px; }
}
