/* =========================================================================
   AI PM LIVE NEWS & INTELLIGENCE HUB — 120HZ LIQUID GLASS STYLESHEET
   FILE: css/news.css — ISOLATED nw-* NAMESPACE (LIGHT + DARK + MOBILE)
   ========================================================================= */

:root {
  --nw-ease: cubic-bezier(0.16, 1, 0.3, 1);
  --nw-spring: cubic-bezier(0.22, 1.38, 0.36, 1);
  --nw-bg: rgba(246, 245, 240, 0.88);
  --nw-surface: rgba(255, 255, 255, 0.72);
  --nw-card: rgba(255, 255, 255, 0.92);
  --nw-rim: rgba(255, 255, 255, 0.90);
  --nw-stroke: rgba(17, 17, 17, 0.12);
  --nw-ink: #111111;
  --nw-ink-2: #3F3F46;
  --nw-muted: #71717A;
  --nw-live: #0F766E;
  --nw-accent: #E63900;
  --nw-blue: #1D4ED8;
  --nw-shadow: 0 22px 54px -14px rgba(17, 24, 39, 0.16), inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

:root.ix-dark {
  --nw-bg: rgba(9, 10, 15, 0.90);
  --nw-surface: rgba(20, 22, 30, 0.78);
  --nw-card: rgba(25, 28, 38, 0.92);
  --nw-rim: rgba(255, 255, 255, 0.18);
  --nw-stroke: rgba(255, 255, 255, 0.14);
  --nw-ink: #F4F3ED;
  --nw-ink-2: #C9C8C1;
  --nw-muted: #8E8D86;
  --nw-live: #2DD4BF;
  --nw-accent: #FF6B35;
  --nw-blue: #60A5FA;
  --nw-shadow: 0 26px 64px -14px rgba(0, 0, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.16);
}

/* HAMBURGER MENU HIGHLIGHT STYLE FOR LIVE NEWS ITEM */
.hm-item.hm-news {
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.14) 0%, rgba(29, 78, 216, 0.08) 100%);
  border: 1.5px solid var(--nw-live);
}
.hm-pill.live {
  background: #0F766E;
  color: #FFFFFF;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.nw-pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #5EEAD4;
  display: inline-block;
  animation: nwPulse 1.8s ease-in-out infinite;
}
@keyframes nwPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.35); }
}

/* FULL-SCREEN LIQUID-GLASS NEWS HUB OVERLAY */
.nw-overlay {
  position: fixed;
  inset: 0;
  z-index: 560;
  background:
    radial-gradient(at 10% 12%, rgba(15, 118, 110, 0.22) 0px, transparent 48%),
    radial-gradient(at 88% 14%, rgba(29, 78, 216, 0.22) 0px, transparent 50%),
    radial-gradient(at 80% 88%, rgba(230, 57, 0, 0.18) 0px, transparent 50%),
    var(--nw-bg);
  backdrop-filter: blur(20px) saturate(185%);
  -webkit-backdrop-filter: blur(20px) saturate(185%);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  width: 100vw;
  color: var(--nw-ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 16px, 0) scale(0.988);
  transition: opacity 0.28s var(--nw-ease), transform 0.32s var(--nw-ease), visibility 0.28s ease;
}
.nw-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1);
}

/* HEADER BAR */
.nw-topbar {
  padding: calc(10px + env(safe-area-inset-top, 0px)) 20px 10px;
  border-bottom: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.nw-brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.nw-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--nw-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.nw-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--nw-live);
  margin-top: 1px;
}
.nw-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.nw-search {
  width: 230px;
  padding: 7px 11px;
  border-radius: 8px;
  border: 1px solid var(--nw-stroke);
  background: var(--nw-card);
  color: var(--nw-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
}
.nw-search:focus { border-color: var(--nw-live); }

.nw-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid var(--nw-stroke);
  background: var(--nw-card);
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--nw-ink-2);
  white-space: nowrap;
}
.nw-status-pill.syncing {
  border-color: var(--nw-live);
  color: var(--nw-live);
}
.nw-refresh-btn {
  border: 1px solid var(--nw-live);
  background: rgba(15, 118, 110, 0.12);
  color: var(--nw-live);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.22s var(--nw-spring), background 0.16s ease, color 0.16s ease;
}
.nw-refresh-btn:hover:not(:disabled) {
  transform: translate3d(0, -1.5px, 0) scale(1.05);
  background: #0F766E;
  color: #FFFFFF !important;
}
.nw-refresh-btn:disabled { opacity: 0.55; cursor: wait; }

