/* =========================================
   MAGNA POST GRID ¨C Estilo moderno
   Paleta Magna:
   MAGNA-1: #BFA87E
   MAGNA-2: #735A3D
   MAGNA-3: #A68660
   MAGNA-4: #F2F2F2
   MAGNA-5: #262626
========================================= */

/* Contenedor principal */
.magna-post-grid-container {
  position: relative;
  background: #F2F2F2; /* MAGNA-4 */
  padding: 40px 20px;
  border-radius: 24px;
  overflow: hidden;
}

/* Overlay de carga */
.magna-post-grid-container.magna-is-loading::after {
  content: "Cargando...";
  position: absolute;
  inset: 0;
  background: rgba(242, 242, 242, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #735A3D;
  font-size: 14px;
  z-index: 10;
}

/* Wrapper interno */
.magna-post-grid-wrapper {
  max-width: 1350px;
  margin: 0 auto;
}

/* Grid de 3 columnas */
.magna-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
}

/* -----------------------------------------
   Tarjetas
------------------------------------------ */
.magna-post-card {
  background: #FFFFFF;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.magna-post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
}

/* Media / miniatura */
.magna-post-thumb {
  display: block;
  position: relative;
  overflow: hidden;
}

.magna-post-thumb img {
  width: 100%;
  height: auto;
  display: block;
}

/* Badge de categor¨ªa sobre la miniatura */
.magna-category-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #BFA87E; /* MAGNA-1 */
  color: #FFFFFF;
  padding: 6px 14px 6px 12px;
  border-radius: 16px 16px 16px 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.magna-category-icon {
  font-size: 14px;
}

/* Contenido de la tarjeta */
.magna-post-content {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* Meta minimalista: solo fecha */
.magna-post-meta {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #735A3D; /* MAGNA-2 */
  margin-bottom: 6px;
  opacity: 0.8;
}

/* T¨ªtulo compacto (2 l¨ªneas m¨¢ximo) */
.magna-post-title {
  margin: 0 0 8px;
}

.magna-post-title a {
  font-size: 18px;
  font-weight: 700;
  color: #262626; /* MAGNA-5 */
  text-decoration: none;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;    /* m¨¢ximo 2 l¨ªneas */
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.magna-post-title a:hover {
  color: #735A3D; /* MAGNA-2 */
}

/* Extracto */
.magna-post-excerpt {
  font-size: 14px;
  line-height: 1.7;
  color: #4A4A4A;
  margin-bottom: 14px;
}

/* Footer + bot¨®n */
.magna-post-footer {
  margin-top: auto;
}

.magna-read-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #735A3D; /* MAGNA-2 */
  color: #FFFFFF;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  transition: background 0.25s ease, transform 0.2s ease;
}

.magna-read-more:hover {
  background: #BFA87E; /* MAGNA-1 */
  transform: translateY(-1px);
}

.magna-read-more svg {
  width: 14px;
  height: 14px;
}

/* -----------------------------------------
   Paginaci¨®n (estilo chips modernos)
------------------------------------------ */
.magna-pagination {
  margin: 32px auto 0;
  display: flex;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
}

.magna-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.magna-page-link a,
.magna-pagination .magna-page-link {
  min-width: 34px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #E5E5E5;
  color: #262626;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.25s ease, color 0.25s ease, transform 0.15s ease,
    border-color 0.25s ease;
  cursor: pointer;
}

/* si est¨¢s generando <a> con la clase directamente */
.magna-pagination .magna-page-link.magna-page-current,
.magna-pagination .magna-page-link .current {
  background: #735A3D; /* MAGNA-2 */
  color: #FFFFFF;
  border-color: rgba(0, 0, 0, 0.06);
}

.magna-pagination .magna-page-link:hover a,
.magna-pagination .magna-page-link:hover,
.magna-pagination .magna-page-link a:hover {
  background: #BFA87E; /* MAGNA-1 */
  color: #FFFFFF;
  transform: translateY(-1px);
}

/* -----------------------------------------
   Responsive
------------------------------------------ */
@media (max-width: 992px) {
  .magna-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .magna-post-grid {
    grid-template-columns: 1fr;
  }

  .magna-post-grid-container {
    padding: 24px 16px;
  }
}
