/* ==========================================================================
   Articles index (/articles).

   Uses the existing tokens and card classes so both themes apply without new
   colour decisions. Only layout and pagination live here.
   ========================================================================== */

.index-hero {
  padding-block: var(--space-8, 3rem) var(--space-6, 2rem);
}

.index-title {
  font-size: clamp(2.75rem, 6vw, 5rem);
  line-height: 0.98;
  margin: 0.5rem 0 0.75rem;
}

.index-list-section {
  padding-block: var(--space-6, 2rem) var(--space-10, 4rem);
}

.index-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}

.index-card {
  border-radius: 6px;
  overflow: hidden;
  /* Card surface, border and shadow come from the theme layers. */
}

.index-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.index-card .card-media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--color-surface-2, #eee);
}

.index-card .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.index-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1rem, 2vw, 1.5rem);
}

.index-card-title {
  font-size: clamp(1.25rem, 1.6vw, 1.6rem);
  line-height: 1.18;
  margin: 0;
}

.index-card-lede {
  margin: 0;
  color: var(--color-text-muted);
  font-size: 0.975rem;
  line-height: 1.5;
}

.index-card .card-meta {
  margin: 0.25rem 0 0;
  font-size: 0.85rem;
  color: var(--color-text-faint);
}

/* Zero-article state. Previously this printed "Aucune publication" in the deck
   and again in the list, and left the page looking sparse rather than
   deliberate. */
.index-empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  max-width: 46rem;
  padding: clamp(1.75rem, 4vw, 3rem);
  border: 1px solid var(--color-divider);
  border-radius: 6px;
  background: var(--color-surface);
}

.index-empty-kicker {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-green);
}

.index-empty-title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.25rem);
  line-height: 1.1;
}

.index-empty-text {
  margin: 0;
  max-width: 40rem;
  color: var(--color-text-muted);
  line-height: 1.6;
}

.index-empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

/* ── Pagination ─────────────────────────────────────────────────────────── */

.index-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: clamp(2rem, 4vw, 3.5rem);
}

.index-page-numbers {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-inline: 0.5rem;
}

.index-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  text-decoration: none;
  color: var(--color-text);
  font-size: 0.9rem;
  font-weight: 600;
}

a.index-page-link:hover {
  border-color: var(--color-green);
  color: var(--color-green);
}

.index-page-link.is-current {
  background: var(--color-green);
  border-color: var(--color-green);
  /* Dark text on the bright fill; white would not clear AA. */
  color: #12201a;
}

.index-page-link.is-disabled {
  opacity: 0.45;
  cursor: default;
}

/* ── Motion ─────────────────────────────────────────────────────────────
   A short lift on hover only. No entrance animation that shifts layout,
   nothing that moves while reading. */

@media (hover: hover) {
  .index-card {
    transition:
      transform 180ms ease,
      box-shadow 180ms ease,
      border-color 180ms ease;
  }

  .index-card:hover {
    transform: translateY(-2px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .index-card {
    transition: none;
  }

  .index-card:hover {
    transform: none;
  }
}
