/* ================================================================
   hub.css — Salud & Ciencia
   Estilos específicos de la página hub/cluster
   Requiere: style.css (variables, topbar, footer, trust strip)
================================================================ */

/* ── BREADCRUMB ──────────────────────────────────────────── */
.breadcrumb { padding: 12px 0; border-bottom: 1px solid var(--border); background: var(--white); }
.breadcrumb-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-muted); flex-wrap: wrap; }
.breadcrumb-inner a { color: var(--text-muted); transition: color .2s; }
.breadcrumb-inner a:hover { color: var(--teal); }
.breadcrumb-inner span { color: var(--text); font-weight: 500; }
.breadcrumb-sep { color: var(--text-light); }

/* ── HUB HERO ────────────────────────────────────────────── */
.hub-hero { background: var(--white); border-bottom: 1px solid var(--border); overflow: hidden; }
.hub-hero-inner { max-width: 1200px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; align-items: start; }

.hub-hero-content { padding: 44px 40px 44px 20px; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.hub-eyebrow { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--teal); }
.hub-hero-content h1 { font-size: 2.8rem; font-weight: 800; line-height: 1.1; color: var(--text); }
.hub-hero-content > p,
.hub-hero-desc { font-size: .95rem; color: var(--text-muted); line-height: 1.7; max-width: 420px; }
.hub-hero-desc p { font-size: .95rem; color: var(--text-muted); line-height: 1.7; }

.hub-trust-row { display: flex; gap: 20px; flex-wrap: wrap; padding-top: 16px; border-top: 1px solid var(--border); }
.hub-trust-item { display: flex; align-items: flex-start; gap: 8px; font-size: .78rem; color: var(--text-muted); }
.hub-trust-item svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; flex-shrink: 0; margin-top: 2px; }
.hub-trust-item strong { display: block; color: var(--text); font-size: .8rem; margin-bottom: 1px; }

.hub-objetivo { display: flex; align-items: flex-start; gap: 12px; background: var(--teal-bg); border: 1px solid #ccfbf1; border-radius: var(--radius); padding: 14px 16px; }
.hub-objetivo svg { width: 20px; height: 20px; stroke: var(--teal); fill: none; flex-shrink: 0; margin-top: 2px; }
.hub-objetivo strong { display: block; font-size: .82rem; color: var(--text); margin-bottom: 2px; }
.hub-objetivo p { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin: 0; }

/* Columna derecha completa (imagen + tarjeta de stats) es sticky como
   bloque conjunto. Así se mantiene visible y bien proporcionada mientras
   se hace scroll por el texto largo de la izquierda, sin dejar espacio
   en blanco ni descentrar la tarjeta. */
.hub-hero-right-wrap {
  position: sticky; top: 24px;
  padding: 44px 20px 44px 0;
  display: flex; flex-direction: column; align-items: center;
}

.hub-hero-right {
  position: relative;
  width: 100%;
  height: 420px;
  border-radius: var(--radius);
  overflow: hidden;
}
.hub-hero-right img {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center;
  display: block;
}

/* La tarjeta se superpone a la parte inferior de la imagen, centrada
   horizontalmente respecto a ella (no pegada a una esquina). */
.hub-stats-card {
  position: relative; margin-top: -56px; z-index: 2;
  background: rgba(255,255,255,.97); border-radius: 14px;
  padding: 20px 24px; box-shadow: 0 8px 32px rgba(0,0,0,.12);
  width: calc(100% - 40px); max-width: 420px;
}
.hub-stats-card-title { font-size: .8rem; font-weight: 600; color: var(--text-muted); margin-bottom: 16px; }
.hub-stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 12px; }
.hub-stat { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.hub-stat-icon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; }
.hub-stat-icon svg { width: 22px; height: 22px; stroke: var(--teal); fill: none; }
.hub-stat-num { font-size: 1.5rem; font-weight: 800; color: var(--text); line-height: 1; }
.hub-stat-label { font-size: .68rem; color: var(--text-muted); text-align: center; line-height: 1.3; }

