/**
 * NDPE Grid – Responsive grid layout + pagination.
 * @package NDPE
 */

/* ═══ Grid Wrap ═══ */
.ndpe-grid-wrap {
  display: grid;
  grid-template-columns: repeat(var(--ndpe-grid-cols, 3), 1fr);
  gap: var(--ndpe-card-gap, 24px);
  position: relative;
}
@media (max-width: 1024px) {
  .ndpe-grid-wrap { grid-template-columns: repeat(var(--ndpe-grid-cols-tablet, 2), 1fr); }
}
@media (max-width: 640px) {
  .ndpe-grid-wrap { grid-template-columns: repeat(var(--ndpe-grid-cols-mobile, 1), 1fr); }
}

/* ═══ Card Entrance Animation ═══ */
.ndpe-grid-wrap .ndpe-card {
  animation: ndpe-card-entrance 0.45s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes ndpe-card-entrance {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ndpe-grid-wrap .ndpe-card:nth-child(1)  { animation-delay: 0ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(2)  { animation-delay: 40ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(3)  { animation-delay: 80ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(4)  { animation-delay: 120ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(5)  { animation-delay: 160ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(6)  { animation-delay: 200ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(7)  { animation-delay: 240ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(8)  { animation-delay: 280ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(9)  { animation-delay: 320ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(10) { animation-delay: 360ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(11) { animation-delay: 400ms; }
.ndpe-grid-wrap .ndpe-card:nth-child(12) { animation-delay: 440ms; }

/* ═══ Pagination ═══ */
.ndpe-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: var(--ndpe-space-8, 2rem);
  padding-top: var(--ndpe-space-6, 1.5rem);
}
.ndpe-page-btn {
  min-width: 38px;
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: var(--ndpe-card-bg, #fff);
  font-family: var(--ndpe-font);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ndpe-text, #374151);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0 10px;
}
.ndpe-page-btn:hover {
  border-color: var(--ndpe-primary, #e85d04);
  color: var(--ndpe-primary, #e85d04);
  background: rgba(232, 93, 4, 0.04);
  transform: translateY(-1px);
}
.ndpe-page-btn.ndpe-page-active {
  background: var(--ndpe-primary, #e85d04);
  border-color: var(--ndpe-primary, #e85d04);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 14px rgba(232, 93, 4, 0.35);
  transform: translateY(-1px);
}
.ndpe-page-ellipsis {
  color: var(--ndpe-text-faint, #9ca3af);
  padding: 0 4px;
  font-size: 0.875rem;
}

/* Prev / Next arrows */
.ndpe-page-prev,
.ndpe-page-next {
  font-size: 1rem;
  font-weight: 700;
}

/* Load More */
.ndpe-load-more {
  margin: var(--ndpe-space-8, 2rem) auto 0;
  padding: 12px 36px;
  font-size: 0.9375rem;
}

/* ═══ Dark Mode ═══ */
@media (prefers-color-scheme: dark) {
  .ndpe-page-btn {
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.1);
    color: #d1d5db;
  }
  .ndpe-page-btn:hover {
    border-color: #e85d04;
    color: #e85d04;
    background: rgba(232, 93, 4, 0.08);
  }
  .ndpe-page-btn.ndpe-page-active {
    background: #e85d04;
    border-color: #e85d04;
    color: #fff;
  }
}
