/* ============================================
   FeediX News — niche-news.css
   Six themes: Pulse (default), Chronicle, Signal, OLED Grid, Glass, Swiss
   Swiss Modernism / Editorial Grid
   ============================================ */

/* -----------------------------------------------
   FONT NOTES:
   Fonts are loaded dynamically by app.js via Google Fonts
   based on data-news-theme attribute.
   CSS only references --nh-font-head / --nh-font-body tokens.
----------------------------------------------- */

/* -----------------------------------------------
   TOKEN BLOCKS — theme variables
----------------------------------------------- */

/* Default / Pulse: Bold, urgent, breaking news energy */
:root,
[data-news-theme="pulse"] {
  --nh-header-bg:     #0a0a0a;
  --nh-header-text:   #ffffff;
  --nh-bg:            #f5f5f7;
  --nh-surface:       #ffffff;
  --nh-border:        #e5e5ea;
  --nh-head:          #111118;
  --nh-body:          #374151;
  --nh-meta:          #5c6670;
  --nh-accent:        #dc2626;
  --nh-accent-dark:   #991b1b;
  --nh-analysis:      #1e40af;
  --nh-update:        #ea580c;
  --nh-font-head:     'Newsreader', Georgia, serif;
  --nh-font-body:     'Roboto', system-ui, sans-serif;
  --nh-header-height: 72px;
  --nh-ticker-bg:     #dc2626;
  --nh-ticker-label:  #ffffff;
  --nh-ticker-text:   #ffffff;
  --nh-surface-hover: #f0f0f5;
  --nh-chip-bg:       #fee2e2;
  --nh-chip-text:     #7f1d1d;
  --nh-row-active-border: #dc2626;
}

/* Chronicle: Print journalism, literary, authoritative */
[data-news-theme="chronicle"] {
  --nh-header-bg:     #1e293b;
  --nh-header-text:   #f8fafc;
  --nh-bg:            #f8fafc;
  --nh-surface:       #ffffff;
  --nh-border:        #e2e8f0;
  --nh-head:          #0f172a;
  --nh-body:          #334155;
  --nh-meta:          #64748b;
  --nh-accent:        #2563eb;
  --nh-accent-dark:   #1d4ed8;
  --nh-analysis:      #7c3aed;
  --nh-update:        #f97316;
  --nh-font-head:     'Cormorant Garamond', Georgia, serif;
  --nh-font-body:     'Libre Baskerville', Georgia, serif;
  --nh-header-height: 72px;
  --nh-ticker-bg:     #1e293b;
  --nh-ticker-label:  #f8fafc;
  --nh-ticker-text:   #cbd5e1;
  --nh-surface-hover: #f1f5f9;
  --nh-chip-bg:       #dbeafe;
  --nh-chip-text:     #1e3a8a;
  --nh-row-active-border: #7c3aed;
}

/* Signal: Dark terminal, financial intelligence */
[data-news-theme="signal"] {
  --nh-header-bg:     #000000;
  --nh-header-text:   #22c55e;
  --nh-bg:            #020617;
  --nh-surface:       #0f172a;
  --nh-border:        #1e293b;
  --nh-head:          #f8fafc;
  --nh-body:          #cbd5e1;
  --nh-meta:          #7a8494;
  --nh-accent:        #22c55e;
  --nh-accent-dark:   #16a34a;
  --nh-analysis:      #60a5fa;
  --nh-update:        #f59e0b;
  --nh-font-head:     'IBM Plex Sans', system-ui, sans-serif;
  --nh-font-body:     'IBM Plex Sans', system-ui, sans-serif;
  --nh-header-height: 72px;
  --nh-ticker-bg:     #000000;
  --nh-ticker-label:  #22c55e;
  --nh-ticker-text:   #86efac;
  --nh-surface-hover: #0f172a;
  --nh-chip-bg:       #14532d;
  --nh-chip-text:     #86efac;
  --nh-row-active-border: #22c55e;
}

/* -----------------------------------------------
   GLOBAL RESET for news niche
----------------------------------------------- */

body[data-niche="news"] {
  background: var(--nh-bg);
  font-family: var(--nh-font-body);
}

/* Override any global max-width cap */
body[data-niche="news"] #app {
  max-width: 100%;
  background: var(--nh-bg);
}

/* -----------------------------------------------
   LAYOUT WRAPPERS
----------------------------------------------- */

/* Mobile layout visible by default, desktop layout hidden */
.nh-mobile-layout {
  display: block;
}

.nh-desktop-layout {
  display: none;
}

/* -----------------------------------------------
   HEADER — sticky editorial masthead
----------------------------------------------- */

.nh-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  background: var(--nh-header-bg);
  border-bottom: 3px solid var(--nh-accent);
  min-height: 72px;
  box-sizing: border-box;
}

