/* Photo gallery strip — two rows scrolling in opposite directions */
#gallery {
  position: relative;
  background: var(--navy, #080b18);
  padding: 28px 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-margin-top: 50px; /* clear the fixed menu bar when jumping here */
  /* soft fade at the left/right edges */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
          mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}

#gallery .g-row {
  display: flex;
  width: max-content;
  animation: g-scroll var(--g-dur, 60s) linear infinite;
  will-change: transform;
}

#gallery .g-row.g-reverse {
  animation-direction: reverse;
}

/* second row is offset so the two rows don't line up */
#gallery .g-row.g-offset {
  margin-left: -140px;
}

#gallery:hover .g-row {
  animation-play-state: paused;
}

#gallery .g-item {
  flex: 0 0 auto;
  height: 340px;
  aspect-ratio: 2 / 3;
  margin-right: 16px; /* spacing lives on the item so the loop is seamless */
  border-radius: 6px;
  overflow: hidden;
  background: #11162a;
}

#gallery .g-item.g-land {
  aspect-ratio: 3 / 2;
}

#gallery .g-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .6s ease;
}

#gallery .g-item:hover img {
  transform: scale(1.04);
}

@keyframes g-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (max-width: 768px) {
  #gallery { padding: 18px 0; gap: 10px; }
  #gallery .g-item { height: 190px; margin-right: 10px; border-radius: 4px; }
  #gallery .g-row.g-offset { margin-left: -75px; }
}

@media (prefers-reduced-motion: reduce) {
  #gallery .g-row { animation: none; }
}

/* ---------- clickable cards ---------- */
#gallery .g-item { cursor: zoom-in; }
#gallery .g-item:focus-visible { outline: 2px solid var(--gold, #f7a220); outline-offset: 2px; }

/* ---------- Lightbox ---------- */
html.g-lb-lock, html.g-lb-lock body { overflow: hidden; }

#g-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000; /* above the nav (100), below the custom cursor (9998+) */
  background: rgba(8, 11, 24, .94);
  -webkit-backdrop-filter: blur(6px);
          backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .25s ease, visibility .25s;
  font-family: inherit;
}
#g-lightbox.open { opacity: 1; visibility: visible; }

#g-lightbox .g-lb-fig {
  margin: 0;
  width: 100%;
  height: 100%;
  padding: 64px 80px 96px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
}
#g-lightbox .g-lb-fig img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}

#g-lightbox .g-lb-btn {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid rgba(232, 229, 222, .25);
  background: rgba(8, 11, 24, .5);
  color: var(--w, #e8e5de);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color .2s, color .2s;
  padding: 0;
}
#g-lightbox .g-lb-btn:hover { border-color: var(--gold, #f7a220); color: var(--gold, #f7a220); }
#g-lightbox svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#g-lightbox .g-lb-close { top: 16px; right: 16px; }
#g-lightbox .g-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
#g-lightbox .g-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }

#g-lightbox .g-lb-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
}
#g-lightbox .g-lb-count {
  color: rgba(232, 229, 222, .6);
  font-size: 13px;
  letter-spacing: .12em;
}
#g-lightbox .g-lb-dl {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--gold, #f7a220);
  color: #080b18;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .2s, box-shadow .2s;
}
#g-lightbox .g-lb-dl:hover { transform: translateY(-1px); box-shadow: 0 8px 24px rgba(247, 162, 32, .35); }
#g-lightbox .g-lb-dl svg { width: 18px; height: 18px; stroke-width: 2.2; }

@media (max-width: 768px) {
  #g-lightbox .g-lb-fig { padding: 64px 12px 100px; }
  #g-lightbox .g-lb-prev, #g-lightbox .g-lb-next { top: auto; bottom: 22px; transform: none; width: 44px; height: 44px; }
  #g-lightbox .g-lb-bar { bottom: 22px; }
  #g-lightbox .g-lb-count { display: none; }
  #g-lightbox .g-lb-dl { padding: 12px 20px; font-size: 12px; }
}
