/* Noticias — hero con panel de datos, tarjetas con profundidad, aparición escalonada y esqueletos.
   Se carga después de db.css. Solo afecta a noticias.html. */

:root { --nt-mono: 'JetBrains Mono', ui-monospace, monospace; --nt-ease: cubic-bezier(.2,.7,.2,1); }

/* ---------- Hero ---------- */
.nt-hero {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 0 auto;
  padding: 140px 40px 56px;
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 56px; align-items: center;
}
.nt-hero::before {
  content: ''; position: absolute; inset: 40px 0 auto; height: 520px; z-index: -1; pointer-events: none;
  background:
    radial-gradient(520px 320px at 78% 40%, rgba(247,147,26,.16), transparent 70%),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px;
  -webkit-mask-image: radial-gradient(70% 80% at 60% 40%, #000 20%, transparent 75%);
  mask-image: radial-gradient(70% 80% at 60% 40%, #000 20%, transparent 75%);
}
.nt-copy { text-align: left; }
.nt-kicker {
  display: inline-flex; align-items: center; gap: 10px; padding: 7px 16px;
  border: 1px solid rgba(255,255,255,.16); border-radius: 999px; background: rgba(255,255,255,.03);
  font-size: .85rem; color: #c9c9ce; margin-bottom: 22px;
}
.nt-dot { width: 8px; height: 8px; border-radius: 50%; background: #F7931A; box-shadow: 0 0 0 0 rgba(247,147,26,.6); animation: ntPing 2s infinite; }
@keyframes ntPing { 70% { box-shadow: 0 0 0 9px rgba(247,147,26,0); } 100% { box-shadow: 0 0 0 0 rgba(247,147,26,0); } }
html body .nt-hero h1 {
  font-size: clamp(2.8rem, 6vw, 5rem); line-height: 1; font-stretch: 112%; max-width: none; margin: 0 0 22px; text-align: left;
}
html body .nt-hero p { font-size: clamp(1.02rem, 1.4vw, 1.2rem); line-height: 1.6; color: #a1a1a6; max-width: 34em; margin: 0; text-align: left; }
.nt-hero .lang-notice { margin-top: 22px; }

/* ---------- Panel tipo terminal ---------- */
.nt-term {
  background: rgba(8,8,9,.88); border: 1px solid rgba(255,255,255,.14); border-radius: 14px; overflow: hidden;
  box-shadow: 0 30px 70px rgba(0,0,0,.65), 0 0 0 1px rgba(247,147,26,.06), inset 0 1px 0 rgba(255,255,255,.06);
  font-family: var(--nt-mono); font-size: .86rem;
}
.nt-term-bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; border-bottom: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.03); }
.nt-term-bar i { width: 10px; height: 10px; border-radius: 50%; background: #3a3a3e; }
.nt-term-bar i:first-child { background: #F7931A; }
.nt-term-title { margin-left: 8px; color: #a1a1a6; font-size: .74rem; letter-spacing: .04em; }
.nt-status { margin-left: auto; font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; color: #F7931A; display: inline-flex; align-items: center; gap: 7px; }
.nt-status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: ntBlink 1.2s steps(2) infinite; }
.nt-status.ok { color: #00D084; }
.nt-status.ok::before { animation: none; }
.nt-status.err { color: #FF6B5E; }
.nt-status.err::before { animation: none; }
@keyframes ntBlink { 50% { opacity: .2; } }
.nt-rows { margin: 0; padding: 8px 18px 6px; }
.nt-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 10px 0; border-bottom: 1px dashed rgba(255,255,255,.1); }
.nt-row:last-child { border-bottom: 0; }
.nt-row dt { font-family: 'Archivo', system-ui, sans-serif; font-size: .8rem; color: #a1a1a6; }
.nt-row dd { margin: 0; text-align: right; color: #f5f5f7; }
.nt-row b { font-weight: 600; font-size: 1.05rem; }
.nt-row small { font-size: .74rem; color: #a1a1a6; }
.nt-row small.up { color: #5fd38d; }
.nt-row small.down { color: #ff7a6b; }
.nt-meter { height: 6px; margin: 2px 0 8px; border-radius: 99px; position: relative; background: linear-gradient(90deg, #FF4444, #FF8A3D 35%, #FBBF24 50%, #8FD14F 70%, #00D084); opacity: .9; }
.nt-meter span { position: absolute; top: -4px; left: 0; width: 3px; height: 14px; border-radius: 2px; background: #fff; box-shadow: 0 0 8px rgba(255,255,255,.7); transform: translateX(-50%); transition: left .9s var(--nt-ease); }
.nt-prompt { padding: 4px 18px 16px; color: #F7931A; }
.nt-cursor { display: inline-block; width: 8px; height: 1em; vertical-align: -2px; background: #F7931A; animation: ntBlink 1s steps(2) infinite; }
.nt-term.is-loading .nt-row b { background: linear-gradient(90deg, rgba(255,255,255,.06) 25%, rgba(255,255,255,.16) 50%, rgba(255,255,255,.06) 75%) 100% 50% / 400% 100%; color: transparent; border-radius: 4px; animation: ntShimmer 1.5s linear infinite; }
@keyframes ntShimmer { to { background-position: 0 50%; } }

/* ---------- Estado + filtro por fuente (chips) ---------- */
.news-wrap .news-status { border-radius: 12px; background: rgba(255,255,255,.03); border-color: rgba(255,255,255,.1); }
.news-wrap .status-left, .news-wrap .status-left span { font-family: var(--nt-mono); font-size: .76rem; color: #b4b4b9; }
.news-wrap .refresh-btn { border-radius: 999px; color: #b4b4b9; border-color: rgba(255,255,255,.2); }
.news-wrap .refresh-btn:hover { background: rgba(247,147,26,.1); }
.news-wrap .source-tabs { border-bottom: 0; padding-bottom: 0; gap: 8px; margin-bottom: 26px; }
.news-wrap .source-tab {
  border: 1px solid rgba(255,255,255,.14); border-radius: 999px; color: #b4b4b9; padding: 8px 16px; min-height: 40px;
  display: inline-flex; align-items: center; gap: 8px; transition: all .25s var(--nt-ease);
}
.news-wrap .source-tab:hover { color: #fff; border-color: rgba(247,147,26,.5); background: rgba(247,147,26,.06); transform: translateY(-1px); }
.news-wrap .source-tab.active { color: #000; background: #F7931A; border-color: #F7931A; font-weight: 700; }
.news-wrap .source-tab.active .cnt { color: #000; background: rgba(0,0,0,.14); }
.news-wrap .source-tab .cnt { color: #b4b4b9; background: rgba(255,255,255,.08); }
.source-tab:focus-visible, .refresh-btn:focus-visible, a.nc:focus-visible, a.card-featured:focus-visible { outline: 2px solid #F7931A; outline-offset: 3px; }

/* ---------- Tarjetas con profundidad ---------- */
.news-grid { gap: 18px; perspective: 1200px; }
.news-wrap a.nc, .news-wrap a.card-featured {
  position: relative; isolation: isolate;
  background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015));
  border: 1px solid rgba(255,255,255,.1); border-radius: 18px;
  box-shadow: 0 1px 0 rgba(255,255,255,.05) inset, 0 2px 4px rgba(0,0,0,.4), 0 10px 24px rgba(0,0,0,.28);
  transition: transform .45s var(--nt-ease), box-shadow .45s var(--nt-ease), border-color .3s;
  will-change: transform;
}
.news-wrap a.nc::before, .news-wrap a.card-featured::before {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .35s;
  background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 0%), rgba(247,147,26,.16), transparent 60%);
}
.news-wrap a.nc:hover, .news-wrap a.card-featured:hover {
  transform: translateY(-8px) scale(1.012);
  border-color: rgba(247,147,26,.55);
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 4px 8px rgba(0,0,0,.4), 0 22px 44px rgba(0,0,0,.55), 0 0 40px -8px rgba(247,147,26,.35);
}
.news-wrap a.nc:hover::before, .news-wrap a.card-featured:hover::before { opacity: 1; }
.news-wrap .nc-body { padding: 18px 20px 16px; gap: 10px; position: relative; z-index: 2; }
.news-wrap .nc-title { font-size: 1rem; font-weight: 650; line-height: 1.38; letter-spacing: -.01em; }
.news-wrap .nc-desc { font-size: .84rem; color: #a8a8ad; }
.news-wrap .nc-label { font-size: .66rem; }
.news-wrap .nc-footer { color: #a1a1a6; border-top: 1px solid rgba(255,255,255,.08); padding-top: 10px; font-size: .72rem; }
.news-wrap .nc-arrow { opacity: .35; transform: translate(-4px, 4px); transition: opacity .3s, transform .35s var(--nt-ease); font-size: 1rem; }
.news-wrap a.nc:hover .nc-arrow { opacity: 1; transform: none; }
.news-wrap .nc-img-wrap { height: 190px; }
.news-wrap .nc-img-wrap img { transition: transform .8s var(--nt-ease); }
.news-wrap a.nc:hover .nc-img-wrap img { transform: scale(1.07); }
.news-wrap .nc-src-badge { border-radius: 999px; padding: 3px 10px; }
.news-wrap .nc.nc-text { border-left-width: 3px; }
.news-wrap a.card-featured { border-radius: 22px; margin-bottom: 4px; }
.news-wrap .card-featured .cf-body { padding: 36px 40px; }
.news-wrap .card-featured .cf-body .nc-title { font-size: clamp(1.3rem, 2.2vw, 1.75rem); line-height: 1.25; letter-spacing: -.02em; }
.news-wrap .card-featured .cf-body .nc-desc { font-size: .95rem; color: #a8a8ad; }
.news-wrap .card-featured .cf-body .nc-meta { color: #a1a1a6; }
.news-wrap .card-featured .cf-body .nc-arrow { opacity: .5; }
.news-wrap .card-featured:hover .nc-arrow { opacity: 1; }
.news-wrap .card-featured .cf-img img { transition: transform .9s var(--nt-ease); }
.news-wrap a.card-featured:hover .cf-img img { transform: scale(1.06); }
.news-wrap .card-featured.no-img .cf-body { border-left: 3px solid #F7931A; }

/* ---------- Aparición escalonada (el índice --i lo pone noticias.js) ---------- */
@keyframes ntRise { from { opacity: 0; transform: translateY(28px) scale(.97); } to { opacity: 1; transform: none; } }
.news-wrap a.nc, .news-wrap a.card-featured {
  animation: ntRise .7s var(--nt-ease) both; animation-delay: calc(var(--i, 0) * 60ms);
}

/* ---------- Esqueleto de carga ---------- */
.news-wrap div.nc, .news-wrap div.card-featured {
  background: rgba(255,255,255,.025); border: 1px solid rgba(255,255,255,.08); border-radius: 18px; overflow: hidden;
  animation: ntPulse 1.6s ease-in-out infinite;
}
.news-wrap div.nc { animation-delay: calc(var(--i, 0) * 120ms); }
@keyframes ntPulse { 50% { opacity: .55; } }
.news-wrap .skeleton { background: linear-gradient(90deg, rgba(255,255,255,.04) 25%, rgba(255,255,255,.11) 50%, rgba(255,255,255,.04) 75%); background-size: 400% 100%; border-radius: 6px; }
.news-wrap .sk-img { height: 190px; }

/* ---------- Fear & Greed: panel acorde ---------- */
.news-wrap .fng { border-radius: 18px; background: linear-gradient(180deg, rgba(255,255,255,.045), rgba(255,255,255,.015)); border-color: rgba(255,255,255,.1); }
.news-wrap .fng-info p, .news-wrap .fng-meta { color: #a8a8ad; }

/* ---------- Móvil ---------- */
@media (max-width: 900px) {
  .nt-hero { grid-template-columns: 1fr; gap: 32px; padding: 112px 16px 36px; }
  html body .nt-hero h1 { font-size: clamp(2.5rem, 12vw, 3.4rem); }
  .nt-hero::before { height: 380px; }
}
@media (max-width: 768px) {
  .news-wrap a.card-featured .cf-body { padding: 22px 22px 24px; }
  .news-wrap .source-tabs { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 2px 16px 8px; scrollbar-width: none; }
  .news-wrap .source-tabs::-webkit-scrollbar { display: none; }
  .news-wrap .source-tab { flex: 0 0 auto; }
  .news-wrap a.nc:hover, .news-wrap a.card-featured:hover { transform: translateY(-3px); }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .nt-dot, .nt-status::before, .nt-cursor, .nt-term.is-loading .nt-row b, .news-wrap div.nc, .news-wrap div.card-featured { animation: none !important; }
  .news-wrap a.nc, .news-wrap a.card-featured { animation: none !important; transition: border-color .2s; }
  .news-wrap a.nc:hover, .news-wrap a.card-featured:hover { transform: none; }
  .news-wrap a.nc:hover .nc-img-wrap img, .news-wrap a.card-featured:hover .cf-img img { transform: none; }
  .nt-meter span { transition: none; }
}
