/**
 * Theme Name:  Astra Child
 * Theme URI:   https://wpastra.com/
 * Description: Thème enfant Astra pour Terra Panamerica. Refonte des pages
 *              archives (catégorie + tag) : texte d'intro, double filtre
 *              croisé (catégorie ⇄ pays) et grille de cards 3 colonnes.
 * Author:      Terra Panamerica
 * Template:    astra
 * Version:     1.0.0
 * Text Domain: astra-child
 */

/* ============================================================
   Tokens du design-system Terra Panamerica
   (repris à l'identique de l'exemple Claude Design — ne pas
    inventer de palette). Scopés sous .tp-archive pour ne rien
    casser ailleurs sur le site.
   ============================================================ */
.tp-archive {
  --tp-petrol:        #2C5E6D;
  --tp-petrol-active: #395D6B;
  --tp-ink:           #3C3C3B;
  --tp-cream:         #FFF7EA;
  --tp-green:         #9ACBAC;
  --tp-white:         #FFFFFF;

  --color-primary:        var(--tp-petrol);
  --color-primary-strong: #234B57;

  --text-title: var(--tp-petrol);
  --text-body:  var(--tp-ink);
  --text-muted: rgba(60, 60, 59, 0.66);
  --text-link:  var(--tp-petrol);

  --surface-page:  var(--tp-white);
  --surface-cream: var(--tp-cream);

  --border-soft: rgba(44, 94, 109, 0.18);

  --font-sans: "Outfit", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --radius-card: 30px;
  --radius-pill: 50px;

  --shadow-card:       0 8px 30px rgba(0, 0, 0, 0.10);
  --shadow-card-hover: 0 14px 40px rgba(0, 0, 0, 0.16);

  --ease-soft: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur-base:  0.28s;

  font-family: var(--font-sans);
  color: var(--text-body);
}

/* ---------- Intro (titre + description du terme) ---------- */
.tp-archive__intro {
  max-width: 860px;
  margin: 0 auto;
  padding: 72px 40px 12px;
  text-align: center;
}
.tp-archive__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--color-primary);
  justify-content: center;
  margin-bottom: 18px;
}
.tp-archive__eyebrow::before {
  content: "";
  width: 28px;
  height: 2px;
  background: currentColor;
}
.tp-archive__title {
  font-size: 52px;
  font-weight: 300;
  line-height: 1.0;
  color: var(--text-title);
  text-wrap: balance;
  margin: 0 0 20px;
}
.tp-archive__title strong { font-weight: 700; }
.tp-archive__lead {
  font-size: 24px;
  font-weight: 300;
  line-height: 1.4;
  color: var(--text-body);
  margin: 0;
}

/* ---------- Barre de filtres (liens-pills) ---------- */
.tp-filters {
  max-width: 1280px;
  margin: 0 auto;
  padding: 36px 40px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}
.tp-filters__label {
  width: 100%;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.tp-filters__btn {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 16px;
  line-height: 1;
  padding: 9px 20px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid var(--border-soft);
  background: transparent;
  color: var(--color-primary);
  transition: all var(--dur-base) var(--ease-soft);
}
.tp-filters__btn:hover { border-color: var(--color-primary); }
.tp-filters__btn.is-active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: #fff;
}

/* ---------- Grille de cards ----------
   Sélecteurs préfixés .tp-archive : spécificité > règles Astra
   (.post / .blog-layout-1) pour gagner quelle que soit la cascade. */
.tp-archive .tp-grid-wrap {
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 48px 40px 40px;
}
.tp-archive .tp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px 36px;
  justify-items: stretch;
  align-items: start;
}
.tp-empty {
  text-align: center;
  font-size: 18px;
  color: var(--text-muted);
  padding: 60px 0;
}

/* ---------- Card article ----------
   width:100% + reset des styles d'article qu'Astra applique en archive
   (inline-block, marges, bordures) pour que la card remplisse sa colonne. */
.tp-archive .tp-grid > .tp-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  float: none;
  background: none;
}

.tp-card__media {
  position: relative;
  width: 100%;
  height: 240px;
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--tp-petrol) center/cover no-repeat;
  box-shadow: var(--shadow-card);
  display: block;
  transition: box-shadow var(--dur-base) var(--ease-soft);
}
.tp-card:hover .tp-card__media { box-shadow: var(--shadow-card-hover); }
.tp-card__media img { width: 100%; height: 100%; object-fit: cover; }
/* Fallback quand l'article n'a pas de vignette */
.tp-card__media--placeholder {
  background: linear-gradient(135deg, var(--tp-petrol) 0%, var(--tp-petrol-active) 100%);
}

.tp-badge {
  position: absolute;
  top: 16px;
  left: 16px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--tp-petrol);
  color: #fff;
}

.tp-card__meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 300;
  color: var(--text-muted);
}
.tp-card__meta .dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; }

.tp-card__title {
  font-weight: 700;
  font-size: 22px;
  line-height: 1.2;
  color: var(--color-primary);
  margin: 0;
  text-wrap: balance;
}
.tp-card__title a { color: inherit; text-decoration: none; }
.tp-card__excerpt {
  font-weight: 300;
  font-size: 16px;
  line-height: 1.45;
  color: var(--text-body);
  margin: 0;
  flex: 1;
}
.tp-textlink {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  font-size: 16px;
  font-weight: 300;
  color: var(--text-link);
  text-decoration: none;
  transition: gap var(--dur-base) var(--ease-soft);
}
.tp-textlink:hover { gap: 12px; }
.tp-textlink svg { width: 1em; height: 1em; }

/* ---------- Pagination (on conserve celle d'Astra, juste centrée) ---------- */
.tp-archive .ast-pagination {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px 64px;
}

/* ============================================================
   Responsive — breakpoints Astra : 3 → 2 → 1 colonne
   ============================================================ */
@media (max-width: 921px) {
  .tp-grid { grid-template-columns: repeat(2, 1fr); }
  .tp-archive__title { font-size: 42px; }
}
@media (max-width: 544px) {
  .tp-grid { grid-template-columns: 1fr; }
  .tp-archive__intro { padding: 48px 22px 8px; }
  .tp-filters,
  .tp-grid-wrap { padding-left: 22px; padding-right: 22px; }
  .tp-archive__title { font-size: 34px; }
  .tp-archive__lead { font-size: 19px; }
}
