/* =====================================================
   GALLERY PAGE — Jakis Promotions
   Filterable photo grid with a fade/scale lightbox. Filter
   transitions use a two-step fade-out-then-collapse so
   items animate away instead of just vanishing.
   ===================================================== */

/* ── Filter tabs ─────────────────────────────────────── */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

.gallery-filter-btn {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-ink);
  background: var(--color-white);
  border: 1.5px solid var(--color-line);
  border-radius: 99px;
  padding: 0.55rem 1.25rem;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease),
              border-color var(--dur-fast) var(--ease),
              color var(--dur-fast) var(--ease),
              transform 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.gallery-filter-btn:hover {
  border-color: var(--color-gold);
  transform: translateY(-1px);
}

.gallery-filter-btn.is-active {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: #fff;
}

/* ── Full gallery grid ───────────────────────────────── */
.full-gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: clamp(0.75rem, 1.8vw, 1.25rem);
}

@media (min-width: 640px) {
  .full-gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1000px) {
  .full-gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.full-gallery-item {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-width: 0;
  background: var(--color-ivory-dim);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}

.full-gallery-item.is-filtered-out {
  opacity: 0;
  transform: scale(0.92);
  pointer-events: none;
}

.full-gallery-item.is-collapsed {
  display: none;
}

.full-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms var(--ease);
}

.full-gallery-item:hover img {
  transform: scale(1.06);
}

.full-gallery-item::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,10,12,0.45) 0%, rgba(10,10,12,0) 40%);
  opacity: 0;
  transition: opacity var(--dur-fast) var(--ease);
}

.full-gallery-item:hover::after {
  opacity: 1;
}

.full-gallery-item-zoom {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(16, 16, 18, 0.55);
  backdrop-filter: blur(2px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease);
}

.full-gallery-item:hover .full-gallery-item-zoom {
  opacity: 1;
  transform: translateY(0);
}

.full-gallery-item-zoom svg {
  width: 15px;
  height: 15px;
}

@media (prefers-reduced-motion: reduce) {
  .full-gallery-item,
  .full-gallery-item img,
  .full-gallery-item-zoom {
    transition: none;
  }
}

/* ── Lightbox ─────────────────────────────────────────── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1rem, 4vw, 3rem);
  background: rgba(10, 10, 12, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 300ms var(--ease), visibility 0s linear 300ms;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 300ms var(--ease), visibility 0s linear 0s;
}

.lightbox-figure {
  position: relative;
  max-width: min(90vw, 1100px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 320ms var(--ease), opacity 320ms var(--ease);
}

.lightbox.is-open .lightbox-figure {
  transform: scale(1);
  opacity: 1;
}

.lightbox-figure img {
  max-width: 100%;
  max-height: 74vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  display: block;
}

.lightbox-caption {
  margin-top: 1rem;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: rgba(251, 247, 241, 0.85);
  text-align: center;
  max-width: 60ch;
}

.lightbox-close,
.lightbox-nav {
  position: fixed;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(251, 247, 241, 0.12);
  border: 1px solid rgba(251, 247, 241, 0.3);
  color: #fff;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease), transform 200ms var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.lightbox-close:hover,
.lightbox-nav:hover {
  background: rgba(251, 247, 241, 0.24);
  transform: translateY(-1px) scale(1.03);
}

.lightbox-close svg,
.lightbox-nav svg {
  width: 20px;
  height: 20px;
}

.lightbox-close {
  top: clamp(1rem, 3vw, 2rem);
  right: clamp(1rem, 3vw, 2rem);
}

.lightbox-nav--prev {
  left: clamp(0.5rem, 3vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav--next {
  right: clamp(0.5rem, 3vw, 2rem);
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav--prev:hover,
.lightbox-nav--next:hover {
  transform: translateY(-50%) scale(1.06);
}

@media (max-width: 640px) {
  .lightbox-nav {
    width: 38px;
    height: 38px;
  }
}
