/* AMT Journal — Noticias: calendario económico de la semana (prefijo .nw-) */

.nw { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.nw .page-head { margin-bottom: 0; }
.nw-body, .nw-loading { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- cabecera ---------- */
.nw-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 0; }
.nw-sub > * { display: inline-flex; align-items: center; gap: 5px; }
.nw-sub > * + *::before { content: "·"; margin: 0 4px 0 9px; color: var(--text-4); }
.nw-sub-week { color: var(--text-2); }
.nw-source { transition: color .14s; }
.nw-source:hover { color: var(--text); }
.nw-updated { font-size: 12.5px; color: var(--text-3); }
#nwRefresh.is-busy svg { animation: spin .8s linear infinite; }

.nw-tabs { margin-top: -6px; }

/* aviso de datos de ejemplo (modo demo) */
.nw-sample {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--r-md);
  font-size: 12.5px; line-height: 1.55; color: var(--text-2);
  overflow-wrap: anywhere;
}
.nw-sample .pill { flex: none; }

/* ---------- siguiente evento ---------- */
.nw-next {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 16px 44px;
  padding: 20px 24px;
  overflow: hidden;
}
.nw-next::before {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(560px 180px at 0% 0%, rgba(61, 123, 255, .09), transparent 70%);
  pointer-events: none;
}
.nw-next > * { position: relative; min-width: 0; }
.nw-next-cap { display: flex; align-items: center; gap: 9px; }
.nw-live { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); animation: nw-pulse 2.2s ease-in-out infinite; }
@keyframes nw-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.nw-next-title { display: flex; align-items: center; gap: 11px; margin-top: 11px; font-size: 19px; font-weight: 600; letter-spacing: -.025em; line-height: 1.25; }
.nw-next-title > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.nw-next-title .nw-cur { flex: none; }
.nw-next-meta { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 7px; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.nw-next-when { color: var(--text-2); }
.nw-next-when::first-letter { text-transform: uppercase; }
.nw-next-vals { display: flex; gap: 30px; }
.nw-next-vals > div { display: flex; flex-direction: column; gap: 7px; }
.nw-next-vals b { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.nw-next-count { display: flex; flex-direction: column; gap: 5px; padding-left: 44px; border-left: 1px solid var(--line-soft); }
.nw-cd { display: flex; align-items: baseline; gap: 12px; white-space: nowrap; }
.nw-cd-u b { font-size: 28px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.nw-cd-u i { margin-left: 3px; font-style: normal; font-size: 11.5px; font-weight: 500; color: var(--text-3); }
.nw-cd.is-soon .nw-cd-u b { color: var(--warn); }

.nw-next.is-none { display: block; padding: 16px 20px; }
.nw-next.is-none::before { display: none; }
.nw-next-none { display: flex; align-items: center; gap: 14px; }
.nw-next-ic { flex: none; width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-md); border: 1px solid var(--line); background: rgba(255, 255, 255, .025); color: var(--text-2); }
.nw-next-none-title { font-size: 13.5px; font-weight: 600; }
.nw-next-none p { margin-top: 2px; font-size: 12.5px; color: var(--text-3); }

/* ---------- filtros ---------- */
.nw-bar-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; padding: 12px 16px; }
.nw-bar-row + .nw-bar-row, .nw-note + .nw-bar-row { border-top: 1px solid var(--line-soft); }
.nw-bar-cap { flex: none; min-width: 126px; }
.nw-chips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; }
.nw-chip {
  display: inline-flex; align-items: center; gap: 7px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; letter-spacing: .03em;
  color: var(--text-3);
  white-space: nowrap;
  transition: color .14s, background .14s, border-color .14s;
}
.nw-chip:hover { color: var(--text); border-color: var(--line-strong); }
.nw-chip.is-active { color: var(--text); background: var(--blue-soft); border-color: var(--blue-line); }
.nw-chip small { font-size: 11px; font-weight: 500; letter-spacing: 0; color: var(--text-3); }
.nw-chip.is-active small { color: var(--text-2); }
.nw-chip.is-fixed { cursor: default; }
.nw-chip.is-fixed svg { color: var(--text-3); }
.nw-chip .nw-imp { color: inherit; font-weight: 600; }
.nw-chip:not(.is-active) .nw-bars i { background: rgba(255, 255, 255, .14) !important; }

.nw-search { margin-left: auto; flex: 0 1 250px; min-width: 170px; }
.nw-search .input { height: 30px; padding-left: 34px; font-size: 13px; }
.nw-search .affix { left: 11px; }

