/* ============================================================
   gallery.css — Public photo gallery + admin thumbnail grid
   ============================================================ */

.gallery-shell { padding: clamp(6rem, 12vh, 8rem) 0 var(--s-5); }

.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5em;
  margin: var(--s-3) 0 var(--s-4);
  align-items: center;
}
.gallery-filter {
  padding: 0.4em 0.95em;
  border-radius: var(--radius-pill);
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--c-rule);
  font-family: var(--f-body);
  font-size: var(--type-sm);
  font-weight: 600;
  color: var(--c-text-mute);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.gallery-filter.is-active,
.gallery-filter:hover {
  background: var(--c-espresso);
  color: var(--c-paper);
  box-shadow: inset 0 0 0 1.5px var(--c-espresso);
}
.gallery-filter.is-active { background: var(--c-terracotta); box-shadow: inset 0 0 0 1.5px var(--c-terracotta); }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--s-2);
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--c-limestone-2);
  aspect-ratio: 4 / 3;
  cursor: zoom-in;
  transition: transform var(--dur-base) var(--ease-out), box-shadow var(--dur-base) var(--ease-out);
}
.gallery-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lift);
}
.gallery-item:nth-child(7n+1) { aspect-ratio: 1 / 1; }
.gallery-item:nth-child(11n+5) { aspect-ratio: 3 / 4; }

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 600ms var(--ease-out);
}
.gallery-item:hover img { transform: scale(1.04); }

.gallery-item__caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: var(--s-3) var(--s-2) var(--s-2);
  background: linear-gradient(180deg, transparent 0%, rgba(15, 5, 32, 0.85) 100%);
  color: var(--c-paper);
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--type-sm);
  font-variation-settings: "opsz" 36, "SOFT" 100;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.gallery-item:hover .gallery-item__caption {
  opacity: 1;
  transform: translateY(0);
}

.gallery-item__tag {
  position: absolute;
  top: 10px; right: 10px;
  font-family: var(--f-body);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--c-paper);
  color: var(--c-espresso);
  padding: 0.25em 0.6em;
  border-radius: var(--radius-sm);
  opacity: 0.92;
}

.gallery-empty {
  grid-column: 1/-1;
  padding: var(--s-5) var(--s-3);
  text-align: center;
  color: var(--c-text-mute);
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--type-lg);
  font-variation-settings: "opsz" 36, "SOFT" 100;
}

/* Lightbox */
.gallery-lightbox {
  position: fixed; inset: 0; z-index: 500;
  display: none;
  align-items: center; justify-content: center;
  padding: var(--s-3);
  background: rgba(15, 5, 32, 0.92);
  animation: authFade 240ms var(--ease-out);
}
.gallery-lightbox.is-open { display: flex; }
.gallery-lightbox img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.gallery-lightbox__caption {
  position: absolute;
  left: 0; right: 0; bottom: var(--s-3);
  text-align: center;
  color: var(--c-paper);
  font-family: var(--f-display);
  font-style: italic;
  font-size: var(--type-lg);
  font-variation-settings: "opsz" 36, "SOFT" 100;
  padding: 0 var(--s-3);
}
.gallery-lightbox__close {
  position: absolute;
  top: 18px; right: 18px;
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(245, 240, 251, 0.12);
  color: var(--c-paper);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out);
}
.gallery-lightbox__close:hover { background: var(--c-terracotta); }
.gallery-lightbox__close svg { width: 20px; height: 20px; }

/* Admin: photo grid (smaller) */
.admin-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.admin-gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--c-limestone-2);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out);
}
.admin-gallery-item:hover { transform: translateY(-2px); }
.admin-gallery-item img { width: 100%; height: 100%; object-fit: cover; }
.admin-gallery-item__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(15, 5, 32, 0.9) 100%);
  display: flex;
  align-items: flex-end;
  padding: 0.7em;
  color: var(--c-paper);
  font-family: var(--f-body);
  font-size: var(--type-xs);
  font-weight: 600;
}
.admin-gallery-item__inactive {
  position: absolute; top: 8px; left: 8px;
  padding: 0.2em 0.5em;
  background: var(--c-bougainvillea);
  color: var(--c-paper);
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
