/* =========================================================
   Site Image Modal / Lightbox — fully scoped CSS.
   Only .site-image-modal* classes and a single body flag class
   are used, so nothing here touches the existing design.
   ========================================================= */

body.site-image-modal-open {
  overflow: hidden;
}

.site-image-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background-color: rgba(0, 0, 0, 0.85);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease;
}

.site-image-modal.site-image-modal-active {
  opacity: 1;
  visibility: visible;
}

.site-image-modal-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.site-image-modal-content img {
  display: block;
  max-width: 90vw;
  max-height: 78vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  background-color: #111;
}

.site-image-modal-close,
.site-image-modal-nav {
  position: absolute;
  border: none;
  cursor: pointer;
  color: #fff;
  background-color: rgba(0, 0, 0, 0.45);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background-color 0.15s ease;
}

.site-image-modal-close:hover,
.site-image-modal-nav:hover {
  background-color: rgba(0, 0, 0, 0.7);
}

.site-image-modal-close {
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  z-index: 2;
}

.site-image-modal-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 42px;
  height: 42px;
  font-size: 22px;
}

.site-image-modal-prev { left: 8px; }
.site-image-modal-next { right: 8px; }

.site-image-modal-title {
  position: absolute;
  bottom: -34px;
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.site-image-modal-counter {
  position: absolute;
  bottom: -56px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 0.8rem;
  opacity: 0.85;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .site-image-modal-prev { left: -60px; }
  .site-image-modal-next { right: -60px; }
}
