/* =============================================================
   Page Projets — styles spécifiques.
   ----------------------------------------------------------------
   La page utilise :
     - .intro (site.css §6.1b) pour le chapeau
     - .project / .projects-grid (site.css §6.3b) pour les cartes
   Ce fichier ajoute :
     - .projects-filters : barre de recherche + chips de filtres
     - .chip : pastille de filtre (active = marine plein)
     - .status-pill : badge de statut sur la carte
     - .projects-list : section conteneur de la grille
     - .projects-empty : état vide (aucun projet ne matche)
     - .t-enfance / .t-insertion / .t-ecologie : fallback dégradés
       par thématique pour les .project-img sans photo
   ============================================================= */

/* =========================================================
   FILTRES — barre sticky avec recherche + chips
   ========================================================= */
.projects-filters {
  padding: clamp(20px, 2.5vw, 32px) 0;
  background: color-mix(in srgb, var(--paper) 92%, transparent);
  backdrop-filter: saturate(140%) blur(14px);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  border-bottom: 1px solid var(--rule);
  position: sticky;
  top: 80px; /* sous le header sticky */
  z-index: 50;
}

.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(12px, 1.5vw, 20px) clamp(20px, 2.5vw, 32px);
}

/* Recherche */
.filters-search { flex: 1 1 240px; min-width: 200px; max-width: 360px; }
.filters-search input {
  width: 100%;
  padding: 10px 16px;
  font: inherit; font-size: 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  background: var(--paper);
  color: var(--ink);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.filters-search input::placeholder { color: var(--stone-500); }
.filters-search input:focus {
  outline: none;
  border-color: var(--marine);
  box-shadow: 0 0 0 3px var(--ocher-soft);
}

/* Groupes de chips */
.filters-chips {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
}
.filters-label {
  font-family: var(--mono); font-size: 10px;
  letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--stone-500);
  margin-right: 4px;
  align-self: center;
}

/* Chip — pastille de filtre */
.chip {
  display: inline-flex; align-items: center;
  padding: 7px 14px;
  font-family: var(--sans); font-size: 12px; font-weight: 500;
  color: var(--stone-700);
  background: transparent;
  border: 1px solid var(--rule-strong);
  border-radius: var(--r-pill);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease-out),
              background var(--t-fast) var(--ease-out),
              border-color var(--t-fast) var(--ease-out);
  white-space: nowrap;
}
.chip:hover { color: var(--marine); border-color: var(--marine); }
.chip.active {
  background: var(--marine);
  color: var(--paper);
  border-color: var(--marine);
}

/* Compteur de résultats */
.filters-count {
  margin-top: 12px;
  font-family: var(--mono); font-size: 11px;
  letter-spacing: 0.04em; color: var(--stone-500);
}
.filters-count #projects-count {
  color: var(--marine);
  font-weight: 500;
}

/* =========================================================
   LISTE DES PROJETS
   ========================================================= */
.projects-list {
  padding: clamp(40px, 5vw, 80px) 0 var(--section-y);
}

/* Cards masquées par les filtres */
.project[hidden] { display: none; }

/* Tag composite (multi-thématiques) sur la vignette */
.project-tag.multi {
  /* permet plusieurs lignes si besoin */
  max-width: calc(100% - 28px);
}

/* Note : la règle `.project-img img { object-fit: cover; … }` vit dans
   site.css §6.3b (utilisée aussi sur la home, pas seulement ici). */

/* Fallback dégradés par thématique (utilisé si pas de <img>) */
.project-img.t-enfance {
  background: linear-gradient(135deg, #E2D6BB 0%, #C8B89A 100%);
}
.project-img.t-insertion {
  background: linear-gradient(160deg, #B8C8D6 0%, #8AA0B0 100%);
}
.project-img.t-ecologie {
  background: linear-gradient(150deg, #C8D1B8 0%, #95A87C 100%);
}
/* Multi-thématique : dégradé combinant les couleurs */
.project-img.t-enfance.t-insertion {
  background: linear-gradient(135deg, #E2D6BB 0%, #B8C8D6 100%);
}

/* Status pill — affichée dans .project-meta */
.status-pill {
  display: inline-flex; align-items: center;
  padding: 3px 9px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: 0.10em; text-transform: uppercase;
  border-radius: var(--r-pill);
  border: 1px solid var(--rule-strong);
  color: var(--stone-700);
  background: transparent;
}
.status-pill::before {
  content: ""; flex: none;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--stone-500);
  margin-right: 7px;
}
/* En cours — vert subtil. Deux sélecteurs : sur .project (carte du
   listing) OU directement sur le .status-pill (fiche détail). */
.project[data-status="en-cours"] .status-pill,
.status-pill[data-status="en-cours"] {
  border-color: color-mix(in srgb, var(--success) 35%, transparent);
  color: var(--success);
}
.project[data-status="en-cours"] .status-pill::before,
.status-pill[data-status="en-cours"]::before {
  background: var(--success);
}
/* Clôturé — ton neutre + carte légèrement atténuée */
.project[data-status="cloture"] .project-img {
  opacity: 0.72;
}

/* =========================================================
   ÉTAT VIDE — aucun projet ne matche
   ========================================================= */
.projects-empty {
  text-align: center;
  padding: clamp(48px, 6vw, 96px) 24px;
  border: 1px dashed var(--rule-strong);
  border-radius: var(--r-2);
  color: var(--stone-700);
  max-width: 480px;
  margin: 0 auto;
}
.projects-empty p {
  font-family: var(--serif); font-style: italic;
  font-size: clamp(18px, 1.6vw, 22px);
  color: var(--marine);
  margin-bottom: 8px;
}
.projects-empty small {
  display: block;
  font-family: var(--sans); font-style: normal; font-size: 13px;
  color: var(--stone-500);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 860px) {
  .projects-filters {
    position: relative; top: auto;
  }
  .filters-row { flex-direction: column; align-items: stretch; }
  .filters-search { max-width: none; }
  .filters-chips { justify-content: flex-start; }
}
