/* Gallery page (#367) — public starrable cookie-photo browser.
   Uses the shared brand tokens from style.css (:root). */

.gallery-hero {
  text-align: center;
  padding: 3.5rem 1.25rem 1.5rem;
  max-width: 720px;
  margin: 0 auto;
}
.gallery-hero h1 {
  font-family: 'Playfair Display', serif;
  color: var(--brown);
  font-size: clamp(2rem, 5vw, 2.9rem);
  margin: 0 0 0.5rem;
}
.gallery-hero p { color: var(--brown-text); opacity: 0.8; font-size: 1.05rem; margin: 0; }

/* Filter tabs */
.gallery-tabs {
  display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: center;
  max-width: 900px; margin: 1.5rem auto 0; padding: 0 1rem;
}
.gallery-tab {
  font-family: 'Lato', sans-serif; font-size: 0.9rem; font-weight: 700;
  color: var(--brown-text); background: var(--white);
  border: 1.5px solid var(--cream-dark); border-radius: 999px;
  padding: 0.5rem 1.1rem; cursor: pointer; transition: all var(--transition);
}
.gallery-tab:hover { border-color: var(--gold); }
.gallery-tab.is-active { background: var(--brown); color: var(--white); border-color: var(--brown); }

/* Grid */
.gallery-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1rem; max-width: 1200px; margin: 2rem auto 4rem; padding: 0 1.25rem;
}
.gallery-card {
  position: relative; margin: 0; border-radius: var(--radius); overflow: hidden;
  background: var(--logo-bg); box-shadow: var(--shadow); cursor: pointer;
  aspect-ratio: 1; transition: transform var(--transition), box-shadow var(--transition);
}
.gallery-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.gallery-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-card figcaption {
  position: absolute; left: 0; right: 0; bottom: 0;
  font-family: 'Lato', sans-serif; font-size: 0.72rem; color: var(--white);
  padding: 1.4rem 0.6rem 0.5rem;
  background: linear-gradient(transparent, rgba(4,6,15,0.72));
  opacity: 0; transition: opacity var(--transition);
}
.gallery-card:hover figcaption, .gallery-card:focus-within figcaption { opacity: 1; }
.gallery-badge {
  position: absolute; top: 0.5rem; left: 0.5rem; z-index: 2;
  background: var(--gold); color: var(--brown-dark); font-weight: 700;
  font-size: 0.6rem; letter-spacing: 0.04em; border-radius: 4px; padding: 2px 6px;
}
/* Favorite heart */
.gallery-fav {
  position: absolute; top: 0.4rem; right: 0.4rem; z-index: 2;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.82); cursor: pointer; font-size: 1.05rem; line-height: 1;
  display: grid; place-items: center; color: var(--terracotta);
  filter: grayscale(0.35); transition: transform 0.12s ease, filter var(--transition);
}
.gallery-fav:hover { transform: scale(1.12); }
.gallery-card.is-fav .gallery-fav { filter: none; background: var(--white); }

.gallery-empty { text-align: center; color: var(--brown-text); opacity: 0.7; padding: 3rem 1rem; grid-column: 1 / -1; }

/* Lightbox */
#glb { position: fixed; inset: 0; z-index: 1000; display: none;
  background: rgba(4,6,15,0.94); flex-direction: column; align-items: center; justify-content: center; }
#glb.is-open { display: flex; }
#glb img { max-width: 92vw; max-height: 78vh; width: auto; height: auto; object-fit: contain; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
#glbCap { color: var(--cream); font-family: 'Lato', sans-serif; font-size: 0.92rem; margin-top: 1rem; text-align: center; max-width: 90vw; padding: 0 1rem; }
.glb-nav { position: fixed; top: 50%; transform: translateY(-50%); font-size: 2.6rem; color: var(--gold);
  background: none; border: none; cursor: pointer; padding: 1rem; user-select: none; line-height: 1; }
#glbPrev { left: 0.5rem; } #glbNext { right: 0.5rem; }
#glbClose { position: fixed; top: 1rem; right: 1.4rem; font-size: 2rem; color: var(--gold); background: none; border: none; cursor: pointer; }
#glbFav { margin-top: 0.9rem; font-family: 'Lato', sans-serif; font-weight: 700; font-size: 0.9rem;
  background: var(--white); color: var(--terracotta); border: none; border-radius: 999px; padding: 0.5rem 1.2rem; cursor: pointer; }
#glbFav.is-on { background: var(--terracotta); color: var(--white); }

@media (prefers-reduced-motion: reduce) {
  .gallery-card, .gallery-fav, .gallery-card figcaption { transition: none; }
}
