/* =====================================================
   NeuralStack - AI & Tech News
   main.css - Dark code-editor aesthetic
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700;800&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --bg:          #0d1117;
  --bg-elevated: #161b22;
  --bg-card:     #161b22;
  --bg-hover:    #1c2129;
  --border:      #30363d;
  --border-soft: #21262d;
  --text:        #e6edf3;
  --text-mid:    #8b949e;
  --text-light:  #6e7681;
  --accent:      #58e6a8;
  --accent-dim:  #2ea366;
  --purple:      #bc8cff;
  --blue:        #58a6ff;
  --orange:      #ff9d5c;
  --red:         #ff6b6b;
  --yellow:      #e3b341;

  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --font-body: 'Inter', -apple-system, sans-serif;

  --radius: 6px;
  --container-w: 1280px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

/* =====================================================
   HEADER
   ===================================================== */
.ns-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.ns-header__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  height: 60px;
  display: flex;
  align-items: center;
  gap: 32px;
}
.ns-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.ns-logo__bracket { color: var(--accent); }
.ns-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}
.ns-nav a {
  padding: 7px 14px;
  border-radius: var(--radius);
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-mid);
  transition: color .15s, background .15s;
  font-family: var(--font-mono);
}
.ns-nav a:hover, .ns-nav a.active {
  color: var(--accent);
  background: rgba(88,230,168,.08);
}

/* =====================================================
   TICKER
   ===================================================== */
.ns-ticker {
  background: #0a0e13;
  border-bottom: 1px solid var(--border-soft);
  height: 38px;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 0;
}
.ns-ticker__label {
  flex-shrink: 0;
  background: var(--accent);
  color: #0d1117;
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 14px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-family: var(--font-mono);
}
.ns-ticker__track { overflow: hidden; flex: 1; min-width: 0; }
.ns-ticker__inner { display: flex; animation: ticker-scroll 45s linear infinite; white-space: nowrap; }
.ns-ticker__inner:hover { animation-play-state: paused; }
.ns-ticker__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 24px;
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text-mid);
}
.ns-ticker__item::after { content: '//'; opacity: .3; margin-left: 10px; color: var(--accent); }
.ns-ticker__item a { color: var(--text-mid); }
.ns-ticker__item a:hover { color: var(--accent); }
@keyframes ticker-scroll { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }

/* =====================================================
   HERO / MASTHEAD
   ===================================================== */
.ns-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.ns-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(88,230,168,.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(88,230,168,.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}
.ns-hero__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  position: relative;
}
.ns-hero__prompt {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ns-hero__prompt::before { content: '$'; color: var(--text-light); }
.ns-hero__title {
  font-family: var(--font-mono);
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 12px;
}
.ns-hero__title .cursor {
  display: inline-block;
  width: .5em;
  background: var(--accent);
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.ns-hero__sub {
  font-size: 14px;
  color: var(--text-mid);
  max-width: 560px;
}

/* =====================================================
   CATEGORY NAV
   ===================================================== */
.ns-filter {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 60px;
  z-index: 50;
}
.ns-filter__inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 clamp(20px, 4vw, 48px);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.ns-filter__inner::-webkit-scrollbar { display: none; }
.ns-filter__btn {
  padding: 12px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-mid);
  border-bottom: 2px solid transparent;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
  font-family: var(--font-mono);
}
.ns-filter__btn:hover { color: var(--text); }
.ns-filter__btn.active { color: var(--accent); border-bottom-color: var(--accent); }

/* =====================================================
   BREADCRUMB
   ===================================================== */
.ns-breadcrumb {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 14px clamp(20px, 4vw, 48px) 0;
  font-size: 11.5px;
  color: var(--text-light);
  font-family: var(--font-mono);
}
.ns-breadcrumb a:hover { color: var(--accent); }
.ns-breadcrumb span { margin: 0 6px; }

/* =====================================================
   LAYOUT
   ===================================================== */
.ns-layout {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 28px clamp(20px, 4vw, 48px) 80px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}
.ns-layout > main { min-width: 0; }
@media (max-width: 960px) {
  .ns-layout { grid-template-columns: minmax(0, 1fr); }
  .ns-sidebar { display: none; }
}

/* =====================================================
   LEAD STORY
   ===================================================== */
.ns-lead {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 260px;
  transition: border-color .2s;
}
.ns-lead:hover { border-color: var(--accent-dim); }
.ns-lead__visual {
  background: linear-gradient(135deg, #1a2332 0%, #0d1117 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border-right: 1px solid var(--border);
}
.ns-lead__icon { font-size: 56px; opacity: .8; }
.ns-lead__body {
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}
.ns-lead__kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.ns-lead__badge {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
  background: var(--accent);
  color: #0d1117;
  padding: 3px 8px;
  border-radius: 3px;
  font-family: var(--font-mono);
}
.ns-lead__cat { font-size: 11px; color: var(--text-mid); font-family: var(--font-mono); }
.ns-lead__title {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 12px;
}
.ns-lead__summary { font-size: 13.5px; color: var(--text-mid); margin-bottom: 16px; line-height: 1.6; }
.ns-lead__footer { display: flex; align-items: center; gap: 12px; font-size: 11px; font-family: var(--font-mono); border-top: 1px solid var(--border-soft); padding-top: 12px; margin-top: auto; }
.ns-lead__time { color: var(--text-light); }
.ns-lead__source { color: var(--accent); font-weight: 600; }
.ns-lead__read { margin-left: auto; color: var(--text); font-weight: 700; }

/* =====================================================
   SECTION RULE
   ===================================================== */
.ns-rule { display: flex; align-items: center; gap: 12px; margin: 28px 0 18px; }
.ns-rule__label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text);
  white-space: nowrap;
  font-family: var(--font-mono);
}
.ns-rule__line { flex: 1; height: 1px; background: var(--border); }
.ns-rule__count { font-size: 10px; color: var(--text-light); font-family: var(--font-mono); }