@media (max-width: 900px) {
  .hub-hero-inner { grid-template-columns: 1fr; }
  .hub-hero-content { padding: 36px 20px 28px; min-height: auto; }
  .hub-hero-content h1 { font-size: 2rem; }
  .hub-hero-right-wrap { position: relative; top: 0; padding: 0 20px 28px; }
  .hub-hero-right { height: 260px; }
  .hub-stats-card { margin-top: -40px; width: calc(100% - 24px); }
}
@media (max-width: 480px) {
  .hub-hero-content h1 { font-size: 1.7rem; }
  .hub-hero-right { height: 200px; }
  .hub-stats-card { min-width: 200px; padding: 12px; }
  .hub-stat-num { font-size: 1.2rem; }
  .hub-trust-row { gap: 14px; }
}

/* ── QUICK NAV CHIPS ─────────────────────────────────────── */
.quick-nav { padding: 18px 0; border-bottom: 1px solid var(--border); background: var(--white); }
.quick-nav-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.quick-nav-title { font-size: .9rem; font-weight: 700; color: var(--text); white-space: nowrap; flex-shrink: 0; }
.quick-nav-chips { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 99px; border: 1.5px solid var(--border); background: var(--white); font-size: .82rem; font-weight: 500; color: var(--text-muted); transition: all .2s; white-space: nowrap; cursor: pointer; text-decoration: none; }
.chip svg { width: 14px; height: 14px; stroke: currentColor; fill: none; flex-shrink: 0; }
.chip:hover, .chip:active { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); }
.chip.active { border-color: var(--teal); color: var(--teal); background: var(--teal-bg); font-weight: 600; }
@media (max-width: 768px) {
  .quick-nav-inner { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; scrollbar-width: none; }
  .quick-nav-inner::-webkit-scrollbar { display: none; }
  .quick-nav-title { display: none; }
  .view-all { display: none; }
}

/* ── MAIN BODY LAYOUT ────────────────────────────────────── */
.hub-body { padding: 36px 0 52px; }
.hub-body-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.sec-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.sec-header h2 { font-size: 1.2rem; font-weight: 700; }
.sec-subtitle { font-size: .84rem; color: var(--text-muted); margin-bottom: 20px; line-height: 1.5; }
@media (max-width: 1024px) { .hub-body-inner { grid-template-columns: 1fr 260px; gap: 28px; } }
@media (max-width: 768px) { .hub-body-inner { grid-template-columns: 1fr; } }

