/* projet.css — styles spécifiques à la page projet uniquement.
   Le header, les variables et le reset viennent de style.css. */

html { scroll-behavior: smooth; }


/* ── Barre retour + titre projet ────────────── */
.pj-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.4rem var(--site-margin);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-muted);
  text-decoration: none;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  transition: color 0.25s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.back-btn:hover { color: var(--color-red); }

.pj-titre-inline {
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--color-white);
  padding-left: 1.5rem;
  line-height: 1;
}

/* ── Galerie / Masonry ──────────────────────── */
.galerie {
  padding: 0 var(--site-margin) 6rem;
}

.masonry {
  columns: 3;
  column-gap: 6px;
}

.masonry-item {
  break-inside: avoid;
  margin-bottom: 6px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}

.masonry-item img,
.masonry-item video {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.45s ease, opacity 0.3s ease;
  opacity: 0.85;
}

.masonry-item:hover img,
.masonry-item:hover video {
  transform: scale(1.03);
  opacity: 1;
}

.video-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  color: white;
  background: rgba(0, 0, 0, 0.4);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 1.2rem;
  pointer-events: none;
}

/* Overlay rouge subtil au hover */
.masonry-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--color-red);
  opacity: 0;
  transition: opacity 0.35s ease;
  pointer-events: none;
}

.masonry-item:hover::after {
  opacity: 0.06;
}

/* ── Responsive masonry ─────────────────────── */
@media (max-width: 900px) {
  .masonry { columns: 2; }
}
@media (max-width: 520px) {
  .masonry { columns: 1; }
  .pj-nav { flex-wrap: wrap; gap: 0.8rem; }
  .pj-titre-inline { border-left: none; padding-left: 0; }
}

/* ── Lightbox ───────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.94);
  cursor: default;
}

/* Stage (image container) */
.lb-stage {
  position: relative;
  z-index: 2;
  max-width: calc(100vw - 160px);
  max-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lb-img,
.lb-video {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  border: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.lb-img.is-loaded,
.lb-video.is-loaded {
  opacity: 1;
  transform: translateY(0);
}

.hidden {
  display: none !important;
}

/* Close */
.lb-close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lb-close:hover { color: var(--color-red); border-color: var(--color-red); }

/* Arrows */
.lb-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: none;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.lb-arrow:hover { color: var(--color-red); border-color: var(--color-red); }

.lb-prev { left: 1.5rem; }
.lb-next { right: 1.5rem; }

/* Counter */
.lb-counter {
  position: absolute;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  color: var(--color-muted);
}

/* Mobile lightbox */
@media (max-width: 600px) {
  .lb-stage {
    max-width: 100vw;
    max-height: calc(100vh - 120px);
  }

  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }

  .lb-arrow {
    display: none;
  }

  .lb-img {
    max-height: calc(100vh - 140px);
  }
}

/* ── Scroll to top ───────────────────────────── */
.scroll-top {
  position: fixed;
  bottom: 2.2rem;
  right: 2.2rem;
  z-index: 500;
  background: #000;
  border: 1px solid var(--color-border);
  color: var(--color-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 52px;
  padding: 0.9rem 0;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px);
  transition:
    opacity 0.35s ease,
    transform 0.35s ease,
    color 0.2s ease,
    border-color 0.2s ease;
}

.scroll-top.is-visible {
  opacity: 1;
  pointer-events: all;
  transform: translateY(0);
}

.scroll-top-icon {
  font-size: 1.5rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.scroll-top-label {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  line-height: 1;
}

.scroll-top:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}

.scroll-top:hover .scroll-top-icon {
  transform: translateY(-3px);
}
