/* ============================================================
   SCIENCIA RECURSOS — Hoja compartida por las secciones
   Actualidad científica / Sala de prensa / Guía académica
   (extiende noticias.css, sigue el mismo patrón que biblioteca.css)
   ============================================================ */

:root { --ease: cubic-bezier(0.22, 1, 0.36, 1); }

/* ── Hero de sección (imagen de fondo se define inline por página) ── */
.n-hub-hero {
  padding: 64px 0 48px; overflow: hidden; position: relative;
  background-size: cover; background-position: center; background-attachment: fixed;
}
.n-hub-hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(30,37,51,0.90) 0%, rgba(30,37,51,0.97) 100%); }
.n-hub-hero::after { content: ''; position: absolute; inset: 0; background: radial-gradient(ellipse at 85% 20%, rgba(226,167,47,.18) 0%, transparent 55%), radial-gradient(ellipse at 15% 80%, rgba(57,119,104,.14) 0%, transparent 50%); }
.n-hub-hero-grid { position: absolute; inset: 0; background-image: linear-gradient(rgba(226,167,47,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(226,167,47,.05) 1px, transparent 1px); background-size: 52px 52px; mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%); }
.n-hub-hero .container { position: relative; z-index: 1; }
.n-hub-hero .n-tag { margin-bottom: 1rem; }
.n-hub-hero h1 { color: #fff; font-size: clamp(1.6rem, 3.6vw, 2.4rem); font-weight: 800; line-height: 1.25; margin-bottom: 0.75rem; max-width: 720px; }
.n-hub-hero p { color: rgba(255,255,255,0.75); font-size: 1rem; max-width: 620px; line-height: 1.6; }

/* ── Iconos flotantes decorativos del hero ── */
.n-hub-float { position: absolute; opacity: 0.10; color: #fff; pointer-events: none; font-size: 2.6rem; animation: n-hub-float 7s ease-in-out infinite; z-index: 1; }
.n-hub-float:nth-child(1) { top: 12%; right: 8%; animation-delay: 0s; font-size: 3.2rem; }
.n-hub-float:nth-child(2) { top: 55%; right: 20%; animation-delay: 1.4s; font-size: 2rem; }
.n-hub-float:nth-child(3) { top: 25%; right: 30%; animation-delay: 2.8s; font-size: 2.4rem; }
.n-hub-float:nth-child(4) { top: 68%; right: 5%; animation-delay: 4.2s; font-size: 1.8rem; }
@keyframes n-hub-float { 0%,100% { transform: translateY(0) rotate(0deg); } 50% { transform: translateY(-18px) rotate(-6deg); } }

/* ── Barra de categorías (menú centrado, simple) ── */
.n-hub-navbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 65px; z-index: 150; box-shadow: 0 2px 0 rgba(0,0,0,0.02); transition: box-shadow 0.3s ease; }
.n-hub-navbar.is-scrolled { box-shadow: 0 6px 18px rgba(16,19,26,0.08); }
.n-hub-nav-inner { display: flex; justify-content: center; gap: clamp(1.5rem, 5vw, 3.5rem); overflow-x: auto; scrollbar-width: none; padding: 1.5rem 0; }
.n-hub-nav-inner::-webkit-scrollbar { display: none; }
.n-hub-navlink {
  background: none; border: none; cursor: pointer; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; gap: 0.65rem;
  font-family: var(--font-display); font-weight: 700; font-size: 0.82rem; color: var(--text-muted);
  padding: 2px; transition: color 0.25s ease;
}
.n-hub-navicon-circle {
  width: 58px; height: 58px; border-radius: 50%; background: var(--surface-low);
  border: 2px solid transparent; display: flex; align-items: center; justify-content: center;
  font-size: 1.6rem; transition: all 0.4s var(--ease);
}
.n-hub-navlink:hover { color: var(--primary); }
.n-hub-navlink:hover .n-hub-navicon-circle { transform: translateY(-4px); border-color: rgba(226,167,47,0.4); background: rgba(226,167,47,0.08); }
.n-hub-navlink.active { color: var(--primary); }
.n-hub-navlink.active .n-hub-navicon-circle {
  background: linear-gradient(135deg, var(--primary), var(--tertiary));
  box-shadow: 0 10px 22px rgba(30,37,51,0.32);
}

/* ── Destacado (spotlight) ── */
.n-hub-spotlight {
  background: linear-gradient(120deg, var(--primary) 0%, #2a3346 100%);
  background-image: linear-gradient(120deg, var(--primary) 0%, #2a3346 100%), radial-gradient(circle at 12% 25%, rgba(57,119,104,0.3), transparent 50%);
  border-radius: var(--r-lg); padding: 2.75rem 3rem; margin-top: 2.25rem;
  display: grid; grid-template-columns: 190px 1fr auto; gap: 2.5rem; align-items: center;
  position: relative; overflow: hidden;
}
.n-hub-spotlight-label {
  display: inline-flex; align-items: center; gap: 6px; background: rgba(226,167,47,0.15); border: 1px solid rgba(226,167,47,0.4);
  color: var(--secondary); font-family: var(--font-display); font-weight: 700; font-size: 0.68rem; letter-spacing: 0.06em;
  text-transform: uppercase; padding: 5px 12px; border-radius: var(--r-full); margin-bottom: 0.85rem;
}
.n-hub-spotlight-cover { border-radius: var(--r-md); overflow: hidden; box-shadow: 0 20px 44px rgba(0,0,0,0.4); transition: transform 0.5s var(--ease); aspect-ratio: 4/3; }
.n-hub-spotlight:hover .n-hub-spotlight-cover { transform: scale(1.04); }
.n-hub-spotlight-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.n-hub-spotlight-body h2 { color: #fff; font-size: clamp(1.25rem, 2.4vw, 1.7rem); font-weight: 800; margin-bottom: 0.4rem; line-height: 1.25; }
.n-hub-spotlight-body p.n-hub-spotlight-meta { color: rgba(255,255,255,0.6); font-size: 0.85rem; margin-bottom: 0.85rem; }
.n-hub-spotlight-body p.n-hub-spotlight-desc { color: rgba(255,255,255,0.78); font-size: 0.92rem; line-height: 1.65; max-width: 480px; }
.n-hub-spotlight-cta {
  display: inline-flex; align-items: center; gap: 8px; background: var(--secondary); color: var(--primary);
  font-family: var(--font-display); font-weight: 700; font-size: 0.85rem; padding: 13px 26px; border-radius: var(--r-full);
  white-space: nowrap; transition: all 0.3s var(--ease); box-shadow: 0 8px 20px rgba(226,167,47,0.25);
}
.n-hub-spotlight-cta:hover { transform: translateY(-3px); box-shadow: 0 14px 28px rgba(226,167,47,0.4); gap: 12px; }

/* ── Encabezado de la sección de catálogo ── */
.n-hub-section-head { display: flex; align-items: baseline; justify-content: space-between; padding: 2.5rem 0 1.5rem; flex-wrap: wrap; gap: 0.5rem; position: relative; background: var(--bg); }
.n-hub-section-head h2 { font-size: 1.3rem; font-weight: 800; }
.n-hub-section-head span { font-size: 0.85rem; color: var(--text-dim); }

/* ── Grid de tarjetas grandes estilo editorial ── */
.n-hub-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.4rem; padding-bottom: 3.5rem; }

.n-hub-card {
  display: block; position: relative; aspect-ratio: 3 / 3.6; overflow: hidden;
  border-radius: var(--r-lg); background: var(--surface-low);
  box-shadow: 0 10px 26px rgba(16,19,26,0.16);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.n-hub-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 5px; z-index: 4;
  background: linear-gradient(90deg, var(--secondary), var(--tertiary));
  transform: scaleX(0); transform-origin: left; transition: transform 0.45s var(--ease);
}
.n-hub-card:hover { transform: translateY(-10px); box-shadow: 0 30px 56px rgba(16,19,26,0.32); }
.n-hub-card:hover::before { transform: scaleX(1); }

.n-hub-cover { position: absolute; inset: 0; overflow: hidden; }
.n-hub-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s var(--ease); }
.n-hub-card:hover .n-hub-cover img { transform: scale(1.08); }
.n-hub-cover::after {
  content: ''; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(to top, rgba(20,24,34,0.96) 0%, rgba(20,24,34,0.72) 30%, rgba(20,24,34,0.1) 65%, transparent 80%);
}
.n-hub-cover-cta {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  background: var(--secondary); color: var(--primary); font-weight: 700; font-size: 0.85rem; border-radius: 50%;
  opacity: 0; transform: translateY(-8px) scale(0.7); transition: all 0.35s var(--ease);
  box-shadow: 0 8px 18px rgba(0,0,0,0.35);
}
.n-hub-card:hover .n-hub-cover-cta { opacity: 1; transform: translateY(0) scale(1); }
.n-hub-badge {
  position: absolute; top: 10px; left: 10px; z-index: 3;
  background: var(--tertiary); color: #fff; font-family: var(--font-display);
  font-size: 0.58rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 5px 9px; border-radius: var(--r-sm); box-shadow: 0 3px 8px rgba(0,0,0,0.3);
}
.n-hub-info {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 1.1rem 1rem 1.2rem; display: flex; flex-direction: column;
}
.n-hub-tag {
  display: inline-flex; align-self: flex-start; background: var(--secondary); color: var(--primary);
  font-family: var(--font-display); font-size: 0.58rem; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-sm); margin-bottom: 9px; box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}
.n-hub-info h3 { color: #fff; font-size: 0.94rem; font-weight: 800; line-height: 1.3; margin-bottom: 6px; transition: color 0.25s ease; }
.n-hub-card:hover .n-hub-info h3 { color: var(--secondary); }
.n-hub-meta { font-size: 0.72rem; color: rgba(255,255,255,0.72); }

/* ── Responsive ── */
@media (max-width: 1300px) { .n-hub-grid { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; } }
@media (max-width: 900px) {
  .n-hub-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .n-hub-spotlight { grid-template-columns: 150px 1fr; padding: 2rem; }
  .n-hub-spotlight-cta { grid-column: 1 / -1; justify-self: start; margin-top: 0.5rem; }
  .n-hub-float { display: none; }
}
@media (max-width: 600px) {
  .n-hub-grid { grid-template-columns: 1fr; gap: 1.25rem; }
  .n-hub-card { aspect-ratio: 3 / 2.6; }
  .n-hub-nav-inner { gap: 2.25rem; }
  .n-hub-navicon-circle { width: 50px; height: 50px; font-size: 1.4rem; }
  .n-hub-navlink { font-size: 0.75rem; }
  .n-hub-spotlight { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 1.75rem 1.25rem; }
  .n-hub-spotlight-cover { max-width: 160px; }
  .n-hub-spotlight-body p.n-hub-spotlight-desc { max-width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
