/* Scoped enhancement: the original mosaic geometry is untouched. */
[data-aztec-gallery] .aztec-lightbox-trigger { cursor: zoom-in; }
[data-aztec-gallery] .aztec-lightbox-trigger:focus-visible { outline: 3px solid #edc35a; outline-offset: -4px; }
.aztec-lightbox {
  position: fixed; inset: 0; box-sizing: border-box; margin: 0; border: 0;
  width: 100%; max-width: none; height: 100vh; height: 100dvh; max-height: none;
  padding: max(8px, env(safe-area-inset-top)) max(2.5vw, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(2.5vw, env(safe-area-inset-left));
  background: rgba(0, 0, 0, .9); color: #fff; overflow: hidden;
  font: 16px/1.4 system-ui, sans-serif; overscroll-behavior: contain;
}
.aztec-lightbox:not([open]) { display: none; }
.aztec-lightbox[open] { display: grid; grid-template-rows: 48px minmax(0, 1fr) auto; gap: 8px; animation: aztec-lightbox-open .2s ease; }
.aztec-lightbox::backdrop { background: transparent; }
.aztec-lightbox__toolbar { display: flex; align-items: center; justify-content: space-between; }
.aztec-lightbox .aztec-lightbox__button {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  width: 48px; height: 48px; padding: 0; margin: 0; border: 1px solid rgba(255,255,255,.35);
  border-radius: 50%; background: rgba(0,0,0,.35); color: #fff; cursor: pointer;
  font: 28px/1 system-ui, sans-serif; transition: background .2s ease;
}
.aztec-lightbox .aztec-lightbox__button:hover { background: rgba(255,255,255,.2); }
.aztec-lightbox .aztec-lightbox__button:focus-visible { outline: 3px solid #edc35a; outline-offset: 2px; }
.aztec-lightbox__frame { display: grid; grid-template-columns: 48px minmax(0, 1fr) 48px; align-items: center; gap: 8px; min-height: 0; }
.aztec-lightbox__stage { display: flex; align-items: center; justify-content: center; min-width: 0; height: 100%; min-height: 0; touch-action: pan-y pinch-zoom; }
.aztec-lightbox .aztec-lightbox__image { display: block; width: auto; height: auto; max-width: min(100%, 95vw); max-height: min(100%, 88vh); max-height: min(100%, 88dvh); object-fit: contain; border: 0; border-radius: 0; margin: 0; }
.aztec-lightbox .aztec-lightbox__image[hidden] { display: none; }
.aztec-lightbox__caption { margin: 0; text-align: center; color: #eee; max-height: 25vh; max-height: 25dvh; overflow: auto; white-space: pre-line; overflow-wrap: anywhere; }
.aztec-lightbox__status { position: absolute; top: 50%; left: 15%; right: 15%; text-align: center; pointer-events: none; }
.aztec-lightbox__status[hidden] { display: none; }
@keyframes aztec-lightbox-open { from { opacity: 0; } to { opacity: 1; } }
@media (max-width: 600px) {
  .aztec-lightbox__frame { position: relative; grid-template-columns: minmax(0, 1fr); padding-bottom: 56px; }
  .aztec-lightbox__frame > .aztec-lightbox__button { position: absolute; bottom: 0; }
  .aztec-lightbox__frame > [data-lb-prev] { left: 0; }
  .aztec-lightbox__frame > [data-lb-next] { right: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .aztec-lightbox[open] { animation: none; }
  .aztec-lightbox .aztec-lightbox__button { transition: none; }
}
