.gallery-section { position: relative; isolation: isolate; padding: var(--space-xl) 0 var(--space-2xl); }
.gallery-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-md); align-items: stretch; }
.gallery-tile { display: flex; min-width: 0; aspect-ratio: 4 / 3; margin: 0; overflow: hidden; border-radius: var(--radius-card); background: var(--color-paper-3); }
.gallery-open { display: flex; flex: 1; align-items: center; justify-content: center; width: 100%; min-width: 0; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gallery-open:active { transform: none; }
.gallery-open:focus-visible { outline-offset: -4px; }
.gallery-tile img { display: block; flex: none; width: 100%; max-width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-empty { padding: var(--space-xl) 0; color: var(--color-ink-2); }
.gallery-lightbox { position: fixed; inset: 0; box-sizing: border-box; width: 100%; max-width: none; height: 100dvh; max-height: none; margin: 0; padding: 64px 80px; border: 0; background: transparent; color: #fff; overflow: hidden; }
.gallery-lightbox:not([open]) { display: none; }
.gallery-lightbox[open] { display: flex; align-items: center; justify-content: center; }
.gallery-lightbox::backdrop { background: rgb(12 15 13 / .94); }
.gallery-lightbox-stage { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; margin: 0; min-width: 0; min-height: 0; }
.gallery-lightbox-image { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-lightbox-image[hidden] { display: none; }
.gallery-lightbox-status { position: absolute; inset: 50% 64px auto; margin: 0; text-align: center; color: #fff; }
.gallery-lightbox-control { position: absolute; z-index: 1; display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 1px solid rgb(255 255 255 / .35); border-radius: 50%; background: rgb(255 255 255 / .1); color: #fff; cursor: pointer; font-size: 30px; line-height: 1; }
.gallery-lightbox-control:hover { background: rgb(255 255 255 / .22); }
.gallery-lightbox-control:focus-visible { outline: 3px solid var(--color-field); outline-offset: 3px; }
.gallery-lightbox-close { top: 16px; right: 16px; }
.gallery-lightbox-prev { top: calc(50% - 24px); left: 16px; }
.gallery-lightbox-next { top: calc(50% - 24px); right: 16px; }
.gallery-lightbox-counter { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); margin: 0; color: #fff; font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: minmax(0, 1fr); }
  .gallery-lightbox { padding: 64px 52px; }
  .gallery-lightbox-prev { left: 4px; }
  .gallery-lightbox-next { right: 4px; }
  .gallery-lightbox-control { width: 44px; height: 44px; }
}
