.empg-gallery-wrap {
  width: 100%;
}
/* Stable masonry layout using CSS columns.
   Use one gap value horizontally and vertically; avoid grid row-span gaps. */
.empg-gallery {
  width: 100%;
  display: block !important;
  column-count: 3;
  column-gap: var(--empg-gap, 4px);
  column-fill: balance;
}
.empg-columns-2 { column-count: 2; }
.empg-columns-3 { column-count: 3; }
.empg-columns-4 { column-count: 4; }
.empg-columns-5 { column-count: 5; }

.empg-gallery-item {
  position: relative;
  display: inline-block !important;
  vertical-align: top;
  width: 100% !important;
  margin: 0 0 var(--empg-gap, 4px) !important;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  break-inside: avoid;
  -webkit-column-break-inside: avoid;
  background: #111;
  cursor: pointer;
  line-height: 0;
  text-decoration: none;
}

.empg-image {
  display: block;
  width: 100%;
  height: auto;
  transition: transform .6s ease;
}
.empg-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(0,0,0,.68), rgba(0,0,0,.08) 62%, transparent);
  opacity: 0;
  transition: opacity .35s ease;
  pointer-events: none;
}
.empg-overlay { display: none; }
.empg-title {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 14px;
  bottom: 22px;
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 500;
  letter-spacing: .02em;
  opacity: 0;
  transform: translateY(9px);
  transition: opacity .35s ease, transform .35s ease;
  pointer-events: none;
}
.empg-zoom .empg-gallery-item:hover .empg-image,
.empg-zoom .empg-gallery-item:focus-visible .empg-image {
  transform: scale(1.035);
}
.empg-gallery-item:hover::after,
.empg-gallery-item:focus-visible::after {
  opacity: 1;
}
.empg-gallery-item:hover .empg-title,
.empg-gallery-item:focus-visible .empg-title {
  opacity: 1;
  transform: translateY(0);
}
.empg-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 54px;
  height: 54px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  transition: transform .3s ease;
}
.empg-play svg { display: block; width: 100%; height: 100%; }
.empg-play circle { fill: rgba(0,0,0,.35); stroke: #fff; stroke-width: 2; }
.empg-play path { fill: #fff; }
.empg-video-item:hover .empg-play { transform: translate(-50%, -50%) scale(1.08); }
.empg-empty { padding: 20px; border: 1px dashed #aaa; }
.empg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.94);
}
.empg-lightbox-inner {
  position: relative;
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
}
.empg-lightbox iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}
.empg-lightbox-close {
  position: absolute;
  top: -42px;
  right: 0;
  border: 0;
  padding: 4px 8px;
  color: #fff;
  background: transparent;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
}
@media (max-width: 1024px) {
  .empg-columns-4, .empg-columns-5 { column-count: 3; }
}
@media (max-width: 767px) {
  .empg-columns-3, .empg-columns-4, .empg-columns-5 { column-count: 2; }
  .empg-title { left: 12px; right: 10px; bottom: 13px; font-size: 13px; }
}
@media (max-width: 480px) {
  .empg-gallery { column-count: 1 !important; }
}

/* Hosted video tiles */
.empg-hosted-video { object-fit: cover; }
.empg-hosted-item .empg-hosted-video { pointer-events: none; }

/* Gallery lightbox and navigation arrows */
.empg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0,0,0,.94);
}
.empg-lightbox-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(1200px, 100%);
  height: min(88vh, 900px);
}
.empg-lightbox-inner img,
.empg-lightbox-inner video {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}
.empg-lightbox-inner iframe {
  display: block;
  width: min(1100px, 100%);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: 85vh;
  border: 0;
}
.empg-lightbox-close,
.empg-lightbox-arrow {
  position: absolute;
  z-index: 5;
  border: 0;
  color: #fff;
  background: rgba(0,0,0,.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.empg-lightbox-close {
  top: 0;
  right: 0;
  width: 42px;
  height: 42px;
  font-size: 30px;
  line-height: 1;
}
.empg-lightbox-arrow {
  top: 50%;
  width: 48px;
  height: 58px;
  transform: translateY(-50%);
  font-size: 38px;
  line-height: 1;
}
.empg-lightbox-prev { left: -56px; }
.empg-lightbox-next { right: -56px; }
.empg-lightbox-arrow:hover,
.empg-lightbox-close:hover { background: rgba(0,0,0,.75); }
.empg-lightbox-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -32px;
  text-align: center;
  color: #fff;
  font-size: 14px;
  line-height: 1.3;
}
@media (max-width: 767px) {
  .empg-lightbox { padding: 14px; }
  .empg-lightbox-prev { left: 0; }
  .empg-lightbox-next { right: 0; }
  .empg-lightbox-arrow { width: 38px; height: 48px; font-size: 30px; }
  .empg-lightbox-close { top: -8px; right: -8px; }
}

/* Progressive loading: icon-only control */
.empg-gallery-item.empg-hidden-item { display: none !important; }
.empg-load-more-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  padding: 24px 0 8px;
}
.empg-load-more-button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  cursor: pointer;
  transition: opacity .2s ease, transform .2s ease;
  font-size: 0;
  line-height: 0;
}
.empg-load-more-button::before {
  content: "";
  display: block;
  width: 12px;
  height: 12px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg);
}
.empg-load-more-button:hover { opacity: .75; transform: translateY(2px); }
.empg-load-more-button:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.empg-load-more-button.is-loading::before {
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform: none;
  animation: empg-spin .65s linear infinite;
}
.empg-load-more-button:disabled { cursor: wait; opacity: .7; }
@keyframes empg-spin { to { transform: rotate(360deg); } }


/* Infinite scroll sentinel: no visible Load More control; batches load on scroll. */
.empg-load-more-wrap {
  display: block;
  width: 100%;
  height: 1px;
  min-height: 1px;
  padding: 0;
  margin: 0;
  pointer-events: none;
}
.empg-load-more-button { display: none !important; }


/* YouTube inline autoplay previews */
.empg-video-item { position: relative; }
.empg-youtube-preview {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  border: 0;
  pointer-events: none;
  background: #111;
}
.empg-video-item .empg-play { z-index: 3; }
.empg-video-item.empg-youtube-playing .empg-play { opacity: 0; }
