/* spec 040 — the news feed.
   ONE card shape for every kind of news: strip → connector → the subject's own card.

   Everything here is written with LOGICAL properties (inline-start/end, margin-inline) so the layout
   mirrors itself under dir=rtl without a single direction-specific rule. The connector is deliberately
   VERTICAL for the same reason — a diagonal arrow would need mirroring, and that is exactly the kind of
   thing that breaks silently in one language only. */

.news-wrap { margin-inline: auto; max-width: 760px; }

/* ── "There is new news" (§1) ──────────────────────────────────────────────── */
.news-new { margin: 12px 0 0; }
.news-new > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  border: 1px solid var(--mm-line-2, rgba(255, 255, 255, .2));
  color: var(--mm-text, #e8ecf5);
  font-size: .84rem;
  text-decoration: none;
}
.news-new > a:hover { background: rgba(255, 255, 255, .14); }
/* The idle placeholder keeps the poll alive and must take no space at all. */
.news-new-idle { display: none; }

/* ── The two tabs (ق٤) ─────────────────────────────────────────────────────── */
.news-tabs {
  display: flex;
  gap: 4px;
  margin: 14px 0 2px;
  border-bottom: 1px solid var(--mm-line, rgba(255, 255, 255, .08));
}
.news-tab {
  padding: 9px 14px;
  font-size: .88rem;
  color: var(--mm-muted, #8b93a7);
  text-decoration: none;
  /* A single-sided accent, so no corner rounding here (a rounded one-sided border reads as a glitch). */
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.news-tab:hover { color: var(--mm-text, #e8ecf5); }
.news-tab.is-active {
  color: var(--mm-text, #e8ecf5);
  border-bottom-color: currentColor;
  font-weight: 600;
}

/* ── Filter chips (rule 5) ─────────────────────────────────────────────────── */
.news-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--mm-line, rgba(255, 255, 255, .1));
  background: rgba(255, 255, 255, .04);
  color: var(--mm-muted, #8b93a7);
  font-size: .82rem;
  text-decoration: none;
  white-space: nowrap;
}
.news-chip:hover { border-color: var(--mm-line-2, rgba(255, 255, 255, .2)); color: var(--mm-text, #e8ecf5); }
.news-chip.is-active {
  background: rgba(255, 255, 255, .1);
  border-color: rgba(255, 255, 255, .24);
  color: var(--mm-text, #e8ecf5);
}

/* ── Cold start (rule 6) ───────────────────────────────────────────────────── */
.news-cold { margin: 20px 0 10px; }
.news-cold-h { margin: 0; font-weight: 700; }
.news-cold-s { margin: 4px 0 0; font-size: .84rem; color: var(--mm-muted, #8b93a7); }

/* ── Day separator ─────────────────────────────────────────────────────────── */
.news-day {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 26px 0 14px;
  color: var(--mm-muted, #8b93a7);
  font-size: .78rem;
  letter-spacing: .02em;
}
.news-day::before,
.news-day::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--mm-line, rgba(255, 255, 255, .08));
}
.news-day > span { white-space: nowrap; }

/* ── One news item ─────────────────────────────────────────────────────────── */
.news-item { margin-bottom: 22px; }

/* ── The strip: what happened ──────────────────────────────────────────────── */
.news-strip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 600;
  line-height: 1.4;
  /* The colour ROLE is set per kind below; these are the shared defaults. */
  background: rgba(255, 255, 255, .06);
  color: var(--mm-text, #e8ecf5);
  border: 1px solid transparent;
}
.news-strip-ico { display: inline-flex; font-size: 1rem; }
.news-strip-txt { min-width: 0; }

/* The colour is a REINFORCEMENT, never the only signal — the icon and the sentence carry the meaning,
   so the strip still reads correctly in monochrome and for a colour-blind reader. */
.news-strip--shop     { background: rgba(52, 199, 123, .14); color: #6ee7a8; border-color: rgba(52, 199, 123, .28); }
.news-strip--product  { background: rgba(139, 124, 246, .14); color: #b3a6ff; border-color: rgba(139, 124, 246, .28); }
.news-strip--offer    { background: rgba(86, 156, 240, .14); color: #93c0ff; border-color: rgba(86, 156, 240, .28); }
.news-strip--deal     { background: rgba(240, 174, 66, .15); color: #f5c778; border-color: rgba(240, 174, 66, .30); }
.news-strip--question { background: rgba(255, 255, 255, .07); color: #c3cbdc; border-color: rgba(255, 255, 255, .12); }
/* Urgency outranks the kind: an expiring card wears this instead of its own role, because "you have hours
   left" matters more to the reader than "this is a deal". Warmer + stronger than every other role on purpose. */
.news-strip--urgent   { background: rgba(226, 75, 74, .16); color: #f79b9a; border-color: rgba(226, 75, 74, .34); }

/* A speech bubble with a "?" inside it — a bare question mark reads as "help" almost everywhere. */
.news-q { position: relative; display: inline-flex; }
.news-q-mark {
  position: absolute;
  inset-block-start: 47%;
  inset-inline-start: 50%;
  transform: translate(-50%, -50%);
  font-size: .62rem;
  font-weight: 700;
  line-height: 1;
  color: #0f1420;
}
[dir="rtl"] .news-q-mark { transform: translate(50%, -50%); }

/* ── The connector ─────────────────────────────────────────────────────────── */
.news-link {
  inline-size: 2px;
  block-size: 16px;
  margin-inline-start: 22px;
  background: var(--mm-line, rgba(255, 255, 255, .14));
}

/* ── The subject's own card(s) ─────────────────────────────────────────────── */
.news-cards { display: grid; gap: 10px; }
.news-cards--grid { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

.news-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  text-decoration: none;
  color: inherit;
  min-inline-size: 0;
}
.news-cards--grid .news-card { flex-direction: column; align-items: stretch; }

.news-thumb {
  inline-size: 56px;
  block-size: 56px;
  flex: none;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(255, 255, 255, .04);
}
.news-cards--grid .news-thumb { inline-size: 100%; block-size: 92px; }
.news-thumb img { inline-size: 100%; block-size: 100%; object-fit: cover; display: block; }

.news-body { display: flex; flex-direction: column; gap: 3px; min-inline-size: 0; }
.news-title {
  font-weight: 600;
  font-size: .9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.news-sub { font-size: .76rem; color: var(--mm-muted, #8b93a7); }

.news-more {
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: .82rem;
  color: var(--mm-muted, #8b93a7);
}

.news-pager { display: flex; justify-content: center; margin: 22px 0 8px; }

@media (max-width: 560px) {
  .news-cards--grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .news-strip { font-size: .82rem; }
}
