/* ============================================================
   NotiCamilistas — Reporteros en Acción
   Estilos base, animaciones y micro-interacciones (CSS puro)
   I.E. Francisco de Paula Santander · Sede Camilo Torres J.T.
   ============================================================ */

:root {
  --azul: #3363C5;
  --azul-700: #274d9e;
  --azul-900: #1b3672;
  --verde: #22C55E;
  --amarillo: #FACC15;
  --tinta: #16213e;       /* texto principal (navy casi negro) */
  --tinta-suave: #54607a; /* texto secundario */
  --hueso: #f6f8fd;       /* fondo off-white frío */
  --linea: #e6ecf7;
}

* { -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--tinta);
  background: #fff;
  line-height: 1.7;
  overflow-x: hidden;
}

h1, h2, h3, h4, .font-display { font-family: 'Poppins', sans-serif; }

::selection { background: var(--amarillo); color: var(--tinta); }

/* ---- Scrollbar sutil ---- */
::-webkit-scrollbar { width: 11px; height: 11px; }
::-webkit-scrollbar-thumb { background: #c8d4ec; border-radius: 999px; border: 3px solid #fff; }
::-webkit-scrollbar-thumb:hover { background: var(--azul); }

/* ============================================================
   1. LOADER INICIAL
   ============================================================ */
#loader {
  position: fixed; inset: 0; z-index: 9999;
  display: grid; place-items: center;
  background: var(--azul);
  transition: opacity .5s ease, visibility .5s ease;
}
#loader.hidden-loader { opacity: 0; visibility: hidden; }
.loader-badge {
  width: 78px; height: 78px; border-radius: 22px;
  background: #fff; color: var(--azul);
  display: grid; place-items: center;
  font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 30px;
  box-shadow: 0 18px 40px rgba(0,0,0,.25);
  animation: loaderPop 1s ease infinite alternate;
}
.loader-ring {
  position: absolute; width: 120px; height: 120px;
  border: 4px solid rgba(255,255,255,.25);
  border-top-color: var(--amarillo);
  border-radius: 50%;
  animation: spin .9s linear infinite;
}
@keyframes loaderPop { from { transform: translateY(0) scale(1); } to { transform: translateY(-6px) scale(1.05); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   2. NAVBAR
   ============================================================ */
.nav-shell {
  position: sticky; top: 0; z-index: 100;
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
}
.nav-shell.scrolled {
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 8px 30px rgba(27,54,114,.10);
}
.nav-link {
  position: relative; font-weight: 600; font-size: .95rem;
  color: var(--tinta); padding: .35rem .1rem;
  transition: color .2s ease;
}
.nav-link::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px;
  background: var(--amarillo); border-radius: 99px;
  transform: scaleX(0); transform-origin: left; transition: transform .28s cubic-bezier(.5,1.6,.4,1);
}
.nav-link:hover { color: var(--azul); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link.active { color: var(--azul); }
.nav-link.active::after { transform: scaleX(1); background: var(--azul); }

/* Hamburguesa morph */
.burger { width: 30px; height: 22px; position: relative; cursor: pointer; }
.burger span {
  position: absolute; left: 0; height: 3px; width: 100%; background: var(--tinta);
  border-radius: 99px; transition: transform .35s ease, opacity .25s ease, top .35s ease;
}
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 9px; }
.burger span:nth-child(3) { top: 18px; }
.burger.open span:nth-child(1) { top: 9px; transform: rotate(45deg); }
.burger.open span:nth-child(2) { opacity: 0; }
.burger.open span:nth-child(3) { top: 9px; transform: rotate(-45deg); }

/* Panel móvil */
.mobile-panel {
  max-height: 0; overflow: hidden;
  transition: max-height .45s cubic-bezier(.6,0,.2,1);
}
.mobile-panel.open { max-height: 640px; }
.mobile-link {
  display: flex; align-items: center; gap: .7rem;
  padding: .85rem 1rem; border-radius: 14px; font-weight: 600;
  color: var(--tinta); transition: background .2s, transform .2s;
}
.mobile-link:hover, .mobile-link.active { background: #eef3fd; color: var(--azul); transform: translateX(4px); }

/* ============================================================
   3. BOTONES + RIPPLE
   ============================================================ */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1rem;
  padding: .85rem 1.6rem; border-radius: 14px; cursor: pointer;
  transition: transform .2s ease, box-shadow .25s ease, background .2s ease;
  border: none; line-height: 1;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-azul { background: var(--azul); color: #fff; box-shadow: 0 10px 24px rgba(51,99,197,.32); }
.btn-azul:hover { background: var(--azul-700); transform: translateY(-2px); box-shadow: 0 16px 30px rgba(51,99,197,.4); }
.btn-amarillo { background: var(--amarillo); color: var(--tinta); box-shadow: 0 10px 24px rgba(250,204,21,.4); }
.btn-amarillo:hover { transform: translateY(-2px); box-shadow: 0 16px 30px rgba(250,204,21,.5); }
.btn-verde { background: var(--verde); color: #fff; box-shadow: 0 10px 24px rgba(34,197,94,.34); }
.btn-verde:hover { background: #19a64c; transform: translateY(-2px); box-shadow: 0 16px 30px rgba(34,197,94,.45); }
.btn-ghost { background: #fff; color: var(--azul); border: 2px solid var(--linea); }
.btn-ghost:hover { border-color: var(--azul); transform: translateY(-2px); box-shadow: 0 12px 26px rgba(27,54,114,.12); }

.ripple-ink {
  position: absolute; border-radius: 50%; transform: scale(0);
  background: rgba(255,255,255,.55); pointer-events: none;
  animation: ripple .6s ease-out forwards;
}
.btn-amarillo .ripple-ink, .btn-ghost .ripple-ink { background: rgba(51,99,197,.25); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ============================================================
   4. SCROLL REVEAL
   ============================================================ */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal.visible { opacity: 1; transform: none; }
.reveal-zoom { opacity: 0; transform: scale(.9); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.7,.2,1); }
.reveal-zoom.visible { opacity: 1; transform: none; }
.reveal-left { opacity: 0; transform: translateX(-40px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.2,1); }
.reveal-left.visible { opacity: 1; transform: none; }
[data-delay="1"] { transition-delay: .08s; }
[data-delay="2"] { transition-delay: .16s; }
[data-delay="3"] { transition-delay: .24s; }
[data-delay="4"] { transition-delay: .32s; }
[data-delay="5"] { transition-delay: .4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-zoom, .reveal-left { opacity: 1 !important; transform: none !important; }
  * { animation-duration: .001ms !important; }
}

/* ============================================================
   5. CARDS
   ============================================================ */
.card {
  background: #fff; border: 1px solid var(--linea); border-radius: 22px;
  transition: transform .3s cubic-bezier(.2,.7,.2,1), box-shadow .3s ease, border-color .3s ease;
}
.card-hover:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 26px 50px rgba(27,54,114,.16);
  border-color: transparent;
}

/* ============================================================
   6. PLACEHOLDERS DE IMAGEN (rayas + etiqueta mono)
   ============================================================ */
.ph {
  position: relative; overflow: hidden; display: grid; place-items: center;
  background-color: #eaf0fb;
  background-image: repeating-linear-gradient(45deg, rgba(51,99,197,.10) 0 12px, rgba(51,99,197,0) 12px 24px);
}
.ph::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(120% 120% at 0% 0%, rgba(255,255,255,.55), transparent 55%);
}
.ph-label {
  position: relative; z-index: 1;
  font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: .72rem; font-weight: 500;
  letter-spacing: .02em; color: var(--azul-900);
  background: rgba(255,255,255,.85); border: 1px dashed rgba(51,99,197,.5);
  padding: .35rem .7rem; border-radius: 8px; text-align: center; max-width: 85%;
  backdrop-filter: blur(2px);
}
.ph-amarillo { background-color: #fff7da; background-image: repeating-linear-gradient(45deg, rgba(202,138,4,.13) 0 12px, rgba(202,138,4,0) 12px 24px); }
.ph-verde { background-color: #e3f9ec; background-image: repeating-linear-gradient(45deg, rgba(22,163,74,.13) 0 12px, rgba(22,163,74,0) 12px 24px); }

/* ============================================================
   7. BADGES DE CATEGORÍA
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
  padding: .3rem .7rem; border-radius: 999px; line-height: 1;
  text-transform: uppercase;
}

/* ============================================================
   8. TICKER / MARQUEE
   ============================================================ */
.ticker { display: flex; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; flex-shrink: 0; gap: 2.5rem; padding-right: 2.5rem; white-space: nowrap; animation: marquee 32s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-100%); } }

/* ============================================================
   9. FORMAS GEOMÉTRICAS DECORATIVAS
   ============================================================ */
.blob { position: absolute; border-radius: 42% 58% 63% 37% / 41% 44% 56% 59%; filter: blur(2px); opacity: .55; }
.float-slow { animation: floaty 9s ease-in-out infinite; }
.float-mid { animation: floaty 6.5s ease-in-out infinite; }
.float-fast { animation: floaty 4.5s ease-in-out infinite; }
@keyframes floaty { 0%,100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-22px) rotate(8deg); } }
.spin-slow { animation: spinSlow 18s linear infinite; }
@keyframes spinSlow { to { transform: rotate(360deg); } }
.star4 { clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%); }
.blink { animation: blink 1.3s ease-in-out infinite; }
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* gradiente suave SOLO para héroes/headers */
.hero-grad { background: linear-gradient(135deg, #3363C5 0%, #2a55ad 45%, #1b3672 100%); }
.hero-grad-2 { background: linear-gradient(160deg, #eaf1ff 0%, #f6f8fd 60%, #fff 100%); }

/* ============================================================
   10. BARRA DE PROGRESO DE LECTURA
   ============================================================ */
#reading-bar {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%; z-index: 120;
  background: linear-gradient(90deg, var(--amarillo), var(--verde));
  transition: width .1s linear;
}

/* ============================================================
   11. TOOLTIPS
   ============================================================ */
.tip { position: relative; }
.tip::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 9px); left: 50%; transform: translateX(-50%) translateY(6px);
  background: var(--tinta); color: #fff; font-size: .72rem; font-weight: 600; white-space: nowrap;
  padding: .35rem .6rem; border-radius: 8px; opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease; z-index: 50;
}
.tip::before {
  content: ''; position: absolute; bottom: calc(100% + 3px); left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--tinta); opacity: 0; transition: opacity .2s ease; z-index: 50;
}
.tip:hover::after { opacity: 1; transform: translateX(-50%) translateY(0); }
.tip:hover::before { opacity: 1; }

/* ============================================================
   12. CHATBOT
   ============================================================ */
#chat-fab {
  position: fixed; right: 22px; bottom: 22px; z-index: 200;
  width: 62px; height: 62px; border-radius: 20px; border: none; cursor: pointer;
  background: var(--azul); color: #fff; display: grid; place-items: center;
  box-shadow: 0 16px 34px rgba(51,99,197,.45);
  transition: transform .25s ease, box-shadow .25s ease;
}
#chat-fab:hover { transform: translateY(-3px) scale(1.05); }
#chat-fab .fab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px;
  background: var(--amarillo); color: var(--tinta); border-radius: 999px;
  font-size: .66rem; font-weight: 800; display: grid; place-items: center;
  border: 2px solid #fff; animation: blink 1.3s ease-in-out infinite;
}
#chat-panel {
  position: fixed; right: 22px; bottom: 96px; z-index: 201;
  width: min(380px, calc(100vw - 32px)); height: min(560px, calc(100vh - 130px));
  background: #fff; border-radius: 24px; overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 30px 70px rgba(16,33,62,.32);
  transform: translateY(24px) scale(.96); opacity: 0; pointer-events: none;
  transition: transform .35s cubic-bezier(.2,.9,.3,1.2), opacity .3s ease;
}
#chat-panel.open { transform: none; opacity: 1; pointer-events: auto; }
.chat-msgs { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; background: var(--hueso); }
.bubble { max-width: 82%; padding: .6rem .85rem; border-radius: 16px; font-size: .9rem; line-height: 1.5; animation: bubbleIn .3s ease; }
.bubble .ts { display: block; font-size: .62rem; opacity: .6; margin-top: .25rem; font-weight: 500; }
.bubble-bot { align-self: flex-start; background: #fff; border: 1px solid var(--linea); border-bottom-left-radius: 5px; color: var(--tinta); }
.bubble-user { align-self: flex-end; background: var(--azul); color: #fff; border-bottom-right-radius: 5px; }
.bubble-user .ts { color: rgba(255,255,255,.8); }
@keyframes bubbleIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.typing { display: inline-flex; gap: 4px; align-items: center; padding: .7rem .9rem; }
.typing span { width: 7px; height: 7px; border-radius: 50%; background: #b9c4dd; animation: typing 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes typing { 0%,60%,100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-5px); opacity: 1; } }
.chip {
  font-size: .78rem; font-weight: 600; color: var(--azul); background: #eef3fd;
  border: 1px solid #d9e4fa; padding: .4rem .7rem; border-radius: 999px; cursor: pointer;
  transition: background .2s, transform .15s; white-space: nowrap;
}
.chip:hover { background: var(--azul); color: #fff; transform: translateY(-2px); }

/* ============================================================
   13. LIGHTBOX GALERÍA
   ============================================================ */
#lightbox {
  position: fixed; inset: 0; z-index: 300; display: none;
  place-items: center; padding: 24px;
  background: rgba(16,33,62,.86); backdrop-filter: blur(6px);
  opacity: 0; transition: opacity .3s ease;
}
#lightbox.open { display: grid; opacity: 1; }
.lb-frame { max-width: 880px; width: 100%; transform: scale(.94); transition: transform .35s cubic-bezier(.2,.9,.3,1.2); }
#lightbox.open .lb-frame { transform: none; }

/* Animación de reordenamiento de filtros */
.grid-item { transition: opacity .4s ease, transform .4s ease; }
.grid-item.hide { opacity: 0; transform: scale(.85); position: absolute; pointer-events: none; }

/* Pills de filtro */
.filter-pill {
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: .85rem;
  padding: .5rem 1rem; border-radius: 999px; cursor: pointer; white-space: nowrap;
  border: 2px solid var(--linea); background: #fff; color: var(--tinta-suave);
  transition: all .25s ease;
}
.filter-pill:hover { border-color: var(--azul); color: var(--azul); }
.filter-pill.active { background: var(--azul); border-color: var(--azul); color: #fff; box-shadow: 0 8px 18px rgba(51,99,197,.3); }

/* Inputs */
.field {
  width: 100%; padding: .85rem 1rem; border-radius: 13px; border: 2px solid var(--linea);
  background: #fff; font-family: inherit; font-size: .95rem; color: var(--tinta);
  transition: border-color .2s, box-shadow .2s;
}
.field:focus { outline: none; border-color: var(--azul); box-shadow: 0 0 0 4px rgba(51,99,197,.14); }
.field::placeholder { color: #9aa6bf; }
label.lbl { font-weight: 600; font-size: .85rem; color: var(--tinta); margin-bottom: .35rem; display: block; }

/* Línea de tiempo */
.timeline-line { background: linear-gradient(180deg, var(--azul), var(--verde)); }

/* Utilidad: subrayado marcador */
.mark-under { background: linear-gradient(120deg, transparent 60%, rgba(250,204,21,.55) 60%); }

/* ============================================================
   ARTÍCULO (detalle de noticia)
   ============================================================ */
.articulo { font-size: 1.075rem; line-height: 1.85; color: #2c3650; }
.articulo p { margin-bottom: 1.35rem; }
.articulo p:first-child { font-size: 1.2rem; color: var(--tinta); font-weight: 500; }
.articulo a { color: var(--azul); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.articulo blockquote {
  margin: 2rem 0; padding: 1.4rem 1.6rem; border-left: 5px solid var(--amarillo);
  background: var(--hueso); border-radius: 0 16px 16px 0;
  font-family: 'Poppins', sans-serif; font-weight: 600; font-size: 1.25rem; line-height: 1.4; color: var(--tinta);
}
.articulo blockquote cite { display: block; margin-top: .7rem; font-size: .85rem; font-weight: 500; font-style: normal; color: var(--tinta-suave); font-family: 'Inter', sans-serif; }

/* Transición de entrada de página (solo transform; nunca oculta el contenido) */
.page-fade { animation: pageFade .5s ease both; }
@keyframes pageFade { from { transform: translateY(10px); } to { transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-fade { animation: none; } }
