.community-photos figure{margin:0;background:var(--panel);border-radius:16px;overflow:hidden;break-inside:avoid}.community-photos img{display:block;width:100%;height:auto}.community-photos figcaption{padding:1rem;overflow-wrap:anywhere}.photos-scroll{display:flex;gap:1rem;overflow-x:auto;scroll-snap-type:x mandatory;padding-bottom:1rem}.photos-scroll figure{flex:0 0 clamp(320px,46vw,560px);scroll-snap-align:start}.photos-scroll img,.photos-grid img{aspect-ratio:4/3;object-fit:cover}.photos-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.photos-masonry{columns:3;column-gap:1rem}.photos-masonry figure{margin-bottom:1rem}.gallery-manager{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.gallery-edit-card{border:1px solid #333;border-radius:16px;overflow:hidden;min-width:0}.gallery-edit-card>img{width:100%;aspect-ratio:4/3;object-fit:cover}.gallery-edit-card>div{padding:1rem}.gallery-edit-card[hidden]{display:none}.gallery-switch{display:flex!important;align-items:center;gap:1rem}.gallery-switch input{appearance:none;width:56px!important;height:30px;border-radius:20px;background:#555;position:relative;cursor:pointer;flex-shrink:0}.gallery-switch input:checked{background:#e21b2d}.gallery-switch input:before{content:'';position:absolute;width:22px;height:22px;left:3px;top:3px;border-radius:50%;background:white}.gallery-switch input:checked:before{left:29px}.gallery-switch input:focus-visible{outline:3px solid white;outline-offset:3px}#gallery-progress{width:100%;accent-color:#e21b2d}.gallery-lightbox{max-width:95vw;max-height:95vh;background:#151518;color:#f8f7f5;border:1px solid #555;border-radius:16px}.gallery-lightbox::backdrop{background:#000d}.gallery-lightbox img{max-width:85vw;max-height:75vh;object-fit:contain}.gallery-lightbox button{display:block;margin:0 0 1rem auto}.gallery-lightbox p{max-width:85vw;overflow-wrap:anywhere}@media(max-width:1000px){.gallery-manager{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:650px){.gallery-manager{grid-template-columns:1fr}.photos-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.photos-masonry{columns:2}.community-gallery{min-width:0}}

/* Photo controls match the site's dark panels and red accents. */
.gallery-lightbox { padding: 64px 18px 18px; border-color: var(--line); border-radius: 22px; box-shadow: 0 28px 90px #0008; }
.gallery-lightbox .gallery-lightbox-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 1px solid #ffffff30; border-radius: 50%; background: #242429; color: var(--white); cursor: pointer; transition: background .15s ease, border-color .15s ease; }
.gallery-lightbox .gallery-lightbox-close:hover { background: var(--red); border-color: var(--red2); }
.gallery-lightbox .gallery-lightbox-close:focus-visible { outline: 2px solid var(--red2); outline-offset: 3px; }
.gallery-lightbox img { max-height: calc(90svh - 110px); border-radius: 12px; }
.gallery-lightbox p { margin: 14px 0 0; color: var(--muted); }
.community-photos:focus { outline: none; }
.community-photos:focus-visible { box-shadow: inset 0 -2px var(--red2); }
.gallery-open { display: block; }
.gallery-open.gallery-pointer-return:focus { outline: none; }
.gallery-open:focus-visible { outline: 2px solid var(--red2); outline-offset: -3px; }
.photos-scroll.gallery-auto-scroll { scroll-snap-type: none; scroll-behavior: auto; }
.community-gallery .gallery-auto-toggle { flex: 0 0 auto; font-size: 13px; border-color: var(--line); color: var(--muted) !important; }
.community-gallery .gallery-auto-toggle:hover { color: var(--white) !important; border-color: var(--red2); background: #e21b2d12; }
.community-gallery .gallery-auto-toggle[hidden] { display: none; }
@media (max-width: 650px) {
  .gallery-lightbox { max-width: calc(100vw - 16px); padding: 64px 10px 12px; border-radius: 18px; }
  .gallery-lightbox img { max-width: calc(100vw - 38px); }
}

/* Give mobile photos most of the strip, with the next photo still visible. */
@media (max-width: 650px) {
  .community-gallery .photos-scroll figure { flex-basis: 88%; }
}