.nh-header-identity {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nh-channel-name {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--nh-font-head);
  font-size: 20px;
  font-weight: 800;
  color: var(--nh-header-text);
  letter-spacing: -0.4px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nh-header-meta {
  font-size: 11px;
  color: rgba(255,255,255,0.55);
  font-weight: 400;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.nh-header-dot {
  opacity: 0.4;
}

.nh-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Primary action button (Settings) */
.nh-header-btn--primary {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--nh-accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.1px;
  transition: opacity 160ms ease;
  white-space: nowrap;
  min-height: 40px;
}

/* Secondary action button (Stats) */
.nh-header-btn--secondary {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  line-height: 1;
  letter-spacing: 0.1px;
  transition: background 160ms ease;
  white-space: nowrap;
  min-height: 40px;
}

.nh-header-btn--secondary:hover { background: rgba(255,255,255,0.18); }
.nh-header-btn--primary:hover { opacity: 0.88; }
.nh-header-btn--primary:active,
.nh-header-btn--secondary:active { opacity: 0.72; }

.nh-header-btn--primary:focus-visible,
.nh-header-btn--secondary:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

/* Owner Login link (subtle, for unauthenticated web visitors) */
.nh-header-signin {
  background: transparent;
  color: rgba(255,255,255,0.40);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.2px;
  transition: color 160ms ease, border-color 160ms ease;
  white-space: nowrap;
}

.nh-header-signin:hover {
  color: rgba(255,255,255,0.70);
  border-color: rgba(255,255,255,0.30);
}

/* Signal theme overrides */
[data-news-theme="signal"] .nh-channel-name {
  text-shadow: 0 0 10px rgba(34,197,94,0.35);
}
[data-news-theme="signal"] .nh-header-meta {
  color: rgba(34,197,94,0.55);
}
[data-news-theme="signal"] .nh-header-btn--secondary {
  background: rgba(34,197,94,0.08);
  border-color: rgba(34,197,94,0.25);
  color: rgba(34,197,94,0.85);
}

/* Live dot */
.nh-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nh-accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-live-dot {
    animation: nh-live-pulse 1.6s ease-in-out infinite;
  }
}

@keyframes nh-live-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220,38,38,0.5); }
  50%       { opacity: 0.7; box-shadow: 0 0 0 4px transparent; }
}

/* -----------------------------------------------
   BREAKING TICKER
----------------------------------------------- */

.nh-ticker {
  display: flex;
  align-items: center;
  height: 36px;
  background: var(--nh-ticker-bg);
  overflow: hidden;
  flex-shrink: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.nh-ticker-label {
  background: var(--nh-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 1px;
  padding: 0 10px;
  height: 100%;
  display: flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
}

[data-news-theme="chronicle"] .nh-ticker-label {
  background: var(--nh-accent);
}

[data-news-theme="signal"] .nh-ticker-label {
  background: transparent;
  color: var(--nh-accent);
  border-right: 1px solid var(--nh-border);
}

.nh-ticker-track {
  display: flex;
  align-items: center;
  gap: 20px;
  height: 100%;
  padding: 0 12px;
  white-space: nowrap;
  overflow: hidden;
}

.nh-ticker-track--animated {
  width: max-content;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-ticker-track--animated {
    animation: nh-ticker-scroll 40s linear infinite;
  }

  .nh-ticker-track--animated:hover {
    animation-play-state: paused;
  }
}

@keyframes nh-ticker-scroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.nh-ticker-item {
  font-size: 12px;
  font-weight: 600;
  color: var(--nh-ticker-text);
  letter-spacing: 0.2px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 150ms ease;
  -webkit-tap-highlight-color: transparent;
}

.nh-ticker-item:hover {
  opacity: 0.78;
}

.nh-ticker-item:focus-visible {
  outline: 1px solid var(--nh-accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.nh-ticker-sep {
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  flex-shrink: 0;
  padding: 0 4px;
}

[data-news-theme="signal"] .nh-ticker-sep {
  color: rgba(34, 197, 94, 0.5);
}

/* -----------------------------------------------
   CATEGORY BADGES
----------------------------------------------- */

.nh-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
  line-height: 1.5;
  white-space: nowrap;
}

.nh-badge--breaking {
  background: var(--nh-accent);
  color: #fff;
}

.nh-badge--analysis {
  background: var(--nh-analysis);
  color: #fff;
}

.nh-badge--update {
  background: var(--nh-update);
  color: #fff;
}

/* -----------------------------------------------
   HERO CARD
----------------------------------------------- */

.nh-hero {
  position: relative;
  width: 100%;
  cursor: pointer;
  display: block;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .nh-hero {
    transition: opacity 280ms ease-out, transform 280ms ease-out;
  }
}

.nh-hero.visible {
  opacity: 1;
  transform: translateY(0);
}

.nh-hero-media {
  position: relative;
  width: 100%;
  height: 260px;
  background: var(--nh-border);
  overflow: hidden;
}

.nh-hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-hero-img {
    transition: opacity 350ms ease;
  }
}

.nh-hero-img.loaded {
  opacity: 1;
}

.nh-hero-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--nh-border) 0%, var(--nh-surface) 100%);
}

.nh-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.45) 50%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 12px 14px 14px;
}

.nh-hero-badge-wrap {
  align-self: flex-start;
}

.nh-hero-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nh-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nh-hero-source {
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 2px 8px;
  border-radius: 20px;
  text-transform: uppercase;
}

.nh-hero-time {
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
  font-weight: 500;
}

.nh-hero-headline {
  margin: 0;
  font-family: var(--nh-font-head);
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  line-height: 1.25;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.nh-hero:active .nh-hero-media {
  filter: brightness(0.88);
}

/* -----------------------------------------------
   STORY STRIP (mobile horizontal scroll)
----------------------------------------------- */

.nh-story-strip {
  background: var(--nh-surface);
  border-bottom: 1px solid var(--nh-border);
  padding: 12px 0 12px 16px;
}

.nh-strip-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--nh-accent);
  margin-bottom: 10px;
  text-transform: uppercase;
}

.nh-story-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-right: 16px;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.nh-story-scroll::-webkit-scrollbar {
  display: none;
}

