/* ═══════════════════════════════════════════════════════════════════════════
   APCNT — Cartes projets de rénovation
   Style professionnel — charte ferroviaire BB 8500
   Palette : bleu nuit SNCF, rouge carmin, gris anthracite, laiton
   ═══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Palette principale */
  --apcnt-night: #0f1c2e;        /* Bleu nuit SNCF */
  --apcnt-night-light: #1a2d4a;
  --apcnt-crimson: #c41e3a;       /* Rouge carmin */
  --apcnt-crimson-dark: #9b1830;
  --apcnt-anthracite: #2d2d2d;     /* Gris anthracite */
  --apcnt-steel: #4a5568;         /* Acier */
  --apcnt-laiton: #c9a227;        /* Laiton / jaune maïs */
  --apcnt-laiton-soft: #f5e6b8;
  --apcnt-cream: #faf8f3;         /* Cassé blanc */
  --apcnt-white: #ffffff;

  /* Statuts */
  --apcnt-status-encours: #2563eb;
  --apcnt-status-termine: #16a34a;
  --apcnt-status-planifie: #d97706;

  /* Typographie */
  --apcnt-font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --apcnt-font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Espacements */
  --apcnt-radius: 12px;
  --apcnt-radius-sm: 6px;
  --apcnt-shadow-sm: 0 2px 8px rgba(15, 28, 46, 0.08);
  --apcnt-shadow-md: 0 8px 24px rgba(15, 28, 46, 0.12);
  --apcnt-shadow-lg: 0 16px 48px rgba(15, 28, 46, 0.16);
  --apcnt-transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Section globale ─────────────────────────────────────────────────────── */

.apcnt-projets-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 4rem 2rem;
  font-family: var(--apcnt-font-body);
  color: var(--apcnt-anthracite);
  background: var(--apcnt-cream);
  border-radius: var(--apcnt-radius);
}

/* ── En-tête ─────────────────────────────────────────────────────────────── */

.apcnt-projets-header {
  text-align: center;
  margin-bottom: 3.5rem;
  position: relative;
}

.apcnt-projets-header::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--apcnt-laiton);
  margin: 1.5rem auto 0;
  border-radius: 2px;
}

.apcnt-projets-title {
  font-family: var(--apcnt-font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  color: var(--apcnt-night);
  margin: 0 0 0.75rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.apcnt-projets-subtitle {
  color: var(--apcnt-steel);
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.7;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  font-weight: 400;
}

/* ── Grille ──────────────────────────────────────────────────────────────── */

.apcnt-projets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 2rem;
}

/* ── Carte ───────────────────────────────────────────────────────────────── */

.apcnt-projet-card {
  background: var(--apcnt-white);
  border-radius: var(--apcnt-radius);
  overflow: hidden;
  box-shadow: var(--apcnt-shadow-sm);
  transition: transform var(--apcnt-transition), box-shadow var(--apcnt-transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.apcnt-projet-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--apcnt-shadow-lg);
}

.apcnt-projet-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--apcnt-crimson), var(--apcnt-laiton));
  opacity: 0;
  transition: opacity var(--apcnt-transition);
  z-index: 2;
}

.apcnt-projet-card:hover::before {
  opacity: 1;
}

/* ── Couverture image ────────────────────────────────────────────────────── */

.apcnt-projet-cover {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--apcnt-night);
}

.apcnt-projet-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.apcnt-projet-card:hover .apcnt-projet-cover img {
  transform: scale(1.05);
}

.apcnt-projet-cover::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(to top, rgba(15, 28, 46, 0.6) 0%, transparent 100%);
  pointer-events: none;
}

/* ── Corps de la carte ───────────────────────────────────────────────────── */

.apcnt-projet-body {
  padding: 1.5rem 1.5rem 1.75rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.apcnt-projet-body h3 {
  font-family: var(--apcnt-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

.apcnt-projet-body h3 a {
  color: var(--apcnt-night);
  text-decoration: none;
  transition: color var(--apcnt-transition);
}

.apcnt-projet-body h3 a:hover {
  color: var(--apcnt-crimson);
}

.apcnt-projet-subtitle {
  color: var(--apcnt-steel);
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0 0 1.25rem;
  flex: 1;
}

/* ── Métadonnées (statut + progression) ──────────────────────────────────── */

.apcnt-projet-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.apcnt-projet-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1;
}

.apcnt-projet-status::before {
  content: '';
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* Statut : En cours */
[data-status="en-cours"] .apcnt-projet-status,
.apcnt-projet-status[data-status="en-cours"] {
  background: #eff6ff;
  color: var(--apcnt-status-encours);
}

/* Statut : Terminé */
[data-status="termine"] .apcnt-projet-status,
.apcnt-projet-status[data-status="termine"] {
  background: #f0fdf4;
  color: var(--apcnt-status-termine);
}

/* Statut : Planifié */
[data-status="planifie"] .apcnt-projet-status,
.apcnt-projet-status[data-status="planifie"] {
  background: #fffbeb;
  color: var(--apcnt-status-planifie);
}

/* Barre de progression */
.apcnt-projet-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--apcnt-steel);
  background: #f3f4f6;
  padding: 0.3rem 0.65rem;
  border-radius: var(--apcnt-radius-sm);
}

.apcnt-projet-progress::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--apcnt-laiton);
}

/* ── Bouton CTA ──────────────────────────────────────────────────────────── */

.apcnt-projet-bouton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  background: var(--apcnt-night);
  color: var(--apcnt-white);
  font-family: var(--apcnt-font-body);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--apcnt-radius-sm);
  transition: all var(--apcnt-transition);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  position: relative;
  overflow: hidden;
}

.apcnt-projet-bouton::after {
  content: '→';
  transition: transform var(--apcnt-transition);
}

.apcnt-projet-bouton:hover {
  background: var(--apcnt-crimson);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.apcnt-projet-bouton:hover::after {
  transform: translateX(3px);
}

.apcnt-projet-bouton:focus-visible {
  outline: 2px solid var(--apcnt-laiton);
  outline-offset: 2px;
}

/* ── État vide / indisponible ────────────────────────────────────────────── */

.apcnt-projets-unavailable {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--apcnt-white);
  border-radius: var(--apcnt-radius);
  border: 1px dashed #d1d5db;
  color: var(--apcnt-steel);
}

.apcnt-projets-unavailable p {
  margin: 0;
  font-size: 1rem;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .apcnt-projets-section {
    padding: 2.5rem 1.25rem;
    border-radius: 0;
  }

  .apcnt-projets-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .apcnt-projets-title {
    font-size: 1.75rem;
  }

  .apcnt-projet-body {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}

@media (max-width: 480px) {
  .apcnt-projets-section {
    padding: 2rem 1rem;
  }

  .apcnt-projet-cover {
    aspect-ratio: 16 / 9;
  }
}

/* ── Animation d'entrée (optionnel, siIntersection Observer disponible) ──── */

@keyframes apcnt-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.apcnt-projet-card {
  animation: apcnt-fadeInUp 0.6s ease-out both;
}

.apcnt-projet-card:nth-child(2) { animation-delay: 0.1s; }
.apcnt-projet-card:nth-child(3) { animation-delay: 0.2s; }
.apcnt-projet-card:nth-child(4) { animation-delay: 0.3s; }
.apcnt-projet-card:nth-child(5) { animation-delay: 0.4s; }
.apcnt-projet-card:nth-child(6) { animation-delay: 0.5s; }
