/* Página de projeto: layout alinhado ao print + grid 12 colunas de style.css (--grid-cols, --grid-gap, .wrap) */

body{
  background-color: #fff;
}

.page-project-detail .project-page-wrap img,
.page-project-detail .project-page-wrap video {
  display: block;
  width: 100%;
}

.page-project-detail .project-page-wrap a {
  text-decoration: none;
  color: inherit;
}

.project-page-wrap {
  display: grid;
  grid-template-columns: repeat(var(--grid-cols), 1fr);
  gap: var(--grid-gap);
  row-gap: 0;
  padding-top: clamp(72px, 14vw, 108px);
  padding-bottom: 0;
}

/* Hero vídeo — borda azul como referência */
.project-hero {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.project-hero__player {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border: none;
}

.project-hero__player .video-content {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: cover;
}

/* Intro — bloco de texto mais estreito que o hero */
.project-intro {
  grid-column: 1 / -1;
  padding: clamp(40px, 6vw, 72px) 0 clamp(28px, 4vw, 48px);
}

.has-no-player .project-intro {
  padding-top: 0;
  padding-bottom: clamp(28px, 4vw, 48px);
}

.intro-content {
  max-width: 100%;
  min-width: 0;
}

.project-intro h1 {
  max-width: 100%;
  width: 100%;
  font-size: clamp(36px, 5.5vw, 76.8px);
  line-height: 1.02;
  margin: 0 0 43px;
  font-weight: 400;
  color: #1E1E1E;
  white-space: nowrap;
}

.project-intro p {
  width: 100%;
  font-size: 18.75px;
  line-height: 1.30;
  font-weight: 280;
  color: #1E1E1E;
  margin: 0 0 14px;
}

.project-intro p:last-child {
  font-weight: 400;
}

/* Galeria: N thumbs (3 colunas no desktop; quantidade vem do JSON) */
.project-gallery {
  grid-column: 1 / -1;
  padding-bottom: clamp(32px, 5vw, 56px);
}

.project-gallery.is-empty {
  display: none;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
  width: 100%;
}

.project-gallery .thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 0;
  background: #e0e0e0;
  content-visibility: auto;
  contain-intrinsic-size: 320px 180px;
}

/* GIF / vídeo: conteúdo adiado até a viewport + fila escalonada (JS) */
.project-gallery .thumb--media-pending img.gallery-img--deferred:not([src]) {
  opacity: 0;
  pointer-events: none;
}

.project-gallery .thumb--media-pending video.gallery-video-thumb:not([data-gallery-loaded]) {
  opacity: 0;
  pointer-events: none;
}

.project-gallery .thumb img,
.project-gallery .thumb video.gallery-video-thumb {
  height: auto !important;
  object-fit: cover !important;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.project-gallery .thumb:hover img,
.project-gallery .thumb:hover video.gallery-video-thumb {
  transform: none;
}

.video-thumb .video-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding: 4px 8px;
  border-radius: 999px;
}

/* Créditos — 4 colunas na mesma lógica de gap da home */
.credits {
  grid-column: 1 / -1;
  padding: clamp(36px, 5vw, 56px) 0 clamp(28px, 4vw, 48px);
}

.credits h2 {
  font-size: clamp(32px, 4vw, 52px);
  margin: 0 0 32px;
  font-weight: 500;
  letter-spacing: -0.03em;
  color: #111;
}

.grid-credits {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--grid-gap);
}

.credit-line {
  font-size: 14px;
  margin: 0 0 20px;
  line-height: 1.45;
  font-weight: 200;
}

.credit-line:last-child {
  margin-bottom: 0;
}

.credit-line span {
  color: #111;
  font-size: 14px;
}

/* Last projects — agora usa a mesma lógica de expansão da home */
.last-projects {
  grid-column: 1 / -1;
  padding: 40px 0 80px;
}



/* No mobile, os <br> das descriptions são ignorados — o texto flui naturalmente */
@media (max-width: 900px) {
  .project-intro p br {
    display: none;
  }
}

@media (max-width: 900px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-credits {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  .project-intro h1 {
    font-size: clamp(28px, 6vw, 42px);
    white-space: normal;
  }

  .project-intro p {
    font-size: 16px;
  }

  .credits h2 {
    font-size: clamp(24px, 5vw, 36px);
  }

  .credit-line {
    font-size: 13px;
  }

  .credit-line span {
    font-size: 13px;
  }

  /* No mobile, só a imagem estática na seção "Last projects" */
  .last-projects .thumb-hover {
    display: none !important;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .grid-credits {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: start;
  }

  .grid-credits .credits-col:nth-child(1) {
    grid-column: 1;
    grid-row: span 3;
  }

  .grid-credits .credits-col:nth-child(n+2) {
    grid-column: 2;
  }

  .credit-line {
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.3;
  }

  .credit-line span {
    font-size: 12px;
  }

  .credits h2 {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .project-intro h1 {
    font-size: clamp(22px, 7vw, 30px);
    margin-bottom: 16px;
    white-space: normal;
  }

  .project-intro p {
    font-size: 14px;
    line-height: 1.5;
  }

  .wrap{
    padding: 0;
  }

  .project-intro, 
  .project-hero, 
  .topbar, 
  .credits, 
  .last-projects {
    padding: var(--grid-padding);
  }

  .project-hero{
    padding-top: 90px;
  }
}

/* Máquinas antigas: menos animação na galeria */
.is-low-end .project-gallery .thumb img,
.is-low-end .project-gallery .thumb video.gallery-video-thumb {
  transition: none;
}

.is-low-end .last-projects .thumb-hover {
  display: none !important;
}