/* SysaiQ — AI & tech news (/:lang/news, /:lang/news/:slug).
   Loaded after pages.css on news pages only; reuses its tokens (--mint,
   --violet, --panel, --line, --body…), .card, .crumbs, .eyebrow, .cta-box.
   Covers are brand art per category (inline SVG + gradients) — never a
   source image. Logical properties only; no letter-spacing on Persian. */

.page-news, .nw-article {
  --nw-models: #8b6bff;
  --nw-tools: #7dffd9;
  --nw-devices: #7db8ff;
  --nw-tech: #b9a8ff;
  --nw-industry: #ffc46b;
}
.page-news::before, .nw-article::before {
  content: ""; position: absolute; inset-inline: 0; inset-block-start: 0; height: 420px; pointer-events: none; z-index: -1;
  background: radial-gradient(120% 80% at 50% -10%, rgba(139, 107, 255, .10), transparent 55%);
}
.page-news, .nw-article { position: relative; isolation: isolate; }

/* ---- head + filters ---- */
.nw-head { margin-block-end: 36px; }
.nw-head .sub { margin-block-end: 26px; }
.nw-filters { display: flex; flex-wrap: wrap; gap: 10px; }
.nw-chip {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 18px;
  border: 1px solid var(--line); background: var(--panel); border-radius: 100px;
  font-size: 13.5px; color: var(--dim); transition: color .2s, border-color .2s, background .2s;
}
.nw-chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--nw-dot, var(--grad)); opacity: .9; }
.nw-chip:hover { color: var(--ink); border-color: rgba(236, 234, 246, .24); }
.nw-chip:focus-visible, .nw-card:focus-visible, .nw-cat:focus-visible { outline: 2px solid var(--mint); outline-offset: 2px; }
.nw-chip[aria-current="page"] { color: var(--ink); border-color: transparent; background: linear-gradient(var(--panel), var(--panel)) padding-box, var(--grad) border-box; border: 1px solid transparent; }
.nw-k-models { --nw-dot: var(--nw-models); }
.nw-k-tools { --nw-dot: var(--nw-tools); }
.nw-k-devices { --nw-dot: var(--nw-devices); }
.nw-k-tech { --nw-dot: var(--nw-tech); }
.nw-k-industry { --nw-dot: var(--nw-industry); }

/* ---- grid + cards ---- */
.nw-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.nw-card { color: var(--ink); text-decoration: none; min-width: 0; }
.nw-card-body { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px 24px; flex: 1; }
.nw-title { font-size: 18px; font-weight: 500; line-height: 1.45; margin: 0; letter-spacing: -.005em; }
[dir="rtl"] .nw-title { letter-spacing: 0; line-height: 1.75; font-size: 17px; }
.nw-sum { color: var(--body); font-size: 14px; line-height: 1.75; margin: 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
[dir="rtl"] .nw-sum { line-height: 1.9; }
.nw-more { margin-block-start: auto; padding-block-start: 6px; font-size: 13px; color: var(--mint); font-style: normal; }
.nw-card:hover .nw-title { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.nw-lead { grid-column: span 2; }
.nw-lead .nw-cover { aspect-ratio: 16 / 7; }
.nw-lead .nw-title { font-size: clamp(20px, 2.2vw, 26px); font-weight: 400; }
[dir="rtl"] .nw-lead .nw-title { font-size: clamp(19px, 2vw, 24px); }

.nw-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin: 0; font-size: 12.5px; color: var(--dim); }
.nw-cat {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px; border-radius: 100px;
  border: 1px solid var(--line); background: rgba(236, 234, 246, .03); color: var(--ink); font-size: 12px;
}
.nw-cat::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--nw-dot, var(--mint)); }
a.nw-cat:hover { border-color: rgba(236, 234, 246, .28); }

