/* El header es fijo y mide 76px: sin este hueco el hero queda debajo. */
.blog-main-content {
  min-height: 100vh;
  /* Sin reserva para la cabecera: el hero se mete debajo de ella y pone el
     hueco de su lado (ver .blog-hero). Reservando aqui quedaba una franja
     del color de la pagina entre la cabecera y el hero. */
  padding-top: 0;
}

/* ==================================================================
   HERO DEL BLOG - centro de conocimiento
   Conserva el video de fondo original; solo cambia el contenido que
   va encima. La tarjeta "Lectura recomendada" ocupa la columna
   derecha, donde el diseno situaba una ilustracion.
   ================================================================== */

.blog-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--azul-oscuro) 0%, var(--azul-intermedio) 100%);
  color: var(--blanco);
  /* 88px es holgura para la cabecera fija, que mide entre 76 y 82 segun el
     ancho. Aqui pasarse no se ve -solo baja un poco el texto-; quedarse
     corto en .blog-main-content si se veia, como una linea clara. */
  padding: calc(4.5rem + 88px) 2rem 4rem;
}

.blog-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1240px;
  margin: 0 auto;
}

.blog-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(300px, 0.95fr);
  gap: 2.5rem;
  align-items: center;
}

.blog-hero .hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--verde-lima);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
  background: none;
  border: 0;
  padding: 0;
}

.blog-hero h1 {
  font-size: clamp(1.9rem, 3.6vw, 2.9rem);
  font-weight: 700;
  line-height: 1.18;
  color: #ffffff;
  margin: 0 0 0.9rem;
  max-width: 15ch;
}

.blog-hero p {
  color: rgba(255, 255, 255, 0.76);
  font-size: 1rem;
  line-height: 1.65;
  margin: 0 0 1.6rem;
  max-width: 46ch;
}

/* ------------------------------------------------------- Buscador */

.hero-buscador {
  display: flex;
  align-items: stretch;
  gap: 0.6rem;
  max-width: 460px;
  margin-bottom: 1.15rem;
}

.hero-buscador input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 50px;
  padding: 0.85rem 1.15rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.95rem;
  backdrop-filter: blur(4px);
  transition: border-color 0.25s ease, background 0.25s ease;
}

.hero-buscador input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.hero-buscador input:focus {
  outline: none;
  border-color: rgba(140, 203, 50, 0.7);
  background: rgba(255, 255, 255, 0.12);
}

/* Quita la cruz nativa de los campos de busqueda */
.hero-buscador input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.hero-buscador button {
  flex-shrink: 0;
  width: 52px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--verde-lima) 0%, var(--verde-lima-profundo) 100%);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.hero-buscador button img {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

.hero-buscador button:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(140, 203, 50, 0.3);
}

/* -------------------------------------------------- Pastillas */

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.9rem;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.86);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.hero-chip img {
  width: 16px;
  height: 16px;
  opacity: 0.9;
}

.hero-chip:hover {
  border-color: rgba(140, 203, 50, 0.5);
  background: rgba(140, 203, 50, 0.12);
  color: #ffffff;
}

/* La categoria activa se marca desde blog.js */
.hero-chip.active {
  background: var(--verde-lima);
  border-color: var(--verde-lima);
  color: var(--azul-oscuro);
  font-weight: 700;
}

.hero-chip.active img {
  filter: brightness(0) saturate(100%) invert(9%) sepia(30%) saturate(2400%) hue-rotate(196deg);
  opacity: 1;
}

/* ---------------------------------------------------- Cifras */

.blog-hero .blog-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2rem;
  justify-content: flex-start;
  margin-top: 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.blog-hero .stat {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-align: left;
}

.blog-hero .stat > img {
  width: 28px;
  height: 28px;
  opacity: 0.9;
  flex-shrink: 0;
}

.blog-hero .stat .number {
  display: block;
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--verde-lima);
  line-height: 1.1;
  margin-bottom: 0;
}

.blog-hero .stat .label {
  display: block;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.7);
  opacity: 1;
}

/* Separador entre cifras */
.blog-hero .stat:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 34px;
  margin-left: 1.3rem;
  background: rgba(255, 255, 255, 0.14);
}

/* Foco visible por teclado */
.blog-hero button:focus-visible,
.blog-hero a:focus-visible,
.blog-hero input:focus-visible {
  outline: 3px solid var(--verde-lima);
  outline-offset: 3px;
}

/* ------------------------------------------------------ Responsive */

@media (max-width: 980px) {
  .blog-hero-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .blog-hero h1,
  .blog-hero p {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .blog-hero {
    padding: calc(3rem + 88px) 1rem 3rem;
  }

  .hero-buscador {
    max-width: none;
  }

  .blog-hero .blog-stats {
    gap: 1.1rem;
  }

  .blog-hero .stat:not(:last-child)::after {
    display: none;
  }

  .blog-hero .stat {
    flex: 1 1 auto;
    min-width: 130px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-buscador button,
  .hero-chip {
    transition: none !important;
  }

  .hero-buscador button:hover {
    transform: none;
  }
}

.blog-hero-media {
  position: absolute;
  inset: 0;
}

.blog-hero-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.blog-hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(
      135deg,
      rgba(11, 30, 59, 0.84) 0%,
      rgba(30, 61, 107, 0.78) 52%,
      rgba(11, 30, 59, 0.86) 100%
    ),
    radial-gradient(
      circle at 78% 22%,
      rgba(141, 198, 63, 0.12),
      transparent 24%
    );
}

.blog-hero-content {
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin: 0 auto;
}

.blog-breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-bottom: 2rem;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.75);
}

