.lightbox {
  display: none;          /* hidden by default */
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.8);
  justify-content: center;
  align-items: center;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.lightbox.show {
  display: flex;
  opacity: 1;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
}
/* Close button (X in top-right corner) */
.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: #fff;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  transition: color 0.3s;
  z-index: 10001;
}
.lightbox .close:hover {
  color: #ccc;
}

/* Navigation arrows */
.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #fff;
  font-size: 60px;
  font-weight: bold;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0 15px;
  z-index: 10001;
  transition: color 0.3s;
}

.lightbox-prev {
  left: 20px;   /* floats on left side */
}

.lightbox-next {
  right: 20px;  /* floats on right side */
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #ccc;
}

/* Play/Pause button (bottom center) */
#lightbox-playpause {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 30px;
  color: #fff;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10001;
}
/* Caption under the image */
#lightbox-caption {
  position: absolute;
  bottom: 70px;          /* sits above the play/pause button */
  left: 50%;
  transform: translateX(-50%);
  max-width: 80%;
  text-align: center;
  color: #fff;
  font-size: 18px;
  line-height: 1.4;
  z-index: 10001;
}

/* Progress bar container */
#lightbox-progress {
  position: absolute;
  bottom: 50px;          /* just above play/pause button */
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  height: 6px;
  background: rgba(255,255,255,0.2);
  border-radius: 3px;
  overflow: hidden;
  z-index: 10001;
}

/* Progress bar itself */
#lightbox-progress .progress-bar {
  width: 0%;
  height: 100%;
  background: #fff;
  transition: width 0.1s linear;
}
/* Remove focus outline from the lightbox image */
#lightbox-img {
  outline: none;
}
#lightbox-img:focus {
  outline: none;
}
#lightbox-img {
  outline: none !important;
  border: none !important;
}

#lightbox-img:focus {
  outline: none !important;
  border: none !important;
}
/* 1) Remove mobile tap highlight (common lime/green box on touch) */
.lightbox, .lightbox * {
  -webkit-tap-highlight-color: transparent;
}

/* 2) Kill focus-visible rings (Chrome/Firefox) */
#lightbox-img:focus-visible,
.lightbox a:focus-visible,
.lightbox button:focus-visible {
  outline: none !important;
}

/* 3) If the large image is inside a link, also remove link outlines */
.lightbox a {
  outline: none !important;
  border: none !important;
}

/* 4) General reset for buttons/controls inside the overlay */
.lightbox button {
  outline: none !important;
  border: none !important;
  background: none;
}
.lightbox *:focus {
  outline: none !important;
  box-shadow: none !important;
  border: none !important;
}

.lightbox *:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}
/* Kill ALL focus rings and tap highlights inside the lightbox */
.lightbox, .lightbox * {
  -webkit-tap-highlight-color: transparent;     /* Chrome/Safari mobile */
}

/* Image-specific: cross-browser focus ring removal */
#lightbox-img,
#lightbox-img:focus,
#lightbox-img:active {
  outline: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Firefox-specific focus ring */
#lightbox-img:-moz-focusring {
  outline: none !important;
}

/* Edge/Chrome focus-visible */
#lightbox-img:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

/* As a belt-and-suspenders: if the image is inside ANY link, remove link outlines */
.lightbox a,
.lightbox a:focus,
.lightbox a:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  border: 0 !important;
}

/* Optional: make the image non-interactive so it never gets focus from clicks */
#lightbox-img {
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none; /* keep if image itself doesn't need to be clickable */
}
