/* =============================================
   ADAMAS GOLD — PORTFOLIO PAGE
   Inherits variables from styles.css
   ============================================= */

/* ── GALLERY SECTION ───────────────────────── */

.portfolio-section {
  background: var(--bg);
  padding-bottom: 96px;
}

.portfolio-grid {
  max-width: 1320px;
  margin: 0 auto;
  padding: 40px 48px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

/* ── GRID ITEM ──────────────────────────────── */

.pf-item {
  position: relative;
  overflow: hidden;
  background: var(--bg-card);
  border: 1px solid var(--border-card);
  border-radius: var(--radius);
  cursor: pointer;
  aspect-ratio: 1 / 1;
  animation: cardIn 0.4s ease both;
}

.pf-item:nth-child(2)  { animation-delay: 0.04s; }
.pf-item:nth-child(3)  { animation-delay: 0.08s; }
.pf-item:nth-child(4)  { animation-delay: 0.12s; }
.pf-item:nth-child(5)  { animation-delay: 0.16s; }
.pf-item:nth-child(6)  { animation-delay: 0.20s; }
.pf-item:nth-child(7)  { animation-delay: 0.24s; }
.pf-item:nth-child(8)  { animation-delay: 0.28s; }
.pf-item:nth-child(9)  { animation-delay: 0.32s; }
.pf-item:nth-child(10) { animation-delay: 0.36s; }
.pf-item:nth-child(11) { animation-delay: 0.40s; }
.pf-item:nth-child(12) { animation-delay: 0.44s; }

.pf-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease;
}

.pf-item-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(7, 7, 5, 0);
  color: var(--gold);
  opacity: 0;
  transition: opacity 0.25s ease, background 0.25s ease;
  pointer-events: none;
}

.pf-item:hover img {
  transform: scale(1.06);
}

.pf-item:hover .pf-item-overlay {
  opacity: 1;
  background: rgba(7, 7, 5, 0.38);
}

.pf-item:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pf-item:active .pf-item-overlay {
  background: rgba(7, 7, 5, 0.52);
}

/* ── LIGHTBOX ───────────────────────────────── */

.pf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.28s ease;
}

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

.pf-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 7, 5, 0.92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.pf-lightbox-stage {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 90vw;
  max-height: 88vh;
}

.pf-lightbox-img {
  max-width: min(88vw, 820px);
  max-height: 84vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  border: 1px solid rgba(217, 157, 44, 0.22);
  border-radius: var(--radius);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.7),
    0 0 0 1px rgba(217, 157, 44, 0.06);
  opacity: 1;
  transform: scale(1);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

/* ── LIGHTBOX CONTROLS ──────────────────────── */

.pf-lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 10;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 27, 21, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  color: var(--text-sec);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.pf-lightbox-close:hover {
  color: var(--gold);
  border-color: rgba(217, 157, 44, 0.4);
  background: rgba(217, 157, 44, 0.06);
}

.pf-lightbox-close:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pf-lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(27, 27, 21, 0.7);
  border: 1px solid var(--border-card);
  border-radius: 50%;
  color: var(--text-sec);
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s, background 0.2s, transform 0.2s;
}

.pf-lightbox-prev { left: 20px; }
.pf-lightbox-next { right: 20px; }

.pf-lightbox-prev:hover {
  color: var(--gold);
  border-color: rgba(217, 157, 44, 0.4);
  background: rgba(217, 157, 44, 0.06);
  transform: translateY(-50%) translateX(-2px);
}

.pf-lightbox-next:hover {
  color: var(--gold);
  border-color: rgba(217, 157, 44, 0.4);
  background: rgba(217, 157, 44, 0.06);
  transform: translateY(-50%) translateX(2px);
}

.pf-lightbox-nav:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.pf-lightbox-counter {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* ── RESPONSIVE ─────────────────────────────── */

@media (max-width: 900px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 32px 24px 0;
    gap: 8px;
  }

  .pf-lightbox-prev { left: 8px; }
  .pf-lightbox-next { right: 8px; }
}

@media (max-width: 540px) {
  .portfolio-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 24px 16px 0;
    gap: 6px;
  }

  .pf-lightbox-img {
    max-width: 96vw;
    max-height: 78vh;
  }

  .pf-lightbox-nav {
    width: 40px;
    height: 40px;
  }
}