/* TOPIC & VIEW FILTER RIBBON */
.nw-ribbon {
  padding: 8px 20px;
  border-bottom: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nw-ribbon::-webkit-scrollbar { display: none; }
.nw-tab-group {
  display: flex;
  gap: 6px;
  align-items: center;
}
.nw-tab {
  border: 1px solid var(--nw-stroke);
  background: var(--nw-card);
  color: var(--nw-ink-2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 7px;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.22s var(--nw-spring), background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.nw-tab:hover {
  transform: translate3d(0, -1.5px, 0) scale(1.04);
  border-color: var(--nw-accent);
  color: var(--nw-ink);
}
.nw-tab.active {
  background: var(--nw-accent);
  border-color: var(--nw-accent);
  color: #FFFFFF !important;
  box-shadow: 0 5px 14px rgba(230, 57, 0, 0.24);
}
.nw-tab.active[data-ntab="blogs"],
.nw-tab.active[data-ntab="saved"] {
  background: #0F766E;
  border-color: #0F766E;
  box-shadow: 0 5px 14px rgba(15, 118, 110, 0.24);
}

/* MAIN SCROLLABLE CANVAS */
.nw-body {
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 24px 36px;
  -webkit-overflow-scrolling: touch;
}

/* BRIEFING BANNER & SOURCE HEALTH STRIP */
.nw-banner {
  padding: 15px 18px;
  border-radius: 12px;
  border: 1px solid var(--nw-rim);
  background: var(--nw-card);
  box-shadow: var(--nw-shadow);
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.nw-banner h2 {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--nw-ink);
  margin: 2px 0 4px;
}
.nw-banner p {
  font-size: 12px;
  line-height: 1.5;
  color: var(--nw-ink-2);
  max-width: 760px;
}
.nw-signal-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.nw-sig-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  color: var(--nw-ink-2);
}
.nw-sig-chip.ok { border-color: var(--nw-live); color: var(--nw-live); }

/* LIVE NEWS CARD GRID */
.nw-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 12px;
}
.nw-card {
  border: 1px solid var(--nw-stroke);
  border-radius: 12px;
  background: var(--nw-card);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  contain: layout style;
  box-shadow: 0 6px 20px rgba(17, 24, 39, 0.05);
  transition: transform 0.24s var(--nw-spring), border-color 0.16s ease, box-shadow 0.22s ease;
}
.nw-card:hover {
  transform: translate3d(0, -3px, 0);
  border-color: var(--nw-accent);
  box-shadow: 0 14px 28px rgba(230, 57, 0, 0.12);
}
.nw-card.is-saved {
  border-left: 4px solid var(--nw-live);
}
.nw-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.nw-source-tag {
  color: var(--nw-accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.nw-time-tag {
  color: var(--nw-muted);
  white-space: nowrap;
}
.nw-card-title {
  font-size: 14px;
  font-weight: 800;
  line-height: 1.32;
  color: var(--nw-ink);
  text-decoration: none;
  display: block;
}
.nw-card-title:hover { color: var(--nw-accent); }
.nw-card-excerpt {
  font-size: 11.8px;
  line-height: 1.5;
  color: var(--nw-ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nw-topic-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.nw-topic-pill {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  color: var(--nw-ink-2);
}
.nw-topic-pill.frontier { border-color: var(--nw-accent); color: var(--nw-accent); }
.nw-topic-pill.evals    { border-color: var(--nw-live); color: var(--nw-live); }
.nw-topic-pill.strategy { border-color: var(--nw-blue); color: var(--nw-blue); }
.nw-topic-pill.agents   { border-color: #B45309; color: #B45309; }
:root.ix-dark .nw-topic-pill.agents { color: #FCD34D; }

.nw-card-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--nw-stroke);
}
.nw-read-link {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  color: var(--nw-blue);
  text-decoration: none;
  text-transform: uppercase;
}
.nw-read-link:hover { text-decoration: underline; }
.nw-card-actions {
  display: flex;
  gap: 5px;
}
.nw-mini-btn {
  border: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  color: var(--nw-ink-2);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  padding: 4px 7px;
  border-radius: 6px;
  cursor: pointer;
  transition: transform 0.2s var(--nw-spring), border-color 0.15s ease, color 0.15s ease;
}
.nw-mini-btn:hover { transform: scale(1.06); border-color: var(--nw-accent); color: var(--nw-ink); }
.nw-mini-btn.saved {
  background: #0F766E;
  border-color: #0F766E;
  color: #FFFFFF !important;
}

/* ESSENTIAL BLOGS & CUSTOM RSS MANAGER */
.nw-sec-heading {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--nw-accent);
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nw-sec-heading:first-of-type { margin-top: 4px; }
.nw-custom-box {
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px dashed var(--nw-live);
  background: var(--nw-card);
  margin-bottom: 16px;
}
.nw-custom-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.nw-custom-form input,
.nw-custom-form select {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--nw-stroke);
  background: var(--nw-surface);
  color: var(--nw-ink);
  font-family: var(--font-mono);
  font-size: 11px;
  outline: none;
}
.nw-custom-form input.nw-url-inp { flex: 1 1 260px; }

/* SHIMMER SKELETON LOADERS WHILE FETCHING LIVE */
.nw-skel {
  height: 175px;
  border-radius: 12px;
  border: 1px solid var(--nw-stroke);
  background: linear-gradient(90deg, var(--nw-surface) 25%, var(--nw-card) 50%, var(--nw-surface) 75%);
  background-size: 200% 100%;
  animation: nwShimmer 1.3s ease-in-out infinite;
}
@keyframes nwShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* MOBILE 120HZ RESPONSIVE FIT */
@media (max-width: 860px) {
  .nw-topbar { padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px; gap: 8px; }
  .nw-controls { width: 100%; justify-content: space-between; }
  .nw-search { width: 100%; font-size: 16px; }
  .nw-ribbon { padding: 7px 12px; }
  .nw-body { padding: 12px 12px calc(28px + env(safe-area-inset-bottom, 0px)); }
  .nw-grid { grid-template-columns: minmax(0, 1fr); }
  .nw-card:hover { transform: none; }
  .nw-custom-form input,
  .nw-custom-form select { width: 100%; font-size: 16px; }
}
