/* ===== PROJECT PAGE ===== */

.projet-hero {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 8rem var(--container-padding) 2rem;
}

.projet-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-medium);
  text-decoration: none;
  margin-bottom: 2.5rem;
  transition: color var(--speed-medium);
}

.projet-back:hover {
  color: var(--text-bright);
}

.projet-hero__header {
  max-width: 800px;
}

.projet-hero__tags {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.projet-hero__title {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--text-bright);
  margin-bottom: 1.2rem;
}

.projet-hero__excerpt {
  font-size: 1.15rem;
  line-height: 1.7;
  color: var(--text-medium);
  max-width: 600px;
}

/* ===== GALLERY ===== */

.projet-gallery {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 1rem var(--container-padding) var(--section-gap);
}

.projet-gallery__main {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: var(--base-shade);
}

.projet-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.4s ease;
}

.projet-gallery__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(8px);
  color: var(--base-opp);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--speed-medium);
  opacity: 0;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.projet-gallery__main:hover .projet-gallery__nav {
  opacity: 1;
}

.projet-gallery__nav:hover {
  background: #fff;
  transform: translateY(-50%) scale(1.1);
}

.projet-gallery__nav--prev { left: 1rem; }
.projet-gallery__nav--next { right: 1rem; }

.projet-gallery__counter {
  position: absolute;
  bottom: 1rem;
  right: 1rem;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}

.projet-gallery__thumbs {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: var(--base-shade) transparent;
}

.projet-gallery__thumb {
  flex-shrink: 0;
  width: 120px;
  height: 80px;
  border-radius: var(--radius-s);
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  border: 2px solid transparent;
  transition: all var(--speed-medium);
}

.projet-gallery__thumb:hover {
  opacity: 0.8;
}

.projet-gallery__thumb.active {
  opacity: 1;
  border-color: var(--accent);
}

.projet-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ===== DETAILS ===== */

.projet-details {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding) var(--section-gap);
}

.projet-details__grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
}

.projet-details__heading {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-top: 1rem;
  margin-bottom: 1.5rem;
}

.projet-details__text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--text-medium);
}

.projet-details__text p {
  margin-bottom: 1.2rem;
}

.projet-details__text p:last-child {
  margin-bottom: 0;
}

/* Tableaux issus du contenu riche (Markdown « extra »). Sans ces regles les
   cellules se collent : le HTML genere n'a aucune classe a cibler. */
.projet-details__text table {
  display: block;          /* autorise le scroll horizontal sur mobile */
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  margin: 1.6rem 0;
  font-size: 0.95rem;
}

.projet-details__text th,
.projet-details__text td {
  padding: 0.7rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.projet-details__text th {
  color: var(--text-bright);
  font-weight: 600;
  white-space: nowrap;
  border-bottom-width: 2px;
}

.projet-details__text tr:last-child td {
  border-bottom: none;
}

/* Sidebar */
.projet-details__sidebar {
  background: var(--base-tint);
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: var(--radius-m);
  padding: 2rem;
  position: sticky;
  top: 6rem;
}

.projet-details__sidebar-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.08);
}

.projet-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.projet-info-list dt {
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding-top: 1rem;
}

.projet-info-list dd {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-bright);
  padding-bottom: 1rem;
  border-bottom: 1px solid rgba(0,0,0,0.06);
  margin: 0.25rem 0 0 0;
}

.projet-info-list dd:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* ===== CTA ===== */

.projet-cta {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--section-gap) var(--container-padding);
  text-align: center;
}

.projet-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 1rem;
}

.projet-cta p {
  font-size: 1.1rem;
  color: var(--text-medium);
  margin-bottom: 2rem;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== RESPONSIVE ===== */

@media (max-width: 1024px) {
  .projet-details__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .projet-details__sidebar {
    position: static;
  }
}

@media (max-width: 640px) {
  .projet-hero {
    padding-top: 6rem;
  }

  .projet-gallery__main {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-s);
  }

  .projet-gallery__nav {
    width: 2.5rem;
    height: 2.5rem;
    opacity: 1;
  }

  .projet-gallery__thumb {
    width: 90px;
    height: 60px;
  }

  .projet-details__sidebar {
    padding: 1.5rem;
  }
}

/* ---- Vidéos projet (ajout Django) ---- */
.projet-videos{display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:20px;padding:0 6vw}
.projet-video{margin:0}
.projet-video video{width:100%;border-radius:14px;display:block;background:#000}
.projet-video figcaption{margin-top:8px;font-size:.9rem;opacity:.7}
