/* Forex News — macro desk (event cards, spotlight). Loaded after styles.css. */

.forex-news-page {
  --nx-accent: var(--accent-primary, #5b8cff);
  --nx-text: var(--text-primary, #eef1f8);
  --nx-muted: var(--text-secondary, #9aa3b5);
  --nx-panel: color-mix(in srgb, var(--nx-accent) 5%, rgba(12, 14, 20, .62));
  --nx-raised: color-mix(in srgb, var(--nx-accent) 8%, rgba(255, 255, 255, .035));
  --nx-line: color-mix(in srgb, var(--nx-accent) 18%, rgba(255, 255, 255, .07));
  --nx-high: #ff5d6c;
  --nx-medium: #ffab4a;
  --nx-low: #e9cf6a;
  --nx-holiday: #8f96a6;
}

/* ---------- Spotlight: next high-impact release ---------- */
.nx-spotlight {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  margin: 0 0 22px;
  padding: 30px 32px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--nx-high) 34%, var(--nx-line));
  border-radius: 24px;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--nx-high) 22%, transparent), transparent 52%),
    radial-gradient(90% 120% at 0% 100%, color-mix(in srgb, var(--nx-accent) 20%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(4, 5, 9, .55), rgba(4, 5, 9, .82));
  box-shadow: 0 30px 60px -30px rgba(0, 0, 0, .7), inset 0 1px 0 rgba(255, 255, 255, .06);
  color: #f4f6fb;
  cursor: pointer;
  outline: none;
  animation: nx-rise .7s cubic-bezier(.2, .8, .2, 1) both;
}

.nx-spotlight[hidden] { display: none; }

.nx-spotlight::before,
.nx-spotlight::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 7px;
  z-index: -1;
  background: repeating-linear-gradient(90deg, rgba(255, 255, 255, .07) 0 14px, transparent 14px 26px);
  opacity: .55;
}

.nx-spotlight::before { top: 0; }
.nx-spotlight::after { bottom: 0; }

.nx-spotlight:hover,
.nx-spotlight:focus-visible {
  border-color: color-mix(in srgb, var(--nx-high) 60%, transparent);
  box-shadow: 0 34px 70px -30px rgba(0, 0, 0, .8), 0 0 0 1px color-mix(in srgb, var(--nx-high) 30%, transparent);
}

.nx-spot-copy { min-width: 0; display: grid; gap: 10px; }

.nx-spot-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  color: color-mix(in srgb, var(--nx-high) 70%, #fff);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.nx-spot-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--nx-high);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--nx-high) 60%, transparent);
  animation: nx-beacon 2.2s ease-out infinite;
}

.nx-spot-copy h3 {
  margin: 0;
  font-size: clamp(24px, 2.6vw, 36px);
  line-height: 1.06;
  letter-spacing: -.03em;
  color: #fff;
}

.nx-spot-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: rgba(235, 239, 248, .72);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.nx-spot-clock {
  display: grid;
  justify-items: end;
  gap: 6px;
  text-align: right;
}

.nx-spot-clock > span {
  color: rgba(235, 239, 248, .6);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .2em;
  text-transform: uppercase;
}

.nx-spot-clock > strong {
  font-size: clamp(38px, 4.4vw, 60px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.035em;
  font-variant-numeric: tabular-nums;
  color: #fff;
  text-shadow: 0 0 34px color-mix(in srgb, var(--nx-high) 45%, transparent);
}

.nx-spotlight.is-active .nx-spot-clock > strong { color: var(--nx-high); }

.nx-spot-figures { display: flex; gap: 8px; margin-top: 6px; }

.nx-spot-figures .nx-cell {
  min-width: 96px;
  background: rgba(255, 255, 255, .05);
  border-color: rgba(255, 255, 255, .1);
}

.nx-spotlight .nx-asset { color: rgba(240, 243, 250, .82); border-color: rgba(255, 255, 255, .12); background: rgba(255, 255, 255, .05); }

/* ---------- Event list ---------- */
.forex-news-page .forex-news-events {
  container-type: inline-size;
  gap: 10px;
}

.forex-news-page .forex-news-events .nx-day {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0 2px;
  padding: 10px 2px;
  color: var(--nx-text);
  letter-spacing: 0;
  text-transform: none;
  background: linear-gradient(180deg, var(--nx-sticky, rgba(10, 12, 18, .92)) 70%, transparent);
  backdrop-filter: blur(6px);
}

.forex-news-page .forex-news-events .nx-day:first-child { margin-top: 4px; }

.nx-day strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.01em;
  text-transform: capitalize;
}

