/* Lightbox cursor */
.lightbox {
  cursor: pointer;
}

/* Lightbox container (modal overlay) */
.lightboxContainer {
  position: fixed;
  z-index: 9999;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Top options bar */
.lightboxContainer .lightboxOptions {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 0.25rem 0.5rem;
  text-align: end;
  background: #444;
}

/* Wrapper for image & controls */
.lightboxContainer .lightboxWrapper {
  position: relative;
}

/* Image container */
.lightboxContainer .lbContent {
  padding-inline: calc(0.5rem + 1.5vw);
  border-radius: 0.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Image */
.lightboxContainer .lbImg {
  max-width: 100%;
  max-height: 90vh;
}

/* Close & Download buttons */
.lightboxContainer .lbClose,
.lightboxContainer .lbDownload {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(var(--primary-color-rgb, 0, 123, 255), 1);
  backdrop-filter: blur(4px);
  border: none;
  cursor: pointer;
  z-index: 999;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease, opacity 0.15s ease;
}

.lightboxContainer .lbClose:hover,
.lightboxContainer .lbDownload:hover {
  background: rgba(var(--secondary-color-rgb, 0, 0, 0), 0.75);
  transform: scale(1.05);
}

.lightboxContainer .lbClose:active,
.lightboxContainer .lbDownload:active {
  transform: scale(0.95);
}

.lightboxContainer .lbClose:focus-visible,
.lightboxContainer .lbDownload:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Close icon */
.lightboxContainer .lbClose::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath d='M.293.293a1 1 0 011.414 0L8 6.586 14.293.293a1 1 0 111.414 1.414L9.414 8l6.293 6.293a1 1 0 01-1.414 1.414L8 9.414l-6.293 6.293a1 1 0 01-1.414-1.414L6.586 8 .293 1.707a1 1 0 010-1.414z'/%3e%3c/svg%3e") no-repeat center / contain;
}

/* Download icon */
.lightboxContainer .lbDownload {
  margin-inline-end: 0.75rem;
}

.lightboxContainer .lbDownload::before {
  content: "";
  width: 1rem;
  height: 1rem;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="%23fff"><path d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/><path d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/></svg>') no-repeat center / contain;
}

/* Controls (custom prev/next for old lightbox) */
.lightboxContainer .controls {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: space-between;
  height: 100%;
  max-height: 128px;
  top: 50%;
  transform: translateY(-50%);
}

.lightboxContainer .controls :is(.prev, .next) {
  border: none;
  background: none;
  width: 128px;
  display: flex;
  justify-content: center;
  align-items: center;
  --padding-inner: 3rem;
  --padding-outer: 1.5rem;
  opacity: 0.4;
  transition: opacity 150ms ease;
}

.lightboxContainer .controls :is(.prev, .next):hover {
  opacity: 1;
}

.lightboxContainer .controls :is(.prev, .next):focus-visible {
  outline: none;
}

.lightboxContainer .controls .prev {
  padding-inline: var(--padding-outer) var(--padding-inner);
}

.lightboxContainer .controls .next {
  padding-inline: var(--padding-inner) var(--padding-outer);
}

.lightboxContainer .controls .prev::before {
  content: "";
  position: absolute;
  width: 2rem;
  height: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 6.84 14.77'%3E%3Cpath d='m6.34,14.77c.11,0,.23-.04.32-.12.21-.18.24-.49.06-.7L1.16,7.38,6.72.82c.18-.21.15-.53-.06-.7-.21-.18-.53-.15-.7.06L.12,7.06c-.16.19-.16.46,0,.65l5.84,6.88c.1.12.24.18.38.18Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

.lightboxContainer .controls .next::before {
  content: "";
  position: absolute;
  width: 2rem;
  height: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23ffffff' viewBox='0 0 6.84 14.77'%3E%3Cpath d='m.5,14.77c-.11,0-.23-.04-.32-.12-.21-.18-.24-.49-.06-.7l5.56-6.56L.12.82C-.06.61-.03.3.18.12.39-.06.7-.03.88.18l5.84,6.88c.16.19.16.46,0,.65L.88,14.59c-.1.12-.24.18-.38.18Z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}

/* Dots (pagination) */
.lightboxContainer .dots {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  display: flex;
  column-gap: 0.25rem;
  transform: translateX(-50%);
}

.lightboxContainer .dots .dotsChild {
  border: 2px solid #fff;
  border-radius: 50vw;
  opacity: 0.4;
  width: 2px;
  transition: width 500ms ease;
}

.lightboxContainer .dots .dotsChild.active {
  opacity: 1;
  width: 1rem;
}

/* Gallery thumbnails */
.gallery-thumbnail {
  width: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  grid-auto-rows: 200px;
  grid-auto-flow: dense;
  grid-gap: 20px;
}

.gallery-thumbnail :is(img, video) {
  width: 100%;
  height: 100%;
  overflow: hidden;
  object-fit: cover;
  object-position: center 35%;
  transition: all 0.5s ease;
  border-radius: 0.5rem;
}

/* --- Bootstrap carousel controls fix --- */
.carousel-control-prev-icon,
.carousel-control-next-icon {
  background-color: rgba(var(--primary-color-rgb), 1);
  /* dark semi-transparent circle */
  background-size: 50% 50%;
  background-repeat: no-repeat;
  border-radius: 50%;
}

/* Optional: increase size of clickable area */
.carousel-control-prev,
.carousel-control-next {
  width: 8%;
  opacity: 1;
}

.carousel-control-next,
.carousel-control-prev {
  filter: none !important;
}


/* Download button */
.lbDownload {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  border: none;
  cursor: pointer;
  background: none;
  /* background: rgba(var(--primary-color-rgb), 0.9);
  backdrop-filter: blur(6px); */

  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition:
    background 0.2s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

/* Hover */
.lbDownload:hover {
  /* background: rgba(0, 0, 0, 0.75); */
  transform: scale(1.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

/* Active */
.lbDownload:active {
  transform: scale(0.95);
}

/* Focus (keyboard accessibility) */
.lbDownload:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* Download icon */
.lbDownload::before {
  content: "";
  width: 1.05rem;
  height: 1.05rem;
  background: url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="%23fff"%3E%3Cpath d="M.5 9.9a.5.5 0 0 1 .5.5v2.5a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-2.5a.5.5 0 0 1 1 0v2.5a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2v-2.5a.5.5 0 0 1 .5-.5z"/%3E%3Cpath d="M7.646 11.854a.5.5 0 0 0 .708 0l3-3a.5.5 0 0 0-.708-.708L8.5 10.293V1.5a.5.5 0 0 0-1 0v8.793L5.354 8.146a.5.5 0 1 0-.708.708l3 3z"/%3E%3C/svg%3E') no-repeat center / contain;
}