.blog-breadcrumb a {
  color: var(--blanco);
  text-decoration: none;
}

.hero-insight-card {
  position: relative;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 24px;
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.2);
}

.insight-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--verde-lima);
  color: var(--azul-oscuro);
  font-size: 0.8rem;
  font-weight: 700;
}

.hero-insight-card h2 {
  font-size: 1.6rem;
  margin-bottom: 1rem;
}

.hero-insight-card p {
  margin-bottom: 1.2rem;
}

.insight-list {
  list-style: none;
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.4rem;
}

.insight-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}

.insight-link {
  color: var(--verde-lima);
  font-weight: 700;
  text-decoration: none;
}

.blog-content {
  padding: 4rem 2rem;
  background: var(--gris-claro);
}



/* Sidebar */










.advisory-widget .widget-kicker,
.advisory-widget h3,
.advisory-widget p,
.advisory-widget .btn {
  position: relative;
  z-index: 1;
}







.advisory-widget .btn {
  width: 100%;
  justify-content: center;
  background: var(--verde-lima);
  color: var(--azul-oscuro);
  border: none;
  box-shadow: 0 10px 20px rgba(154, 205, 50, 0.22);
}

.advisory-widget .btn:hover {
  background: #b3df45;
  transform: translateY(-2px);
}















.category-list a:hover,
.category-list a.active {
  background: rgba(154, 205, 50, 0.1);
  border-left-color: var(--verde-lima);
  color: var(--verde-lima);
}



















.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.newsletter-form input {
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 8px;
  font-size: 0.9rem;
}



/* Main Content */
.blog-main {
  display: flex;
  flex-direction: column;
  gap: 3rem;
}

































































.saved-topics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid rgba(10, 40, 74, 0.12);
  border-radius: 999px;
  background: var(--blanco);
  color: var(--azul-oscuro);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(10, 40, 74, 0.06);
  transition:
    transform 0.25s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    background-color 0.25s ease;
}

.saved-topics-toggle strong {
  min-width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(154, 205, 50, 0.16);
  color: var(--azul-oscuro);
  font-size: 0.8rem;
  transition:
    transform 0.25s ease,
    background-color 0.25s ease;
}

.saved-topics-toggle.has-saved {
  border-color: rgba(154, 205, 50, 0.34);
}

.saved-topics-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(10, 40, 74, 0.1);
}

.saved-topics-toggle.is-spotlight {
  animation: savedTopicsSpotlight 1s ease;
  border-color: rgba(154, 205, 50, 0.55);
  box-shadow: 0 0 0 10px rgba(154, 205, 50, 0.08);
}

.saved-topics-toggle strong.is-bumping {
  animation: savedTopicsCountBump 0.6s ease;
  background: rgba(154, 205, 50, 0.3);
}

