/* ==========================================================================
   Portfolio (Act 03): asymmetric photo and video gallery,
   Instagram links and native video controls
   ========================================================================== */

/* --- Abertura --- */
.pf-open { padding-top: calc(72px + clamp(3rem, 6vw, 5rem)); padding-bottom: clamp(2rem, 4vw, 3rem); }
.pf-open .act-title { max-width: 16ch; }
.pf-intro { display: grid; grid-template-columns: minmax(0, 38rem) minmax(0, 22rem); justify-content: space-between; align-items: end; gap: 2rem; }
.pf-sub { margin-bottom: 1.2rem; font: 700 clamp(1.4rem, 2.4vw, 2.2rem)/var(--lh-display) var(--f-display); text-transform: uppercase; color: var(--accent); max-width: 24ch; }
.pf-note { padding-left: 1rem; border-left: 1px solid var(--accent); color: var(--text-2); font-size: .95rem; }

.pf-gallery { padding: 0 var(--gutter) clamp(4rem, 7vw, 6rem); }

/* --- Galeria: grelha densa de 12 colunas, cada peça com a sua escala.
   Larguras de 3 ou 6 colunas e alturas de 3 a 7 linhas: o desalinhamento entre colunas
   dá o ar "sem regra", e o modo dense preenche os vazios. --- */
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); grid-auto-rows: clamp(70px, 8vw, 120px); grid-auto-flow: dense; gap: clamp(.6rem, 1.4vw, 1.2rem); }
.gallery figure { position: relative; grid-column: span 3; grid-row: span 3; }
.gallery .g-xxl  { grid-column: span 6; grid-row: span 7; }
.gallery .g-xl   { grid-column: span 6; grid-row: span 5; }
.gallery .g-wide { grid-column: span 6; grid-row: span 3; }
.gallery .g-long { grid-column: span 3; grid-row: span 6; }
.gallery .g-tall { grid-column: span 3; grid-row: span 5; }
.gallery .g-mid  { grid-column: span 3; grid-row: span 4; }
.gallery .g-sm   { grid-column: span 3; grid-row: span 3; }
.g-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: var(--night-2); cursor: pointer; }
.g-open img { width: 100%; height: 100%; object-fit: cover; transition: transform 900ms var(--ease-out), filter var(--t-base); }
.g-open:hover img, .g-open:focus-visible img { transform: scale(1.04); filter: brightness(1.08); }
.g-open:focus-visible { outline-offset: -4px; }
/* Native controls keep films playable without a lightbox or captions. */
.gallery video { width: 100%; height: 100%; object-fit: cover; background: var(--paper-ink); }

/* --- Fecho: faixa com os dois botões (Instagram e disponibilidade) --- */
.pf-ig { padding: clamp(2.5rem, 5vw, 4rem) var(--gutter); background: var(--night-2); border-top: 1px solid var(--night-3); }
.pf-ig .btn-row { justify-content: center; }

/* --- Responsivo --- */
@media (max-width: 900px) {
  .pf-intro { grid-template-columns: 1fr; }
  /* 6 colunas: as peças de 6 ocupam a largura toda e as de 3 ficam lado a lado */
  .gallery { grid-template-columns: repeat(6, 1fr); grid-auto-rows: clamp(60px, 13vw, 110px); }
}
@media (max-width: 600px) {
  .pf-open { padding-top: calc(64px + 2.5rem); }
  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 26vw; }
  .gallery figure, .gallery .g-long, .gallery .g-tall, .gallery .g-mid { grid-column: span 1; grid-row: span 3; }
  .gallery .g-sm { grid-column: span 1; grid-row: span 2; }
  .gallery .g-xxl { grid-column: span 2; grid-row: span 4; }
  .gallery .g-xl { grid-column: span 2; grid-row: span 3; }
  .gallery .g-wide { grid-column: span 2; grid-row: span 2; }
  .pf-ig .btn-row { justify-content: flex-start; }
}

@media (max-width: 600px) {
  .gallery .g-film { grid-column: span 2; grid-row: span 4; }
}
