

/* --- Carousel Hero --- */
.gallery-carousel {
  position: relative;
  width: 100%;
  border-radius: 1.25rem;
  overflow: hidden;
  aspect-ratio: 21 / 9;
  background: #111;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.dark .gallery-carousel {
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
  position: relative;
  flex-shrink: 0;
}
.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.carousel-slide::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, transparent 50%);
  pointer-events: none;
}

.carousel-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.5rem 1.5rem;
  color: #fff;
  z-index: 2;
}
.carousel-caption h3 {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}
.carousel-caption p {
  font-size: 0.875rem;
  opacity: 0.8;
}

.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  opacity: 0;
}
.gallery-carousel:hover .carousel-btn {
  opacity: 1;
}
.carousel-btn:hover {
  background: rgba(255,255,255,0.35);
  transform: translateY(-50%) scale(1.1);
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }

.carousel-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.carousel-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
}
.carousel-dot.active {
  background: #f97316;
  transform: scale(1.25);
  box-shadow: 0 0 10px rgba(249,115,22,0.5);
}

/* --- Album Tabs --- */
.gallery-album-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #e5e7eb transparent;
}
.dark .gallery-album-tabs {
  scrollbar-color: #374151 transparent;
}
.gallery-album-tabs::-webkit-scrollbar {
  height: 4px;
}
.gallery-album-tabs::-webkit-scrollbar-thumb {
  background: #e5e7eb;
  border-radius: 4px;
}
.dark .gallery-album-tabs::-webkit-scrollbar-thumb {
  background: #374151;
}

.album-tab {
  white-space: nowrap;
  padding: 0.5rem 1rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #6b7280;
  flex-shrink: 0;
}
.dark .album-tab {
  background: #1f2937;
  border-color: #374151;
  color: #9ca3af;
}
.album-tab:hover {
  background: #f3f4f6;
  color: #374151;
}
.dark .album-tab:hover {
  background: #374151;
  color: #e5e7eb;
}
.album-tab.active {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}
.dark .album-tab.active {
  background: #f97316;
  border-color: #f97316;
  color: #fff;
}

/* --- Masonry Grid --- */
.gallery-masonry {
  column-count: 4;
  column-gap: 16px;
}
.gallery-masonry .masonry-item {
  break-inside: avoid;
  margin-bottom: 16px;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.dark .gallery-masonry .masonry-item {
  background: #1f2937;
  border-color: #374151;
}
.gallery-masonry .masonry-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 24px -8px rgba(0,0,0,0.15);
}
.gallery-masonry .masonry-item img {
  width: 100%;
  display: block;
  transition: transform 0.5s ease;
}
.gallery-masonry .masonry-item:hover img {
  transform: scale(1.05);
}

.masonry-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.75) 0%, transparent 50%);
  opacity: 0;
  transition: opacity 0.35s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  color: #fff;
}
.gallery-masonry .masonry-item:hover .masonry-overlay {
  opacity: 1;
}
.masonry-overlay h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.masonry-overlay span {
  font-size: 0.75rem;
  opacity: 0.75;
}
.masonry-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  background: rgba(245,158,11,0.9);
  color: #fff;
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.3s;
}
.gallery-masonry .masonry-item:hover .masonry-badge {
  opacity: 1;
}

@media (max-width: 1024px) {
  .gallery-masonry { column-count: 3; }
  .gallery-carousel { aspect-ratio: 16 / 9; }
}
@media (max-width: 768px) {
  .gallery-masonry { column-count: 2; column-gap: 12px; }
  .gallery-masonry .masonry-item { margin-bottom: 12px; }
  .gallery-carousel { aspect-ratio: 4 / 3; }
  .carousel-caption { padding: 1rem; }
  .carousel-caption h3 { font-size: 1rem; }
}
@media (max-width: 480px) {
  .gallery-masonry { column-count: 1; }
}

/* --- Premium Lightbox --- */
.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.gallery-lightbox.open {
  opacity: 1;
}
.gallery-lightbox.open .lightbox-image-wrapper {
  transform: scale(1);
  opacity: 1;
}

.lightbox-image-wrapper {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.lightbox-image-wrapper img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close-btn {
  position: fixed;
  top: 20px;
  right: 20px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
  color: #fff;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  z-index: 10010;
}
.lightbox-close-btn:hover {
  background: rgba(255,255,255,0.25);
  transform: rotate(90deg);
}

.lightbox-nav-btn {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  z-index: 10010;
  opacity: 0;
}
.gallery-lightbox.open .lightbox-nav-btn {
  opacity: 0.6;
}
.lightbox-nav-btn:hover {
  opacity: 1 !important;
  background: rgba(255,255,255,0.2);
  transform: translateY(-50%) scale(1.1);
}
.lightbox-prev-btn { left: 20px; }
.lightbox-next-btn { right: 20px; }

.lightbox-counter {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.875rem;
  font-weight: 500;
  z-index: 10010;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 9999px;
  border: 1px solid rgba(255,255,255,0.08);
}

.lightbox-caption-text {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  text-align: center;
  max-width: 80vw;
  z-index: 10010;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

@media (max-width: 768px) {
  .lightbox-nav-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
  .lightbox-prev-btn { left: 10px; }
  .lightbox-next-btn { right: 10px; }
  .lightbox-close-btn { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 1.1rem; }
}

/* --- Zoom on click (toggle) --- */
.lightbox-image-wrapper.zoomed img {
  cursor: zoom-out;
}
.lightbox-image-wrapper img {
  cursor: zoom-in;
}

/* --- Loading skeleton --- */
.gallery-skeleton {
  background: linear-gradient(90deg, #e5e7eb 25%, #f3f4f6 50%, #e5e7eb 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 1rem;
}
.dark .gallery-skeleton {
  background: linear-gradient(90deg, #374151 25%, #4b5563 50%, #374151 75%);
  background-size: 200% 100%;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* --- Fade-in animation for items --- */
.masonry-item {
  animation: fadeInUp 0.5s ease forwards;
  opacity: 0;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