.saved-topics-panel {
  margin: 1rem 0 2rem;
  padding: 1.15rem;
  border: 1px solid rgba(10, 40, 74, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(10, 40, 74, 0.08);
  transform-origin: top right;
}

.saved-topics-panel.is-open {
  animation: savedTopicsPanelReveal 0.28s ease;
}

.saved-topics-header,
.saved-topics-empty,
.saved-topic-item,
.saved-topic-actions {
  display: flex;
  align-items: center;
}

.saved-topics-header {
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.9rem;
  color: var(--azul-oscuro);
}

.saved-topics-header span {
  color: #4a5a6d;
  font-size: 0.85rem;
}

.saved-topics-list {
  display: grid;
  gap: 0.8rem;
}

.saved-topic-item {
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  background: rgba(10, 40, 74, 0.04);
}

.saved-topic-copy {
  display: grid;
  gap: 0.25rem;
}

.saved-topic-copy span {
  color: var(--verde-lima);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.saved-topic-copy strong {
  color: var(--azul-oscuro);
  font-size: 0.95rem;
  line-height: 1.4;
}

.saved-topic-actions {
  gap: 0.6rem;
}

.saved-topic-open,
.saved-topic-remove,
.article-read-toggle,
.article-secondary-link,
.article-save-badge {
  font: inherit;
  cursor: pointer;
}

.saved-topic-open,
.article-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 999px;
  background: var(--verde-lima);
  color: var(--azul-oscuro);
  font-weight: 700;
  /* Es un <a> para que el buscador lo siga: hay que quitarle el subrayado */
  text-decoration: none;
}

.saved-topic-remove {
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 50%;
  background: rgba(10, 40, 74, 0.08);
  color: var(--azul-oscuro);
}

.saved-topics-empty {
  gap: 1rem;
  padding: 0.8rem 0.3rem;
  color: #4a5a6d;
}

.saved-topics-empty i {
  color: var(--verde-lima);
  font-size: 1.3rem;
}

.saved-topics-empty strong {
  display: block;
  margin-bottom: 0.2rem;
  color: var(--azul-oscuro);
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
}

.article-card {
  background: var(--blanco);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.article-card.is-expanded {
  grid-column: span 2;
}

.article-card-highlight {
  animation: blogCardHighlight 1.8s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.article-image {
  height: 200px;
  position: relative;
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.article-card:hover .article-image img {
  transform: scale(1.05);
}

.article-category {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: var(--verde-lima);
  color: var(--azul-oscuro);
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
}

.article-tag {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  background: rgba(10, 40, 74, 0.8);
  color: var(--blanco);
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.article-save-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--azul-oscuro);
  box-shadow: 0 10px 24px rgba(10, 40, 74, 0.16);
  transition:
    transform 0.25s ease,
    background-color 0.25s ease,
    box-shadow 0.25s ease;
}

.article-save-badge.is-saved {
  background: var(--verde-lima);
}

.article-save-badge:hover,
.article-save-badge.is-saved {
  transform: scale(1.06);
}

.article-content {
  padding: 1.5rem;
}

.article-topline {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--gris-medio);
  font-size: 0.82rem;
}

.article-author,
.article-date {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.article-content h3 {
  font-size: 1.2rem;
  margin-bottom: 0.8rem;
  line-height: 1.4;
  color: var(--azul-oscuro);
}

.article-excerpt {
  color: var(--gris-medio);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
}

.article-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: var(--gris-medio);
  margin-bottom: 1rem;
}

.article-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.article-secondary-link {
  padding: 0.75rem 0.95rem;
  border: 1px solid rgba(10, 40, 74, 0.1);
  border-radius: 999px;
  background: transparent;
  color: var(--azul-oscuro);
  font-weight: 600;
  text-decoration: none;
}

.article-secondary-link.is-saved {
  border-color: rgba(154, 205, 50, 0.32);
  background: rgba(154, 205, 50, 0.12);
}

.saved-topic-flyer {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 2500;
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--verde-lima);
  color: var(--azul-oscuro);
  box-shadow: 0 12px 24px rgba(10, 40, 74, 0.18);
  pointer-events: none;
  transform: translate3d(0, 0, 0) scale(0.85);
  opacity: 0;
}

.article-read-toggle i {
  transition: transform 0.3s ease;
}

.article-read-toggle:hover i {
  transform: translateX(4px);
}

.article-detail {
  margin-top: 1.25rem;
  padding-top: 1.2rem;
  border-top: 1px solid rgba(10, 40, 74, 0.08);
}

.article-detail-copy {
  display: grid;
  gap: 0.8rem;
  margin-bottom: 1rem;
  color: #4a5a6d;
  line-height: 1.7;
}

.article-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.article-detail-block {
  padding: 1rem;
  border-radius: 14px;
  background: rgba(10, 40, 74, 0.04);
}

.article-detail-block h4 {
  margin-bottom: 0.7rem;
  color: var(--azul-oscuro);
  font-size: 0.95rem;
}

.article-detail-block p,
.article-detail-block li {
  color: #4a5a6d;
  font-size: 0.9rem;
  line-height: 1.65;
}

.article-detail-block ul {
  padding-left: 1.1rem;
}

.article-detail-footer {
  margin-top: 1rem;
}

.article-detail-footer .btn {
  width: 100%;
  justify-content: center;
}

@keyframes blogCardHighlight {
  0% {
    box-shadow: 0 0 0 0 rgba(154, 205, 50, 0.3);
  }
  40% {
    box-shadow: 0 0 0 10px rgba(154, 205, 50, 0.08);
  }
  100% {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  }
}

@keyframes savedTopicsSpotlight {
  0% {
    transform: translateY(0) scale(1);
  }
  40% {
    transform: translateY(-2px) scale(1.04);
  }
  100% {
    transform: translateY(0) scale(1);
  }
}

@keyframes savedTopicsCountBump {
  0% {
    transform: scale(1);
  }
  45% {
    transform: scale(1.18);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes savedTopicsPanelReveal {
  0% {
    opacity: 0;
    transform: translateY(-8px) scale(0.98);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.load-more-container {
  text-align: center;
  margin-top: 2rem;
}

.empty-state {
  padding: 2.5rem 2rem;
  border: 2px dashed rgba(10, 40, 74, 0.14);
  border-radius: 18px;
  text-align: center;
  background: rgba(255, 255, 255, 0.75);
}

.empty-state-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 68px;
  height: 68px;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: rgba(154, 205, 50, 0.16);
  color: var(--azul-oscuro);
  font-size: 1.8rem;
}

/* Responsive */
@media (max-width: 968px) {
  .blog-hero-grid,
  .blog-cta-banner,
  .blog-quick-actions {
    grid-template-columns: 1fr;
  }

  

  .article-card.is-expanded {
    grid-column: auto;
  }
}

@media (max-width: 768px) {
  .blog-hero h1 {
    font-size: 2.2rem;
  }

  .blog-stats {
    gap: 2rem;
  }

  .articles-grid {
    grid-template-columns: 1fr;
  }

  .blog-breadcrumb,
  .hero-tags,
  .hero-trust-strip,
  .blog-hero-actions,
  .post-meta,
  .featured-actions,
  .toolbar-actions,
  .article-topline,
  .article-meta,
  .article-actions,
  .cta-inline-form {
    flex-direction: column;
    align-items: flex-start;
  }

  .article-detail-grid,
  .saved-topic-item {
    grid-template-columns: 1fr;
  }

  .saved-topic-item,
  .saved-topic-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-inline-form {
    display: flex;
    width: 100%;
  }

  

  

  .cta-inline-form .btn,
  .blog-hero-actions .btn,
  .featured-actions .btn,
  .article-read-toggle,
  .article-secondary-link,
  .saved-topics-toggle,
  .saved-topic-open,
  .sidebar-widget .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===== MEJORAS VISUALES PREMIUM ===== */

/* 1. Barra de Progreso de Lectura */
.blog-reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--verde-lima),
    #c5e84b,
    var(--verde-lima)
  );
  background-size: 200% 100%;
  z-index: 10000;
  pointer-events: none;
  box-shadow:
    0 0 12px rgba(141, 198, 63, 0.6),
    0 0 4px rgba(141, 198, 63, 0.3);
  transition: width 0.12s linear;
}

.blog-reading-progress::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  width: 80px;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4));
  border-radius: 0 2px 2px 0;
}