.nw-note { padding: 0 16px 12px 156px; margin-top: -2px; font-size: 12.5px; line-height: 1.55; color: var(--text-3); overflow-wrap: anywhere; }
.nw-note-mv { display: inline-flex; vertical-align: -1px; color: var(--blue); }

.nw-sep { flex: none; width: 1px; height: 18px; margin: 0 4px; background: var(--line); }
.nw-switch { font-size: 12.5px; white-space: nowrap; }
.nw-count { margin-left: auto; font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

/* ---------- impacto y divisa ---------- */
.nw-cur {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 42px; height: 22px; padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, .035);
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .04em;
  color: var(--text-2);
  text-transform: uppercase;
  white-space: nowrap;
}
.nw-imp { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.nw-imp.is-medium { color: var(--text-2); }
.nw-imp.is-high { color: var(--text); font-weight: 600; }
.nw-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.nw-bars i { width: 3px; border-radius: 1px; background: rgba(255, 255, 255, .14); }
.nw-bars i:nth-child(1) { height: 5px; }
.nw-bars i:nth-child(2) { height: 8.5px; }
.nw-bars i:nth-child(3) { height: 12px; }
.nw-imp.is-low .nw-bars i:nth-child(1) { background: var(--text-2); }
.nw-imp.is-medium .nw-bars i:nth-child(-n+2) { background: var(--warn); }
.nw-imp.is-high .nw-bars i { background: var(--neg); }

/* ---------- días ---------- */
.nw-list { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
/* clip (no hidden): recorta las esquinas sin crear contenedor de scroll, así la cabecera sticky sigue pegándose a .view */
.nw-day { overflow: clip; }
.nw-day-head {
  position: sticky; top: 0; z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px 100px;
  column-gap: 14px;
  align-items: center;
  min-height: 46px; padding: 0 18px;
  background: var(--bg-1);
  border-bottom: 1px solid var(--line-soft);
}
.nw-day-head > .cap { text-align: right; }
.nw-day-title { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; min-width: 0; font-size: 13.5px; font-weight: 600; letter-spacing: -.005em; }
.nw-day-name::first-letter { text-transform: uppercase; }
.nw-day-name { display: inline-block; }
.nw-day-count { font-size: 12px; font-weight: 400; color: var(--text-3); }
.nw-day.is-today { border-color: var(--line); }

.nw-hol {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px;
  padding: 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  background: rgba(255, 255, 255, .018);
  font-size: 12px; color: var(--text-3);
}
.nw-hol > svg { flex: none; }
.nw-hol-cap { font-weight: 600; color: var(--text-2); }
.nw-hol-item { display: inline-flex; align-items: center; gap: 8px; min-width: 0; overflow-wrap: anywhere; }
.nw-hol .nw-cur { height: 20px; min-width: 38px; font-size: 10.5px; }
.nw-day > .nw-hol:last-child, .nw-hol:has(+ .nw-rows:empty) { border-bottom: none; }

.nw-ev {
  display: grid;
  grid-template-columns: 96px 62px 92px minmax(0, 1fr) 100px 100px;
  column-gap: 14px;
  align-items: center;
  min-height: 46px; padding: 8px 18px;
  border-bottom: 1px solid var(--line-soft);
  transition: background .12s;
}
.nw-ev:last-child { border-bottom: none; border-radius: 0 0 var(--r-lg) var(--r-lg); }
.nw-ev:hover { background: rgba(255, 255, 255, .025); }
.nw-ev-meta, .nw-ev-vals { display: contents; }
.nw-ev-time { font-size: 13px; font-weight: 500; line-height: 1.3; white-space: nowrap; }
.nw-ev-time small { display: block; margin-top: 1px; font-size: 11px; font-weight: 500; color: var(--blue); }
.nw-allday { font-size: 12px; color: var(--text-2); }
.nw-ev-cur, .nw-ev-imp { display: flex; align-items: center; }
.nw-ev-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; min-width: 0; font-size: 13.5px; font-weight: 500; line-height: 1.4; }
.nw-ev-title > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.nw-ev-val { text-align: right; font-size: 13px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nw-ev.is-past > *, .nw-ev.is-past .nw-ev-meta > *, .nw-ev.is-past .nw-ev-vals > * { opacity: .42; }
.nw-ev.is-past .nw-bars i { background: rgba(255, 255, 255, .3) !important; }
.nw-ev.is-mover { box-shadow: inset 2px 0 0 var(--blue); }
.nw-ev.is-mover.is-past { box-shadow: inset 2px 0 0 var(--blue-line); }
.nw-mover {
  flex: none;
  display: inline-flex; align-items: center; gap: 5px;
  height: 20px; padding: 0 7px;
  border: 1px solid var(--blue-line);
  border-radius: 6px;
  background: var(--blue-soft);
  font-size: 11px; font-weight: 600; letter-spacing: .02em;
  color: var(--blue);
  white-space: nowrap;
}

/* línea de «ahora» dentro del día en curso */
.nw-now {
  display: flex; align-items: center; gap: 10px;
  height: 22px; padding: 0 18px;
  border-bottom: 1px solid var(--line-soft);
  font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase;
  color: var(--blue);
}
.nw-now::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, var(--blue-line), transparent); }

