/* =========================================
   1. BASE PAGE & TYPOGRAPHY
========================================= */
/*
body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #f4f4f5;
  margin: 0;
  padding: 0;
  color: #333;
}
*/

.gallery-container {
/*  max-width: 1000px;*/
  max-width: 90%;
  margin: 2rem auto;
  padding: 0 1rem;
}

.gallery-container h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 600;
}

/* =========================================
   2. GALLERY GRID LAYOUT
========================================= */
.gallery {
  display: grid;
/*  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));*/
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 25px;
}

.gallery-item {
  margin: 0;
  display: flex;
  flex-direction: column;
}

.gallery-item a {
  display: block;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  background: #e4e4e7; /* Placeholder background color */
/*    transition: transform 0.3s ease, box-shadow 0.3s ease;*/
    transition: transform 4s ease-out, filter 2s ease-in, border 3s ease-in, box-shadow 2s ease-out;
}

.gallery-item a:hover {
/*  box-shadow: 0 8px 15px rgba(0,0,0,0.15);*/
/*    transform: translateY(-5px);*/
    transform: scale(1.5, 1.5);
	filter: drop-shadow(8px 8px 10px black);
	border:5px solid #fff;
	box-shadow: 0px 0px 500px #000, 0px 0px 700px #000, 0px 0px 1000px #000;
}

.gallery-item img {
  width: 100%;
/*  height: 250px;*/
  height: 150px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s ease;
}

.gallery-item figcaption {
  margin-top: 10px;
  font-size: 0.95rem;
  color: #555;
  line-height: 1.4;
  text-align: center;
}

/* =========================================
   3. LIGHTBOX OVERLAY BACKGROUND
========================================= */
.lightbox {
  position: fixed;
  top: 0; 
  left: 0; 
  width: 100vw; 
  height: 100vh;
  background: rgba(10, 10, 10, 0.9);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px); /* Safari support */
/*  z-index: 1000;*/
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

/* =========================================
   4. AUTOPLAY PROGRESS BAR
========================================= */
.lb-progress-bar {
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  background: #3b82f6; /* Modern bright blue */
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.8);
  width: 0%;
  z-index: 1005; 
  pointer-events: none; 
}

/* =========================================
   5. TOOLBAR & CONTROLS
========================================= */
.lb-toolbar {
  position: absolute;
  top: 0; 
  left: 0; 
  width: 100%;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-sizing: border-box;
  z-index: 1001;
}

.lb-counter {
  color: white;
  font-weight: 600;
  letter-spacing: 1px;
  font-size: 1.1rem;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.lb-controls button, 
.lb-nav {
/*  background: rgba(255, 255, 255, 0.1);*/
  background: rgba(255, 255, 255, 0.5);
/*  border: 1px solid rgba(255, 255, 255, 0.2);*/
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: white;
  font-size: 1.1rem;
  border-radius: 50%;
  width: 45px; 
  height: 45px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}

.lb-controls button:hover, 
.lb-nav:hover {
  background: white;
  color: black;
  transform: scale(1.05);
}

/* Navigation Arrows (Left / Right) */
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1001;
  margin: 0; /* Override the margin-left from toolbar buttons */
}
.lb-nav.left { left: 20px; }
.lb-nav.right { right: 20px; }

/* =========================================
   6. MAIN IMAGE & DRAGGING
========================================= */
.lb-content {
  position: relative;
/*  width: 90vw;*/
  width: 100vw;
/*  height: 85vh;*/
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden; 
}

#lb-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  opacity: 0; /* Hidden initially, JS fades it in */
  transition: opacity 0.3s ease, transform 0.2s ease-out;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none; /* Prevents native browser ghost-dragging */
}

#lb-img.dragging {
  transition: opacity 0.3s ease; /* Remove transform transition for instant dragging response */
  cursor: grabbing;
}

/* =========================================
   7. FLOATING CAPTION
========================================= */
.lb-caption {
  position: absolute;
  bottom: 5vh;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 15, 15, 0.75);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  color: white;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 1rem;
  text-align: center;
  max-width: 80%;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  pointer-events: none; /* Let users click/drag the image through the caption */
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1010;
}

.lb-caption.visible {
  opacity: 1;
}

/* =========================================
   8. LOADING SPINNER
========================================= */
.lb-loader {
  position: absolute;
  width: 40px; 
  height: 40px;
  border: 4px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  display: none; /* Controlled by JS */
  z-index: 1000;
}

@keyframes spin { 
  100% { transform: rotate(360deg); } 
}

/* =========================================
   9. MOBILE RESPONSIVENESS
========================================= */
@media (max-width: 600px) {
  .lb-toolbar {
    padding: 10px;
  }
  
  .lb-controls button, 
  .lb-nav {
    width: 38px;
    height: 38px;
    font-size: 0.9rem;
    margin-left: 5px;
  }

  .lb-nav.left { left: 10px; }
  .lb-nav.right { right: 10px; }
  
  .lb-caption {
    bottom: 8vh;
    font-size: 0.9rem;
    width: 90%;
    padding: 8px 15px;
  }
}