/* 2. Skeleton Loading Shimmer */
.skeleton-card {
  background: var(--blanco);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.skeleton-image {
  height: 200px;
  background: linear-gradient(90deg, #e2e5e9 25%, #f0f2f5 37%, #e2e5e9 63%);
  background-size: 400% 100%;
  animation: blogShimmer 1.4s ease infinite;
}

.skeleton-content {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.skeleton-line {
  border-radius: 6px;
  background: linear-gradient(90deg, #e2e5e9 25%, #f0f2f5 37%, #e2e5e9 63%);
  background-size: 400% 100%;
  animation: blogShimmer 1.4s ease infinite;
}

.skeleton-line--title {
  height: 18px;
  width: 85%;
}
.skeleton-line--text {
  height: 12px;
  width: 100%;
}
.skeleton-line--text:last-of-type {
  width: 65%;
}
.skeleton-line--meta {
  height: 10px;
  width: 40%;
}

@keyframes blogShimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 3. Entrada escalonada de las tarjetas
   El estado inicial NO usa opacity. Antes era opacity:0 y la tarjeta
   solo se revelaba cuando el IntersectionObserver disparaba: si no lo
   hacia (pestana en segundo plano, rejilla rehecha al filtrar), el
   articulo quedaba invisible. Un texto no puede depender de que una
   animacion llegue a ejecutarse. */
.article-card.stagger-init {
  transform: translateY(24px);
}

.article-card.stagger-visible {
  transform: translateY(0);
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-reduced-motion: reduce) {
  .article-card.stagger-init,
  .article-card.stagger-visible {
    transform: none;
    transition: none;
  }
}

/* 5. Cursor Glow Effect */
.card-glow-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(141, 198, 63, 0.14) 0%,
    transparent 70%
  );
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -50%);
  z-index: 0;
  filter: blur(15px);
  transition: opacity 0.35s ease;
}

.article-card:hover .card-glow-orb {
  opacity: 1;
}

/* 6. Counter Animation */
.stat .number {
  font-variant-numeric: tabular-nums;
}

/* 7. Parallax Hero */
.blog-hero-media.parallax-active {
  will-change: transform;
}

/* 8. Typewriter */
.typewriter-cursor {
  display: inline-block;
  width: 3px;
  height: 0.85em;
  background: var(--verde-lima);
  margin-left: 3px;
  vertical-align: text-bottom;
  animation: twCursorBlink 0.7s step-end infinite;
  box-shadow: 0 0 8px rgba(141, 198, 63, 0.5);
  border-radius: 1px;
}

@keyframes twCursorBlink {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0;
  }
}

/* Hero stat counter pulse on animate */
.stat.counting .number {
  text-shadow: 0 0 20px rgba(141, 198, 63, 0.3);
  transition: text-shadow 0.3s ease;
}

/* Responsive: disable heavy effects on mobile */
@media (max-width: 768px) {
  .card-glow-orb {
    display: none;
  }
  .blog-hero-media.parallax-active {
    will-change: auto;
  }
}

/* ==================================================================
   BLOG - contenido destacado, biblioteca, recursos y temas
   ================================================================== */

