/* ==============================================
   Blog — búsqueda, tags y tarjetas
   ============================================== */

.blog-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;

  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 18px;
  padding: 14px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  margin: 18px 0 24px;
}

#blog-search {
  flex: 1 1 260px;
  min-width: 240px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #ffffff;
}

#blog-search:focus {
  outline: 3px solid rgba(37, 99, 235, .20);
  outline-offset: 2px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.tag {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #0f172a;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.tag:hover {
  transform: translateY(-2px);
  background: #eef2ff;
  border-color: #dbeafe;
}

.tag.is-active {
  background: #2563eb;
  border-color: transparent;
  color: #ffffff;
}

.blog-cards {
  margin-top: 8px;
}

.post-card {
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .06);
  transition: transform .2s ease, box-shadow .2s ease;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 18px 40px rgba(15, 23, 42, .10);
}

.post-card .cover {
  display: block;
  height: 170px;
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(37, 99, 235, .18), rgba(6, 182, 212, .14));
  background-size: cover;
  background-position: center;
  transition: transform .18s ease, filter .18s ease;
  filter: saturate(1.02) contrast(1.02);
}
.post-card:hover .cover {
  transform: translateY(-2px) scale(1.01);
  filter: saturate(1.05) contrast(1.05);
}
.post-card[data-tags*="hipoteca"] .cover {
  background: linear-gradient(135deg, rgba(37, 99, 235, .16), rgba(245, 158, 11, .14));
}

.post-card[data-tags*="inversion"] .cover {
  background: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(37, 99, 235, .14));
}

.post-card[data-tags*="ahorro"] .cover {
  background: linear-gradient(135deg, rgba(59, 130, 246, .16), rgba(99, 102, 241, .14));
}

.post-card[data-tags*="ia"] .cover {
  background: linear-gradient(135deg, rgba(6, 182, 212, .16), rgba(37, 99, 235, .14));
}

.post-content {
  padding: 18px 18px 20px;
}

.post-content h3 {
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.post-content h3 a {
  color: #0f172a;
  text-decoration: none;
}

.post-content h3 a:hover {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.post-content p {
  margin: 0 0 12px;
  color: #475569;
  line-height: 1.65;
}

.post-content .meta {
  color: #64748b;
  font-weight: 600;
  font-size: .95rem;
}

@media (max-width: 640px) {
  .blog-controls {
    padding: 12px;
  }
  #blog-search {
    min-width: 100%;
  }
}

/* --- Portadas en tarjetas (Blog) --- */
.post-card .cover {
  position: relative;
  display: block;
  height: 190px;
  border-radius: 16px;
  overflow: hidden;
  background: #f1f5f9;
}

.post-card .cover picture,
.post-card .cover img {
  width: 100%;
  height: 100%;
  display: block;
}

.post-card .cover img {
  object-fit: cover;
  transform: scale(1.02);
  transition: transform .35s ease;
}

.post-card:hover .cover img {
  transform: scale(1.06);
}

.post-card .cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(15, 23, 42, .35), rgba(15, 23, 42, .08));
  pointer-events: none;
}

/* --- Blog clusters (v19.4) --- */
.blog-clusters{ margin-top: 12px; }
.cluster-section{ margin-top: 26px; }
.cluster-title{
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.cluster-sub{ margin: 0 0 14px; }
