/* ====
   BLOG — Bluesite HR Hub
   Versión mejorada con Masonry, Filtros y Animaciones
==== */

.blog-section{
  padding-top: 40px;
  padding-bottom: 100px;
}

/* ===== MASONRY GRID ===== */
.blog-grid{
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.blog-card{
  border-radius: 16px;
  padding: 0;
  border: 1px solid rgba(45, 116, 156, 0.1);
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,.06);
  transition: all .35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  transform: translateY(30px) scale(0.95);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.blog-card:hover{
  transform: translateY(-8px);
  box-shadow: 0 20px 50px rgba(45, 116, 156, 0.15);
  border-color: rgba(45, 116, 156, 0.3);
}

/* ===== IMAGEN HERO ===== */
.blog-card-image{
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: linear-gradient(135deg, #2D749C, #C6016B);
  transition: transform .35s ease;
}

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

.blog-card-content{
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-grow: 1;
}

/* ===== META INFO ===== */
.blog-meta{
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  background: linear-gradient(135deg, #2D749C, #C6016B);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blog-meta::before{
  content: '';
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #2D749C;
}

/* ===== TÍTULOS Y TEXTO ===== */
.blog-card h3{
  font-size: 20px;
  line-height: 1.4;
  margin: 0;
  color: #1a1a1a;
  font-weight: 700;
  transition: color .2s ease;
}

.blog-card:hover h3{
  color: #2D749C;
}

.blog-card p{
  font-size: 15px;
  line-height: 1.6;
  color: #666;
  margin: 0;
  flex-grow: 1;
}

/* ===== LINK ===== */
.blog-link{
  margin-top: auto;
  font-weight: 700;
  font-size: 14px;
  color: #2D749C;
  transition: all .2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
}

.blog-link:hover{
  gap: 10px;
  color: #C6016B;
}

/* ===== FILTROS Y TAG CLOUD ===== */
.filter-section{
  padding: 40px 0 20px;
  border-bottom: 1px solid rgba(45, 116, 156, 0.1);
}

.filter-container{
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.filter-btn, .tag-btn{
  padding: 10px 20px;
  border-radius: 50px;
  border: 2px solid rgba(45, 116, 156, 0.2);
  background: #fff;
  color: #2D749C;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all .25s ease;
  text-transform: capitalize;
}

.filter-btn:hover, .tag-btn:hover{
  background: rgba(45, 116, 156, 0.05);
  border-color: #2D749C;
  transform: translateY(-2px);
}

.filter-btn.active, .tag-btn.active{
  background: linear-gradient(135deg, #2D749C, #C6016B);
  color: #fff;
  border-color: transparent;
}

/* ===== TAG CLOUD ===== */
.tag-cloud{
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-btn{
  font-size: 12px;
  padding: 8px 16px;
  opacity: 0;
  animation: tagFadeIn 0.4s ease forwards;
}

@keyframes tagFadeIn {
  to { opacity: 1; }
}

.tag-btn[data-count]::after{
  content: " (" attr(data-count) ")";
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.7;
}

/* ===== RESULTS INFO ===== */
.results-info{
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

/* ===== PAGINACIÓN ===== */
.pagination-container{
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 60px;
  flex-wrap: wrap;
}

.pagination-btn{
  padding: 12px 18px;
  border-radius: 10px;
  border: 2px solid rgba(45, 116, 156, 0.2);
  background: #fff;
  color: #2D749C;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all .25s ease;
  min-width: 44px;
}

.pagination-btn:hover:not(:disabled){
  background: rgba(45, 116, 156, 0.05);
  border-color: #2D749C;
  transform: translateY(-2px);
}

.pagination-btn.active{
  background: linear-gradient(135deg, #2D749C, #C6016B);
  color: #fff;
  border-color: transparent;
}

.pagination-btn:disabled{
  opacity: 0.3;
  cursor: not-allowed;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner{
  display: none;
  justify-content: center;
  padding: 40px;
}

.loading-spinner.active{
  display: flex;
}

.spinner{
  width: 50px;
  height: 50px;
  border: 4px solid rgba(45, 116, 156, 0.1);
  border-top-color: #2D749C;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .blog-grid{
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .filter-container{
    flex-direction: column;
    align-items: stretch;
  }
  
  .tag-cloud{
    justify-content: center;
  }
  
  .filter-btn, .tag-btn{
    width: 100%;
    text-align: center;
  }
}

/* ===== ANIMACIONES STAGGER ===== */
.blog-card:nth-child(1) { animation-delay: 0.05s; }
.blog-card:nth-child(2) { animation-delay: 0.1s; }
.blog-card:nth-child(3) { animation-delay: 0.15s; }
.blog-card:nth-child(4) { animation-delay: 0.2s; }
.blog-card:nth-child(5) { animation-delay: 0.25s; }
.blog-card:nth-child(6) { animation-delay: 0.3s; }
.blog-card:nth-child(7) { animation-delay: 0.35s; }
.blog-card:nth-child(8) { animation-delay: 0.4s; }
.blog-card:nth-child(9) { animation-delay: 0.45s; }

.tag-btn:nth-child(1) { animation-delay: 0.05s; }
.tag-btn:nth-child(2) { animation-delay: 0.1s; }
.tag-btn:nth-child(3) { animation-delay: 0.15s; }
.tag-btn:nth-child(4) { animation-delay: 0.2s; }
.tag-btn:nth-child(5) { animation-delay: 0.25s; }
.tag-btn:nth-child(6) { animation-delay: 0.3s; }
.tag-btn:nth-child(7) { animation-delay: 0.35s; }
.tag-btn:nth-child(8) { animation-delay: 0.4s; }