/**
 * PsicosTheme — main.css
 * Estilos específicos de componentes y home page.
 * Las variables globales están en style.css
 */

/* =============================================
   ANIMACIONES (animate-on-scroll)
   ============================================= */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity .5s ease, transform .5s ease;
}
.animate-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* =============================================
   HEADER SCROLLED
   ============================================= */
.site-header.scrolled {
  box-shadow: 0 2px 12px rgba(0,0,0,.10);
}

/* =============================================
   HERO
   ============================================= */
.hero {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 100%);
  padding: 5rem 0 4rem;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .3rem .8rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  margin-bottom: 1.25rem;
  color: var(--color-text);
}

.hero-description {
  font-size: 1.1rem;
  color: var(--color-text-muted);
  margin-bottom: 2rem;
  max-width: 480px;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn-lg { padding: .8rem 1.8rem; font-size: 1rem; }
.btn-sm { padding: .4rem 1rem; font-size: .85rem; }

.hero-img {
  width: 100%;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  aspect-ratio: 4/3;
  object-fit: cover;
}

.hero-img-placeholder {
  width: 100%;
  aspect-ratio: 4/3;
  background: linear-gradient(135deg, #bfdbfe, #bae6fd);
  border-radius: var(--radius-lg);
}

/* =============================================
   STATS BAR
   ============================================= */
.stats-bar {
  background: var(--color-primary);
  color: #fff;
  padding: 2rem 0;
}

.stats-list {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 1.5rem;
  text-align: center;
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.stat-label {
  font-size: .85rem;
  opacity: .85;
}

/* =============================================
   SECCIONES GENERALES
   ============================================= */
.section-categories,
.section-featured,
.section-page-content {
  padding: 4rem 0;
}

.section-categories { background: var(--color-bg); }
.section-featured   { background: var(--color-surface); }

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  flex-wrap: wrap;
  gap: .5rem;
}

.section-header h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }

.section-link {
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

/* =============================================
   CARDS DE CATEGORÍAS
   ============================================= */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--gap);
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: .6rem;
  padding: 1.75rem 1rem;
  background: var(--color-surface);
  border: 2px solid transparent;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  transition: border-color .2s, box-shadow .2s, transform .2s;
  text-decoration: none;
  color: var(--color-text);
}

.category-card:hover {
  border-color: var(--cat-color, var(--color-primary));
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  color: var(--color-text);
}

.category-icon {
  font-size: 2.5rem;
  line-height: 1;
  display: block;
}

.category-name {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
}

.category-count {
  font-size: .8rem;
  color: var(--color-text-muted);
  margin: 0;
}

/* =============================================
   GRID DE TESTS
   ============================================= */
.tests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

.test-card { display: flex; flex-direction: column; }
.test-card .card-body { display: flex; flex-direction: column; flex: 1; }

.test-card .card-thumbnail img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.test-category-badge {
  display: inline-block;
  background: #eff6ff;
  color: var(--color-primary);
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: .2rem .6rem;
  border-radius: 999px;
  margin-bottom: .6rem;
}

.test-title {
  font-size: 1.05rem;
  margin-bottom: .5rem;
}
.test-title a { color: var(--color-text); }
.test-title a:hover { color: var(--color-primary); }

.test-excerpt {
  font-size: .875rem;
  color: var(--color-text-muted);
  flex: 1;
  margin-bottom: 1rem;
}

/* =============================================
   POSTS GRID (index / archive)
   ============================================= */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--gap);
}

/* =============================================
   RESPONSIVE — HOME
   ============================================= */
@media (max-width: 768px) {
  .hero { padding: 3rem 0; }

  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-description { max-width: 100%; }
  .hero-actions { justify-content: center; }
  .hero-image { order: -1; max-width: 400px; margin: 0 auto; }

  .stats-list { gap: 2rem; }
  .stat-number { font-size: 1.5rem; }

  .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }
}

@media (max-width: 480px) {
  .tests-grid,
  .posts-grid {
    grid-template-columns: 1fr;
  }
}