* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: white;
  font-family: system-ui, sans-serif;
  min-height: 100vh;
}

:root {
  --hauteur-bandeau: 50px;
}

/* ─── BANDEAU HEADER INDEX ─── */

.bandeau {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--hauteur-bandeau);
  background: white;
  display: flex;
  align-items: center;
  justify-content: left;
  z-index: 9999;
}

.logo {
  height: 100%;
  width: auto;
}

/* ─── CONTENEUR PRINCIPAL ─── */

.conteneur {
  display: flex;
  flex-direction: row;
  margin-top: var(--hauteur-bandeau);
  min-height: calc(100vh - 50px);
}

/* ─── GRILLE ─── */

.grille {
  flex: 1;
  padding: 20px;
  padding-right: 180px;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  overflow: hidden;
}

/* ─── LIGNES ─── */

.ligne {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  width: 100%;
  margin-bottom: -2%;
}

.ligne.aligne-droite {
  justify-content: flex-end;
}

.ligne.aligne-gauche {
  justify-content: flex-start;
}

/* ─── IMAGES INDEX ─── */

.image-item {
  position: relative;
  flex-shrink: 0;
  transition: transform 0.1s ease-out;
  cursor: pointer;
}

.image-item img {
  width: 100%;
  height: auto;
  display: block;
}

.image-item.hidden {
  display: none;
}

/* ─── FILTRES COLONNE DROITE ─── */

.filtres {
  position: fixed;
  top: var(--hauteur-bandeau);
  right: 0;
  width: 160px;
  height: calc(100vh - 50px);
  background: white;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 9999;
  border-left: 1px solid #eee;
  overflow-y: auto;
}

.filtre {
  padding: 6px 10px;
  border: 1px solid #333;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-family: system-ui, sans-serif;
  text-align: left;
  transition: all 0.2s ease;
}

.filtre:hover {
  background: #f0f0f0;
}

.filtre.actif {
  background: #333;
  color: white;
}

/* ─── OVERLAY PROJET ─── */

.projet-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: white;
  z-index: 8000;
  overflow-y: auto;
}

.projet-overlay.visible {
  display: block;
}

/* ─── BANDEAU HEADER PROJET ─── */

.bandeau-projet {
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--hauteur-bandeau);
  background: #white;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

/* ─── BOUTON FERMER ─── */

.bouton-fermer {
  position: sticky;
  top: 60px;
  left: 20px;
  z-index: 100;
  font-size: 20px;
  border: 1px solid #333;
  background: white;
  cursor: pointer;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 0 20px;
  transition: all 0.2s ease;
  font-family: system-ui, sans-serif;
}

.bouton-fermer:hover {
  background: #333;
  color: white;
}

/* ─── GALERIE PROJET ─── */

.galerie-projet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0 240px 0;
}

.image-projet {
  width: 40%;
  height: auto;
  display: block;
}

/* ─── BANDEAU INFO ─── */

.bandeau-info {
  position: sticky;
  bottom: 0;
  width: 100%;
  height: 10vh;
  background: white;
  border-top: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}



.projet-overlay.visible ~ .bandeau-info,
.bandeau-info.visible {
  display: flex;
}

.info-contenu {
  width: 40%;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.projet-titre {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.projet-court {
  font-size: 13px;
  color: #555;
  text-decoration: underline;
  cursor: pointer;
}

.projet-court:hover {
  color: #000;
}

/* ─── POP-UP ─── */

.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
  align-items: center;
  justify-content: center;
}

.popup-overlay.visible {
  display: flex;
}

.popup-contenu {
  background: white;
  width: 50%;
  max-height: 70vh;
  overflow-y: auto;
  padding: 40px;
  position: relative;
}

.popup-fermer {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: #333;
  font-family: system-ui, sans-serif;
}

.popup-fermer:hover {
  color: #000;
}

#popup-texte {
  font-size: 14px;
  line-height: 1.7;
  color: #333;
}

/* ─── LOADER ─── */

.loader {
  position: fixed;
  top: 50px;
  left: 0;
  width: calc(100% - 160px);
  height: calc(100vh - 50px);
  background: white;
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.loader.hidden {
  display: none;
}
.loader-gif {
  width: 40px;
  height: 40px;
  object-fit: contain;
}
.grille {
  opacity: 0;
  transition: opacity 0.3s ease;
}
.grille.visible {
  opacity: 1;
}

/* ─── MOBILE ─── */

@media (max-width: 768px) {

  .filtres {
    position: relative;
    top: auto;
    right: auto;
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-wrap: wrap;
    border-left: none;
    border-bottom: 1px solid #eee;
    padding: 10px;
  }

  .conteneur {
    flex-direction: column;
  }

  .grille {
    padding-right: 20px;
    margin-top: 0;
  }

  .bandeau-info {
    height: auto;
    min-height: 15vh;
    padding: 15px;
  }

  .info-contenu {
    width: 90%;
  }

  .image-projet {
    width: 90%;
  }



}
