/* Live threat-intel feed — SOC console styling.
   Uses its own tokens so it reads as a "terminal panel" in both light and dark themes.
   Override --nf-accent to match your theme's accent color. */

.nf {
  --nf-bg: #0b0f14;
  --nf-panel: #10161d;
  --nf-line: #1e2a36;
  --nf-text: #d6e2ee;
  --nf-dim: #7d8fa3;
  --nf-accent: #3ef0b4;
  --nf-accent-dim: rgba(62, 240, 180, 0.12);
  --nf-warn: #ffb547;
  --nf-crit: #ff5d73;
  --nf-mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", Menlo, Consolas, monospace;

  position: relative;
  background:
    radial-gradient(120% 60% at 100% 0%, rgba(62, 240, 180, 0.06), transparent 60%),
    var(--nf-bg);
  border: 1px solid var(--nf-line);
  border-radius: 12px;
  color: var(--nf-text);
  font-size: 15px;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(62, 240, 180, 0.04), 0 20px 50px -20px rgba(0, 0, 0, 0.6);
}

/* Faint scanline glow along the top edge */
.nf::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--nf-accent), transparent);
  opacity: 0.6;
}

/* ---------- header ---------- */
.nf-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: var(--nf-panel);
  border-bottom: 1px solid var(--nf-line);
  font-family: var(--nf-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
}
.nf-title { display: flex; align-items: center; gap: 10px; color: var(--nf-accent); font-weight: 600; }
.nf-status { color: var(--nf-dim); text-align: right; }
.nf-status.is-err { color: var(--nf-warn); }

.nf-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--nf-accent);
  box-shadow: 0 0 0 0 var(--nf-accent);
  animation: nf-pulse 2s infinite;
}
@keyframes nf-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 240, 180, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(62, 240, 180, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 240, 180, 0); }
}

