/* ============================================================
   Gallery Page & Lightbox Styles
   ============================================================ */

/* ---- Gallery Grid ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.gallery-item {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: var(--transition);
  outline: none;
}
.gallery-item:hover,
.gallery-item:focus {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.gallery-img-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, var(--purple-mid), var(--purple-dark));
}
.gallery-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}
.gallery-item:hover .gallery-img-wrap img {
  transform: scale(1.05);
}

.gallery-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.25);
  font-size: 3rem;
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: rgba(45,10,78,0);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.gallery-item:hover .gallery-overlay {
  background: rgba(45,10,78,0.45);
}
.gallery-zoom-icon {
  color: white;
  font-size: 1.5rem;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.gallery-item:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.gallery-caption {
  padding: 12px 16px;
}
.gallery-caption-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gallery-caption-text {
  font-size: 0.8rem;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Lightbox ---- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(10, 0, 20, 0.92);
  backdrop-filter: blur(4px);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
}

.lightbox-img-wrap {
  width: 100%;
  max-height: 75vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
}
.lightbox-img-wrap img {
  max-width: 100%;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-lg);
  display: block;
  transition: opacity 0.2s ease;
}
.lightbox-img-wrap img.loading {
  opacity: 0.3;
}

.lightbox-info {
  width: 100%;
  text-align: center;
  padding: 16px 8px 0;
}
.lightbox-info h3 {
  color: var(--white);
  font-size: 1.1rem;
  margin-bottom: 4px;
}
.lightbox-info p {
  color: rgba(255,255,255,0.65);
  font-size: 0.875rem;
}

.lightbox-counter {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
}

/* Lightbox buttons */
.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: fixed;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 2;
  font-size: 1rem;
}
.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: rgba(201,168,76,0.4);
  border-color: var(--gold-primary);
}

.lightbox-close {
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
}
.lightbox-prev {
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}
.lightbox-next {
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
}

/* ---- Badge for gallery type ---- */
.badge-gallery {
  background: #FCE4EC;
  color: #C2185B;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