:root {
  --blog-navy: #0b2347;
  --blog-navy-2: #12335f;
  --blog-lime: #8ccb32;
  --blog-surface: #f4f7fa;
  --blog-text: #102342;
  --blog-muted: #65758b;
  --blog-border: #dfe6ee;
  --blog-radius: 20px;
  --blog-shadow: 0 14px 36px rgba(11, 35, 71, 0.1);
}

.blog-shell {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 2rem;
}

.blog-kicker {
  display: block;
  color: var(--blog-lime);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.blog-kicker:not(.blog-kicker-claro) {
  color: #7fb52b;
}

.blog-encabezado {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.6rem;
}

.blog-encabezado h2,
.blog-lista-encabezado h2,
.blog-temas h2,
.blog-recursos h2 {
  font-size: clamp(1.4rem, 2.4vw, 1.9rem);
  font-weight: 700;
  color: var(--blog-text);
  margin: 0;
  line-height: 1.25;
}

.blog-enlace {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: #7fb52b;
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: gap 0.25s ease;
}

.blog-enlace:hover {
  gap: 0.75rem;
  color: var(--blog-navy);
}

/* ------------------------------------------- Contenido destacado */

.blog-destacados {
  padding: 3.5rem 0 2.5rem;
  background: var(--blog-surface);
}

.destacados-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

/* Tarjeta grande */
.destacado-principal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.9rem;
  min-height: 300px;
  padding: 2.25rem;
  border-radius: var(--blog-radius);
  background: linear-gradient(135deg, var(--blog-navy) 0%, var(--blog-navy-2) 100%);
  color: #ffffff;
  overflow: hidden;
}

/* Firma REITOR: la trama editorial de siempre, más tenue, y el logo de
   marca de agua abajo a la derecha. */
.destacado-principal::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    url("../assets/images/logo-marca-agua-blanca.png") no-repeat right -40px bottom -60px / 300px 300px,
    url("../assets/images/blog/patron-editorial.svg") no-repeat right center / cover;
  opacity: 0.85;
  pointer-events: none;
}

/* Filete lima a la izquierda, como en el resto de piezas REITOR */
.destacado-principal::before {
  content: "";
  position: absolute;
  top: 2.25rem;
  bottom: 2.25rem;
  left: 0;
  width: 4px;
  border-radius: 0 4px 4px 0;
  background: linear-gradient(180deg, var(--blog-lime), rgba(140, 203, 50, 0));
  z-index: 1;
}

.destacado-cabeza {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.destacado-firma {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
}

.destacado-firma img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.destacado-firma b {
  font-family: "Orbitron", "Poppins", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: #fff;
}

.destacado-principal > * {
  position: relative;
  z-index: 1;
}

.destacado-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  align-self: flex-start;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.destacado-principal h3 {
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  line-height: 1.24;
  margin: 0;
  max-width: 22ch;
}

.destacado-principal p {
  color: rgba(255, 255, 255, 0.74);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 0;
  max-width: 44ch;
}

.destacado-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.84rem;
}

.destacado-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.destacado-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.8rem 1.4rem;
  border-radius: 10px;
  border: 0;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.destacado-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(140, 203, 50, 0.3);
  color: var(--blog-navy);
}

/* Tarjetas pequenas */
.destacados-lista {
  display: grid;
  grid-template-rows: 1fr 1fr;
  gap: 1.5rem;
  min-width: 0;
}

.destacado-mini {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-shadow);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.destacado-mini:hover {
  transform: translateY(-3px);
  border-color: rgba(140, 203, 50, 0.45);
  box-shadow: 0 18px 38px rgba(11, 35, 71, 0.13);
}

/* Miniatura: tesela azul con el icono de la categoría y el logo en la
   esquina. Antes era la portada 800x500 recortada a un cuadrado, con el
   rótulo partido ("MATIVAS"). */
.destacado-mini-portada {
  position: relative;
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  background:
    radial-gradient(70px 70px at 100% 0, rgba(140, 203, 50, 0.22), transparent 70%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.03) 0 6px, transparent 6px 12px),
    linear-gradient(150deg, var(--blog-navy), #1e3d6b);
}

.destacado-mini-portada .dm-icono {
  width: 40px;
  height: 40px;
  transition: transform 0.3s ease;
}

.destacado-mini-portada .dm-logo {
  position: absolute;
  right: 7px;
  bottom: 7px;
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.85;
}

.destacado-mini:hover .dm-icono {
  transform: scale(1.08);
}

.destacado-mini-cat {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blog-lime-dark, #5f9419);
}

.destacado-mini-texto {
  min-width: 0;
}

.destacado-mini-texto h4 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--blog-text);
  line-height: 1.3;
  margin: 0 0 0.45rem;
}

.destacado-mini-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  color: var(--blog-muted);
  font-size: 0.8rem;
}

.destacado-mini-meta .punto {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--blog-lime);
}

/* ------------------------------------------------ Barra de filtros */

.blog-content {
  padding: 2.5rem 0 3.5rem;
  background: var(--blog-surface);
}

.blog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--blog-border);
  box-shadow: 0 8px 22px rgba(11, 35, 71, 0.06);
  margin-bottom: 2.25rem;
}

