/* Task 88 — اسلایدر اخبار صفحهٔ اصلی + صفحهٔ جزئیات خبر
   فقط متغیرهای تم سایت (تیره/روشن)؛ بدون وابستگی خارجی و بدون بلور سنگین. */

/* ── اسلایدر صفحهٔ اصلی ─────────────────────────────────────────── */
.news-slider { padding: 84px 0 64px; }

.ns-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

.ns-nav { display: flex; gap: 10px; }

.ns-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: border-color 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.ns-arrow:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

.ns-arrow:disabled { opacity: 0.35; cursor: default; }

.ns-viewport {
  overflow: hidden;
  padding: 6px 2px 4px;
  touch-action: pan-y;
}

.ns-track {
  display: flex;
  gap: 20px;
  transition: transform 0.55s cubic-bezier(0.22, 0.8, 0.3, 1);
  will-change: transform;
}

.ns-card {
  flex: 0 0 calc((100% - 40px) / 3);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.ns-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent);
  box-shadow: var(--shadow);
  color: var(--text);
}

.ns-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-elevated);
}

.ns-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s ease;
}

.ns-card:hover .ns-media img { transform: scale(1.045); }

.ns-chip {
  position: absolute;
  top: 12px;
  inset-inline-start: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  backdrop-filter: none;
}

.ns-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 18px 18px;
  flex: 1;
}

.ns-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.7;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(2 * 1.7em);
}

.ns-summary {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.8;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ns-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 0.76rem;
  color: var(--text-dim);
  margin-top: 2px;
}

.ns-more {
  margin-top: auto;
  padding-top: 8px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--accent);
}

.ns-dots {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin-top: 26px;
}

.ns-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: var(--border-strong);
  cursor: pointer;
  transition: width 0.3s ease, background 0.3s ease;
}

.ns-dot.is-active { width: 26px; background: var(--accent); }

/* ── صفحهٔ جزئیات خبر (/news/<id>) ─────────────────────────────── */
.nd-page { padding: 72px 0 90px; }

.nd-container { max-width: 860px; }

.nd-crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-bottom: 22px;
}

.nd-crumbs a { color: var(--text-muted); text-decoration: none; }
.nd-crumbs a:hover { color: var(--accent); }

.nd-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 4vw, 40px);
}

.nd-head { margin-bottom: 18px; }

.nd-chip {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  margin-bottom: 14px;
}

.nd-title {
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  line-height: 1.6;
  margin: 0 0 14px;
}

.nd-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: 0.82rem;
  color: var(--text-dim);
}

.nd-meta svg {
  width: 14px;
  height: 14px;
  vertical-align: -2px;
  margin-inline-end: 4px;
}

/* Task 91 — نشان «در حال ترجمهٔ خودکار» در جزئیات خبر */
.nd-translating {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 600;
  padding: 2px 11px;
}

.nd-translating svg {
  width: 13px;
  height: 13px;
}

.nd-spin {
  animation: nd-spin 1s linear infinite;
}

@keyframes nd-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .nd-spin { animation: none; }
}

.nd-figure {
  margin: 0 0 22px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}

.nd-figure img { width: 100%; display: block; max-height: 460px; object-fit: cover; }

.nd-lead {
  font-size: 1.02rem;
  line-height: 2.1;
  font-weight: 600;
  color: var(--text);
  background: var(--accent-soft);
  border-inline-start: 3px solid var(--accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 18px;
}

.nd-body p {
  margin: 0 0 14px;
  font-size: 0.95rem;
  line-height: 2.15;
  color: var(--text-muted);
}

.nd-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
}

.nd-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  color: var(--text);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  transition: border-color 0.25s ease, color 0.25s ease, background 0.25s ease;
}

.nd-btn:hover { border-color: var(--accent); color: var(--accent); }

.nd-btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.nd-btn--primary:hover { color: #fff; filter: brightness(1.08); }

.nd-related { margin-top: 54px; }

.nd-related h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.nd-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.nd-rel-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.nd-rel-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  color: var(--text);
}

.nd-rel-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-elevated); }

.nd-rel-media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.nd-rel-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  padding: 12px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.8;
}

/* ── ریسپانسیو ──────────────────────────────────────────────────── */
@media (max-width: 1023px) {
  .ns-card { flex: 0 0 calc((100% - 20px) / 2); }
}

@media (max-width: 679px) {
  .news-slider { padding: 64px 0 48px; }
  .ns-head { flex-direction: column; align-items: stretch; }
  .ns-nav { align-self: flex-end; margin-top: -46px; }
  .ns-card { flex: 0 0 100%; }
  .ns-title { font-size: 0.95rem; }
  .nd-page { padding: 48px 0 70px; }
  .nd-actions .nd-btn { flex: 1 1 auto; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  .ns-track { transition: none; }
  .ns-card, .ns-card:hover .ns-media img, .ns-arrow, .nd-rel-card { transition: none; }
}
