/* ==========================================================================
   Zocrates Screenshots Gallery — Page-Specific Styles
   Depends on styles.css for the 5-theme palette variables & shared chrome
   (site-header, floating theme dock, buttons, footer, ambient background).
   ========================================================================== */

/* ------------------------------------------------------------------------
   Page Hero
   ------------------------------------------------------------------------ */
.gallery-hero {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
}

.gallery-hero .eyebrow-banner {
  margin: 0 auto 1.25rem;
}

.gallery-hero h1 {
  font-family: 'Outfit', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 0.9rem;
}

.gallery-hero p {
  max-width: 640px;
  margin: 0 auto;
  color: var(--text-secondary);
  font-size: 1.05rem;
  line-height: 1.6;
}

/* ------------------------------------------------------------------------
   Filter Chips
   ------------------------------------------------------------------------ */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  padding: 1.5rem 0 2rem;
}

.gallery-filter-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.gallery-filter-btn:hover {
  border-color: var(--border-strong);
  color: var(--text-main);
}

.gallery-filter-btn.active {
  background: var(--primary-soft);
  border-color: var(--border-strong);
  color: var(--text-main);
  box-shadow: 0 0 18px -6px var(--primary-soft);
}

/* ------------------------------------------------------------------------
   Masonry Grid (handles mixed aspect ratios natively)
   ------------------------------------------------------------------------ */
.gallery-masonry {
  columns: 3 300px;
  column-gap: 1.25rem;
  padding-bottom: 4rem;
}

.gallery-item {
  break-inside: avoid;
  margin: 0 0 1.25rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  cursor: zoom-in;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.gallery-item.hidden {
  display: none;
}

.gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--code-bg);
}

.gallery-item figcaption {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 0.8rem 1rem 0.9rem;
  border-top: 1px solid var(--border);
}

.gallery-item .shot-title {
  color: var(--text-main);
  font-size: 0.9rem;
  font-weight: 600;
}

.gallery-item .shot-desc {
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.gallery-item .shot-tag {
  align-self: flex-start;
  margin-top: 0.15rem;
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
}

/* ------------------------------------------------------------------------
   Lightbox
   ------------------------------------------------------------------------ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 2.5rem;
}

.lightbox.open {
  display: flex;
}

.lightbox-figure {
  position: relative;
  max-width: min(1400px, 94vw);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  margin: 0;
}

.lightbox-figure img {
  display: block;
  max-width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border-radius: 10px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
}

.lightbox-figure figcaption {
  margin-top: 0.9rem;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.lightbox-figure figcaption strong {
  color: var(--text-main);
}

.lightbox-count {
  color: var(--text-muted);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  margin-left: 0.75rem;
}

.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-glass);
  color: var(--text-main);
  width: 46px;
  height: 46px;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.lightbox-btn:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
}

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

.lightbox-close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  transform: none;
  width: 42px;
  height: 42px;
}

/* ------------------------------------------------------------------------
   Mobile
   ------------------------------------------------------------------------ */
@media (max-width: 640px) {
  .gallery-hero { padding: 3rem 0 1.5rem; }
  .lightbox { padding: 1rem; }
  .lightbox-btn { width: 38px; height: 38px; }
  .lightbox-btn.prev { left: 0.5rem; }
  .lightbox-btn.next { right: 0.5rem; }
}
