/**
 * Gallery and Masonry Grid Styles
 * Quin's Curse Theme
 */

/* ====================================
   FILTER CONTROLS
   ==================================== */
.filter-controls {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.75rem 1.5rem;
  background: var(--color-card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 50px;
  color: var(--color-text-primary);
  font-weight: 500;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: var(--transition-base);
  text-decoration: none;
}

.filter-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  transform: translateY(-3px);
  box-shadow: 0 5px 20px rgba(255, 0, 255, 0.2);
}

.filter-btn.active {
  background: linear-gradient(135deg, var(--color-accent-primary), var(--color-accent-tertiary));
  border-color: var(--color-accent-primary);
  color: var(--color-text-primary);
  box-shadow: 0 5px 20px rgba(255, 0, 255, 0.3);
}

/* ====================================
   MASONRY GRID
   ==================================== */
.masonry-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 3rem;
}

/* For wider screens, make grid more dense */
@media (min-width: 1200px) {
  .masonry-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  }
}

@media (min-width: 1600px) {
  .masonry-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 15px;
  transition: var(--transition-base);
  opacity: 0;
  animation: fadeInGrid 0.5s ease-out forwards;
}

@keyframes fadeInGrid {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Stagger animation for grid items */
.masonry-item:nth-child(1) { animation-delay: 0.05s; }
.masonry-item:nth-child(2) { animation-delay: 0.1s; }
.masonry-item:nth-child(3) { animation-delay: 0.15s; }
.masonry-item:nth-child(4) { animation-delay: 0.2s; }
.masonry-item:nth-child(5) { animation-delay: 0.25s; }
.masonry-item:nth-child(6) { animation-delay: 0.3s; }
.masonry-item:nth-child(7) { animation-delay: 0.35s; }
.masonry-item:nth-child(8) { animation-delay: 0.4s; }
.masonry-item:nth-child(9) { animation-delay: 0.45s; }
.masonry-item:nth-child(10) { animation-delay: 0.5s; }
.masonry-item:nth-child(11) { animation-delay: 0.55s; }
.masonry-item:nth-child(12) { animation-delay: 0.6s; }

.masonry-item:hover {
  transform: translateY(-5px);
  z-index: 10;
}

/* ====================================
   ARTWORK CARD
   ==================================== */
.artwork-card {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 15px;
  background: var(--color-bg-secondary);
  cursor: pointer;
}

.artwork-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.artwork-card:hover .artwork-image {
  transform: scale(1.1);
}

.artwork-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 0, 255, 0.1), rgba(0, 255, 255, 0.1));
  font-size: 4rem;
  color: var(--color-accent-primary);
}

/* ====================================
   ARTWORK OVERLAY
   ==================================== */
.artwork-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
  padding: 2rem 1.5rem 1.5rem;
  transform: translateY(calc(100% - 80px));
  transition: transform 0.3s ease;
}

.artwork-card:hover .artwork-overlay {
  transform: translateY(0);
}

.artwork-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.artwork-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.artwork-overlay .category-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

.artwork-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.artwork-overlay .available-badge,
.artwork-overlay .price-badge {
  font-size: 0.75rem;
  padding: 0.3rem 0.75rem;
}

/* ====================================
   LIGHTBOX (if using a lightbox plugin)
   ==================================== */
.glightbox-clean .gslide-description {
  background: rgba(10, 10, 10, 0.95);
  backdrop-filter: blur(10px);
}

/* ====================================
   GRID FILTERING ANIMATIONS
   ==================================== */
.masonry-item.filter-hidden {
  display: none;
}

.masonry-item.filter-show {
  display: block;
  animation: fadeInGrid 0.5s ease-out;
}

/* ====================================
   LOADING STATE
   ==================================== */
.gallery-loading {
  text-align: center;
  padding: 4rem 2rem;
}

.gallery-loading .loading {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* ====================================
   NO RESULTS STATE
   ==================================== */
.no-results-message {
  text-align: center;
  padding: 4rem 2rem;
  grid-column: 1 / -1;
}

.no-results-message i {
  font-size: 4rem;
  color: var(--color-accent-primary);
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results-message h3 {
  color: var(--color-text-primary);
  margin-bottom: 0.5rem;
}

.no-results-message p {
  color: var(--color-text-secondary);
}

/* ====================================
   CATEGORY ARCHIVE SPECIFIC
   ==================================== */
.archive-artwork .page-header-section {
  margin-bottom: 0;
}

.archive-description {
  max-width: 700px;
  margin: 1rem auto 0;
  color: var(--color-text-secondary);
}

/* ====================================
   GALLERY GRID VARIATIONS
   ==================================== */
/* Compact Grid */
.gallery-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

/* Wide Grid */
.gallery-grid.wide {
  grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
  gap: 2rem;
}

/* List View */
.gallery-grid.list-view {
  grid-template-columns: 1fr;
  gap: 2rem;
}

.gallery-grid.list-view .artwork-card {
  aspect-ratio: 16 / 9;
}

.gallery-grid.list-view .artwork-overlay {
  transform: translateY(0);
  background: linear-gradient(to right, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 40%, transparent 100%);
  padding: 2rem;
  width: 50%;
}

/* ====================================
   ISOTOPE / FILTERING LIBRARY SUPPORT
   ==================================== */
.isotope-item {
  transition: transform 0.5s, opacity 0.5s;
}

.isotope-hidden {
  opacity: 0;
  pointer-events: none;
}

.isotope {
  transition: height 0.5s;
}