/* Gallery Detail / Photo View Page */
.mt_50 {
  margin-top: 50px;
}

/* Reset global margins inside gallery (style.css sets large margins on p, h1-h6, ul, etc.) */
.gallery h1, .gallery h2, .gallery h3, .gallery h4, .gallery h5, .gallery h6,
.gallery p, .gallery ul, .gallery ol {
  margin: 0;
}

/* Photo Grid */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  padding: 20px 0;
}
.photo-card {
  border: none;
  padding: 0;
  margin: 0;
  background: none;
  cursor: pointer;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.photo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}
.photo-container {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16/10;
}
.photo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.photo-card:hover .photo-image {
  transform: scale(1.05);
}
.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo-card:hover .photo-overlay {
  opacity: 1;
}
.photo-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
  padding: 1rem;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.photo-card:hover .photo-caption {
  opacity: 1;
}
.photo-caption p {
  margin: 0;
  color: white;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lightbox */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.95);
  align-items: center;
  justify-content: center;
}
.lightbox.active {
  display: flex;
}
.lightbox.bg-75 { background: rgba(0, 0, 0, 0.75); }
.lightbox.bg-85 { background: rgba(0, 0, 0, 0.85); }
.lightbox.bg-95 { background: rgba(0, 0, 0, 0.95); }

/* Lightbox Controls */
.lightbox-controls {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6) 0%, transparent 100%);
  z-index: 10;
}
.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
.control-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.control-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.control-btn.active {
  background: rgba(255, 255, 255, 0.3);
}
.control-panel {
  display: flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.3);
  padding: 4px;
  border-radius: 8px;
}
.control-label {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10px;
  padding: 0 4px;
  text-transform: uppercase;
}
.control-option {
  font-size: 10px;
  padding: 4px 8px;
}
.zoom-display {
  color: #fff;
  font-size: 12px;
  min-width: 40px;
  text-align: center;
}

/* Navigation */
.lightbox .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}
.lightbox .nav-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.lightbox .nav-btn.prev { left: 16px; }
.lightbox .nav-btn.next { right: 16px; }

/* Lightbox Image */
.lightbox-image-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  padding: 60px 80px 80px;
}
.lightbox-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}

/* Info Panel */
.lightbox-info {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}
.info-panel {
  background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
  padding: 20px 16px 12px;
}
.info-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.info-caption {
  font-size: 16px;
  color: #fff;
  margin: 0 0 4px;
}
.info-alt {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.info-counter {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}
.info-dimensions {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

/* Text size variants */
.text-sm { font-size: 12px !important; }
.text-base { font-size: 14px !important; }
.text-lg { font-size: 16px !important; }
.text-xl { font-size: 20px !important; }

/* Progress bar */
.progress-bar {
  height: 3px;
  background: rgba(255, 255, 255, 0.2);
  margin-top: 8px;
  border-radius: 2px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: #BC9F60;
  border-radius: 2px;
  transition: width 0.3s ease;
}

@media (max-width: 768px) {
  .photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .lightbox-image-container {
    padding: 50px 16px 70px;
  }
  .lightbox .nav-btn {
    width: 36px;
    height: 36px;
  }
  .lightbox-controls {
    flex-wrap: wrap;
    gap: 4px;
  }
  .control-panel {
    display: none;
  }
}