/* ── ARTICLES GRID ───────────────────────────────────────── */
.articles-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 22px; }
.article-card a { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.article-thumb { border-radius: var(--radius); overflow: hidden; height: 150px; background: var(--border); position: relative; flex-shrink: 0; }
.article-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.article-card:hover .article-thumb img { transform: scale(1.04); }
.article-badge { position: absolute; top: 8px; left: 8px; font-size: .67rem; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; padding: 3px 9px; border-radius: 4px; color: var(--white); background: var(--teal); }
.article-body { padding: 12px 0 0; display: flex; flex-direction: column; flex: 1; gap: 6px; }
.article-body h3 { font-size: .9rem; font-weight: 700; line-height: 1.4; color: var(--text); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.article-body p { font-size: .78rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.article-meta { display: flex; align-items: center; gap: 5px; font-size: .74rem; color: var(--text-light); margin-top: auto; padding-top: 8px; }
.article-meta svg { width: 13px; height: 13px; stroke: var(--text-light); fill: none; }
.articles-cta { text-align: center; margin-top: 28px; }
@media (max-width: 768px) { .articles-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .articles-grid { grid-template-columns: 1fr; } }

/* ── SIDEBAR ─────────────────────────────────────────────── */
.sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 100px; align-self: start; }
.sidebar-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.sidebar-card-header { padding: 14px 16px 12px; border-bottom: 1px solid var(--border); }
.sidebar-card-header h3 { font-size: .92rem; font-weight: 700; color: var(--text); }
.tool-item { display: flex; align-items: center; gap: 12px; padding: 13px 16px; border-bottom: 1px solid var(--border); transition: background .15s; text-decoration: none; color: inherit; }
.tool-item:last-of-type { border-bottom: none; }
.tool-item:hover { background: var(--bg-light); }
.tool-item-icon { width: 36px; height: 36px; border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.tool-item-icon svg { width: 18px; height: 18px; fill: none; stroke: currentColor; }
.tool-item-body { flex: 1; min-width: 0; }
.tool-item-body strong { display: block; font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tool-item-body span { font-size: .74rem; color: var(--text-muted); }
.tool-item-arrow { font-size: .9rem; color: var(--text-light); flex-shrink: 0; }
.faq-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--border); font-size: .82rem; color: var(--text); transition: background .15s; text-decoration: none; min-height: 46px; }
.faq-item:last-of-type { border-bottom: none; }
.faq-item:hover { background: var(--bg-light); color: var(--teal); }
.faq-item span { flex: 1; line-height: 1.4; }
.faq-item-arrow { font-size: .8rem; color: var(--text-light); flex-shrink: 0; }
.sidebar-footer { padding: 12px 16px; border-top: 1px solid var(--border); }
.cta-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; }
.cta-card-icon { width: 44px; height: 44px; background: var(--teal-bg); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.cta-card-icon svg { width: 22px; height: 22px; stroke: var(--teal); fill: none; }
.cta-card h3 { font-size: .92rem; font-weight: 700; color: var(--text); margin-bottom: 6px; line-height: 1.3; }
.cta-card p { font-size: .8rem; color: var(--text-muted); line-height: 1.5; margin-bottom: 16px; }
.btn-primary-full { width: 100%; justify-content: center; }

/* ── SUBTEMAS GRID ───────────────────────────────────────── */
.subtemas-section { padding: 36px 0; border-top: 1px solid var(--border); background: var(--bg-light); }
.subtemas-inner { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: grid; grid-template-columns: 1fr 300px; gap: 40px; align-items: start; }
.subtemas-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 14px; margin-top: 20px; }
.subtema-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 16px 10px; border: 1.5px solid var(--border); border-radius: var(--radius); background: var(--white); cursor: pointer; transition: box-shadow .2s, border-color .2s; text-decoration: none; color: inherit; }
.subtema-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal-light); }
.subtema-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--teal-bg); display: flex; align-items: center; justify-content: center; }
.subtema-icon svg { width: 22px; height: 22px; stroke: var(--teal); fill: none; }
.subtema-card h3 { font-size: .78rem; font-weight: 700; color: var(--text); line-height: 1.3; }
.subtema-card small { font-size: .72rem; color: var(--text-muted); }
.subtemas-cta { text-align: center; margin-top: 20px; }
.nuevo-card { background: var(--white); border: 1.5px solid var(--border); border-radius: var(--radius); padding: 18px; }
.nuevo-card p { font-size: .82rem; color: var(--text-muted); line-height: 1.55; margin-bottom: 14px; }
.nuevo-card-btn { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: var(--radius); text-decoration: none; color: var(--text); transition: all .2s; }
.nuevo-card-btn:hover { border-color: var(--teal); background: var(--teal-bg); }
.nuevo-card-btn-icon { width: 36px; height: 36px; background: var(--teal-bg); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.nuevo-card-btn-icon svg { width: 18px; height: 18px; stroke: var(--teal); fill: none; }
.nuevo-card-btn strong { font-size: .85rem; font-weight: 600; }
@media (max-width: 1024px) { .subtemas-inner { grid-template-columns: 1fr 260px; gap: 28px; } }
@media (max-width: 768px) { .subtemas-inner { grid-template-columns: 1fr; } .subtemas-grid { grid-template-columns: repeat(3,1fr); } }
@media (max-width: 480px) { .subtemas-grid { grid-template-columns: repeat(2,1fr); } }
