/* ============================================================
   Zendesk Lightbox — paligo-lightbox.css
   Drop into Guide Admin → Customize design → Assets
   Reference in document_head.hbs:
     <link rel="stylesheet" href="{{asset 'paligo-lightbox.css'}}">
   ============================================================ */

/* ---------- Overlay ---------- */
.zd-lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(10, 12, 18, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: zoom-out;
  animation: zd-lb-fade-in 0.22s ease forwards;
}

.zd-lightbox-overlay.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------- Inner container (stops click propagation) ---------- */
.zd-lightbox-inner {
  position: relative;
  max-width: 92vw;
  max-height: 90vh;
  cursor: default;
  animation: zd-lb-scale-in 0.25s cubic-bezier(0.34, 1.3, 0.64, 1) forwards;
}

/* ---------- Image ---------- */
.zd-lightbox-img {
  display: block;
  max-width: 92vw;
  max-height: 86vh;
  width: auto;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

/* ---------- Caption ---------- */
.zd-lightbox-caption {
  margin-top: 10px;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  letter-spacing: 0.01em;
  line-height: 1.5;
  max-width: 92vw;
}

/* ---------- Close button ---------- */
.zd-lightbox-close {
  position: fixed;
  top: 18px;
  right: 20px;
  z-index: 10000;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
  padding: 0;
  appearance: none;
  -webkit-appearance: none;
}

.zd-lightbox-close:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.55);
  transform: scale(1.08);
}

.zd-lightbox-close:focus-visible {
  outline: none;
  outline-offset: 2px;
}

/* Close icon (×) via pseudo-element */
.zd-lightbox-close::before,
.zd-lightbox-close::after {
  content: '';
  position: absolute;
  width: 16px;
  height: 1.5px;
  background: #fff;
  border-radius: 2px;
}

.zd-lightbox-close::before { transform: rotate(45deg); }
.zd-lightbox-close::after  { transform: rotate(-45deg); }

/* ---------- Images in articles become clickable ---------- */
.article-body img,
.article-container img,
.article img {
  cursor: zoom-in;
}

.article-body img[role="button"],
.article-container img[role="button"],
.article img[role="button"] {
  outline: none;
  border: none;
  box-shadow: none;
  background: none;
}

/* ---------- Animations ---------- */
@keyframes zd-lb-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes zd-lb-scale-in {
  from { opacity: 0; transform: scale(0.93); }
  to   { opacity: 1; transform: scale(1); }
}

/* ---------- Closing animation ---------- */
.zd-lightbox-overlay.is-closing {
  animation: zd-lb-fade-out 0.18s ease forwards;
}

.zd-lightbox-overlay.is-closing .zd-lightbox-inner {
  animation: zd-lb-scale-out 0.18s ease forwards;
}

@keyframes zd-lb-fade-out {
  from { opacity: 1; }
  to   { opacity: 0; }
}

@keyframes zd-lb-scale-out {
  from { opacity: 1; transform: scale(1); }
  to   { opacity: 0; transform: scale(0.95); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .zd-lightbox-overlay,
  .zd-lightbox-inner,
  .article-body img,
  .article-container img,
  .article img {
    animation: none !important;
    transition: none !important;
  }
}