.blog-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.blog-filtro {
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 0;
  background: transparent;
  color: #4a5d75;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.blog-filtro:hover {
  background: rgba(140, 203, 50, 0.12);
  color: var(--blog-navy);
}

.blog-filtro.active {
  background: var(--blog-lime);
  color: var(--blog-navy);
}

.blog-toolbar-acciones {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.blog-vista {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.2rem;
  border-radius: 10px;
  border: 1px solid var(--blog-border);
}

.blog-vista-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  transition: background 0.25s ease;
}

.blog-vista-btn img {
  width: 18px;
  height: 18px;
  opacity: 0.6;
}

.blog-vista-btn.is-activa {
  background: rgba(140, 203, 50, 0.16);
}

.blog-vista-btn.is-activa img {
  opacity: 1;
}

.blog-content .saved-topics-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--blog-border);
  background: #ffffff;
  color: var(--blog-text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
}

.blog-content .saved-topics-toggle strong {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  background: rgba(140, 203, 50, 0.18);
  color: #4c6b1f;
  font-size: 0.78rem;
}

.blog-lista-encabezado {
  margin-bottom: 1.5rem;
}

.blog-lista-encabezado p {
  color: var(--blog-muted);
  font-size: 0.92rem;
  margin: 0.35rem 0 0;
}

/* ------------------------------------------- Rejilla de articulos */

.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* Vista en lista */
.articles-grid.es-lista {
  grid-template-columns: 1fr;
}

.articles-grid.es-lista .article-card {
  flex-direction: row;
}

.articles-grid.es-lista .article-image {
  flex: 0 0 260px;
  aspect-ratio: auto;
}

.article-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--blog-radius);
  background: #ffffff;
  border: 1px solid var(--blog-border);
  box-shadow: var(--blog-shadow);
  overflow: hidden;
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease;
}

.article-card:hover {
  transform: translateY(-5px);
  border-color: rgba(140, 203, 50, 0.4);
  box-shadow: 0 22px 46px rgba(11, 35, 71, 0.14);
}

.article-image {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--blog-navy);
  overflow: hidden;
}

.article-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.article-category {
  position: absolute;
  top: 0.85rem;
  left: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* El tag antiguo se integra en la meta, no sobre la portada */
.article-image .article-tag {
  display: none;
}

.article-save-badge {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--blog-navy);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.article-save-badge.is-saved {
  background: var(--blog-lime);
  color: var(--blog-navy);
}

.article-content {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1.25rem 1.3rem 1.15rem;
}

/* La linea autor/fecha se resume en la meta inferior */
.article-topline {
  display: none;
}

.article-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--blog-text);
  line-height: 1.32;
  margin: 0 0 0.55rem;
}

.article-excerpt {
  color: var(--blog-muted);
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0 0 1.1rem;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
  padding-bottom: 0.9rem;
  color: var(--blog-muted);
  font-size: 0.8rem;
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.article-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.9rem;
  border-top: 1px solid var(--blog-border);
}

.article-read-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  background: none;
  padding: 0;
  color: #7fb52b;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  /* Es un <a> para que el buscador lo siga: hay que quitarle el subrayado */
  text-decoration: none;
  transition: gap 0.25s ease, color 0.25s ease;
}

.article-read-toggle:hover {
  gap: 0.75rem;
  color: var(--blog-navy);
}

.article-secondary-link {
  border: 0;
  background: none;
  padding: 0;
  color: var(--blog-muted);
  font-family: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  transition: color 0.25s ease;
}

.article-secondary-link:hover,
.article-secondary-link.is-saved {
  color: #7fb52b;
}

/* --------------------------------------- Recursos descargables */

.blog-recursos {
  padding: 3.5rem 0;
  background: linear-gradient(135deg, var(--blog-navy) 0%, var(--blog-navy-2) 100%);
  color: #ffffff;
}

.blog-recursos h2 {
  color: #ffffff;
  margin-bottom: 1.75rem;
}

.recursos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.recurso-card {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1.35rem 1.3rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
  transition: border-color 0.28s ease, background 0.28s ease, transform 0.28s ease;
}

.recurso-card:hover {
  border-color: rgba(140, 203, 50, 0.42);
  background: rgba(140, 203, 50, 0.08);
  transform: translateY(-3px);
}

