:root {
  --accent: #0086cb;
  --transition-duration: 1s;
  --autoplay-interval: 7000;
}

/* Wrapper & layout */
.carousel-wrapper {
  max-width: 1140px;
  margin: 32px auto;
  position: relative;
  padding: 0 24px;
  box-sizing: border-box;
  overflow: visible; /* allow outside arrows/shadows */
}

/* Visible window */
.carousel-container {
  width: 100%;
  overflow: hidden;
  position: relative;

  /* Prevent collapse & add fade-in */
  min-height: 340px; /* adjust approx height of your carousel */
  opacity: 1;
  transition: opacity 0.4s ease;
  pointer-events: auto;
}
.carousel-container.preload {
  opacity: 0.4;
  pointer-events: none;
}

/* Track */
.carousel-track {
  display: flex;
  margin: 0;
  padding: 0;
  list-style: none;
  transition: none; /* we show/hide items instead of sliding */
  will-change: auto;
}

/* Item base: hidden by default (no bleed, no hover) */
.carousel-item {
  display: none;                /* hidden until JS reveals on current page */
  flex: 0 0 33.3333%;           /* desktop default */
  box-sizing: border-box;
  padding: 10px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.56s ease, transform 0.56s ease;
  outline-offset: 4px;
  position: relative;
  user-select: none;
}

/* When JS makes visible it will add animation class */
.carousel-item.animate-in {
  display: block;               /* ensure it participates in flex layout */
  pointer-events: auto;
  opacity: 1;
  transform: translateY(0);
}

/* Image */
.carousel-item img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.55);
  transition: transform 0.32s ease, filter 0.32s ease;
  pointer-events: none;
  display: block;
}

/* Hover/focus */
.carousel-item:hover img,
.carousel-item:focus-within img {
  transform: scale(1.03);
  filter: brightness(1.03);
  box-shadow: 0 3px 17px rgba(0, 0, 0, 0.55);
}
.carousel-item:focus-visible {
  outline: none; /* Remove default outline */
  box-shadow: none; /* Remove any box shadow */

  /* Add only a blue bottom border as focus indicator */
  border-bottom: 3px solid var(--accent);
  border-left: none;
  border-right: none;
  border-top: none;

  /* To avoid layout shift when border appears, 
     add bottom padding equal or greater than border thickness */
  padding-bottom: 7px; /* adjust if needed */
}

/* Caption */
.carousel-caption {
  margin-top: 18px;
  font-weight: 600;
  font-size: 0.95rem;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  line-height: 130%;
  text-align: center;
  user-select: none;
  max-width: 100%;
}

.carousel-caption span {
  display: inline;
}

.carousel-caption i.fa-magnifying-glass {
  color: var(--accent);
  font-size: 1rem;
  margin-right: 6px; /* spacing after icon */
  vertical-align: text-top; /* aligns icon nicely with text baseline */
}



/* Arrows - round outside gallery on desktop */
.carousel-arrow {
  position: absolute;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  border: none;
  cursor: pointer;
  z-index: 60;
  transition: background 0.18s ease;
}
.carousel-arrow:hover,
.carousel-arrow:focus {
  background: rgba(0, 0, 0, 0.7);
  outline: 3px solid var(--accent);
  box-shadow: 0 0 8px var(--accent);
  outline-offset: 2px;
}
.carousel-arrow.left { left: -64px; top: 50%; transform: translateY(-50%); }
.carousel-arrow.right { right: -64px; top: 50%; transform: translateY(-50%); }

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 8px;
  padding: 0;
  z-index: 50;
}
.carousel-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #bbb;
  border: none;
  cursor: pointer;
}
.carousel-dot.active,
.carousel-dot[aria-selected="true"] { background: var(--accent); }
.carousel-dot:focus { outline: none; box-shadow: inset 0 -3px 0 var(--accent); }

/* Hide controls for a single page */
.carousel-wrapper.hide-controls .carousel-arrow,
.carousel-wrapper.hide-controls .carousel-dots { display: none !important; }

/* Lightbox - higher specificity to beat WPBakery */
#lightbox.custom-lightbox {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  z-index: 999999999999991100000000000000000000 !important; /* raised to beat nav */
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.88);
  padding: 20px;
  box-sizing: border-box;
  overflow: auto;
  opacity: 0;
  transition: opacity 0.8s ease; /* slower fade */
}
#lightbox.custom-lightbox.open {
  display: flex !important;
  opacity: 1 !important;
}

#lightbox.custom-lightbox .lightbox-frame {
  max-width: 90vw;
  max-height: 90vh;
  width: auto;
  height: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

#lightbox.custom-lightbox .lightbox-img {
  max-width: 100%;
  max-height: 80vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.75);
  display: block;
  object-fit: contain;
}


.lightbox-frame {
  max-width: 760px;
  max-height: 90vh;
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:12px;
  position:relative;
  animation: lbZoom 360ms cubic-bezier(.2,.9,.2,1) both;
}
@keyframes lbZoom {
  from { transform: scale(.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.lightbox-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.75);
  display:block;
}
.lightbox-caption {
  color:#fff;
  font-weight:600;
  text-align:center;
  font-size:1.02rem;
  margin-top:6px;
}
.lightbox-close {
  position:absolute;
  top:-3rem;
  right:0;
  background:none;
  color:#fff;
  border:none;
  font-size:1.3rem;
  cursor:pointer;
  font-weight:700;
  display:flex;
  align-items:center;
  gap:8px;
  padding:6px 8px;
  z-index:100000;
}
.lightbox-close:hover, .lightbox-close:focus { color:#ff6b6b; outline:none; }

/* Responsive */
@media (max-width: 1140px) {
  .carousel-item { flex: 0 0 50%; }
  .carousel-arrow.left { left: -48px; }
  .carousel-arrow.right { right: -48px; }
}

@media (max-width: 768px) {
  .carousel-item { flex: 0 0 100%; }

  /* Move arrows down to sit near dots (above dots) */
  .carousel-arrow {
    top: auto !important;
    bottom: 46px !important; /* aligns with dots area */
    transform: none !important;
    width: 40px;
    height: 40px;
  }
  .carousel-arrow.left { left: 18px !important; right: auto !important; }
  .carousel-arrow.right { right: 18px !important; left: auto !important; }
}
