/* Horizontal gallery for projects */
.galley{
  position: relative;
  padding: 0 16px 8px;
}

.galley__track{
  display: flex;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 8px 4px 16px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.galley__track::-webkit-scrollbar{
  display: none;
  width: 0;
  height: 0;
}

.galley__item{
  flex: 0 0 40%; /* ~2.5 items visible on desktop */
  scroll-snap-align: start;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  display: block;
}

.galley__item img{
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.galley__item:hover{
  border-color: rgba(225,123,255,0.6);
}

@media (max-width: 800px){
  .galley__item{
    flex: 0 0 65%; /* ~1.5 items visible on mobile */
  }
}

html.galley-lightbox-open,
body.galley-lightbox-open{
  overflow: hidden !important;
}

.galley-lightbox{
  position: fixed;
  inset: 0;
  z-index: 12000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.94);
}

.galley-lightbox.is-open{
  display: flex;
}

.galley-lightbox__figure{
  position: relative;
  margin: 0;
  width: min(92vw, 1220px);
  height: min(82vh, 840px);
  display: grid;
  place-items: center;
}

.galley-lightbox__img{
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.galley-lightbox__img.is-portrait{
  max-height: min(72vh, 760px);
  max-width: min(58vw, 640px);
}

.galley-lightbox__close{
  position: absolute;
  top: 16px;
  right: 18px;
  border: 0;
  background: transparent;
  color: rgba(255,255,255,0.88);
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.galley-lightbox__nav{
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  z-index: 3;
}

.galley-lightbox__nav--prev{ left: 16px; }
.galley-lightbox__nav--next{ right: 16px; }

.galley-lightbox__caption{
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  background: rgba(0,0,0,0.88);
  color: #fff;
  border-top: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
  white-space: nowrap;
  padding: 6px 10px;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  z-index: 4;
}

.galley-lightbox__captionTrack{
  display: inline-flex;
  align-items: center;
  gap: 42px;
  min-width: max-content;
  animation: galleyCaptionMarquee 18s linear infinite;
}

@keyframes galleyCaptionMarquee{
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@media (max-width: 700px){
  .galley-lightbox__figure{
    width: min(94vw, 720px);
    height: min(74vh, 560px);
  }
  .galley-lightbox__img.is-portrait{
    max-height: min(66vh, 500px);
    max-width: min(88vw, 520px);
  }
  .galley-lightbox__caption{ font-size: 11px; }
  .galley-lightbox__nav{
    width: 38px;
    height: 38px;
    font-size: 24px;
  }
  .galley-lightbox__nav--prev{ left: 8px; }
  .galley-lightbox__nav--next{ right: 8px; }
  .galley-lightbox__close{
    top: 10px;
    right: 12px;
    font-size: 26px;
  }
}
