/* ==========================================================================
   THE CONSERVATORY POA - INTERACTIVE GALLERY & LIGHTBOX STYLES
   ========================================================================== */

/* Gallery Filters */
.gallery-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.gallery-filter-btn {
  padding: 10px 22px;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--slate-600);
  background: var(--white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.gallery-filter-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-accent);
  background: var(--gold-100);
}

.gallery-filter-btn.active {
  background: var(--color-primary);
  color: var(--white);
  border-color: var(--color-primary);
  box-shadow: 0 4px 12px rgba(10, 25, 47, 0.2);
}

/* Gallery Grid (Responsive CSS Grid) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  width: 100%;
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 600px) {
  .gallery-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--white);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), opacity var(--transition-fast);
}

.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
  border-color: rgba(197, 160, 89, 0.5);
}

.gallery-thumb-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
}

.gallery-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-smooth);
}

.gallery-item:hover .gallery-thumb {
  transform: scale(1.05);
}

/* Hover Overlay */
.gallery-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    180deg,
    rgba(7, 17, 30, 0.1) 0%,
    rgba(7, 17, 30, 0.3) 50%,
    rgba(7, 17, 30, 0.88) 100%
  );
  opacity: 0;
  transition: opacity var(--transition-fast);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  z-index: 2;
}

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

.gallery-zoom-icon {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: transform var(--transition-fast), background var(--transition-fast);
}

.gallery-item:hover .gallery-zoom-icon {
  transform: scale(1.1);
  background: var(--color-accent);
  color: var(--navy-950);
}

.gallery-item-category {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 4px;
}

.gallery-item-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--white);
  line-height: 1.2;
}

/* Filter animation */
.gallery-item.hidden {
  display: none;
}

/* ==========================================================================
   MODERN LIGHTBOX MODAL
   ========================================================================== */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(5, 12, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}

.lightbox.active {
  opacity: 1;
  pointer-events: auto;
}

/* Lightbox Top Bar */
.lightbox-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 10;
  padding: 0 12px;
}

.lightbox-counter {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--slate-300);
  background: rgba(255, 255, 255, 0.1);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.lightbox-close {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

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

/* Lightbox Main Stage */
.lightbox-stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  padding: 16px 64px;
}

.lightbox-image-wrapper {
  max-width: 100%;
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.lightbox-image {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transition: opacity var(--transition-fast), transform var(--transition-fast);
  user-select: none;
}

.lightbox-image.loading {
  opacity: 0.3;
}

/* Navigation Buttons */
.lightbox-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 54px;
  height: 54px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.lightbox-btn:hover {
  background: var(--color-accent);
  color: var(--navy-950);
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev {
  left: 24px;
}

.lightbox-next {
  right: 24px;
}

/* Lightbox Bottom Caption */
.lightbox-caption {
  text-align: center;
  z-index: 10;
  padding: 12px 24px 8px;
}

.lightbox-title {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--white);
  margin-bottom: 4px;
}

.lightbox-subtitle {
  font-size: 0.85rem;
  color: var(--color-accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

@media (max-width: 768px) {
  .lightbox-stage {
    padding: 10px 0;
  }
  .lightbox-btn {
    width: 42px;
    height: 42px;
    font-size: 1.4rem;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}
