/* ===== Páginas de categoría (Historias / Tecnología) ===== */

.cat-page {
  max-width: 112rem; /* 1120px */
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
}

/* ===== Header de sección ===== */
.cat-header {
  text-align: center;
  margin-bottom: 4rem;
  padding-bottom: 2.4rem;
  border-bottom: 1px solid #e5e7eb;
}

.cat-header h1 {
  font-size: clamp(2.6rem, 4.5vw, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.8rem;
  background: linear-gradient(135deg, #0f172a 0%, #7c3aed 50%, #a10395 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cat-header p {
  font-size: 1.55rem;
  color: #6b7280;
  max-width: 60ch;
  margin: 0 auto;
  line-height: 1.6;
}

/* ===== Grid ===== */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

@media (max-width: 1024px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .cat-grid { grid-template-columns: 1fr; gap: 1.4rem; }
}

/* ===== Tarjeta ===== */
.cat-card {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 1.2rem;
  padding: 2rem 2.2rem 1.8rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  cursor: pointer;
  outline: none;
  /* Animación de entrada */
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease,
              box-shadow 0.2s ease, border-color 0.2s ease;
}

.cat-card.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.cat-card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db;
}

.cat-card:focus-visible {
  outline: 2px solid #7c3aed;
  outline-offset: 2px;
}

/* Meta (fecha · lectura) */
.cat-card__meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.25rem;
  color: #9ca3af;
  flex-wrap: wrap;
}

.cat-card__sep {
  color: #d1d5db;
}

/* Título */
.cat-card__title {
  font-size: clamp(1.6rem, 2vw, 1.9rem);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  margin: 0;
  color: #111827;
}

.cat-card__link {
  text-decoration: none;
  color: inherit;
  transition: color 0.15s;
}

.cat-card__link:visited {
  color: inherit;
}

.cat-card:hover .cat-card__link {
  color: #7c3aed;
}

/* Descripción */
.cat-card__desc {
  font-size: 1.4rem;
  color: #4b5563;
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* Enlace "Leer →" */
.cat-card__more {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.3rem;
  font-weight: 600;
  color: #7c3aed;
  text-decoration: none;
  width: fit-content;
  margin-top: auto;
  padding-bottom: 1px;
  border-bottom: 1.5px solid transparent;
  transition: border-color 0.15s, gap 0.15s;
}

.cat-card__more:hover {
  border-color: #7c3aed;
  gap: 0.5rem;
}

/* ===== Estados vacío / error ===== */
.cat-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: #6b7280;
  padding: 4rem 1rem;
  font-size: 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.4rem;
}

.cat-btn {
  padding: 0.9rem 2rem;
  border-radius: 999px;
  background: #0f172a;
  color: #ffffff;
  border: none;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 600;
  transition: background 0.15s;
}

.cat-btn:hover { background: #1e293b; }

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .cat-page {
    padding: 2.4rem 1.6rem 4rem;
  }

  .cat-header {
    margin-bottom: 2.8rem;
    padding-bottom: 1.8rem;
  }

  .cat-header h1 {
    font-size: 2.4rem;
  }

  .cat-card {
    padding: 1.6rem 1.6rem 1.4rem;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .cat-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
