.gallery-main { max-width:1500px; margin-inline:auto; }
.gallery-grid { columns:3; column-gap:1.5rem; }
.gallery-photo { break-inside:avoid; margin:0 0 1.5rem; padding:0; background:var(--paper-2); border:1px solid var(--line); border-radius:8px; overflow:hidden; }
.gallery-photo a { display:block; }
.gallery-photo a:focus-visible { outline:3px solid var(--brand-pink); outline-offset:-3px; }
.gallery-photo img { display:block; width:100%; height:auto; }
.gallery-photo figcaption { padding:.9rem 1rem 1rem; color:var(--muted); font:400 .85rem/1.5 "Archivo",system-ui,sans-serif; }
@media(max-width:1050px) { .gallery-grid { columns:2; } }
@media(max-width:600px) { .gallery-grid { columns:1; } }
.gallery-viewer-open { overflow:hidden; }
.gallery-viewer { width:100%; height:100vh; height:100dvh; max-width:none; max-height:none; padding: max(.75rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left)); margin:0; border:0; background:transparent; color:var(--ink); }
.gallery-viewer::backdrop { background:rgba(8,5,5,.94); }
.gallery-viewer[open] { display:grid; grid-template-rows:auto minmax(0, 1fr) auto; gap:.65rem; }
.gallery-viewer figure { display:grid; grid-template-rows:minmax(0, 1fr) auto auto; min-height:0; margin:0; max-width:100%; text-align:center; touch-action:pan-y pinch-zoom; }
.gallery-viewer img { display:block; max-width:100%; max-height:100%; width:100%; height:100%; margin:auto; object-fit:contain; user-select:none; }
.gallery-viewer figcaption { margin-top:1rem; font:400 .9rem/1.5 "Archivo",system-ui,sans-serif; color:var(--muted); }
.gallery-close { justify-self:end; }
.gallery-close, .gallery-controls button { width:48px; height:48px; border:1px solid var(--line); border-radius:50%; background:var(--paper-2); color:var(--ink); font:28px/1 system-ui,sans-serif; cursor:pointer; }
.gallery-controls { display:flex; justify-content:center; align-items:center; gap:1.5rem; }
#gallery-count { min-width:4rem; text-align:center; font-variant-numeric:tabular-nums; }
#gallery-status { margin:.4rem 0 0; color:var(--muted); font-size:.85rem; }
#gallery-status:empty { display:none; }
.gallery-viewer button:focus-visible { outline:2px solid var(--brand-pink); outline-offset:3px; }
