/* ===========================
   Gallery Page Styles
   =========================== */

/* Gallery Section */
.gallery-section {
  padding: 4rem 0 6rem;
}

/* Loading State */
.gallery-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 0;
  gap: 1.5rem;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.gallery-loading p {
  color: var(--muted-foreground);
  font-size: 1rem;
}

/* Error State */
.gallery-error {
  text-align: center;
  padding: 4rem 0;
  color: var(--muted-foreground);
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  grid-auto-rows: 250px;
  gap: 1.5rem;
  opacity: 0;
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

@media (max-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    grid-auto-rows: 220px;
  }
}

@media (max-width: 640px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 300px;
    gap: 1rem;
  }
}

/* Gallery Item */
.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--card);
  cursor: pointer;
  transition: all var(--transition-normal);
}

/* Featured items - larger spans for visual interest */
.gallery-item:nth-child(6n+1) {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-item:nth-child(8n+3) {
  grid-row: span 2;
}

.gallery-item:nth-child(10n+5) {
  grid-column: span 2;
}

/* Disable spanning on mobile for cleaner layout */
@media (max-width: 640px) {
  .gallery-item:nth-child(6n+1),
  .gallery-item:nth-child(8n+3),
  .gallery-item:nth-child(10n+5) {
    grid-column: span 1;
    grid-row: span 1;
  }
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(212, 168, 75, 0.15);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

/* Overlay removed for cleaner gallery view */

/* Lightbox */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(10, 10, 20, 0.95);
  backdrop-filter: blur(10px);
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.lightbox.active {
  display: flex;
  opacity: 1;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox-caption {
  color: var(--white);
  font-size: 1rem;
  text-align: center;
  padding: 1rem;
  background: rgba(10, 10, 20, 0.8);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

/* Lightbox Controls */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(10, 10, 20, 0.8);
  border: 1px solid var(--border);
  color: var(--white);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  backdrop-filter: blur(10px);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--gold);
  color: var(--navy-dark);
  border-color: var(--gold);
  transform: scale(1.1);
}

.lightbox-close {
  top: 2rem;
  right: 2rem;
}

.lightbox-prev {
  left: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-prev:hover {
  transform: translateY(-50%) scale(1.1);
}

.lightbox-next {
  right: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next:hover {
  transform: translateY(-50%) scale(1.1);
}

@media (max-width: 768px) {
  .lightbox-close,
  .lightbox-prev,
  .lightbox-next {
    width: 40px;
    height: 40px;
  }

  .lightbox-close {
    top: 1rem;
    right: 1rem;
  }

  .lightbox-prev {
    left: 1rem;
  }

  .lightbox-next {
    right: 1rem;
  }

  .lightbox-content img {
    max-height: 70vh;
  }
}

/* Active Navigation Link */
.nav-link.active {
  color: var(--gold);
  font-weight: 600;
}

.mobile-nav-link.active {
  color: var(--gold);
  font-weight: 600;
}