/* ---- covers: one design per category ---- */
.nw-cover {
  position: relative; aspect-ratio: 16 / 9; overflow: hidden; isolation: isolate;
  background: #0a0f1c; border-block-end: 1px solid var(--line); color: var(--nw-ink, var(--mint));
}
.nw-cover::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(70% 90% at 18% 12%, var(--nw-g1, rgba(139, 107, 255, .40)), transparent 62%),
    radial-gradient(60% 80% at 88% 92%, var(--nw-g2, rgba(125, 255, 217, .22)), transparent 60%),
    linear-gradient(160deg, #0c1222, #070a12);
}
.nw-cover::after {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .5;
  background-image: linear-gradient(rgba(236, 234, 246, .05) 1px, transparent 1px), linear-gradient(90deg, rgba(236, 234, 246, .05) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%);
  mask-image: radial-gradient(80% 80% at 50% 50%, #000 30%, transparent 80%);
}
.nw-cover svg { position: absolute; inset: 0; width: 100%; height: 100%; stroke-width: 1.2; opacity: .9; transition: transform .8s cubic-bezier(.2, .6, .2, 1); }
.nw-card:hover .nw-cover svg { transform: scale(1.06); }
.nw-cover-tag {
  position: absolute; inset-block-end: 12px; inset-inline-start: 14px; font-size: 9.5px; letter-spacing: .22em;
  color: rgba(236, 234, 246, .55); unicode-bidi: isolate;
}
.nw-c-models { --nw-ink: #b9a8ff; --nw-g1: rgba(139, 107, 255, .45); --nw-g2: rgba(125, 255, 217, .20); }
.nw-c-tools { --nw-ink: #7dffd9; --nw-g1: rgba(125, 255, 217, .30); --nw-g2: rgba(125, 184, 255, .24); }
.nw-c-devices { --nw-ink: #7db8ff; --nw-g1: rgba(125, 184, 255, .34); --nw-g2: rgba(139, 107, 255, .30); }
.nw-c-tech { --nw-ink: #c9bcff; --nw-g1: rgba(185, 168, 255, .30); --nw-g2: rgba(125, 255, 217, .16); }
.nw-c-industry { --nw-ink: #ffc46b; --nw-g1: rgba(255, 196, 107, .26); --nw-g2: rgba(139, 107, 255, .30); }
.nw-cover-lg { aspect-ratio: 21 / 9; border: 1px solid var(--line); border-radius: 16px; margin-block: 8px 36px; }

/* ---- pager + feed link ---- */
.nw-pager { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 16px; margin-block: 44px 10px; }
.nw-pager > :last-child { justify-self: end; }
.nw-pageof { font-size: 13px; color: var(--dim); }
.nw-feed { margin-block: 36px 0; font-size: 12.5px; color: var(--faint); display: flex; gap: 8px; align-items: center; }
.nw-feed a { color: var(--dim); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; }
.nw-feed a:hover { color: var(--mint); }
.nw-feed .mono { font-size: 10px; letter-spacing: .18em; }

/* ---- article ---- */
.nw-article { max-width: 900px; }
.nw-hero { margin-block-end: 18px; }
.nw-hero .nw-meta { margin-block-end: 16px; }
.nw-hero h1 { font-weight: 300; line-height: 1.12; }
[dir="rtl"] .nw-hero h1 { line-height: 1.45; font-weight: 400; }
.nw-body { max-width: 720px; }
.nw-lede { font-size: clamp(17px, 1.6vw, 19px); line-height: 1.85; color: var(--ink); margin: 0 0 30px; font-weight: 300; }
[dir="rtl"] .nw-lede { line-height: 2.05; font-weight: 400; }
.nw-why {
  position: relative; padding: 22px 24px; margin-block-end: 28px; border-radius: 14px;
  background: linear-gradient(160deg, rgba(139, 107, 255, .09), rgba(125, 255, 217, .04)); border: 1px solid var(--line);
}
.nw-why::before { content: ""; position: absolute; inset-block: 14px; inset-inline-start: -1px; width: 2px; border-radius: 2px; background: var(--grad); }
.nw-why h2 { font-size: 15px; font-weight: 600; margin: 0 0 8px; color: var(--mint); letter-spacing: 0; }
.nw-why p { margin: 0; color: var(--body); line-height: 1.85; }
[dir="rtl"] .nw-why p { line-height: 2; }
.nw-source { font-size: 14px; color: var(--dim); margin: 0 0 14px; }
.nw-source .k { color: var(--faint); }
.nw-source a { color: var(--ink); border-block-end: 1px solid rgba(125, 255, 217, .4); }
.nw-source a:hover { color: var(--mint); }
.nw-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; justify-content: flex-start; }
[dir="rtl"] .nw-tags { justify-content: flex-end; }
.nw-tags .mono { font-size: 11px; color: var(--dim); background: var(--panel); border: 1px solid var(--line); border-radius: 100px; padding: 3px 10px; }
.nw-note { font-size: 12.5px; color: var(--faint); line-height: 1.8; margin: 0; }
.nw-article .cta-box .btn { min-width: 180px; }
.nw-related { margin-block-start: 60px; }
.nw-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.nw-related .nw-title { font-size: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- responsive ---- */
@media (max-width: 1024px) {
  .nw-grid, .nw-grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .nw-grid, .nw-grid-3 { grid-template-columns: 1fr; }
  .nw-lead { grid-column: auto; }
  .nw-lead .nw-cover { aspect-ratio: 16 / 9; }
  .nw-cover-lg { aspect-ratio: 16 / 9; margin-block-end: 28px; }
  .nw-filters { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 6px; scrollbar-width: none; }
  .nw-filters::-webkit-scrollbar { display: none; }
  .nw-chip { flex: 0 0 auto; }
  .nw-pager { grid-template-columns: 1fr 1fr; }
  .nw-pageof { grid-column: 1 / -1; grid-row: 1; text-align: center; }
  .nw-why { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  .nw-cover svg, .nw-chip { transition: none; }
  .nw-card:hover .nw-cover svg { transform: none; }
}