/* Shared story card styles (strip + sidebar) */
.nh-story-card {
  background: var(--nh-bg);
  border: 1px solid var(--nh-border);
  border-left: 3px solid var(--nh-accent);
  border-radius: 8px;
  padding: 12px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  flex-shrink: 0;
  width: 200px;
  opacity: 0;
  transform: translateX(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .nh-story-card {
    transition: background 180ms ease, box-shadow 180ms ease, transform 280ms ease-out, opacity 280ms ease-out;
  }
}

.nh-story-card.visible {
  opacity: 1;
  transform: translateX(0);
}

.nh-story-card:hover {
  background: var(--nh-surface-hover);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nh-story-card:active {
  background: var(--nh-surface);
}

.nh-story-card:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

.nh-story-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.nh-story-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--nh-accent);
  text-transform: uppercase;
  line-height: 1;
}

.nh-story-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--nh-accent);
  flex-shrink: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-story-dot--pulse {
    animation: nh-dot-pulse 1.5s ease-in-out infinite;
  }
}

@keyframes nh-dot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4); }
  50%       { opacity: 0.6; box-shadow: 0 0 0 4px transparent; }
}

.nh-story-time {
  font-size: 10px;
  color: var(--nh-meta);
  font-weight: 500;
  white-space: nowrap;
}

.nh-story-title {
  font-family: var(--nh-font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.3;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nh-story-facts {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nh-story-facts li {
  font-size: 11px;
  color: var(--nh-body);
  line-height: 1.4;
  padding-left: 12px;
  position: relative;
}

.nh-story-facts li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--nh-accent);
  opacity: 0.6;
}

.nh-story-count {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 3px;
  font-size: 11px;
  font-weight: 700;
  color: var(--nh-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nh-story-chevron {
  font-size: 14px;
  line-height: 1;
}

/* -----------------------------------------------
   CATEGORY PILLS
----------------------------------------------- */

.nh-cat-strip {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  background: var(--nh-surface);
  border-bottom: 1px solid var(--nh-border);
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nh-cat-strip::-webkit-scrollbar {
  display: none;
}

.nh-cat-pill {
  flex-shrink: 0;
  background: transparent;
  color: var(--nh-meta);
  border: 1px solid var(--nh-border);
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  outline: none;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-cat-pill {
    transition: background 180ms ease, color 180ms ease, border-color 180ms ease;
  }
}

.nh-cat-pill:hover {
  background: var(--nh-surface-hover);
  color: var(--nh-head);
  border-color: var(--nh-accent);
}

.nh-cat-pill.active {
  background: var(--nh-accent);
  color: #fff;
  border-color: var(--nh-accent);
  font-weight: 700;
}

.nh-cat-pill:active {
  opacity: 0.8;
}

.nh-cat-pill:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

/* -----------------------------------------------
   ARTICLE ROWS
----------------------------------------------- */

#nh-feed,
.nh-feed {
  background: var(--nh-bg);
  min-height: 40vh;
}

.nh-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--nh-border);
  cursor: pointer;
  background: var(--nh-bg);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .nh-row {
    transition: background 180ms ease, transform 240ms ease-out, opacity 240ms ease-out;
  }
}

.nh-row.visible {
  opacity: 1;
  transform: translateY(0);
}

.nh-row:hover {
  background: var(--nh-surface-hover);
}

.nh-row:active {
  background: var(--nh-surface);
}

.nh-row:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: -2px;
}

/* Analysis rows get a left border accent */
.nh-row--analysis {
  border-left: 3px solid var(--nh-analysis);
  padding-left: 13px;
}

.nh-row-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nh-row-badge-wrap {
  margin-bottom: 2px;
}

.nh-row-headline {
  font-family: var(--nh-font-head);
  font-size: 16px;
  font-weight: 600;
  color: var(--nh-head);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.1px;
}

.nh-row-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  line-height: 1.3;
  flex-wrap: wrap;
}

.nh-row-source {
  color: var(--nh-accent);
  font-weight: 600;
}

.nh-row-time {
  color: var(--nh-meta);
  font-weight: 400;
}

.nh-meta-sep {
  color: var(--nh-meta);
  font-size: 10px;
}

.nh-row-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 2px;
}

.nh-row-thumb {
  flex-shrink: 0;
  width: 80px;
  height: 64px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--nh-border);
  align-self: flex-start;
}

.nh-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-row-thumb img {
    transition: opacity 250ms ease;
  }
}

.nh-row-thumb img.loaded {
  opacity: 1;
}

/* -----------------------------------------------
   ENTITY CHIPS
----------------------------------------------- */

.nh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 12px;
  background: var(--nh-chip-bg);
  color: var(--nh-chip-text);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  outline: none;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  min-height: 24px;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-chip {
    transition: background 180ms ease, color 180ms ease, box-shadow 180ms ease;
  }
}

.nh-chip:hover {
  box-shadow: 0 0 0 1px var(--nh-accent);
}

.nh-chip:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

.nh-chip:active {
  opacity: 0.8;
}

.nh-chip--active {
  background: var(--nh-accent);
  color: #fff;
}

/* Location chip: muted blue-grey tint */
.nh-chip--location {
  background: #e8eef7;
  color: #2c4a7c;
}

[data-news-theme="signal"] .nh-chip--location,
[data-news-theme="oled"] .nh-chip--location,
[data-news-theme="glass"] .nh-chip--location {
  background: rgba(96, 165, 250, 0.15);
  color: #93c5fd;
}

/* Read-only fallback chip (no onclick, used when entities are empty) */
.nh-chip--readonly {
  cursor: default;
  opacity: 0.7;
  background: var(--nh-border);
  color: var(--nh-meta);
}