.nx-day em {
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--nx-accent);
  background: color-mix(in srgb, var(--nx-accent) 14%, transparent);
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nx-day span {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 12px;
  color: var(--nx-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.nx-day span::before {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--nx-line), transparent);
  order: 2;
}

.forex-news-page .forex-news-events .nx-card {
  --nx-tone: var(--nx-low);
  position: relative;
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 18px 18px 18px 22px;
  overflow: hidden;
  border: 1px solid var(--nx-line);
  border-radius: 20px;
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--nx-tone) 9%, transparent), transparent 38%),
    var(--nx-panel);
  box-shadow: 0 18px 36px -28px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .04);
  color: var(--nx-text);
  animation: nx-rise .55s cubic-bezier(.2, .8, .2, 1) both;
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease, opacity .22s ease;
}

.forex-news-page .forex-news-events .nx-card.impact-high { --nx-tone: var(--nx-high); }
.forex-news-page .forex-news-events .nx-card.impact-medium { --nx-tone: var(--nx-medium); }
.forex-news-page .forex-news-events .nx-card.impact-holiday { --nx-tone: var(--nx-holiday); }

.forex-news-page .forex-news-events .nx-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--nx-tone);
  box-shadow: 0 0 18px color-mix(in srgb, var(--nx-tone) 70%, transparent);
}

.forex-news-page .forex-news-events .nx-card:hover,
.forex-news-page .forex-news-events .nx-card:focus-visible {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--nx-tone) 45%, var(--nx-line));
  box-shadow: 0 24px 44px -26px rgba(0, 0, 0, .85), 0 0 0 1px color-mix(in srgb, var(--nx-tone) 18%, transparent);
}

.forex-news-page .forex-news-events .nx-card.is-selected {
  border-color: color-mix(in srgb, var(--nx-accent) 75%, transparent);
  background:
    linear-gradient(100deg, color-mix(in srgb, var(--nx-accent) 16%, transparent), transparent 55%),
    var(--nx-panel);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--nx-accent) 40%, transparent), 0 24px 44px -26px rgba(0, 0, 0, .85);
}

.forex-news-page .forex-news-events .nx-card.is-past { opacity: .62; }
.forex-news-page .forex-news-events .nx-card.is-past:hover,
.forex-news-page .forex-news-events .nx-card.is-past.is-selected { opacity: 1; }

.forex-news-page .forex-news-events .nx-card.is-next {
  border-color: color-mix(in srgb, var(--nx-accent) 45%, var(--nx-line));
}

.forex-news-page .forex-news-events .nx-card.is-next::after,
.forex-news-page .forex-news-events .nx-card.is-active::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, color-mix(in srgb, var(--nx-accent) 12%, transparent) 50%, transparent 70%);
  transform: translateX(-100%);
  animation: nx-sweep 4.8s ease-in-out infinite;
}

.forex-news-page .forex-news-events .nx-card.is-active { border-color: color-mix(in srgb, var(--nx-tone) 70%, transparent); }

/* time column */
.nx-time { display: grid; gap: 6px; align-content: center; }

.nx-time strong {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}

