/* ═══════════════════════════════════════
   PAGE PROJET
═══════════════════════════════════════ */

.projet-header {
  padding: 48px 60px 36px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.retour {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--camel);
  text-decoration: none;
  display: inline-block;
  margin-bottom: 20px;
  transition: opacity 0.2s ease;
}

.retour:hover { opacity: 0.6; }

.projet-titre {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.8rem);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--black);
  margin-bottom: 12px;
  line-height: 1.1;
}

.projet-meta {
  display: flex;
  gap: 20px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 400;
  color: #888;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ── Corps principal ─ */
.projet-body {
  display: flex;
  gap: 40px;
  padding: 48px 60px;
  align-items: flex-start;
}

.projet-main-img {
  flex: 0 0 auto; /* plus de largeur fixe — s'adapte à l'image */
  max-width: 50%; /* mais ne prend jamais plus de la moitié */
}

.projet-main-img .img-wrapper {
  position: relative;
  cursor: zoom-in;
  display: inline-block; /* épouse exactement la taille de l'image */
  max-width: 100%;
}

.projet-main-img .img-wrapper img {
  display: block;
  max-width: 100%;
  max-height: 72vh;
  width: auto;
  height: auto;
}

.projet-texte {
  flex: 1; /* prend tout l'espace restant */
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 4px;
  padding-right: 5rem;
}

.projet-texte p {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  line-height: 1.75;
  color: var(--black);
}

/* ── Images secondaires ─ */
.projet-imgs-secondaires {
  display: grid;
  gap: 14px;
  padding: 0 60px 60px;
  /* défaut : 3 colonnes — couvre 1, 3, 5, 6+ images */
  grid-template-columns: repeat(3, 1fr);
}

/* 4 images : une rangée de 4 */
.projet-imgs-secondaires:has(.img-wrapper:nth-child(4):last-child) {
  grid-template-columns: repeat(4, 1fr);
}

.projet-imgs-secondaires .img-wrapper {
  position: relative;
  overflow: hidden;
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
}

.projet-imgs-secondaires .img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s var(--ease-out);
}

.projet-imgs-secondaires .img-wrapper:hover img {
  transform: scale(1.04);
}

/* ── Icône agrandir ─ */
.img-expand {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  background: rgba(255,255,255,0.85);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.img-wrapper:hover .img-expand { opacity: 1; }

.img-expand svg {
  width: 13px;
  height: 13px;
  stroke: var(--black);
  stroke-width: 2;
  fill: none;
}

/* ── Lightbox ─ */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}

.lightbox.active { display: flex; }

.lightbox img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 24px;
  right: 32px;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.lightbox-close:hover { opacity: 1; }

/* ── Navigation entre projets ─ */
.projet-nav {
  display: flex;
  justify-content: space-between;
  padding: 32px 60px 52px;
  border-top: 1px solid rgba(0,0,0,0.08);
}

.projet-nav-lien {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 400;
  color: var(--black);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.2s ease;
}

.projet-nav-lien:hover { color: var(--camel); }

/* ═══════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════ */
@media (max-width: 900px) {
  .projet-header,
  .projet-body,
  .projet-imgs-secondaires,
  .projet-nav {
    padding-left: 36px;
    padding-right: 36px;
  }

  .projet-body {
    flex-direction: column;
  }

  .projet-main-img {
    flex: 0 0 auto;
    width: 100%;
  }

  .projet-main-img .img-wrapper img {
    max-height: 55vh;
  }

  .projet-imgs-secondaires,
  .projet-imgs-secondaires:has(.img-wrapper:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projet-header,
  .projet-body,
  .projet-imgs-secondaires,
  .projet-nav {
    padding-left: 20px;
    padding-right: 20px;
  }

  .projet-imgs-secondaires,
  .projet-imgs-secondaires:has(.img-wrapper:nth-child(4):last-child) {
    grid-template-columns: repeat(2, 1fr);
  }
}