/* ==========================================
   LENS. — Works Grid & Lightbox
   ========================================== */

/* ==========================================
   WORKS — Editorial list (contact-sheet)
   Left: spectrum tick + title (Inter) + series (Inter, tracked)
   Right: large cinematic frame
   ========================================== */
/* Desktop: keep the project list a touch narrower than the page column
   so the images read smaller / more restrained. */
@media (min-width: 861px) {
  #works .container { max-width: 1040px; }
}

.works-list {
  display: flex;
  flex-direction: column;
  gap: clamp(56px, 9vh, 116px);
}

.work-item {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(0, 2.4fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: start;
  cursor: pointer;
}

/* ---- Left meta ---- */
.work-meta {
  display: flex;
  flex-direction: column;
  padding-top: 4px;
}

.work-tick {
  display: block;
  width: 28px;
  height: 1px;
  background: var(--spectrum);
  margin-bottom: 20px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-item:hover .work-tick { width: 48px; }

.work-title {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.9vw, 25px);
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.25;
  color: var(--text-primary);
}

.work-series {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 14px;
}

/* ---- Right frame (uniform cinematic crop for consistent rhythm) ---- */
.work-figure {
  position: relative;
  overflow: hidden;
  background: #ECECEC;
  aspect-ratio: 3 / 2;
}

/* broken / unloaded image → shows bg color */
.work-figure img[src=""],
.work-figure img:not([src]) { visibility: hidden; }

.work-figure img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 1.1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.work-item:hover .work-figure img { transform: scale(1.04); }

/* ---- More (→ full works page) ---- */
.works-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(52px, 9vh, 104px);
}
.works-more a {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.3s ease;
}
.works-more a::after {
  content: '';
  width: 40px;
  height: 1px;
  background: var(--spectrum);
  transition: width 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.works-more a:hover { color: var(--text-primary); }
.works-more a:hover::after { width: 72px; }

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s ease;
}

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

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 15, 15, 0.95);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  max-width: min(88vw, 1000px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
  transform: scale(0.97);
  transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.lightbox.open .lightbox-content {
  transform: scale(1);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
}

.lightbox-caption {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.lightbox-caption-sub {
  font-size: 10px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.32);
}

/* ---- Lightbox Close ---- */
.lightbox-close {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 201;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1;
  transition: opacity 0.3s ease;
}
.lightbox-close:hover { opacity: 0.4; }

/* ---- Lightbox Arrows ---- */
.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 201;
  background: none;
  border: none;
  padding: 20px 16px;
  transition: opacity 0.3s ease;
}
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-prev:hover,
.lightbox-next:hover { opacity: 0.35; }

.arrow-icon {
  display: block;
  width: 16px;
  height: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  border-right: 1px solid rgba(255, 255, 255, 0.6);
}
.lightbox-prev .arrow-icon { transform: rotate(-135deg); }
.lightbox-next .arrow-icon { transform: rotate(45deg); }

/* ---- Responsive ---- */
@media (max-width: 860px) {
  /* Stack: meta above the frame, full-width image */
  .work-item {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .work-meta { padding-top: 0; }
  .work-tick { margin-bottom: 12px; }
  .work-title { font-size: clamp(18px, 5vw, 24px); }
}

@media (max-width: 767px) {
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
