.projets {
  margin-left: 220px;
  padding: 48px 40px 80px;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  min-height: 100vh;
  box-sizing: border-box;
}

.projets-container {
  max-width: 880px;
  margin: 0 auto;
}

.projets-container > h2 {
  margin: 0 0 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  font: 600 24px/1.2 system-ui, sans-serif;
}

#projets-liste {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.projets-message {
  color: var(--muted);
}

/* ---------- Carte (liste) ---------- */
.projet-element {
  all: unset;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  transition: background 0.2s, border-color 0.2s, transform 0.2s;
}

.projet-element:hover,
.projet-element:focus-visible {
  background: var(--bg-hover);
  border-color: var(--accent);
  transform: translateY(-2px);
}

.projet-banner,
.modale-banner {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-bottom: 1px solid var(--border);
}

/* bannière absente : bloc de remplacement */
.banner-vide {
  background: var(--bg-hover);
}

.projet-corps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
}

.projet-titre {
  margin: 0;
  font: 600 16px/1.3 system-ui, sans-serif;
  color: var(--text);
}

/* ---------- Badges de statut ---------- */
.statut {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 1px solid currentColor;
  border-radius: 999px;
  font: 600 12px/1 system-ui, sans-serif;
  white-space: nowrap;
}

.statut-encours   { color: #f5a524; background: rgba(245, 165, 36, 0.12); }
.statut-termine, .statut-contribution  { color: #3fb950; background: rgba(63, 185, 80, 0.12); }
.statut-pause,
.statut-abandonne { color: #f85149; background: rgba(248, 81, 73, 0.12); }

/* ---------- Fenêtre ---------- */
.projet-modale {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(640px, calc(100% - 32px));
  max-height: calc(100% - 48px);
  padding: 0;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, sans-serif;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.projet-modale::backdrop {
  background: rgba(0, 0, 0, 0.7);
}

/* bloque le scroll de la page derrière la fenêtre */
body:has(dialog[open]) {
  overflow: hidden;
}

.modale-fermer {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  cursor: pointer;
  background: rgba(15, 17, 21, 0.8);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  font: 400 22px/1 system-ui, sans-serif;
}

.modale-fermer:hover {
  border-color: var(--accent);
}

.modale-corps {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
}

.modale-entete {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modale-titre {
  margin: 0;
  font: 600 22px/1.3 system-ui, sans-serif;
}

.modale-date {
  margin: 0;
  font: 400 14px/1 system-ui, sans-serif;
  color: var(--muted);
}

.modale-desc {
  margin: 4px 0 8px;
  font: 400 15px/1.65 system-ui, sans-serif;
  opacity: 0.85;
}

.modale-bouton {
  align-self: flex-start;
  padding: 12px 20px;
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  font: 600 15px/1 system-ui, sans-serif;
  text-decoration: none;
  transition: filter 0.2s;
}

.modale-bouton:hover {
  filter: brightness(1.15);
}

@media (max-width: 900px) {
  .projets {
    margin-left: 0;
    padding: 32px 16px 80px;
  }
}