/* Only site detail pages load the gallery and full-screen viewer. */
.detail-gallery { position: relative; }
.gallery-stage { display: block; width: 100%; aspect-ratio: 2.43; height: auto; padding: 0; border: 0; background: var(--soft); cursor: zoom-in; }
.gallery-stage img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.gallery-step { position: absolute; z-index: 1; top: 50%; transform: translateY(-50%); left: 5px; width: 30px; height: 36px; border: 0; border-radius: 4px; background: #101010db; color: white; cursor: pointer; font-size: 21px; }
.gallery-step:last-child { left: auto; right: 5px; }
.lightbox-open { overflow: hidden; overscroll-behavior-x: none; }
#gallery-lightbox { box-sizing: border-box; position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 50px 12px; border: 0; background: transparent; color: #fff; }
#gallery-lightbox[open] { display: grid; place-items: center; touch-action: pan-y pinch-zoom; }
#gallery-lightbox::backdrop { background: #080808ed; }
.lightbox-image { max-width: 100%; max-height: calc(100vh - 100px); max-height: calc(100dvh - 100px); object-fit: contain; }
#gallery-lightbox button { position: absolute; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff40; border-radius: 4px; color: #fff; background: #202020aa; font-size: 30px; cursor: pointer; }
.lightbox-close { top: max(8px, env(safe-area-inset-top)); right: max(8px, env(safe-area-inset-right)); }
.lightbox-prev { top: calc(50% - 22px); left: 0; }
.lightbox-next { top: calc(50% - 22px); right: 0; }
.lightbox-status { position: absolute; bottom: 42px; margin: 0; padding: 4px 8px; background: #151515c9; font-size: 13px; text-align: center; }
.lightbox-status:empty { display: none; }
.lightbox-count { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); font-size: 14px; }
