/* gallery.css — Cricket Creek Studio Gallery Page */

/* ─── GALLERY SECTION ─── */
.gallery-section {
  padding: var(--space-20) 0 var(--space-12);
  background: var(--color-bg);
}

/* ─── MASONRY-STYLE GRID ─── */
.gallery-grid {
  columns: 3;
  column-gap: var(--space-5);
  margin-bottom: var(--space-10);
}
@media (max-width: 860px) { .gallery-grid { columns: 2; } }
@media (max-width: 480px) { .gallery-grid { columns: 1; } }

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-5);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.25s, transform 0.25s;
}
.gallery-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-3px);
}

/* ─── THUMBNAIL BUTTON ─── */
.gallery-thumb {
  display: block;
  width: 100%;
  border: none;
  background: none;
  cursor: zoom-in;
  padding: 0;
  position: relative;
  overflow: hidden;
}
.gallery-thumb img {
  display: block;
  width: 100%;
  height: auto;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}
.gallery-thumb:hover img { transform: scale(1.04); }
.gallery-thumb:focus-visible {
  outline: 3px solid var(--color-laguna);
  outline-offset: 2px;
}

/* Zoom overlay on hover */
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42, 155, 175, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0;
  transition: opacity 0.2s;
}
.gallery-thumb:hover .gallery-overlay,
.gallery-thumb:focus-visible .gallery-overlay { opacity: 1; }

/* ─── CAPTION ─── */
.gallery-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-3) var(--space-4);
  gap: var(--space-2);
}
.gallery-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.gallery-tag {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-laguna);
  background: var(--color-laguna-light);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .gallery-tag { background: rgba(42,155,175,0.15); }

/* ─── GALLERY NOTE ─── */
.gallery-note {
  text-align: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  max-width: none;
}

/* ─── LIGHTBOX ─── */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lightbox[hidden] { display: none; }

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: pointer;
}

.lightbox-inner {
  position: relative;
  z-index: 1;
  max-width: min(90vw, 900px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}
.lightbox-img {
  display: block;
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 64px rgba(0,0,0,0.5);
  object-fit: contain;
}
.lightbox-caption {
  color: rgba(255,255,255,0.85);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: center;
}

/* Lightbox controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  z-index: 2;
  background: rgba(255,255,255,0.12);
  border: 1.5px solid rgba(255,255,255,0.25);
  color: #fff;
  border-radius: var(--radius-full);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  backdrop-filter: blur(8px);
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover { background: rgba(255,255,255,0.25); }
.lightbox-close:focus-visible,
.lightbox-prev:focus-visible,
.lightbox-next:focus-visible {
  outline: 2px solid var(--color-laguna);
  outline-offset: 2px;
}

.lightbox-close { top: var(--space-5); right: var(--space-5); }
.lightbox-prev  { left: var(--space-5); top: 50%; transform: translateY(-50%); }
.lightbox-next  { right: var(--space-5); top: 50%; transform: translateY(-50%); }
.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

@media (max-width: 600px) {
  .lightbox-prev { left: var(--space-2); }
  .lightbox-next { right: var(--space-2); }
  .lightbox-close { top: var(--space-3); right: var(--space-3); }
}