/* ---------- KEV ticker ---------- */
.nf-ticker {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--nf-line);
  font-family: var(--nf-mono);
  font-size: 12px;
}
.nf-ticker-label {
  flex: none;
  display: flex; align-items: center;
  padding: 0 12px;
  background: var(--nf-crit);
  color: #0b0f14;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.nf-ticker-track { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 4%, #000 96%, transparent); }
.nf-ticker-row { display: inline-flex; gap: 32px; padding: 9px 16px; white-space: nowrap; animation: nf-marquee 60s linear infinite; }
.nf-ticker:hover .nf-ticker-row { animation-play-state: paused; }
@keyframes nf-marquee { to { transform: translateX(-50%); } }

.nf-kev { color: var(--nf-dim); text-decoration: none; }
.nf-kev b { color: var(--nf-text); font-weight: 600; }
.nf-kev:hover b { color: var(--nf-accent); }
.nf-rw { margin-left: 8px; padding: 1px 6px; border: 1px solid var(--nf-crit); border-radius: 3px; color: var(--nf-crit); font-size: 10px; }

/* ---------- filter chips ---------- */
.nf-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 18px 4px; }
.nf-chip {
  font: 500 12px var(--nf-mono);
  color: var(--nf-dim);
  background: transparent;
  border: 1px solid var(--nf-line);
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.nf-chip:hover { color: var(--nf-text); border-color: var(--nf-dim); }
.nf-chip[aria-pressed="true"] { color: var(--nf-accent); border-color: var(--nf-accent); background: var(--nf-accent-dim); }
.nf-chip.is-down { opacity: .45; text-decoration: line-through; }
.nf-chip:focus-visible, .nf-link:focus-visible, .nf-kev:focus-visible { outline: 2px solid var(--nf-accent); outline-offset: 2px; }

/* ---------- items ---------- */
.nf-list { list-style: none; margin: 0; padding: 6px 0 8px; }
.nf-item {
  position: relative;
  padding: 14px 18px 14px 22px;
  border-bottom: 1px solid var(--nf-line);
  transition: background .15s;
}
.nf-item:last-child { border-bottom: 0; }
.nf-item::before {
  content: "";
  position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 2px; border-radius: 2px;
  background: var(--nf-line);
  transition: background .15s;
}
.nf-item:hover { background: rgba(255, 255, 255, 0.02); }
.nf-item:hover::before { background: var(--nf-accent); }
.nf-item[data-src="cisa"]::before { background: var(--nf-warn); }

.nf-meta { display: flex; gap: 10px; align-items: baseline; font: 11px var(--nf-mono); letter-spacing: 0.06em; text-transform: uppercase; color: var(--nf-dim); margin-bottom: 4px; }
.nf-src { color: var(--nf-accent); }
.nf-item[data-src="cisa"] .nf-src { color: var(--nf-warn); }
.nf-time::before { content: "//"; margin-right: 10px; opacity: .5; }

.nf-link { display: block; color: var(--nf-text); text-decoration: none; font-weight: 600; line-height: 1.4; }
.nf-link:hover { color: var(--nf-accent); }
.nf-link::after { content: " ↗"; font-weight: 400; color: var(--nf-dim); }

.nf-sum { margin: 6px 0 0; color: var(--nf-dim); font-size: 14px; line-height: 1.55; }

.nf-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.nf-cve { font: 600 11px var(--nf-mono); color: var(--nf-crit); background: rgba(255, 93, 115, 0.1); border: 1px solid rgba(255, 93, 115, 0.35); border-radius: 4px; padding: 2px 7px; }

.nf-empty { padding: 28px 18px; color: var(--nf-dim); font-family: var(--nf-mono); font-size: 13px; text-align: center; }

/* ---------- skeleton loader ---------- */
.nf-skel-line { height: 12px; border-radius: 4px; margin: 6px 0; background: linear-gradient(90deg, var(--nf-line) 25%, #26364580 50%, var(--nf-line) 75%); background-size: 200% 100%; animation: nf-shimmer 1.4s infinite; }
.nf-skel-line.short { width: 30%; height: 9px; }
@keyframes nf-shimmer { to { background-position: -200% 0; } }

/* ---------- compact variant (homepage sidebar / widget) ---------- */
.nf--compact .nf-item { padding: 10px 16px 10px 20px; }
.nf--compact .nf-link { font-size: 14px; }

/* ---------- small screens ---------- */
@media (max-width: 600px) {
  .nf-head { flex-direction: column; align-items: flex-start; gap: 4px; padding: 12px 16px; }
  .nf-status { text-align: left; }
  .nf-chips { flex-wrap: nowrap; overflow-x: auto; padding: 12px 16px 4px; scrollbar-width: none; }
  .nf-item { padding: 12px 16px 12px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .nf-pulse, .nf-ticker-row, .nf-skel-line { animation: none; }
  .nf-ticker-track { overflow-x: auto; }
}

/* Override theme link styles inside the feed */
.nf a.nf-link, .nf a.nf-kev, .nf a.nf-more { text-decoration: none; }
.nf a.nf-link { color: var(--nf-text); }
.nf a.nf-link:hover { color: var(--nf-accent); }
.nf a.nf-kev { color: var(--nf-dim); }
.nf a.nf-kev:hover b { color: var(--nf-accent); }

/* "View all" footer link */
.nf a.nf-more {
  display: block;
  padding: 12px 18px;
  border-top: 1px solid var(--nf-line);
  background: var(--nf-panel);
  color: var(--nf-accent);
  font: 600 12px var(--nf-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.nf a.nf-more:hover { background: var(--nf-accent-dim); }

/* ---------- homepage layout: posts + threat intel sidebar ---------- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
.home-section-header { padding-top: 0; border-bottom: none; margin-bottom: 1.5rem; }
.home-section-title {
  margin: 0 0 1.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.home-section-header .home-section-title { margin: 0; }
.home-view-all { padding: 1.5rem 0; }
.home-view-all a { font-size: 0.875rem; font-weight: 500; color: var(--accent); }
.home-sidebar .nf { font-size: 14px; }

@media (min-width: 1000px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .home-sidebar { position: sticky; top: 1.5rem; }
}
.nf--compact .nf-chips { display: none; }