.nh-chip--readonly:hover {
  box-shadow: none;
}

.nh-chip-icon {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  opacity: 0.75;
}

/* -----------------------------------------------
   FEATURED STRIP (2-card strip — desktop above fold)
----------------------------------------------- */

.nh-featured-strip {
  display: none; /* shown only on desktop via media query */
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--nh-border);
}

.nh-featured-card {
  flex: 1;
  background: var(--nh-surface);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  opacity: 0;
  transform: translateY(4px);
}

@media (prefers-reduced-motion: no-preference) {
  .nh-featured-card {
    transition: box-shadow 200ms ease, transform 260ms ease-out, opacity 260ms ease-out;
  }
}

.nh-featured-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.nh-featured-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nh-featured-card:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

.nh-featured-media {
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: var(--nh-border);
}

.nh-featured-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-featured-img {
    transition: opacity 280ms ease;
  }
}

.nh-featured-img.loaded {
  opacity: 1;
}

.nh-featured-img-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--nh-border) 0%, var(--nh-surface) 100%);
}

.nh-featured-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nh-featured-headline {
  font-family: var(--nh-font-head);
  font-size: 14px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nh-featured-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
}

.nh-featured-source {
  color: var(--nh-accent);
  font-weight: 600;
}

.nh-featured-time {
  color: var(--nh-meta);
}

/* -----------------------------------------------
   EMPTY STATE
----------------------------------------------- */

.nh-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 20px;
  gap: 12px;
  color: var(--nh-meta);
  font-size: 14px;
  text-align: center;
}

.nh-empty-icon {
  font-size: 32px;
  opacity: 0.3;
}

/* -----------------------------------------------
   ARTICLE DETAIL VIEW
----------------------------------------------- */

.nh-detail-view {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nh-bg);
  z-index: 150;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* Mini sticky header in detail */
.nh-detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: var(--nh-header-bg);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  min-height: 48px;
}

.nh-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--nh-header-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-detail-back {
    transition: background 150ms ease;
  }
}

.nh-detail-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nh-detail-back:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

.nh-detail-header-badge {
  flex: 1;
}

/* Full-bleed media — show complete image, no crop */
.nh-detail-media {
  width: 100%;
  background: var(--nh-border);
}

.nh-detail-media img {
  width: 100%;
  height: auto;
  display: block;
  opacity: 0;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-detail-media img {
    transition: opacity 350ms ease;
  }
}

.nh-detail-media img.loaded {
  opacity: 1;
}

/* Meta block */
.nh-detail-meta {
  padding: 16px 16px 12px;
  border-bottom: 1px solid var(--nh-border);
  background: var(--nh-surface);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.nh-detail-badge-row {
  display: flex;
}

.nh-detail-headline {
  margin: 0;
  font-family: var(--nh-font-head);
  font-size: 22px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.nh-detail-byline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.nh-detail-source {
  background: var(--nh-chip-bg);
  color: var(--nh-chip-text);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.nh-detail-time {
  font-size: 12px;
  color: var(--nh-meta);
}

.nh-detail-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Article body */
.nh-detail-body {
  padding: 16px 16px 8px;
  font-family: var(--nh-font-body);
  font-size: 16px;
  color: var(--nh-body);
  line-height: 1.75;
  background: var(--nh-surface);
}

[data-news-theme="chronicle"] .nh-detail-body {
  line-height: 1.85;
}

/* Read original CTA */
.nh-detail-cta-wrap {
  padding: 16px;
  background: var(--nh-surface);
  border-top: 1px solid var(--nh-border);
}

.nh-detail-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--nh-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-detail-cta {
    transition: opacity 180ms ease;
  }
}

.nh-detail-cta:hover {
  opacity: 0.88;
}

.nh-detail-cta:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 3px;
}

.nh-cta-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

/* Developing story context panel (in detail) */
.nh-ctx-panel {
  margin: 0;
  background: var(--nh-surface);
  border-top: 2px solid var(--nh-accent);
  padding: 16px;
}

.nh-ctx-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--nh-accent);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.nh-ctx-title {
  font-family: var(--nh-font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.35;
  margin-bottom: 10px;
}

.nh-ctx-facts {
  list-style: none;
  margin: 0 0 12px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nh-ctx-facts li {
  font-size: 13px;
  color: var(--nh-body);
  line-height: 1.45;
  padding-left: 14px;
  position: relative;
}

.nh-ctx-facts li::before {
  content: '';
  position: absolute;
  left: 3px;
  top: 7px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--nh-accent);
  opacity: 0.7;
}

.nh-ctx-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: 1px solid var(--nh-accent);
  color: var(--nh-accent);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  cursor: pointer;
  letter-spacing: 0.03em;
  min-height: 32px;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .nh-ctx-link {
    transition: background 150ms ease, color 150ms ease;
  }
}

.nh-ctx-link:hover {
  background: var(--nh-accent);
  color: #fff;
}

.nh-ctx-link:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

/* -----------------------------------------------
   ARTICLE DETAIL BACKDROP (Bug 5: click-outside-to-close)
   Rendered only on desktop; on mobile detail is full-screen anyway.
----------------------------------------------- */

.nh-detail-backdrop {
  display: none;
}

@media (min-width: 1024px) {
  .nh-detail-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 149;
    /* Bug 3 fix: was 0.4, raised to 0.78 so sidebar doesn't bleed through */
    background: rgba(0, 0, 0, 0.78);
    cursor: pointer;
  }
}