.recurso-icono {
  position: relative;
  flex-shrink: 0;
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.recurso-formato {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.12rem 0.42rem;
  border-radius: 5px;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.recurso-texto h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.35rem;
}

.recurso-texto p {
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0 0 0.9rem;
}

.recurso-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.05rem;
  border-radius: 8px;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-size: 0.84rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.recurso-btn img {
  width: 16px;
  height: 16px;
}

.recurso-btn:hover {
  transform: translateY(-2px);
  color: var(--blog-navy);
}

/* ------------------------------------------ Temas mas consultados */

.blog-temas {
  padding: 3.5rem 0;
  background: var(--blog-surface);
}

.blog-temas h2 {
  margin-bottom: 1.6rem;
}

.temas-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(320px, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.temas-lista {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.9rem;
}

.tema-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 1rem 0.95rem;
  border-radius: 14px;
  background: #ffffff;
  border: 1px solid var(--blog-border);
  color: var(--blog-text);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease;
}

.tema-card img {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.tema-card span {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.3;
}

.tema-card i {
  color: #7fb52b;
  font-size: 0.8rem;
  transition: transform 0.25s ease;
}

.tema-card:hover {
  border-color: rgba(140, 203, 50, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(11, 35, 71, 0.08);
}

.tema-card:hover i {
  transform: translateX(3px);
}

/* Tarjeta de la experta */
.tema-experto {
  position: relative;
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  padding: 1.75rem 0 0 1.75rem;
  border-radius: var(--blog-radius);
  background: linear-gradient(135deg, var(--blog-navy) 0%, var(--blog-navy-2) 100%);
  overflow: hidden;
}

.tema-experto-texto {
  flex: 1 1 auto;
  min-width: 0;
  padding-bottom: 1.75rem;
}

.tema-experto h3 {
  font-size: 1.2rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.45rem;
  line-height: 1.3;
}

.tema-experto p {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.88rem;
  line-height: 1.55;
  margin: 0 0 1.1rem;
}

.blog-btn-verde {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.25rem;
  border-radius: 9px;
  background: var(--blog-lime);
  color: var(--blog-navy);
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.25s ease;
}

.blog-btn-verde:hover {
  transform: translateY(-2px);
  color: var(--blog-navy);
}

.tema-experto-foto {
  flex-shrink: 0;
  width: 42%;
  max-width: 210px;
  height: auto;
  align-self: flex-end;
  display: block;
}

/* --------------------------------------------------- Suscripcion */

.blog-cta-banner {
  padding: 2.5rem 0 3rem;
  background: var(--blog-surface);
}

.blog-cta-shell {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(380px, auto);
  align-items: center;
  gap: 1.5rem;
  padding: 1.75rem 2rem;
  border-radius: var(--blog-radius);
  background: linear-gradient(135deg, var(--blog-navy) 0%, var(--blog-navy-2) 100%);
  max-width: 1240px;
  margin: 0 auto;
}

.blog-cta-icono {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(140, 203, 50, 0.5);
  background: rgba(140, 203, 50, 0.1);
}

.blog-cta-icono img {
  width: 30px;
  height: 30px;
  filter: brightness(0) saturate(100%) invert(74%) sepia(38%) saturate(700%) hue-rotate(38deg);
}

.blog-cta-copy h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  margin: 0 0 0.3rem;
  line-height: 1.3;
}

.blog-cta-copy p {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.9rem;
  margin: 0;
  line-height: 1.5;
}

.blog-cta-banner .cta-inline-form {
  display: flex;
  /* .newsletter-form global impone flex-direction: column */
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 0.6rem;
  min-width: 0;
  /* .newsletter-form global trae max-width y margin auto; en una rejilla
     los margenes automaticos impiden que el elemento se estire. */
  width: 100%;
  max-width: none;
  margin: 0;
}

.blog-cta-banner .cta-inline-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 48px;
  padding: 0.75rem 1.1rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.95);
  color: var(--blog-text);
  font-family: inherit;
  font-size: 0.92rem;
}

.blog-cta-banner .cta-inline-form .btn {
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--blog-lime);
  border: 0;
  color: var(--blog-navy);
  font-weight: 700;
  white-space: nowrap;
}

.blog-cta-notas {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.82rem;
}

.blog-cta-notas span {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.blog-cta-notas span::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blog-lime);
}

.blog-cta-banner .reitor-form-msg {
  grid-column: 1 / -1;
  color: #ffffff;
}

/* Foco visible por teclado */
.blog-content button:focus-visible,
.blog-temas a:focus-visible,
.blog-recursos a:focus-visible,
.blog-destacados a:focus-visible,
.blog-cta-banner input:focus-visible,
.blog-cta-banner button:focus-visible {
  outline: 3px solid var(--blog-lime);
  outline-offset: 3px;
}

/* ------------------------------------------------------ Responsive */

