/* ── Portfolio Page ───────────────────────────────────────── */
.page-portfolio {
  overflow: hidden;
}

.portfolio-main {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  bottom: var(--footer-h);
  overflow: hidden;
}

/* ── Horizontal scroll track ─────────────────────────────── */
.gallery {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 100%;
  padding: 24px 0;
  will-change: transform;
}

.gallery-item {
  flex: 0 0 auto;
  height: 85%;
  overflow: hidden;
  position: relative;
  margin: 0;
  cursor: pointer;
}

.gallery-item img {
  height: 100%;
  width: auto;
  display: block;
  filter: grayscale(100%);
  transition: filter 0.8s ease;
}

.gallery-item:hover img {
  filter: grayscale(0%);
}

/* ── Lightbox ────────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  cursor: pointer;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-img {
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
  cursor: default;
  animation: lightboxIn 0.25s ease;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  font-size: 28px;
  font-family: var(--font-sans);
  font-weight: 300;
  cursor: pointer;
  line-height: 1;
  padding: 8px;
  transition: color 0.2s;
}

.lightbox-close:hover {
  color: #fff;
}

@keyframes lightboxIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  .gallery {
    gap: 6px;
    padding: 16px 0;
  }

  .gallery-item {
    height: 80%;
  }

  .lightbox {
    padding: 16px;
  }
}
