/* =========================================
   static/css/home.css
   Home page layout and animations
   ========================================= */

/* Hero Terminal glow and float */
.hero-terminal-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120%;
  height: 120%;
  background: radial-gradient(circle at center, rgba(148, 163, 184, 0.05) 0%, transparent 60%);
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: 0;
}

.hero-terminal {
  position: relative;
  z-index: 10;
  animation: terminalFloat 6s ease-in-out infinite alternate;
}

@keyframes terminalFloat {
  0% {
    transform: translateY(0px);
  }
  100% {
    transform: translateY(-8px);
  }
}

/* Hero entrance fade-in */
.hero-fade-in {
  opacity: 0;
  animation: fadeIn 0.8s ease-out forwards;
}

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

/* Featured Post image scale */
.featured-img-wrapper:hover img {
  transform: scale(1.03);
}

/* Post card entrance staggered fade-in */
@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.post-card {
  opacity: 0;
  animation: cardFadeIn 0.5s ease forwards;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
              border-color 0.3s ease;
  border: 1px solid transparent;
  will-change: transform, box-shadow;
}

/* Delay for staggered load */
.post-card:nth-child(1) { animation-delay: 0.05s; }
.post-card:nth-child(2) { animation-delay: 0.10s; }
.post-card:nth-child(3) { animation-delay: 0.15s; }
.post-card:nth-child(4) { animation-delay: 0.20s; }
.post-card:nth-child(5) { animation-delay: 0.25s; }
.post-card:nth-child(6) { animation-delay: 0.30s; }
.post-card:nth-child(7) { animation-delay: 0.35s; }
.post-card:nth-child(8) { animation-delay: 0.40s; }
.post-card:nth-child(n+9) { animation-delay: 0.45s; }

/* Enhanced card hover matching requirement */
.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 
              0 10px 10px -5px rgba(0, 0, 0, 0.04), 
              0 0 16px rgba(148, 163, 184, 0.08) !important;
  border-color: rgba(148, 163, 184, 0.2);
  z-index: 10;
}

:root[data-theme="business"] .post-card:hover {
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 
              0 10px 10px -5px rgba(0, 0, 0, 0.2), 
              0 0 16px rgba(148, 163, 184, 0.05) !important;
}

.post-card img.cover-fallback {
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover img.cover-fallback {
  transform: scale(1.05); /* Req: 图片 hover scale(1.03) 到 scale(1.05) */
}

/* Category Badge Float */
.post-card .badge-primary {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.post-card:hover .badge-primary {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