@media (max-width: 1000px) {
  .destacados-grid,
  .temas-grid {
    grid-template-columns: 1fr;
  }

  .temas-lista {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blog-cta-shell {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .tema-experto-foto {
    max-width: 170px;
  }
}

@media (max-width: 640px) {
  .blog-shell {
    padding: 0 1rem;
  }

  .destacado-principal {
    padding: 1.6rem 1.35rem;
  }

  .temas-lista {
    grid-template-columns: 1fr;
  }

  .blog-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .blog-toolbar-acciones {
    justify-content: space-between;
  }

  .destacado-mini {
    flex-direction: column;
    align-items: flex-start;
  }

  .destacado-mini-portada {
    width: 100%;
    height: 130px;
  }

  .blog-cta-banner .cta-inline-form {
    flex-direction: column;
  }

  .tema-experto {
    padding: 1.5rem 1.25rem 0;
  }

  .tema-experto-foto {
    display: none;
  }

  .tema-experto-texto {
    padding-bottom: 1.5rem;
  }

  .articles-grid.es-lista .article-card {
    flex-direction: column;
  }

  .articles-grid.es-lista .article-image {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-card,
  .destacado-mini,
  .recurso-card,
  .tema-card,
  .destacado-btn,
  .recurso-btn,
  .blog-btn-verde {
    transition: none !important;
  }

  .article-card:hover,
  .destacado-mini:hover,
  .recurso-card:hover,
  .tema-card:hover,
  .destacado-btn:hover,
  .recurso-btn:hover,
  .blog-btn-verde:hover {
    transform: none;
  }
}

/* ==================================================================
   ANIMACIONES DE LECTURA
   El detalle del articulo se despliega animando su altura real desde
   js/blog.js. Antes se rehacia toda la rejilla al abrir una tarjeta,
   lo que producia un parpadeo en lugar de una transicion.
   ================================================================== */

.article-detail {
  /* La altura la controla el script; aqui solo el punto de partida */
  will-change: height, opacity;
}

.article-detail[hidden] {
  display: none;
}

/* El contenido entra con un desplazamiento leve, no de golpe */
.article-card.is-expanded .article-detail-copy,
.article-card.is-expanded .article-detail-grid,
.article-card.is-expanded .article-detail-footer {
  animation: detalleEntra 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.article-card.is-expanded .article-detail-grid {
  animation-delay: 0.06s;
}

.article-card.is-expanded .article-detail-footer {
  animation-delay: 0.12s;
}

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

/* La tarjeta abierta se destaca del resto */
.article-card.is-expanded {
  grid-column: 1 / -1;
  border-color: rgba(140, 203, 50, 0.45);
  box-shadow: 0 22px 46px rgba(11, 35, 71, 0.16);
}

/* La tarjeta desplegada se lee mejor a dos columnas, pero solo cuando
   hay ancho de sobra: en movil debe seguir apilada. */
@media (min-width: 820px) {
  .articles-grid:not(.es-lista) .article-card.is-expanded {
    flex-direction: row;
    align-items: flex-start;
  }

  .articles-grid:not(.es-lista) .article-card.is-expanded .article-image {
    flex: 0 0 300px;
    aspect-ratio: 4 / 3;
  }

  .articles-grid:not(.es-lista) .article-card.is-expanded .article-content {
    min-width: 0;
  }
}

/* La flecha del boton gira al abrir */
.article-read-toggle i {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.article-card.is-expanded .article-read-toggle i {
  transform: rotate(90deg);
}

/* --------------------- Entrada de las tarjetas al filtrar o buscar */

.articles-grid .article-card {
  /* Solo se anima el desplazamiento. La opacidad queda fuera a proposito:
     si la animacion no llegara a ejecutarse, la tarjeta seguiria siendo
     visible. El contenido nunca debe depender de una animacion. */
  animation: tarjetaEntra 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.articles-grid .article-card:nth-child(1) { animation-delay: 0.02s; }
.articles-grid .article-card:nth-child(2) { animation-delay: 0.06s; }
.articles-grid .article-card:nth-child(3) { animation-delay: 0.1s; }
.articles-grid .article-card:nth-child(4) { animation-delay: 0.14s; }
.articles-grid .article-card:nth-child(5) { animation-delay: 0.18s; }
.articles-grid .article-card:nth-child(6) { animation-delay: 0.22s; }
.articles-grid .article-card:nth-child(n + 7) { animation-delay: 0.26s; }

@keyframes tarjetaEntra {
  from {
    transform: translateY(14px) scale(0.985);
  }
  to {
    transform: none;
  }
}

/* El marcador de guardado responde al pulsarlo */
.article-save-badge {
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.article-save-badge:active {
  transform: scale(0.88);
}

.article-save-badge.is-saved {
  animation: guardadoLatido 0.42s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes guardadoLatido {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}

/* ------------------------ Respeta a quien pidio menos movimiento */

@media (prefers-reduced-motion: reduce) {
  .article-detail,
  .articles-grid .article-card,
  .article-card.is-expanded .article-detail-copy,
  .article-card.is-expanded .article-detail-grid,
  .article-card.is-expanded .article-detail-footer,
  .article-save-badge.is-saved {
    animation: none !important;
  }

  .article-read-toggle i,
  .article-save-badge {
    transition: none !important;
  }

  .article-card.is-expanded .article-read-toggle i {
    transform: none;
  }
}

/* ==========================================================================
   EL BOTON DEL BOLETIN SE SALIA ENTRE 641 Y 768 px
   --------------------------------------------------------------------------
   css/responsive.css pone TODOS los .btn a width:100% desde 768px hacia
   abajo, pero este formulario solo se apilaba desde 640. En la franja de
   enmedio el boton ocupaba el ancho entero dentro de una fila y se salia 15px
   por la derecha -medido a 768-.

   Se apila en el mismo punto en que el boton se hace ancho.
   ========================================================================== */
@media (max-width: 768px) {
  .blog-cta-banner .cta-inline-form {
    flex-direction: column;
  }
}