.nw-disclaimer { font-size: 12px; line-height: 1.6; color: var(--text-4); overflow-wrap: anywhere; }
.nw-disclaimer a { display: inline-flex; align-items: center; gap: 4px; color: var(--text-3); transition: color .14s; }
.nw-disclaimer a:hover { color: var(--text); }

/* ---------- carga ---------- */
.nw-skel {
  display: block; max-width: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, rgba(255, 255, 255, .045), rgba(255, 255, 255, .1), rgba(255, 255, 255, .045));
  background-size: 200% 100%;
  animation: nw-shimmer 1.5s linear infinite;
}
@keyframes nw-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.nw-loading .nw-next::before { display: none; }
.nw-loading .nw-next-main { display: flex; flex-direction: column; gap: 12px; }
.nw-loading .nw-next-title, .nw-loading .nw-next-meta { margin-top: 0; }
.nw-loading .nw-next-count { border-left: none; }
.nw-loading .nw-ev:hover { background: none; }
.nw-loading .nw-ev-val .nw-skel { margin-left: auto; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .nw-next { grid-template-columns: minmax(0, 1fr) auto; gap: 16px 32px; }
  .nw-next-vals { grid-column: 1; grid-row: 2; }
  .nw-next-count { grid-column: 2; grid-row: 1 / span 2; padding-left: 32px; }
  .nw-next:not(:has(.nw-next-vals)) .nw-next-count { grid-row: 1; }
  .nw-ev { grid-template-columns: 88px 58px 86px minmax(0, 1fr) 84px 84px; column-gap: 12px; }
  .nw-day-head { grid-template-columns: minmax(0, 1fr) 84px 84px; column-gap: 12px; }
  .nw-bar-cap { min-width: 0; flex-basis: 100%; }
  .nw-note { padding-left: 16px; }
}
@media (max-width: 760px) {
  .nw-next { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 18px; }
  .nw-next-vals, .nw-next-count { grid-column: 1; grid-row: auto; }
  .nw-next-count { padding: 14px 0 0; border-left: none; border-top: 1px solid var(--line-soft); }
  .nw-next-title { font-size: 17px; }
  .nw-cd-u b { font-size: 26px; }
  .nw-search { flex: 1 1 100%; margin-left: 0; order: 3; }
  .nw-sep { display: none; }

  .nw-day-head { grid-template-columns: minmax(0, 1fr); padding: 0 14px; }
  .nw-day-head > .cap { display: none; }
  .nw-hol, .nw-now { padding-left: 14px; padding-right: 14px; }
  .nw-ev { grid-template-columns: 56px minmax(0, 1fr); column-gap: 12px; row-gap: 6px; align-items: start; padding: 12px 14px; }
  .nw-ev-time { grid-column: 1; grid-row: 1 / span 3; padding-top: 2px; white-space: normal; }
  .nw-ev-meta { display: flex; align-items: center; gap: 10px; grid-column: 2; }
  .nw-ev-title { grid-column: 2; }
  .nw-ev-vals { display: flex; gap: 16px; grid-column: 2; }
  .nw-ev.no-vals .nw-ev-vals { display: none; }
  .nw-ev-val { text-align: left; font-size: 12.5px; }
  .nw-ev-val::before { content: attr(data-label) " "; color: var(--text-3); }
  .nw-ev.is-past > * { opacity: .42; }
  .nw-ev.is-past .nw-ev-meta > *, .nw-ev.is-past .nw-ev-vals > * { opacity: 1; }
  .nw-loading .nw-ev-val .nw-skel { margin-left: 0; }
}
@media (max-width: 640px) {
  .nw .page-actions { width: 100%; justify-content: space-between; }
  .nw-sub { flex-direction: column; align-items: flex-start; }
  .nw-sub > * + *::before { display: none; }
  .nw-sample { flex-direction: column; gap: 8px; }
}
