/* Gallery only: show the whole photo at the maximum size that fits. */
.activity-detail #content-modal[open]:has(.lightbox-photo) {
 display:grid; grid-template-rows:auto minmax(0,1fr); row-gap:8px;
 width:min(1520px,calc(100% - 24px)); max-width:none; height:calc(100% - 24px); height:calc(100dvh - 24px); max-height:none; margin:auto;
 border-radius:12px; padding:8px 12px 12px; overflow:hidden; background:#101114; color:#fff;
}
.activity-detail #content-modal:has(.lightbox-photo)::backdrop { background:#08090be8; }
.activity-detail #content-modal:has(.lightbox-photo) #modal-title {
 display:flex; align-items:center; min-height:44px; padding:0 48px 0 0; color:#fff;
 font-size:clamp(16px,2vw,24px); line-height:1.15; letter-spacing:0;
}
.activity-detail #content-modal:has(.lightbox-photo) > .close { right:10px; top:8px; padding:0; background:#292a2e; color:#fff; border-radius:50%; line-height:1; }
.activity-detail #content-modal:has(.lightbox-photo) #modal-body { display:grid; min-height:0; place-items:center; }
.activity-detail #content-modal .lightbox-photo { width:100%; height:100%; min-height:0; max-height:none; object-fit:contain; margin:0; }
@media (max-width:700px) {
 .activity-detail #content-modal[open]:has(.lightbox-photo) { width:100%; height:100%; height:100dvh; border-radius:0; padding:8px 0; }
 .activity-detail #content-modal:has(.lightbox-photo) #modal-title { padding-left:12px; padding-right:64px; }
}

.direction-gallery-hint { margin:-6px 0 16px; color:#dadada; font-size:16px; }
.direction-gallery-open { display:block; width:100%; padding:0; border:0; background:transparent; color:inherit; cursor:zoom-in; }
.direction-gallery-open:focus-visible { outline:2px solid #ffe0a2; outline-offset:-4px; }
.direction-gallery-strip { touch-action:pan-x pan-y; }
@media (max-width:700px) {
 .activity-detail #content-modal:has(.lightbox-photo) { overscroll-behavior:contain; }
}

@media (min-width:1024px) {
 .direction-gallery .direction-gallery-shell { width:min(100%,1240px); }
 .direction-gallery .direction-gallery-slide img { height:clamp(530px,48vw,675px); }
}

/* Keep the dialog name for assistive technology without a visible caption. */
.activity-detail #content-modal[open]:has(.lightbox-photo) { grid-template-rows:minmax(0,1fr); padding-top:54px; }
.activity-detail #content-modal:has(.lightbox-photo) #modal-title { position:absolute; width:1px; height:1px; min-height:0; padding:0; margin:0; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