/* -----------------------------------------------
   STORY DETAIL OVERLAY (timeline)
   (Kept from original — uses .story-detail classes
    which are still referenced by the JS)
----------------------------------------------- */

.story-detail {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--nh-bg);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.story-detail-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nh-header-bg);
  border-bottom: 2px solid var(--nh-accent);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
}

.story-detail-back {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--nh-header-text);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
  -webkit-tap-highlight-color: transparent;
}

@media (prefers-reduced-motion: no-preference) {
  .story-detail-back {
    transition: background 150ms ease;
  }
}

.story-detail-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.story-detail-back:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

.story-detail-header-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--nh-accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  flex: 1;
}

.story-detail-title {
  font-family: var(--nh-font-head);
  font-size: 18px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.3;
  padding: 16px;
  border-bottom: 1px solid var(--nh-border);
  background: var(--nh-surface);
}

.story-timeline {
  padding: 8px 0 48px;
}

.story-timeline-entry {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--nh-border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: var(--nh-surface);
}

@media (prefers-reduced-motion: no-preference) {
  .story-timeline-entry {
    transition: background 150ms ease;
  }
}

.story-timeline-entry:hover {
  background: var(--nh-surface-hover);
}

.story-timeline-entry:active {
  background: var(--nh-bg);
}

.story-timeline-entry:last-child {
  border-bottom: none;
}

.story-timeline-left {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0;
  width: 8px;
  padding-top: 4px;
}

.story-timeline-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nh-accent);
  flex-shrink: 0;
}

.story-timeline-line {
  width: 2px;
  flex: 1;
  background: var(--nh-border);
  margin-top: 4px;
  min-height: 24px;
}

.story-timeline-entry:last-child .story-timeline-line {
  display: none;
}

.story-timeline-body {
  flex: 1;
  min-width: 0;
}

.story-category-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 3px;
  margin-bottom: 6px;
  line-height: 1.5;
}

.story-category-badge--breaking {
  background: rgba(220, 38, 38, 0.15);
  color: var(--nh-accent);
  border: 1px solid rgba(220, 38, 38, 0.3);
}

.story-category-badge--update {
  background: rgba(234, 88, 12, 0.12);
  color: var(--nh-update);
  border: 1px solid rgba(234, 88, 12, 0.25);
}

.story-category-badge--analysis {
  background: rgba(30, 64, 175, 0.12);
  color: var(--nh-analysis);
  border: 1px solid rgba(30, 64, 175, 0.25);
}

.story-category-badge--signal {
  background: rgba(34, 197, 94, 0.12);
  color: var(--nh-accent);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.story-entry-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}

.story-entry-time {
  font-size: 11px;
  color: var(--nh-meta);
  font-weight: 500;
}

.story-entry-text {
  font-size: 14px;
  color: var(--nh-body);
  line-height: 1.5;
}

/* -----------------------------------------------
   SCROLL SENTINEL
----------------------------------------------- */

#nh-feed ~ .scroll-sentinel {
  display: flex;
  justify-content: center;
  padding: 20px 0 40px;
  background: var(--nh-bg);
}

/* -----------------------------------------------
   SIDEBAR COMPONENTS
----------------------------------------------- */

/* Both sidebars hidden on mobile */
.nh-sidebar-left,
.nh-sidebar-right {
  display: none;
}

.nh-sidebar-section {
  margin-bottom: 24px;
}

.nh-sidebar-label {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--nh-accent);
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--nh-accent);
}

.nh-sidebar-label--breaking {
  color: var(--nh-accent);
  border-bottom-color: var(--nh-accent);
}

/* Sidebar story cards: full-width, not constrained */
.nh-sidebar-right .nh-story-card {
  width: 100%;
  border-radius: 6px;
  margin-bottom: 8px;
}

.nh-entity-cloud {
  /* container for entity cloud chips */
}

.nh-entity-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* About card (left sidebar) */
.nh-about-card {
  background: var(--nh-bg);
  border: 1px solid var(--nh-border);
  border-radius: 8px;
  padding: 14px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nh-about-name {
  font-family: var(--nh-font-head);
  font-size: 15px;
  font-weight: 700;
  color: var(--nh-head);
  line-height: 1.25;
}

.nh-about-desc {
  font-size: 12px;
  color: var(--nh-body);
  line-height: 1.5;
}

.nh-about-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--nh-accent);
  text-decoration: none;
  display: inline-block;
}

.nh-about-link:hover {
  text-decoration: underline;
}

.nh-about-stats {
  font-size: 11px;
  color: var(--nh-meta);
  margin-top: 2px;
}

