/* MODX Gallery: centered Flexbox rows. No UIkit or JS changes required. */
.photo-gallery {
  --gallery-gap: 14px;
  --gallery-display-cols: var(--gallery-cols, 5);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: var(--gallery-gap);
}
.photo-gallery__item {
  box-sizing: border-box;
  flex: 0 0 calc((100% + var(--gallery-gap)) / var(--gallery-display-cols) - var(--gallery-gap));
  min-width: 0;
  max-width: 100%;
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: #e6ebe6;
  cursor: zoom-in;
}
.photo-gallery__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}
.photo-gallery__item:hover .photo-gallery__image { transform: scale(1.045); }
.photo-gallery__zoom {
  position: absolute;
  right: 11px;
  bottom: 11px;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #fff;
  background: rgba(0,0,0,.53);
  font-size: 21px;
  line-height: 1;
}
@media (max-width: 900px) {
  .photo-gallery { --gallery-display-cols: min(var(--gallery-cols, 5), 3); --gallery-gap: 10px; }
}
@media (max-width: 600px) {
  .photo-gallery { --gallery-display-cols: min(var(--gallery-cols, 5), 2); --gallery-gap: 8px; }
  .photo-gallery__item { border-radius: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  .photo-gallery__image { transition: none; }
}

.site-lightbox[hidden] { display: none !important; }
.site-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  background: rgba(8, 11, 13, .97);
  color: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
.site-lightbox__top {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 60px;
  padding: 8px 18px;
  background: linear-gradient(to bottom, rgba(0,0,0,.65), transparent);
}
.site-lightbox__counter { font-size: 13px; opacity: .85; font-variant-numeric: tabular-nums; }
.site-lightbox__button {
  appearance: none;
  padding: 0;
  box-sizing: border-box;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.13);
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.site-lightbox__button svg {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  fill: none;
  stroke: currentColor;
}

.site-lightbox__button:hover { background: rgba(255,255,255,.27); }
.site-lightbox__button:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.site-lightbox__stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 66px 72px 58px;
  touch-action: pan-y;
}
.site-lightbox__image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.site-lightbox__status {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  color: rgba(255,255,255,.8);
  font-size: 14px;
}
.site-lightbox__nav { position: absolute; z-index: 2; top: 50%; transform: translateY(-50%); }
.site-lightbox__prev { left: 14px; }
.site-lightbox__next { right: 14px; }
.site-lightbox__caption {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 13px;
  min-height: 20px;
  font-size: 13px;
  line-height: 1.35;
  color: #e7e7e7;
  text-align: center;
  overflow-wrap: anywhere;
}
@media (max-width: 600px) {
  .site-lightbox__stage { padding: 65px 12px 65px; }
  .site-lightbox__nav { top: auto; bottom: 12px; transform: none; }
  .site-lightbox__prev { left: 10px; }
  .site-lightbox__next { right: 10px; }
  .site-lightbox__caption { left: 70px; right: 70px; bottom: 20px; }
  .site-lightbox__top { min-height: 55px; padding: 6px 12px; }
  .site-lightbox__button { width: 42px; height: 42px; }
}
/* Ensure dynamic visibility attributes override display rules above. */
.site-lightbox__image[hidden],
.site-lightbox__status[hidden],
.site-lightbox__button[hidden] { display: none !important; }
