/* ============================================================
   TARGA IME – Gallery Page Styles
   ============================================================ */

/* ============================================================
   Filter Bar
   ============================================================ */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: var(--space-3xl);
}

.filter-btn {
  padding: 0.5rem 1.2rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
}

.filter-btn:hover {
  border-color: rgba(255,255,255,0.15);
  color: var(--color-text);
  background: var(--color-glass);
}

.filter-btn.active {
  border-color: var(--color-gold);
  background: rgba(255,215,0,0.1);
  color: var(--color-gold);
}

/* ============================================================
   Masonry Grid
   ============================================================ */
.gallery-masonry {
  columns: 4 220px;
  column-gap: var(--space-md);
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  transition: transform var(--transition-base), box-shadow var(--transition-base), opacity var(--transition-base);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(255,215,0,0.2);
}

.gallery-item img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform var(--transition-slow);
  background: var(--color-bg-3);
}

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

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.85) 100%);
  opacity: 0;
  transition: opacity var(--transition-base);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: var(--space-md);
}

.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-item-title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}

.gallery-item-cat {
  font-size: 0.75rem;
  color: var(--color-gold);
  font-weight: 500;
}

.gallery-item-zoom {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.gallery-item:hover .gallery-item-zoom { opacity: 1; }

/* Empty state */
.gallery-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--space-4xl) var(--space-xl);
  color: var(--color-text-dim);
}

.gallery-empty-icon { font-size: 3rem; margin-bottom: var(--space-md); }

/* ============================================================
   Loading Skeleton
   ============================================================ */
.gallery-skeleton {
  columns: 4 220px;
  column-gap: var(--space-md);
}

.skeleton-item {
  break-inside: avoid;
  margin-bottom: var(--space-md);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(90deg, var(--color-card) 25%, var(--color-card-hover) 50%, var(--color-card) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============================================================
   Load More
   ============================================================ */
.gallery-load-more {
  text-align: center;
  margin-top: var(--space-3xl);
}

/* ============================================================
   Lightbox
   ============================================================ */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,0.95);
  backdrop-filter: blur(20px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl);
}

.lightbox.open { display: flex; }

.lightbox-inner {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.lightbox-close {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.lightbox-close:hover { background: rgba(255,255,255,0.2); transform: rotate(90deg); }

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition-base);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }
.lightbox-prev:hover, .lightbox-next:hover {
  background: rgba(255,215,0,0.15);
  border-color: var(--color-border-gold);
  color: var(--color-gold);
}

.lightbox-caption {
  text-align: center;
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.lightbox-counter {
  font-size: 0.8rem;
  color: var(--color-text-dim);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .gallery-masonry, .gallery-skeleton { columns: 2 150px; }
  .gallery-filter-bar { gap: var(--space-xs); }
  .filter-btn { font-size: 0.8rem; padding: 0.4rem 0.8rem; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
  .gallery-masonry, .gallery-skeleton { columns: 2 120px; }
}
