/* =========================================================
   Aliados / Colaboradores – Grid + Cards + Paginación
   (estilo aislado para estas dos plantillas)
   ========================================================= */

/* ===== Tokens mínimos (alineados al archive-list.css) ===== */
:root{
  --ally-maxw: 1180px;
  --ally-gap: 20px;
  --ally-bg: #fff;
  --ally-text: #111;
  --ally-muted: #6c757d;
  --ally-line: #E8E8EA;
  --ally-shadow-xs: 0 1px 2px rgba(16,24,40,.06);
  --ally-shadow-sm: 0 2px 8px rgba(16,24,40,.08);
  --ally-radius: 14px;
  --ally-primary: #032A53; /* azul inspenet */
}

/* ===== Contenedor ===== */
.container{
  max-width: var(--ally-maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: 16px;
  padding-right: 16px;
}

/* ===== Header ===== */
.page-header{
  margin: 12px 0 18px;
}
.page-title{
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 8px;
  color: var(--ally-text);
}
.page-intro{
  color: var(--ally-muted);
  font-size: 15px;
  line-height: 1.5;
}

/* ===== Grid ===== */
.cards-grid{
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr));
  gap: var(--ally-gap);
}

/* >=768: 2 cols, >=1024: 3 cols */
@media (min-width: 768px){
  .cards-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1024px){
  .cards-grid{ grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ===== Card ===== */
.card{
  border: 1px solid var(--ally-line);
  border-radius: var(--ally-radius);
  background: var(--ally-bg);
  box-shadow: var(--ally-shadow-xs);
  overflow: hidden;
  transition: transform .08s ease, box-shadow .2s ease;
}
.card:hover{
  transform: translateY(-1px);
  box-shadow: var(--ally-shadow-sm);
}

.card a{
  color: inherit;
  text-decoration: none;
  display: block;
}

.card-media{
  width: 100%;
  /* Mantener 16:9 y que la imagen no deforme */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f3f4f6;
}
.card-media img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.card-body{
  padding: 14px;
}
.card-title{
  font-size: clamp(16px, 1.6vw, 18px);
  font-weight: 800;
  line-height: 1.3;
  margin: 0 0 8px;
}
.card-meta{
  font-size: 12px;
  color: var(--ally-muted);
  margin: 0 0 8px;
}
.card-excerpt{
  font-size: 14px;
  color: #444;
  margin: 0;
}

/* ===== Paginación (WP paginate_links type=list) ===== */
.pagination{
  margin: 24px 0 8px;
  display: flex;
  justify-content: center;
}
.pagination ul{
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 8px;
  flex-wrap: wrap;
}
.pagination li{
  display: inline-flex;
}
.pagination a,
.pagination span{
  display: inline-flex;
  min-width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--ally-line);
  border-radius: 10px;
  font-size: 14px;
  text-decoration: none;
  color: var(--ally-text);
  background: #fff;
}
.pagination .current{
  background: var(--ally-primary);
  color: #fff;
  border-color: var(--ally-primary);
}

/* ===== Accesibilidad: focus visible ===== */
.cards-grid a:focus-visible,
.pagination a:focus-visible{
  outline: 3px solid rgba(22,119,255,.25);
  outline-offset: 2px;
  border-radius: 12px;
}

/* ===== Reduce motion ===== */
@media (prefers-reduced-motion: reduce){
  .card{ transition: none; }
}
