/* In-context media chips and lightbox — themed for Classic, Noir, Print. */

.nx-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  margin: 1.1rem 0 1.35rem;
}
.nx-chips + .story-actions,
.nx-chips + .actions { margin-top: 1.5rem; }
.nx-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  min-height: 36px;
  padding: .4rem .85rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, .32);
  background: rgba(255, 255, 255, .05);
  color: var(--color-text-secondary, #b3bfd0);
  font: 600 .78rem/1 var(--font-heading, inherit);
  letter-spacing: .02em;
  cursor: pointer;
  text-decoration: none !important;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}
.nx-chip:hover {
  border-color: var(--color-accent-500, #0891b2);
  background: rgba(8, 145, 178, .12);
  color: #ffffff;
}
.nx-chip__icon { font-size: .7em; opacity: .85; }
/* Chips sitting on bright sections */
:where(.section--light, .story-section--light, .bg-light, .bg-light-alt) .nx-chip {
  border-color: rgba(51, 65, 85, .3);
  background: #ffffff;
  color: #334155;
}
:where(.section--light, .story-section--light, .bg-light, .bg-light-alt) .nx-chip:hover {
  border-color: #0e7490;
  background: #ecfeff;
  color: #075985;
}

/* Lightbox */
.nx-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(6, 13, 26, .8);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.nx-lightbox__panel {
  width: min(960px, 96vw);
  background: #0f2038;
  border: 1px solid rgba(148, 163, 184, .3);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 40px 120px rgba(0, 0, 0, .5);
  display: flex;
  flex-direction: column;
}
.nx-lightbox__panel--article { height: min(84vh, 900px); }
.nx-lightbox__bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: .6rem .9rem;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  color: #f1f5f9;
}
.nx-lightbox__title {
  font: 700 .9rem/1.3 var(--font-heading, inherit);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nx-lightbox__open {
  color: #7dd3fc;
  font-size: .8rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Focus sentinel. Must stay in the tab order, so it cannot use display:none or
   visibility:hidden. Keydown events inside a cross-origin video iframe never
   reach this document; tabbing past the iframe lands here instead, and the
   handler returns focus to the close button so the dialog cannot trap a
   keyboard user (WCAG 2.1.2 No Keyboard Trap). */
.nx-lightbox__sentinel {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.nx-lightbox__close {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(148, 163, 184, .35);
  background: transparent;
  color: #f1f5f9;
  font-size: .9rem;
  cursor: pointer;
}
.nx-lightbox__close:hover { background: rgba(255, 255, 255, .1); }
.nx-lightbox__content { flex: 1; min-height: 0; display: flex; }
.nx-lightbox__frame { position: relative; width: 100%; aspect-ratio: 16 / 9; }
.nx-lightbox__frame iframe,
.nx-lightbox__page {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.nx-lightbox__page { position: relative; background: #ffffff; }

/* Noir */
html[data-theme="noir"] .nx-chip {
  border-color: rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .05);
  color: #c3d0e3;
}
html[data-theme="noir"] .nx-chip:hover {
  border-color: rgba(92, 198, 222, .6);
  background: rgba(92, 198, 222, .14);
  color: #ffffff;
}
html[data-theme="noir"] .nx-lightbox { background: rgba(0, 0, 0, .85); }
html[data-theme="noir"] .nx-lightbox__panel {
  background: #22395f;
  border-color: rgba(255, 255, 255, .16);
}

/* Print Edition */
html[data-theme="print"] .nx-chip {
  border-radius: 0;
  border: 1.5px solid #1a1712;
  background: #fffdf8;
  color: #1a1712;
  font-family: var(--pe-serif-text, inherit);
  text-transform: uppercase;
  letter-spacing: .1em;
  font-size: .7rem;
}
html[data-theme="print"] .nx-chip:hover {
  background: #1a1712;
  color: #f7f3ea;
  border-color: #1a1712;
}
html[data-theme="print"] .nx-lightbox { background: rgba(26, 23, 18, .68); backdrop-filter: none; }
html[data-theme="print"] .nx-lightbox__panel {
  background: #fffdf8;
  border: 2px solid #1a1712;
  border-radius: 0;
  box-shadow: 14px 14px 0 #1a1712;
}
html[data-theme="print"] .nx-lightbox__bar { color: #1a1712; border-bottom-color: rgba(26, 23, 18, .25); }
html[data-theme="print"] .nx-lightbox__open { color: #b5372c; }
html[data-theme="print"] .nx-lightbox__close {
  border-radius: 0;
  border: 1.5px solid #1a1712;
  color: #1a1712;
}
html[data-theme="print"] .nx-lightbox__close:hover { background: #1a1712; color: #f7f3ea; }

@media (max-width: 640px) {
  .nx-lightbox { padding: 8px; }
  .nx-lightbox__panel--article { height: 92vh; }
}
@media print {
  .nx-chips, .nx-lightbox { display: none !important; }
}
