/* Algemene overlay styling */
#custom-lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
#custom-lightbox-overlay.active {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Standaard: desktop-layout zichtbaar, mobiele layout verborgen */
.clb-desktop {
  display: grid;
  /* Zorgt dat de desktop-layout altijd de volledige hoogte gebruikt */
  height: 100vh;
}
.clb-mobile {
  display: none;
}

/* ---------- Desktop Layout (Aangepast) ---------- */
.clb-desktop {
  /* Grid met drie kolommen: vaste breedte voor navigatie links en rechts, en de rest voor de afbeelding */
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  max-width: 1000px;
  width: 90%;
  background: transparent;
  position: relative;
  padding: 0;
}

.clb-nav-panel {
  background: transparent;
  width: 60px;
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.clb-image-panel {
  text-align: center;
  position: relative;
}

/* Aangepaste styling voor desktopafbeeldingen:
   Verticaal langwerpige afbeeldingen vullen nu de volledige beschikbare hoogte (100vh) */
.clb-image-panel .clb-image {
  display: inline-block;
  border: none;
  max-width: 100%;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transition: opacity 0.5s ease-in-out;
}

.desktop-caption {
  color: #fff;
  font-size: 16px;
  margin-top: 10px;
  background-color: transparent;
}

/* Navigatiepijlen (desktop) – de iconen binnen de nav-panel */
.clb-prev,
.clb-next {
  cursor: pointer;
  font-size: 24px;
  color: #fff;
}
.clb-prev:hover,
.clb-next:hover {
  opacity: 0.9;
}

/* Sluitknop (desktop): rechtsboven, ronde lichttransparante knop */
.clb-close {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: rgba(255,255,255,0.7);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  color: #333;
  z-index: 10;
}
.clb-close:hover {
  background-color: rgba(255,255,255,0.9);
}

/* ---------- Mobiele Layout (max-width: 768px) ---------- */
@media screen and (max-width: 768px) {
  .clb-desktop {
    display: none;
  }
  .clb-mobile {
    display: block;
    width: 100%;
    position: relative;
    text-align: center;
  }
  /* Aangepaste styling voor mobiele afbeeldingen */
  .clb-mobile .clb-inner-mobile .clb-image {
    display: block;
    margin: 0 auto;
    border: 3px solid #fff;
    max-width: 100%;
    max-height: 80vh;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: opacity 0.5s ease-in-out;
  }
  
  /* Globale mobiele navigatiebalk */
  .clb-mobile-nav {
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    z-index: 10000;
  }
  
  /* Portrait: navbalk vast bovenaan */
  @media (orientation: portrait) {
    .clb-mobile-nav {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 50px;
    }
    .clb-mobile .clb-inner-mobile {
      margin-top: 50px;
    }
  }
  
  /* Landscape: navbalk vast aan rechterkant */
  @media (orientation: landscape) {
    .clb-mobile-nav {
      position: fixed;
      top: 0;
      right: 0;
      width: 50px;
      height: 100%;
      flex-direction: column;
      justify-content: center;
      gap: 55px;
    }
    .clb-mobile-nav span {
      margin: 0;
    }
    .clb-mobile .clb-inner-mobile {
      margin-right: 50px;
    }
  }
  
  /* Captionbar voor mobiel: vaste hoogte, en in beide oriëntaties als vast balkje onderaan */
  .clb-mobile-caption {
    background-color: rgba(0,0,0,0.5);
    color: #fff;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    z-index: 10000;
    height: 50px;
  }
  /* Zowel in portrait als in landscape de captionbar als fixed vast onderaan */
  @media (orientation: portrait), (orientation: landscape) {
    .clb-mobile-caption {
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 20px;
    }
    .clb-mobile .clb-inner-mobile {
      margin-bottom: 20px;
    }
  }
  .clb-mobile-caption .clb-caption {
    flex: 1;
    text-align: center;
  }
  .clb-mobile-caption .clb-close-caption {
    cursor: pointer;
    font-size: 20px;
  }
  .clb-mobile-caption.hidden {
    display: none;
  }
}
