* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #171717; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
img { display: block; }
button { font: inherit; }

.slideshow { display: grid; grid-template-rows: minmax(0, 1fr) auto; width: 100%; height: 100vh; height: 100dvh; overflow: hidden; color: #fff; }
.slideshow__stage { min-height: 0; display: flex; align-items: center; justify-content: center; padding: max(4px, env(safe-area-inset-top)) max(4px, env(safe-area-inset-right)) 4px max(4px, env(safe-area-inset-left)); touch-action: pan-y pinch-zoom; cursor: pointer; }
.slideshow__image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.slideshow__controls { display: flex; justify-content: center; align-items: center; gap: 24px; padding: 10px 16px max(18px, env(safe-area-inset-bottom)); }
.slideshow__button { display: grid; width: 48px; height: 48px; flex: 0 0 48px; place-items: center; padding: 0; border: 1px solid rgba(255, 255, 255, .65); border-radius: 50%; background: transparent; color: #fff; cursor: pointer; }
.slideshow__button:hover { background: #fff; color: #171717; }
.slideshow__button:focus-visible { outline: 3px solid #f7b5c7; outline-offset: 3px; }
.slideshow__button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.slideshow__previous { order: 1; }
.slideshow__toggle { order: 2; }
.slideshow__next { order: 3; }

.photo-grid { columns: 2; column-gap: 4px; padding: 4px 4px 0; background: #fff; }
.photo-card { display: block; width: 100%; margin-bottom: 4px; break-inside: avoid; }
.photo-card img { width: 100%; height: auto; }
.photo-card:focus-visible { outline: 3px solid #ac4a67; outline-offset: -3px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }

@media (min-width: 700px) { .photo-grid { columns: 3; gap: 6px; padding: 6px 6px 0; } .photo-card { margin-bottom: 6px; } }
@media (min-width: 1100px) { .photo-grid { columns: 4; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }
