/* Isolated gallery styles; the rest of the site is unchanged. */
.gallery-shell {padding:32px 24px 64px;}
.gallery-grid {columns:2;column-gap:26px;}
.gallery-card {display:block;break-inside:avoid;margin:0 0 26px;padding:8px;background:#fff;border-radius:18px;box-shadow:0 5px 20px #16394b18;overflow:hidden;transition:transform .25s,box-shadow .25s;}
.gallery-card:first-child {margin-top:28px;}
.gallery-card img {display:block;width:100%;height:auto;border-radius:12px;}
.gallery-card:focus-visible {outline:3px solid #24aae1;outline-offset:4px;}
@media(hover:hover) and (pointer:fine) {
 .gallery-card:hover {transform:translateY(-5px) rotate(-.6deg);box-shadow:0 12px 28px #16394b30;}
 .gallery-card:nth-child(even):hover {transform:translateY(-5px) rotate(.6deg);}
}
.gallery-viewer {position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:none;margin:0;padding:64px 70px;border:0;background:#101a20f5;color:white;box-sizing:border-box;}
.gallery-viewer[open] {display:flex;align-items:center;justify-content:center;}
.gallery-viewer::backdrop {background:#101a20;}
.viewer-image {max-width:100%;max-height:100%;object-fit:contain;touch-action:pan-y;}
.gallery-viewer button {position:absolute;border:1px solid #ffffff50;background:#26363c;color:white;border-radius:50%;width:48px;height:48px;font-size:32px;cursor:pointer;line-height:1;}
.gallery-viewer button:focus-visible {outline:3px solid #24aae1;outline-offset:4px;}
.viewer-close {top:12px;right:16px;}
.viewer-prev {left:12px;top:calc(50% - 24px);}
.viewer-next {right:12px;top:calc(50% - 24px);}
.viewer-count {position:absolute;bottom:10px;left:0;right:0;text-align:center;margin:0;}
html.gallery-open {overflow:hidden;}
@media(max-width:600px) {
 .gallery-shell {padding:18px 12px 36px;}
 .gallery-grid {column-gap:12px;}
 .gallery-card {padding:4px;border-radius:12px;margin-bottom:14px;}
 .gallery-card img {border-radius:8px;}
 .gallery-card:first-child {margin-top:18px;}
 .gallery-viewer {padding:65px 8px 82px;}
 .viewer-prev,.viewer-next {top:auto!important;bottom:18px;}
 .viewer-count {bottom:30px;left:65px;right:65px;}
}
@media(prefers-reduced-motion:reduce) {.gallery-card {transition:none;}}

.gallery-card[hidden] {display:none;}
.gallery-card:first-child {margin-top:0;}
.gallery-card:nth-child(odd) {position:relative;top:18px;}
