/* =========================================
   GALLERY — inline section
   ========================================= */

#cursor { z-index: 99999 !important; }

/* ---- expanding section ---- */

.gallery-section {
    margin-top: 5rem;
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.45s ease;
  width: 100%;
}

.gallery-section.is-open {
  grid-template-rows: 1fr;
}

.gallery-inner {
  overflow: hidden;
  width: 90vw;
  margin: 0 auto;
}

/* ---- masonry grid — columns auto-fit to screen width ---- */

.gallery-grid {
  column-width: 300px;
  column-gap: 6px;
  padding: 2rem 6px 4rem;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 6px;
  border-radius: 6px;
  overflow: hidden;
  cursor: none;
  display: block;
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.gallery-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item img {
  width: 100%;
  display: block;
  border-radius: 6px;
  transition: transform 0.3s ease, filter 0.3s ease;
}

.gallery-item:hover img {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.gallery-loading {
  text-align: center;
  padding: 4rem;
  color: rgba(0,0,0,0.35);
  font-family: geom, sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
}

/* =========================================
   LIGHTBOX
   ========================================= */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 50000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

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

.lightbox-img-wrap img {
  max-width: 90vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-icon-btn {
  position: fixed;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: white;
  border-radius: 50%;
  cursor: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  padding: 0;
}

.lightbox-icon-btn:hover {
  background: rgba(255,255,255,0.2);
}

.lightbox-close-btn {
  top: 1.5rem;
  right: 1.5rem;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.4rem;
  line-height: 1;
}

.lightbox-nav-btn {
  top: 50%;
  transform: translateY(-50%);
  width: 3rem;
  height: 3rem;
  font-size: 1.8rem;
}

.lightbox-prev { left: 1.2rem; }
.lightbox-next { right: 1.2rem; }

.lightbox-counter {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.4);
  font-family: geom, sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  pointer-events: none;
}

/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 768px) {
  .gallery-item { cursor: default; }
  .lightbox-icon-btn { cursor: default; }
  .lightbox-prev { left: 0.4rem; }
  .lightbox-next { right: 0.4rem; }
  .gallery-grid {column-width: 150px;}
  .gallery-inner {width: 95vw;}
}