/* ============================================================
   FÁBRICA IMAGENS — portfolio.css
============================================================ */

/* --- CABEÇALHO DA PÁGINA --- */
.page-header {
  padding: 140px 0 48px;
  border-bottom: 1px solid var(--border);
}

.page-header__title {
  font-size: clamp(40px, 6vw, 80px);
  font-weight: 100;
  letter-spacing: -0.02em;
  line-height: 1;
  margin-bottom: 16px;
  text-transform: uppercase;
}

.page-header__sub {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}


/* --- FILTRO --- */
.filter-bar {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: rgba(13,13,13,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.filter-bar__inner {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-bar__inner::-webkit-scrollbar { display: none; }

.filter-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 20px 28px;
  cursor: pointer;
  white-space: nowrap;
  position: relative;
  transition: color 0.2s;
}

.filter-btn::after {
  content: '';
  position: absolute;
  bottom: 0; left: 28px;
  right: 28px;
  height: 2px;
  background: var(--gradient-iris);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

.filter-btn:hover        { color: var(--text-soft); }
.filter-btn.active       { color: var(--text); }
.filter-btn.active::after { transform: scaleX(1); }


/* --- GRADE DE FOTOS --- */
.portfolio-page {
  padding: 48px 0 100px;
}

.foto-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

/* Card panorâmico ocupa 2 colunas */
.foto-card--wide {
  grid-column: span 2;
}

.foto-card {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  cursor: pointer;
  aspect-ratio: 4 / 3;
}

.foto-card--wide {
  aspect-ratio: 8 / 3;
}

.foto-card__img-wrap {
  position: absolute;
  inset: 0;
}

.foto-card__img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  display: block;
}

.foto-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--border);
  pointer-events: none;
}

/* Oculta placeholder quando imagem carrega */
.foto-card__img-wrap img[src]:not([src=""]) + .foto-card__placeholder {
  opacity: 0;
}

.foto-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13,13,13,0.85) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.35s ease;
}

.foto-card:hover .foto-card__overlay { opacity: 1; }
.foto-card:hover .foto-card__img-wrap img { transform: scale(1.05); }

.foto-card__cat {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--accent);
  padding-bottom: 3px;
  display: inline-block;
  margin-bottom: 6px;
  align-self: flex-start;
}

.foto-card__title {
  font-size: 14px;
  font-weight: 300;
  color: var(--text);
  line-height: 1.3;
}

/* Cards ocultos pelo filtro */
.foto-card.hidden {
  display: none;
}

/* Mensagem de categoria vazia */
.filter-empty {
  display: none;
  text-align: center;
  padding: 80px 0;
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.filter-empty.visible { display: block; }


/* --- LIGHTBOX --- */
.lightbox__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.97);
  z-index: 900;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 901;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  padding: 72px 48px 32px;
}

.lightbox.open,
.lightbox.open ~ .lightbox__backdrop {
  opacity: 1;
  pointer-events: all;
}

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
  transition: opacity 0.2s ease;
}

.lightbox__img.fading { opacity: 0; }

.lightbox__info {
  padding-top: 20px;
  text-align: center;
  flex-shrink: 0;
}

.lightbox__cat {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent);
  display: block;
  margin-bottom: 6px;
}

.lightbox__title {
  font-size: 18px;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 4px;
}

.lightbox__desc {
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

.lightbox__count {
  display: block;
  margin-top: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

/* Botão fechar */
.lightbox__close {
  position: fixed;
  top: 24px; right: 32px;
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 16px;
  width: 44px; height: 44px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 902;
}

.lightbox__close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Botões prev/next */
.lightbox__nav {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: none;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 20px;
  width: 52px; height: 52px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 902;
}

.lightbox__nav:hover {
  border-color: var(--text-soft);
  color: var(--text);
}

.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }


/* --- RESPONSIVO --- */
@media (max-width: 900px) {
  .foto-grid { grid-template-columns: repeat(2, 1fr); }
  .foto-card--wide { grid-column: span 2; aspect-ratio: 16/7; }
}

@media (max-width: 600px) {
  .page-header { padding: 120px 0 36px; }
  .filter-btn  { padding: 18px 20px; font-size: 9px; }
  .filter-btn::after { left: 20px; right: 20px; }

  .foto-grid { grid-template-columns: 1fr; }
  .foto-card--wide { grid-column: span 1; aspect-ratio: 4/3; }
  .foto-card__overlay { opacity: 1; }

  .lightbox { padding: 72px 16px 24px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
}