/* Category chips (left sidebar) */
.nh-cat-chips {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nh-cat-chip {
  display: block;
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--nh-body);
  border: 1px solid var(--nh-border);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
  outline: none;
  min-height: 36px;
  -webkit-tap-highlight-color: transparent;
  transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nh-cat-chip:hover {
  background: var(--nh-surface-hover);
  color: var(--nh-head);
  border-color: var(--nh-accent);
}

.nh-cat-chip--active {
  background: var(--nh-accent);
  color: #fff;
  border-color: var(--nh-accent);
  font-weight: 700;
}

.nh-cat-chip:focus-visible {
  outline: 2px solid var(--nh-accent);
  outline-offset: 2px;
}

/* Breaking panel (right sidebar) */
.nh-breaking-item {
  padding: 10px 0;
  border-bottom: 1px solid var(--nh-border);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.nh-breaking-item:last-child {
  border-bottom: none;
}

.nh-breaking-item:hover .nh-breaking-item-headline {
  color: var(--nh-accent);
}

.nh-breaking-item-headline {
  font-family: var(--nh-font-head);
  font-size: 13px;
  font-weight: 600;
  color: var(--nh-head);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 150ms ease;
}

.nh-breaking-item-time {
  font-size: 11px;
  color: var(--nh-meta);
  margin-top: 3px;
}

/* Ad placeholder (right sidebar) */
.nh-ad-placeholder {
  border: 1px dashed var(--nh-border);
  border-radius: 6px;
  padding: 12px;
  text-align: center;
}

.nh-ad-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--nh-meta);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.nh-ad-box {
  width: 100%;
  height: 120px;
  background: var(--nh-border);
  border-radius: 4px;
  opacity: 0.5;
}

/* -----------------------------------------------
   RTL SUPPORT
----------------------------------------------- */

/* Swap header identity/actions visually */
[dir="rtl"] .nh-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-header-identity {
  align-items: flex-end;
  text-align: right;
}

[dir="rtl"] .nh-channel-name {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-header-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-header-actions {
  flex-direction: row-reverse;
}

/* Featured card: align text to the right */
[dir="rtl"] .nh-featured-card {
  text-align: right;
}

[dir="rtl"] .nh-ticker {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-row-thumb {
  order: -1;
}

[dir="rtl"] .nh-row-body {
  align-items: flex-end;
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .nh-row-headline {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .nh-row-meta {
  flex-direction: row-reverse;
  text-align: right;
}

[dir="rtl"] .nh-row-chips {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-detail-chips {
  flex-direction: row-reverse;
}

/* Bug 7: mirror back button to right side in RTL */
[dir="rtl"] .nh-detail-header {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-detail-back svg {
  transform: scaleX(-1);
}

[dir="rtl"] .nh-story-badge-row {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-story-facts li {
  padding-left: 0;
  padding-right: 12px;
}

[dir="rtl"] .nh-story-facts li::before {
  left: auto;
  right: 2px;
}

[dir="rtl"] .nh-ctx-facts li {
  padding-left: 0;
  padding-right: 14px;
}

[dir="rtl"] .nh-ctx-facts li::before {
  left: auto;
  right: 3px;
}

[dir="rtl"] .story-timeline-entry {
  flex-direction: row-reverse;
}

[dir="rtl"] .story-entry-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-hero-meta {
  flex-direction: row-reverse;
}

[dir="rtl"] .nh-hero-headline,
[dir="rtl"] .nh-hero-body {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .nh-featured-headline,
[dir="rtl"] .nh-featured-meta {
  text-align: right;
  direction: rtl;
}

[dir="rtl"] .nh-detail-byline {
  flex-direction: row-reverse;
}

/* -----------------------------------------------
   DESKTOP TWO-COLUMN LAYOUT (>= 1024px)
----------------------------------------------- */

@media (min-width: 1024px) {

  /* Neutralize mobile layouts, show desktop */
  .nh-mobile-layout {
    display: none;
  }

  /* Three-column layout: left sidebar | main | right sidebar */
  .nh-desktop-layout {
    display: grid;
    grid-template-columns: 220px 1fr 260px;
    gap: 0;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 0 48px;
    align-items: start;
  }

  .nh-main {
    min-width: 0;
    padding: 24px 20px 0;
    border-left: 1px solid var(--nh-border);
    border-right: 1px solid var(--nh-border);
  }

  /* Left sidebar */
  .nh-sidebar-left {
    display: block;
    position: sticky;
    top: var(--nh-header-height, 56px);
    height: calc(100vh - var(--nh-header-height, 56px));
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--nh-border) transparent;
    padding: 20px 16px;
    background: var(--nh-surface);
    border-right: 1px solid var(--nh-border);
  }

  .nh-sidebar-left::-webkit-scrollbar {
    width: 4px;
  }

  .nh-sidebar-left::-webkit-scrollbar-thumb {
    background: var(--nh-border);
    border-radius: 2px;
  }

  /* Right sidebar */
  .nh-sidebar-right {
    display: block;
    position: sticky;
    top: calc(var(--nh-header-height, 56px) + 16px);
    max-height: calc(100vh - var(--nh-header-height, 56px) - 32px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--nh-border) transparent;
    padding: 20px 16px;
  }

  .nh-sidebar-right::-webkit-scrollbar {
    width: 4px;
  }

  .nh-sidebar-right::-webkit-scrollbar-thumb {
    background: var(--nh-border);
    border-radius: 2px;
  }

  /* Show featured strip on desktop */
  .nh-featured-strip {
    display: flex;
  }

  /* Hero is taller on desktop */
  .nh-desktop-layout .nh-hero-media {
    height: 360px;
  }

  .nh-desktop-layout .nh-hero-headline {
    font-size: 26px;
    -webkit-line-clamp: 3;
  }

  /* Category strip: no horizontal scroll on desktop */
  .nh-cat-strip {
    flex-wrap: wrap;
    overflow-x: visible;
    background: transparent;
    padding: 12px 0;
    border-bottom: 1px solid var(--nh-border);
  }

  /* Article rows on desktop */
  .nh-row {
    border-radius: 6px;
    border-left: 1px solid var(--nh-border);
    border-right: 1px solid var(--nh-border);
    margin-bottom: -1px;
  }

  .nh-row:first-child {
    border-top-left-radius: 6px;
    border-top-right-radius: 6px;
  }

  .nh-row:last-child {
    border-bottom-left-radius: 6px;
    border-bottom-right-radius: 6px;
  }

  .nh-row-headline {
    font-size: 16px;
  }

  .nh-row-thumb {
    width: 96px;
    height: 72px;
  }

  /* Feed on desktop: has its own background */
  #nh-feed,
  .nh-feed {
    background: var(--nh-surface);
    border: 1px solid var(--nh-border);
    border-radius: 8px;
    overflow: hidden;
  }

  /* Wider sidebar story cards */
  .nh-sidebar-right .nh-story-card {
    width: 100%;
    flex-shrink: unset;
  }

  /* Entity cloud chips slightly larger on sidebar */
  .nh-entity-chips .nh-chip {
    font-size: 12px;
    padding: 4px 10px;
    min-height: 28px;
  }

  /* Constrain article detail to a readable column on desktop */
  /* Bug 4 fix: avoid transform on position:fixed (breaks overflow-y on Safari).
     Bug 5 fix: z-index raised above backdrop; backdrop handles dimming. */
  .nh-detail-view {
    max-width: 760px;
    left: calc(50% - 380px);
    right: auto;
    width: 760px;
    z-index: 150;
  }

  .nh-detail-headline {
    font-size: 26px;
  }

  .nh-detail-meta {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 24px 12px;
  }

  .nh-detail-body {
    max-width: 680px;
    margin: 0 auto;
    padding: 20px 24px 16px;
  }

  .nh-detail-cta-wrap {
    max-width: 680px;
    margin: 0 auto;
    padding: 16px 24px 24px;
  }
}

/* -----------------------------------------------
   THEME: OLED — Bloomberg Terminal meets The Verge
   True black, card grid, bold red accent
----------------------------------------------- */

[data-news-theme="oled"] {
  --nh-header-bg:         #000000;
  --nh-header-text:       #ffffff;
  --nh-bg:                #000000;
  --nh-surface:           #111111;
  --nh-border:            rgba(255,255,255,0.08);
  --nh-head:              #ffffff;
  --nh-body:              rgba(255,255,255,0.78);
  --nh-meta:              rgba(255,255,255,0.45);
  --nh-accent:            #dc2626;
  --nh-chip-bg:           rgba(220,38,38,0.15);
  --nh-chip-text:         #fca5a5;
  --nh-ticker-bg:         #dc2626;
  --nh-ticker-label:      #ffffff;
  --nh-ticker-text:       #ffffff;
  --nh-surface-hover:     #1c1c1c;
  --nh-row-active-border: #dc2626;
  --nh-font-head:         'Inter', system-ui, -apple-system, sans-serif;
  --nh-font-body:         'Inter', system-ui, -apple-system, sans-serif;
}

/* OLED feed: 2-column card grid */
[data-news-theme="oled"] #nh-feed,
[data-news-theme="oled"] .nh-feed {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  overflow: visible !important;
}

[data-news-theme="oled"] .nh-row {
  flex-direction: column;
  border-radius: 12px;
  background: #141414;
  overflow: hidden;
  padding: 0 !important;
  border: none !important;
  border-left: none !important;
  border-right: none !important;
  margin-bottom: 0 !important;
}

[data-news-theme="oled"] .nh-row-thumb {
  width: 100% !important;
  height: 110px !important;
  flex-shrink: 0;
  border-radius: 0;
}

[data-news-theme="oled"] .nh-row-body {
  padding: 10px 10px 12px !important;
  align-items: flex-start !important;
  flex: 1;
}

[data-news-theme="oled"] .nh-row-headline {
  font-size: 13px !important;
  font-weight: 700 !important;
  -webkit-line-clamp: 3 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.2px;
}

[data-news-theme="oled"] .nh-row-summary {
  display: none !important;
}

[data-news-theme="oled"] .nh-row-meta {
  margin-top: 6px;
  flex-direction: column;
  gap: 4px;
}

/* Empty state spans full grid width */
[data-news-theme="oled"] .nh-empty {
  grid-column: 1 / -1;
}

/* Hero: bold red left border accent */
[data-news-theme="oled"] .nh-hero {
  border-left: 4px solid #dc2626;
}

/* Breaking chip glows on OLED */
[data-news-theme="oled"] .nh-chip-breaking {
  box-shadow: 0 0 8px rgba(220,38,38,0.5);
}

/* RTL: grid is symmetric, card vertical flow preserved */
[dir="rtl"] [data-news-theme="oled"] .nh-row {
  flex-direction: column;
}

/* -----------------------------------------------
   THEME: GLASS — Frosted, visionOS / iOS 17 aesthetic
   Deep dark bg, backdrop-filter blur cards
----------------------------------------------- */

[data-news-theme="glass"] {
  --nh-header-bg:         rgba(8,8,16,0.85);
  --nh-header-text:       #ffffff;
  --nh-bg:                #070711;
  --nh-surface:           rgba(255,255,255,0.06);
  --nh-border:            rgba(255,255,255,0.1);
  --nh-head:              #ffffff;
  --nh-body:              rgba(255,255,255,0.72);
  --nh-meta:              rgba(255,255,255,0.42);
  --nh-accent:            #dc2626;
  --nh-chip-bg:           rgba(220,38,38,0.18);
  --nh-chip-text:         #fca5a5;
  --nh-ticker-bg:         rgba(220,38,38,0.85);
  --nh-ticker-label:      #ffffff;
  --nh-ticker-text:       rgba(255,255,255,0.9);
  --nh-surface-hover:     rgba(255,255,255,0.1);
  --nh-row-active-border: rgba(220,38,38,0.8);
  --nh-font-head:         'Inter', system-ui, -apple-system, sans-serif;
  --nh-font-body:         'Inter', system-ui, -apple-system, sans-serif;
}

/* Glass header: frosted */
[data-news-theme="glass"] .nh-header {
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

/* Glass article rows */
[data-news-theme="glass"] .nh-row {
  background: rgba(255,255,255,0.05) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.08) !important;
  border-radius: 14px !important;
  margin-bottom: 8px;
  overflow: hidden;
  border-left: 1px solid rgba(255,255,255,0.08) !important;
  border-right: 1px solid rgba(255,255,255,0.08) !important;
}

[data-news-theme="glass"] .nh-row:hover,
[data-news-theme="glass"] .nh-row:active {
  background: rgba(255,255,255,0.09) !important;
  border-color: rgba(220,38,38,0.4) !important;
}

/* Glass feed: remove solid background */
[data-news-theme="glass"] #nh-feed,
[data-news-theme="glass"] .nh-feed {
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  padding: 8px;
}

/* Glass chips */
[data-news-theme="glass"] .nh-chip {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Glass story cards */
[data-news-theme="glass"] .nh-story-card {
  background: rgba(255,255,255,0.06) !important;
  border: 1px solid rgba(255,255,255,0.1) !important;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Glass hero: frosted overlay for text block */
[data-news-theme="glass"] .nh-hero-content {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  margin: -48px 12px 0;
  position: relative;
  z-index: 2;
}

/* Glass detail view */
[data-news-theme="glass"] .nh-detail-view {
  background: #070711;
}

[data-news-theme="glass"] .nh-detail-meta {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

[data-news-theme="glass"] .nh-detail-body {
  background: transparent;
}

/* -----------------------------------------------
   THEME: SWISS — Clean editorial serif, NYT energy
   White bg, Newsreader typography, dramatic red accent
----------------------------------------------- */

[data-news-theme="swiss"] {
  --nh-header-bg:         #111118;
  --nh-header-text:       #ffffff;
  --nh-bg:                #fafafa;
  --nh-surface:           #ffffff;
  --nh-border:            #e5e7eb;
  --nh-head:              #111118;
  --nh-body:              #374151;
  --nh-meta:              #6b7280;
  --nh-accent:            #dc2626;
  --nh-chip-bg:           #fee2e2;
  --nh-chip-text:         #7f1d1d;
  --nh-ticker-bg:         #dc2626;
  --nh-ticker-label:      #ffffff;
  --nh-ticker-text:       #ffffff;
  --nh-surface-hover:     #f3f4f6;
  --nh-row-active-border: #dc2626;
}

/* Swiss: bold red border below header */
[data-news-theme="swiss"] .nh-header {
  border-bottom: 3px solid #dc2626 !important;
}

/* Swiss: article rows with editorial separator lines */
[data-news-theme="swiss"] .nh-row {
  border-bottom: 1px solid #e5e7eb !important;
  border-left: none !important;
  border-right: none !important;
  border-radius: 0 !important;
}

/* Swiss: strong left border on hover */
[data-news-theme="swiss"] .nh-row:hover {
  border-left: 3px solid #dc2626 !important;
  padding-left: calc(var(--nh-row-px, 12px) - 3px);
}

/* Swiss: bigger thumbnails */
[data-news-theme="swiss"] .nh-row-thumb {
  width: 100px !important;
  height: 76px !important;
  border-radius: 4px !important;
}

/* Swiss: serif headlines */
[data-news-theme="swiss"] .nh-row-headline {
  font-size: 17px !important;
  font-weight: 700 !important;
  font-family: var(--nh-font-head) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.3px;
  -webkit-line-clamp: 2 !important;
}

[data-news-theme="swiss"] .nh-hero-headline {
  font-size: 28px !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
}

[data-news-theme="swiss"] .nh-detail-headline {
  font-size: 30px !important;
  font-weight: 800 !important;
  letter-spacing: -0.5px;
  line-height: 1.15 !important;
}

/* Swiss: article body in serif */
[data-news-theme="swiss"] .nh-detail-body {
  font-family: var(--nh-font-head) !important;
  font-size: 17px !important;
  line-height: 1.85 !important;
  color: #1f2937;
}

/* Swiss: strong category strip borders */
[data-news-theme="swiss"] .nh-cat-strip {
  border-top: 2px solid #111118;
  border-bottom: 2px solid #111118;
}

[data-news-theme="swiss"] .nh-cat-btn {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
}

[data-news-theme="swiss"] .nh-cat-btn.active {
  background: #111118 !important;
  color: #ffffff !important;
  border-radius: 2px;
}

/* Swiss: RTL hover border flips to right side */
[dir="rtl"] [data-news-theme="swiss"] .nh-row:hover {
  border-left: none;
  border-right: 3px solid #dc2626 !important;
}

/* -----------------------------------------------
   REDUCED MOTION — wrap all animations
----------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .nh-ticker-track--animated {
    animation: none;
    overflow-x: auto;
  }

  .nh-live-dot,
  .nh-story-dot--pulse {
    animation: none;
  }

  .nh-hero,
  .nh-row,
  .nh-story-card,
  .nh-featured-card {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .nh-hero.visible,
  .nh-row.visible,
  .nh-story-card.visible,
  .nh-featured-card.visible {
    opacity: 1;
    transform: none;
  }

  .nh-hero-img,
  .nh-featured-img,
  .nh-row-thumb img,
  .nh-detail-media img {
    transition: none;
  }
}
