/* Animaciones de entrada y de scroll. Solo opacity y transform. */

@keyframes sube {
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

/* Hero: entrada al cargar la página, en secuencia. */
.hero .caja > * { animation: sube 1.4s cubic-bezier(.16,1,.3,1) backwards; }
.hero .caja > :nth-child(2) { animation-delay: .3s; }
.hero .caja > :nth-child(3) { animation-delay: .6s; }

/* Secciones y tarjetas: aparecen al entrar en pantalla (el script añade .revelar y .visible). */
.js-anim .revelar:not(.visible) { opacity: 0; }
.revelar.visible { animation: sube 1.2s cubic-bezier(.16,1,.3,1) backwards; animation-delay: calc(var(--i, 0) * 160ms); }

.lo-mas-visto { margin-bottom: 40px; }
.lo-mas-visto h3 { text-align: center; color: var(--oro); font-size: 22px; margin-bottom: 14px; }
.mas-vistas { list-style: none; margin: 0 auto; padding: 0; max-width: 960px; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; }
.mas-vistas a { display: flex; gap: 12px; align-items: center; padding: 8px; background: #fff; border: 1px solid var(--borde); border-radius: 12px; text-decoration: none; color: inherit; transition: border-color .2s; }
.mas-vistas a:hover { border-color: var(--oro); }
.mas-vistas .mv-img { flex: 0 0 56px; height: 56px; border-radius: 8px; background: #eef2ea center / cover no-repeat; }
.mas-vistas .mv-texto { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mas-vistas .mv-titulo { font: 600 15px/1.3 'Source Sans 3', sans-serif; color: var(--verde-osc); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mas-vistas time { font-size: 13px; color: #6b6b6b; }

/* Barra de progreso de lectura, en el borde inferior de la cabecera. */
.cab .progreso { position: absolute; left: 0; bottom: -1px; width: 100%; height: 3px; background: var(--oro-vivo); transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
  .hero .caja > *, .revelar.visible { animation: none; }
  .js-anim .revelar:not(.visible) { opacity: 1; }
}

/* Entradas relacionadas y botón «Volver al blog» de la entrada. */
.entrada-relacionadas { margin: 56px auto 0; max-width: 960px; }
.entrada-relacionadas h2 { text-align: center; color: var(--oro); font-size: 22px; margin-bottom: 18px; }
.relacionadas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; }
.volver-blog { display: inline-flex; align-items: center; gap: 10px; padding: 12px 22px; border-radius: 999px; background: var(--verde-osc); color: var(--oro-claro); font: 700 16px 'Source Sans 3', sans-serif; text-decoration: none; box-shadow: 0 6px 16px rgba(10,30,17,.2); transition: background .2s, transform .2s; }
.volver-blog:hover { background: #2b5133; transform: translateY(-2px); color: #fff; }
.volver-rana { width: 26px; height: 26px; fill: var(--oro-vivo); color: var(--oro-vivo); flex: 0 0 auto; }
.post-fin-entrada { display: flex; justify-content: center; }

/* El texto de la entrada hereda el color general de los enlaces (.post a): aquí se fuerza el del botón. */
.post-fin .volver-blog { color: #f3d27a; font-size: 16px; }
.post-fin .volver-blog:hover { color: #fff; }
.post-fin .volver-blog svg { color: #f3d27a; }
