/* ============================================
   PORTFOLIO INTRO
   ============================================ */
.portfolio-intro {
  padding: 10rem 5vw 4rem;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
}

.portfolio-intro__title {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 300;
  margin: 0.75rem 0 1.5rem;
}

.portfolio-intro__text {
  font-size: 1rem;
  color: var(--grey-dark);
  font-weight: 300;
  line-height: 1.9;
  max-width: 560px;
  margin: 0 auto;
}

/* ============================================
   MASONRY GRID
   ============================================ */
.masonry {
  padding: 3rem 5vw 6rem;
  columns: 3;
  column-gap: 12px;
}

.masonry__item {
  break-inside: avoid;
  margin-bottom: 12px;
  overflow: hidden;
  cursor: pointer;
  position: relative;
}

.masonry__item img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              opacity 0.4s ease;
}

.masonry__item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 13, 0);
  transition: background 0.4s ease;
}

.masonry__item:hover img {
  transform: scale(1.04);
}

.masonry__item:hover::after {
  background: rgba(13, 13, 13, 0.15);
}

/* Responsive columns */
@media (max-width: 1100px) {
  .masonry { columns: 3; }
}

@media (max-width: 768px) {
  .masonry { columns: 2; column-gap: 8px; }
  .masonry__item { margin-bottom: 8px; }
}

@media (max-width: 480px) {
  .masonry { columns: 2; column-gap: 4px; }
  .masonry__item { margin-bottom: 4px; }
  .portfolio-intro { padding-top: 8rem; }
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(13, 13, 13, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox:not([hidden]) {
  opacity: 1;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__img-wrap {
  max-width: 90vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__img {
  max-width: 90vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
  transition: opacity 0.25s ease;
}

.lightbox__img.loading {
  opacity: 0;
}

.lightbox__close {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
  opacity: 0.7;
  transition: opacity 0.2s;
  z-index: 1001;
}

.lightbox__close:hover { opacity: 1; }

.lightbox__prev,
.lightbox__next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 1rem;
  opacity: 0.5;
  transition: opacity 0.2s;
  z-index: 1001;
  line-height: 1;
}

.lightbox__prev { left: 1rem; }
.lightbox__next { right: 1rem; }
.lightbox__prev:hover,
.lightbox__next:hover { opacity: 1; }

.lightbox__counter {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.72rem;
  letter-spacing: 0.15em;
  color: rgba(249, 247, 244, 0.45);
  text-transform: uppercase;
}

/* Touch swipe indicator on mobile */
@media (max-width: 768px) {
  .lightbox__prev,
  .lightbox__next {
    padding: 0.75rem 0.5rem;
    opacity: 0.8;
  }
}
