
/* ========================= */
/* GALERIE */
/* ========================= */

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;

  padding: 120px 40px;
  max-width: 1200px;
  margin: auto;

  grid-auto-rows: 10px; /* base pour le calcul */
}

.grid img {
  width: 100%;
  display: block;
  cursor: pointer;

  transition: transform 0.3s ease, opacity 0.3s ease;
}

.grid img:hover {
  transform: scale(1.02);
  opacity: 0.85;
}

/* MOBILE */
@media (max-width: 768px) {
  .grid {
    grid-template-columns: 1fr;
    max-width: 90%;
    padding: 100px 20px;
  }
}

/* ========================= */
/* LIGHTBOX */
/* ========================= */

.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;

  background: rgba(0,0,0,0.97);

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;

  transition: opacity 0.3s ease;
  z-index: 9999;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* IMAGE LIGHTBOX (CORRIGÉE) */
#lightbox-img {
  width: auto;
  height: auto;

  max-width: 900px;   /* 👈 limite desktop */
  max-height: 80vh;   /* 👈 limite hauteur */

  object-fit: contain;

  animation: fadeIn 0.3s ease;
}

/* MOBILE LIGHTBOX */
@media (max-width: 768px) {
  .lightbox-img {
    max-width: 90%;
    max-height: 70vh;
  }
}

/* ANIMATION */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.97);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* ========================= */
/* UI LIGHTBOX */
/* ========================= */

/* fermer */
.close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 40px;
  color: white;
  cursor: pointer;
  transition: 0.2s;
}

.close:hover {
  opacity: 0.7;
}

/* flèches */
.prev, .next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 40px;
  color: white;
  cursor: pointer;
  padding: 10px;
  transition: 0.2s;
  user-select: none;
}

.prev { left: 20px; }
.next { right: 20px; }

.prev:hover, .next:hover {
  opacity: 0.7;
}

/* MOBILE */
@media (max-width: 768px) {

  .burger {
    display: flex;
    justify-content: center;
  }

  nav {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: none;

    display: flex;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    flex-direction: column;
    align-items: center;
    justify-content: center;

    padding: 20px 0;

    /* 👇 animation fluide */
    transform: translateY(-20px);
    opacity: 0;
    pointer-events: none;

    transition:
      transform 0.4s ease,
      opacity 0.3s ease;
  }

  nav a {
    margin: 15px 0;
    font-size: 22px;

    /* petit effet smooth sur les liens */
    transform: translateY(-10px);
    opacity: 0;
    transition: 0.3s ease;
  }

  nav.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
    background: #ffffff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  }

  header {
    background: #ffffff;
  }

  /* apparition progressive des liens */
  nav.active a {
    transform: translateY(0);
    opacity: 1;
  }

  nav.active a:nth-child(1) { transition-delay: 0.1s; }
  nav.active a:nth-child(2) { transition-delay: 0.2s; }
  nav.active a:nth-child(3) { transition-delay: 0.3s; }

  /* burger animation */
  .burger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .burger.active span:nth-child(2) {
    opacity: 0;
  }

  .burger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
  }

  .hero {
    padding: 100px 20px 60px;
  }

  .hero h2 {
    font-size: 24px;
    padding-top: 80px;
  }

  .scroll-down {
    bottom: 45vh;
    font-size: 1.5rem;
  }

  .project-inner h1 {
    font-size: 40px;
  }
}
