/* =========================
   EGgallery Grid
   ========================= */

body .EGgallery {
  display: grid !important;
  grid-template-columns: repeat(4, 1fr) !important;
  gap: 12px !important;
  ...
}

body .EGgallery .eg-img {
  display: block !important;
  width: 100% !important;
  height: auto !important;    /* ← was 100%, change to auto */
  object-fit: cover !important;
  ...
}

/* Tablet: 3 columns */
@media (max-width: 1000px) {
  .EGgallery {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 0 !important;
  }
}

/* Mobile: 2 columns */
@media (max-width: 600px) {
  .EGgallery {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
  }
}

/* Kill Pressero figure defaults */
.EGgallery figure,
.EGgallery .eg-item {
  display: block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Tile wrapper — true 1:1 square crop to match Elfsight original */
.EGgallery .eg-link {
  display: block !important;
  width: 100% !important;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 0;
  cursor: pointer;
}

/* Image — fills square, zooms on hover */
.EGgallery .eg-img {
  display: block !important;
  width: 100% !important;
  height: auto !important;    /* ← was 100%, change to auto */
  object-fit: cover !important;
  transition: transform 0.25s ease;   /* base state = smooth both directions */
}

.EGgallery .eg-link:hover .eg-img {
  transform: scale(1.03);
}

/* Caption below image — visible to Google for SEO */
.EGgallery .eg-caption {
  font-size: 14px;
  font-weight: normal;
  line-height: 1.3;
  padding: 6px 8px 0;
  color: #111111;
}


/* =========================
   EGgallery Lightbox Modal
   ========================= */

.eg-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.83);  /* matches Elfsight popupOverlayColor */
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.eg-modal-overlay.is-open {
  display: flex;
}

.eg-modal {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.eg-modal img {
  display: block;
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: 4px;
}

.eg-modal-title {
  font-size: 24px;
  font-weight: 800;
  color: #ffffff;
  margin: 12px 0 4px;
  text-align: center;
}

.eg-modal-caption {
  font-size: 16px;
  color: #ffffff;
  text-align: center;
  max-width: 680px;
}

/* Close button */
.eg-modal-close {
  position: absolute;
  top: -36px;
  right: 0;
  background: none;
  border: none;
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
}

/* Prev / Next arrows */
.eg-modal-prev,
.eg-modal-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.4);
  border: none;
  color: #ffffff;
  font-size: 32px;
  line-height: 1;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 4px;
  z-index: 10000;
  user-select: none;
}

.eg-modal-prev { left: 12px; }
.eg-modal-next { right: 12px; }

.eg-modal-prev:hover,
.eg-modal-next:hover {
  background: rgba(0,0,0,0.7);
}
