/* ============================================
   PORTFOLIO PAGE
   ============================================ */

.filter-bar {
  background: var(--dark-2);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 80px;
  z-index: 100;
}

.filter-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
  padding: 9px 22px;
  border-radius: 30px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
  background: transparent;
  color: var(--white-dim);
  white-space: nowrap;
}
.filter-btn:hover { border-color: var(--teal); color: var(--teal-light); }
.filter-btn.active { background: var(--teal); border-color: var(--teal); color: white; }

/* Grid */
.portfolio-section { padding: 80px 0 60px; background: var(--dark); }

.portfolio-masonry {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

/* Card */
.project-card {
  background: var(--dark-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition);
  opacity: 0;
  transform: translateY(20px);
  animation: cardIn 0.5s ease forwards;
}
.project-card:nth-child(1) { animation-delay: 0.05s; }
.project-card:nth-child(2) { animation-delay: 0.1s; }
.project-card:nth-child(3) { animation-delay: 0.15s; }
.project-card:nth-child(4) { animation-delay: 0.2s; }
.project-card:nth-child(5) { animation-delay: 0.25s; }
.project-card:nth-child(6) { animation-delay: 0.3s; }

@keyframes cardIn {
  to { opacity: 1; transform: translateY(0); }
}

.project-card:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
}

/* Image */
.project-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  cursor: pointer;
}
.project-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.project-card:hover .project-img-wrap img { transform: scale(1.05); }

/* Hover overlay */
.project-overlay {
  position: absolute;
  inset: 0;
  background: rgba(14,20,16,0.8);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
}
.project-card:hover .project-overlay { opacity: 1; }

.project-category-tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-light);
  margin-bottom: 6px;
}
.project-overlay-inner h3 { font-size: 1.1rem; margin-bottom: 4px; color: white; }
.project-overlay-inner p { font-size: 0.8rem; color: var(--white-dim); max-width: none; margin-bottom: 10px; }
.project-view {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--teal-light);
}

/* Card info */
.project-info { padding: 18px 22px 22px; }

.project-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.project-tag {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-light);
  background: var(--teal-pale);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: 20px;
}
.project-location { font-size: 0.75rem; color: var(--white-faint); }
.project-title {
  font-size: 1.05rem;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--white);
  margin-bottom: 8px;
}
.project-desc { font-size: 0.84rem; color: var(--white-dim); max-width: none; line-height: 1.6; margin-bottom: 12px; }

.project-photo-count {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--teal-light);
  opacity: 0.8;
}

/* Note */
.portfolio-note { text-align: center; font-size: 0.88rem; color: var(--white-dim); max-width: none; }
.portfolio-note a { color: var(--teal-light); text-decoration: underline; text-decoration-color: var(--border); text-underline-offset: 3px; }
.portfolio-note a:hover { color: var(--white); }

/* ═══ LIGHTBOX ═══ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 80px 80px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox.open { opacity: 1; pointer-events: all; }

.lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8,12,9,0.96);
  z-index: 1999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.lightbox-backdrop.open { opacity: 1; pointer-events: all; }

.lightbox-img-wrap {
  position: relative;
  z-index: 2001;
  max-width: 88vw;
  max-height: 80vh;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0,0,0,0.8);
}
.lightbox-img-wrap img {
  max-width: 88vw;
  max-height: 80vh;
  object-fit: contain;
  display: block;
}

.lightbox-footer {
  position: relative;
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 88vw;
  margin-top: 16px;
  gap: 20px;
}

.lightbox-caption {
  font-size: 0.85rem;
  color: var(--white-dim);
  letter-spacing: 0.04em;
}

.lightbox-counter {
  font-size: 0.82rem;
  color: var(--teal-light);
  font-weight: 500;
  flex-shrink: 0;
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  z-index: 2002;
  background: var(--dark-2);
  border: 1px solid var(--border);
  color: white;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 1rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox-close:hover { background: var(--teal); border-color: var(--teal); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2002;
  background: rgba(21,29,23,0.8);
  border: 1px solid var(--border);
  color: white;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  font-size: 1.8rem;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  backdrop-filter: blur(8px);
}
.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover,
.lightbox-next:hover { background: var(--teal); border-color: var(--teal); }

/* Responsive */
@media (max-width: 900px) {
  .portfolio-masonry { grid-template-columns: repeat(2, 1fr); }
  .lightbox { padding: 60px 20px 80px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
@media (max-width: 600px) {
  .portfolio-masonry { grid-template-columns: 1fr; }
  .filter-inner { gap: 6px; }
}