/* =====================================================
   ARTICLE GRID
   ===================================================== */
.ns-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; min-width: 0; }
.ns-card { min-width: 0; }
@media (max-width: 760px) { .ns-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .ns-grid { grid-template-columns: minmax(0, 1fr); } }

/* Global word-break preventions for content */
.ns-card__title, 
.ns-card__summary, 
.ns-card__cat, 
.ns-card__tag {
  word-break: break-word;
  overflow-wrap: break-word;
}

.ns-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .15s, transform .15s;
  overflow: hidden;
}
.ns-card:hover { border-color: var(--accent-dim); transform: translateY(-2px); }
.ns-card__top { height: 3px; }
.ns-card__top--ai-models     { background: var(--purple); }
.ns-card__top--startups      { background: var(--accent); }
.ns-card__top--cybersecurity { background: var(--red); }
.ns-card__top--big-tech      { background: var(--blue); }
.ns-card__top--research      { background: var(--yellow); }
.ns-card__top--regulation    { background: var(--orange); }
.ns-card__top--tools         { background: #6ee7de; }
.ns-card__top--general       { background: var(--text-light); }

.ns-card__body { padding: 16px; flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ns-card__cat {
  display: flex; align-items: center; gap: 6px;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--text-mid); margin-bottom: 10px; font-family: var(--font-mono);
}
.ns-card__breaking { background: var(--red); color: #fff; font-size: 8px; font-weight: 800; padding: 2px 5px; border-radius: 2px; }
.ns-card__new { background: var(--accent); color: #0d1117; font-size: 8px; font-weight: 800; padding: 2px 5px; border-radius: 2px; }
.ns-card__title {
  font-family: var(--font-mono);
  font-size: .98rem;
  line-height: 1.3;
  color: var(--text);
  font-weight: 600;
  margin-bottom: 8px;
  flex: 1;
}
.ns-card__summary {
  font-size: 12px;
  color: var(--text-mid);
  line-height: 1.55;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ns-card__tags { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 10px; }
.ns-card__tag {
  font-size: 10px; font-weight: 600; color: var(--accent);
  background: rgba(88,230,168,.08); padding: 2px 7px; border-radius: 3px;
  font-family: var(--font-mono);
}
.ns-card__footer {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 10px; border-top: 1px solid var(--border-soft);
  font-size: 10.5px; font-family: var(--font-mono);
}
.ns-card__time { color: var(--text-light); }
.ns-card__source { color: var(--accent); font-weight: 600; }

/* =====================================================
   EMPTY / PAGINATION
   ===================================================== */
.ns-empty { text-align: center; padding: 60px 24px; color: var(--text-light); border: 1px dashed var(--border); border-radius: var(--radius); }
.ns-pagination { display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 28px; }
.ns-pagination a, .ns-pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text); background: var(--bg-card); font-family: var(--font-mono);
  transition: border-color .15s, color .15s;
}
.ns-pagination a:hover { border-color: var(--accent); color: var(--accent); }
.ns-pagination .current { background: var(--accent); color: #0d1117; border-color: var(--accent); }
.ns-pagination .disabled { opacity: .3; pointer-events: none; }

/* =====================================================
   SIDEBAR
   ===================================================== */
.ns-sidebar { position: sticky; top: 108px; display: flex; flex-direction: column; gap: 16px; }
.ns-widget { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.ns-widget__head {
  background: var(--bg-elevated); padding: 10px 14px; font-size: 10px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; color: var(--text-mid);
  border-bottom: 1px solid var(--border); font-family: var(--font-mono);
}
.ns-widget__body { padding: 12px; }
.ns-cat-link {
  display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 4px;
  font-size: 12px; font-weight: 600; color: var(--text); transition: background .15s, color .15s;
  font-family: var(--font-mono);
}
.ns-cat-link:hover, .ns-cat-link.active { background: rgba(88,230,168,.08); color: var(--accent); }

.ns-cta { background: linear-gradient(135deg, #1a2332, #0d1117); padding: 20px; text-align: center; border: 1px solid var(--border); border-radius: var(--radius); }
.ns-cta__icon { font-size: 26px; margin-bottom: 8px; }
.ns-cta__title { font-family: var(--font-mono); font-size: 1.05rem; color: var(--text); margin-bottom: 6px; font-weight: 700; }
.ns-cta__text { font-size: 11.5px; color: var(--text-mid); margin-bottom: 14px; line-height: 1.5; }
.ns-cta__btn {
  display: inline-block; background: var(--accent); color: #0d1117; font-size: 11px; font-weight: 800;
  padding: 8px 18px; border-radius: 4px; letter-spacing: .04em; text-transform: uppercase;
  font-family: var(--font-mono); transition: background .15s;
}
.ns-cta__btn:hover { background: #4fd499; }

/* =====================================================
   FOOTER
   ===================================================== */
.ns-footer { background: var(--bg-elevated); border-top: 1px solid var(--border); padding: 32px 0; margin-top: 40px; }
.ns-footer__inner {
  max-width: var(--container-w); margin: 0 auto; padding: 0 clamp(20px, 4vw, 48px);
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
}
.ns-footer__logo { font-family: var(--font-mono); font-weight: 700; color: var(--text); }
.ns-footer__links { display: flex; gap: 20px; }
.ns-footer__links a { font-size: 12px; color: var(--text-mid); font-family: var(--font-mono); }
.ns-footer__links a:hover { color: var(--accent); }
.ns-footer__copy { font-size: 11px; color: var(--text-light); font-family: var(--font-mono); }

/* =====================================================
   MOBILE
   ===================================================== */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .ns-header__inner { padding: 0 16px; }
  .ns-nav { display: none; }
  .ns-hero__inner { padding: 0 16px; }
  .ns-filter__inner { padding: 0 16px; }
  .ns-breadcrumb { padding: 12px 16px 0; }
  .ns-layout { padding: 20px 16px 60px; grid-template-columns: minmax(0, 1fr); }
  .ns-lead { grid-template-columns: minmax(0, 1fr); height: auto; }
  .ns-lead__visual { height: 140px; border-right: none; border-bottom: 1px solid var(--border); }
  .ns-lead__body { padding: 18px; }
  .ns-grid { grid-template-columns: minmax(0, 1fr); }
  .ns-footer__inner { flex-direction: column; text-align: center; }
}

/* ---- HEADER LOGO IMAGE ---- */
.ns-logo { display: flex; align-items: center; gap: 8px; }
.ns-logo img { display: block; border-radius: 4px; }

/* =====================================================
   MOBILE OVERFLOW FIX
   ===================================================== */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

.ns-grid, .ns-card, .ns-lead, .ns-layout,
.ns-hero, .ns-header, .ns-filter, .ns-ticker {
  max-width: 100%;
}

@media (max-width: 640px) {
  .ns-grid { grid-template-columns: minmax(0, 1fr); width: 100%; }
  .ns-card { width: 100%; min-width: 0; }
  .ns-widget--ad,
  ins.adsbygoogle {
    max-width: 100% !important;
    overflow: hidden !important;
  }
  ins.adsbygoogle { width: 100% !important; }
  iframe { max-width: 100% !important; }
} ?>