.nx-time small {
  justify-self: start;
  padding: 3px 8px;
  border-radius: 999px;
  color: var(--nx-muted);
  background: var(--nx-raised);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.nx-card.is-next .nx-time small { color: var(--nx-accent); background: color-mix(in srgb, var(--nx-accent) 14%, transparent); }
.nx-card.is-active .nx-time small { color: #fff; background: var(--nx-tone); animation: nx-pulse 1.6s ease-in-out infinite; }

/* main column */
.nx-main { min-width: 0; display: grid; gap: 9px; }

.nx-head { display: flex; align-items: center; gap: 12px; min-width: 0; }

.nx-title {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: 17px;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: -.015em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nx-head .news-ai-bias { margin-left: auto; flex: none; }

.nx-impact { display: inline-flex; align-items: flex-end; gap: 3px; height: 16px; flex: none; }

.nx-impact i {
  width: 4px;
  border-radius: 2px;
  background: color-mix(in srgb, var(--nx-muted) 30%, transparent);
}

.nx-impact i:nth-child(1) { height: 7px; }
.nx-impact i:nth-child(2) { height: 11px; }
.nx-impact i:nth-child(3) { height: 16px; }

.nx-impact i.is-on { background: var(--nx-tone, var(--nx-high)); box-shadow: 0 0 8px color-mix(in srgb, var(--nx-tone, var(--nx-high)) 55%, transparent); }
.nx-impact[data-level="3"] { --nx-tone: var(--nx-high); }
.nx-impact[data-level="2"] { --nx-tone: var(--nx-medium); }
.nx-impact[data-level="1"] { --nx-tone: var(--nx-low); }

.nx-card.is-selected .nx-impact i.is-on { animation: nx-bars 1.2s ease-in-out infinite alternate; }
.nx-card.is-selected .nx-impact i.is-on:nth-child(2) { animation-delay: .15s; }
.nx-card.is-selected .nx-impact i.is-on:nth-child(3) { animation-delay: .3s; }

.nx-assets { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.nx-assets .nx-ccy { margin: 0; font-weight: 800; }

.nx-asset {
  padding: 3px 8px;
  border: 1px solid var(--nx-line);
  border-radius: 7px;
  color: var(--nx-muted);
  background: var(--nx-raised);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

.nx-flag {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px 5px 8px;
  border: 1px solid color-mix(in srgb, var(--nx-high) 38%, transparent);
  border-radius: 999px;
  color: color-mix(in srgb, var(--nx-high) 75%, var(--nx-text));
  background: repeating-linear-gradient(-45deg, color-mix(in srgb, var(--nx-high) 12%, transparent) 0 6px, color-mix(in srgb, var(--nx-high) 6%, transparent) 6px 12px);
  font-size: 11px;
  font-weight: 750;
  cursor: help;
}

.nx-flag svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.nx-meaning {
  margin: 0;
  overflow: hidden;
  color: var(--nx-muted);
  font-size: 12.5px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.nx-meaning--ai { color: var(--nx-text); }
.nx-meaning--ai::before { content: "AI · "; color: var(--nx-accent); font-weight: 800; }

/* figures column */
.nx-figures { display: flex; align-items: stretch; gap: 8px; }

.nx-cell {
  display: grid;
  align-content: center;
  gap: 5px;
  min-width: 88px;
  padding: 10px 12px;
  border: 1px solid var(--nx-line);
  border-radius: 14px;
  background: var(--nx-raised);
}

.nx-cell span {
  color: var(--nx-muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nx-cell strong {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.nx-cell small { color: var(--nx-muted); font-size: 10px; font-weight: 700; white-space: nowrap; }

.nx-cell--actual { min-width: 112px; }
.nx-cell--actual.is-countdown { border-color: color-mix(in srgb, var(--nx-tone, var(--nx-accent)) 38%, var(--nx-line)); background: color-mix(in srgb, var(--nx-tone, var(--nx-accent)) 9%, var(--nx-raised)); }
.nx-cell--actual.is-countdown strong { color: var(--nx-text); }
.nx-cell--actual.is-above strong, .nx-cell--actual.is-above small { color: var(--nx-accent); }
.nx-cell--actual.is-below strong, .nx-cell--actual.is-below small { color: var(--nx-medium); }
.nx-cell--actual.is-live strong { color: var(--nx-tone); animation: nx-pulse 1.6s ease-in-out infinite; }

.nx-cal {
  display: grid;
  place-items: center;
  width: 46px;
  padding: 0;
  border: 1px solid var(--nx-line);
  border-radius: 14px;
  color: var(--nx-muted);
  background: var(--nx-raised);
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease, transform .18s ease;
}

.nx-cal svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.nx-cal:hover:not(:disabled) { color: var(--nx-text); border-color: color-mix(in srgb, var(--nx-accent) 55%, transparent); background: color-mix(in srgb, var(--nx-accent) 16%, transparent); transform: translateY(-1px); }
.nx-cal:disabled { opacity: .35; cursor: default; }

@container (max-width: 980px) {
  .forex-news-page .forex-news-events .nx-card { grid-template-columns: 74px minmax(0, 1fr) auto; gap: 14px; padding: 16px 14px 16px 18px; }
  .nx-cell { min-width: 78px; padding: 9px 10px; }
  .nx-cell--actual { min-width: 96px; }
  .nx-cell strong { font-size: 15px; }
  .nx-cal { width: 40px; }
  .nx-time strong { font-size: 20px; }
}

@container (max-width: 680px) {
  .forex-news-page .forex-news-events .nx-card { grid-template-columns: 70px minmax(0, 1fr); }
  .nx-figures { grid-column: 1 / -1; }
  .nx-cell { flex: 1; min-width: 0; }
  .nx-time strong { font-size: 19px; }
}

@container (max-width: 460px) {
  .forex-news-page .forex-news-events .nx-card { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .nx-time { grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
  .nx-figures { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .nx-spotlight { grid-template-columns: minmax(0, 1fr); padding: 24px 20px; }
  .nx-spot-clock { justify-items: start; text-align: left; }
}

/* ---------- Animations ---------- */
@keyframes nx-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes nx-sweep { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes nx-pulse { 50% { opacity: .55; } }
@keyframes nx-bars { to { transform: scaleY(.55); } }
@keyframes nx-beacon { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nx-high) 60%, transparent); } 100% { box-shadow: 0 0 0 12px transparent; } }

.forex-news-events .nx-card:nth-child(2) { animation-delay: .03s; }
.forex-news-events .nx-card:nth-child(3) { animation-delay: .06s; }
.forex-news-events .nx-card:nth-child(4) { animation-delay: .09s; }
.forex-news-events .nx-card:nth-child(5) { animation-delay: .12s; }
.forex-news-events .nx-card:nth-child(6) { animation-delay: .15s; }
.forex-news-events .nx-card:nth-child(n+7) { animation-delay: .18s; }

/* ---------- Light theme ---------- */
body[data-theme="white"] .forex-news-page {
  --nx-text: #141a28;
  --nx-muted: #5d6679;
  --nx-panel: #ffffff;
  --nx-raised: color-mix(in srgb, var(--nx-accent) 5%, #f4f6fa);
  --nx-line: color-mix(in srgb, var(--nx-accent) 14%, #e1e5ec);
  --nx-high: #e23b4e;
  --nx-medium: #e08415;
  --nx-low: #c9a227;
  --nx-sticky: rgba(244, 246, 251, .94);
}

body[data-theme="white"] .forex-news-page .forex-news-events .nx-card {
  border-color: var(--nx-line);
  background: linear-gradient(100deg, color-mix(in srgb, var(--nx-tone) 8%, transparent), transparent 34%), var(--nx-panel);
  box-shadow: 0 14px 30px -24px rgba(20, 30, 60, .35);
}

body[data-theme="white"] .forex-news-page .forex-news-events .nx-card.is-selected {
  border-color: color-mix(in srgb, var(--nx-accent) 70%, transparent);
  background: linear-gradient(100deg, color-mix(in srgb, var(--nx-accent) 10%, transparent), transparent 55%), var(--nx-panel);
}

body[data-theme="white"] .forex-news-page .forex-news-events .nx-card.is-active { border-color: color-mix(in srgb, var(--nx-tone) 60%, transparent); }

/* ---------- Solid surfaces (transparency off) ---------- */
html[data-surface="solid"] .forex-news-page {
  --nx-panel: var(--solid-panel, #111317);
  --nx-raised: var(--solid-raised, #1b1e24);
  --nx-line: var(--solid-border, #23262d);
  --nx-sticky: var(--solid-bg, #0a0b0d);
}

html[data-surface="solid"] .forex-news-page .forex-news-events .nx-day { backdrop-filter: none; background: var(--nx-sticky); }
html[data-surface="solid"] .forex-news-page .forex-news-events .nx-card { box-shadow: none; background: var(--nx-panel); }
html[data-surface="solid"] .forex-news-page .forex-news-events .nx-card.is-selected { background: var(--nx-raised); box-shadow: inset 0 0 0 1px var(--nx-accent); }
html[data-surface="solid"] .nx-spotlight { background: var(--solid-panel, #111317); box-shadow: none; }
html[data-surface="solid"] .nx-impact i.is-on,
html[data-surface="solid"] .forex-news-page .forex-news-events .nx-card::before { box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  .nx-spotlight,
  .forex-news-page .forex-news-events .nx-card,
  .forex-news-page .forex-news-events .nx-card::after,
  .nx-spot-kicker::before,
  .nx-card .nx-time small,
  .nx-card .nx-impact i,
  .nx-cell--actual.is-live strong {
    animation: none !important;
  }
  .forex-news-page .forex-news-events .nx-card::after { display: none; }
}
