/* Owner-selected gallery A: a large photo, five previews and a full-photo viewer. */
.activity-gallery-hero { display: block; position: relative; aspect-ratio: 1.85; background: var(--ground); touch-action: pan-y; }
.activity-gallery-hero .activity-hero-photo { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.activity-gallery-main-status { position: absolute; inset: 0; display: grid; place-content: center; padding: 20px; text-align: center; }
.activity-gallery-thumbnails { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; padding: 12px 0 4px; }
.activity-gallery-thumb { display: block; flex: 0 0 84px; min-width: 44px; min-height: 44px; aspect-ratio: 1.5; padding: 3px; border: 2px solid transparent; border-radius: 0; background: transparent; color: var(--slate-deep); cursor: pointer; }
.activity-gallery-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.activity-gallery-thumb[aria-pressed="true"] { border-color: var(--slate-deep); }
.activity-gallery-thumb:hover { background: var(--steel); }
.activity-gallery-thumb-fallback { display: grid; height: 100%; place-content: center; padding: 2px; overflow: hidden; font: 600 11px/1.2 var(--font-body); }
.activity-gallery-footer { display: flex; min-height: 68px; align-items: center; justify-content: end; gap: 12px; padding: 8px 0 16px; }
.activity-gallery-footer .activity-photo-note { padding: 0; }
.activity-gallery-tools { display: flex; flex-shrink: 0; flex-wrap: wrap; justify-content: end; gap: 8px; }
.activity-gallery-button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: 9px 14px; border: 1px solid var(--steel); border-radius: 0; background: var(--paper); color: var(--slate-deep); font: inherit; font-size: 14px; font-weight: 650; line-height: 1.4; cursor: pointer; }
.activity-gallery-button:hover { background: var(--ground); border-color: var(--slate-deep); }
.activity-gallery-fallback summary { display: flex; align-items: center; min-height: 44px; cursor: pointer; text-decoration: underline; }
.activity-gallery-fallback ul { padding-left: 20px; }
.activity-gallery-fallback a { display: inline-flex; align-items: center; min-height: 44px; text-decoration: underline; }
.activity-gallery-dialog { width: min(1120px, calc(100% - 48px)); height: min(860px, calc(100dvh - 48px)); max-width: none; max-height: none; margin: auto; padding: 20px; border: 1px solid var(--steel); border-radius: 0; background: var(--paper); color: var(--slate-deep); overflow: hidden; }
.activity-gallery-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; gap: 12px; }
.activity-gallery-dialog::backdrop { background: rgb(23 54 59 / 78%); }
.activity-gallery-viewer-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.activity-gallery-viewer-header h2 { margin: 0; font: 400 28px/1.2 var(--font-display); }
.activity-gallery-viewer-header button { flex-shrink: 0; }
.activity-gallery-frame { display: grid; position: relative; min-width: 0; min-height: 0; place-items: center; background: var(--ground); touch-action: pan-y; }
.activity-gallery-full-photo { display: block; width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.activity-gallery-feedback { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 16px; text-align: center; pointer-events: none; }
.activity-gallery-feedback button { pointer-events: auto; }
.activity-gallery-viewer-caption p { font-size: 14px; line-height: 1.4; }
.activity-gallery-viewer-caption #activity-gallery-note { margin-top: 4px; color: var(--muted); font-size: 12px; }
.activity-gallery-navigation { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.activity-gallery-navigation p { margin-inline: auto; font-size: 14px; font-variant-numeric: tabular-nums; }
.activity-gallery-all-thumbnails { display: flex; gap: 8px; min-width: 0; padding: 4px; overflow-x: auto; scroll-snap-type: x proximity; }
.activity-gallery-all-thumbnails .activity-gallery-thumb { scroll-snap-align: center; }
@media (max-width: 767px) {
  .activity-gallery-hero { aspect-ratio: 3 / 2; }
  .activity-gallery-thumbnails { display: flex; overflow-x: auto; scroll-snap-type: x proximity; padding: 10px 4px 4px; }
  .activity-gallery-thumbnails .activity-gallery-thumb { scroll-snap-align: center; }
  .activity-gallery-footer { align-items: start; flex-direction: column; gap: 12px; padding: 8px 0 16px; }
  .activity-gallery-tools { width: 100%; justify-content: start; }
  .activity-gallery-tools [data-gallery-open] { flex: 1; }
  .activity-gallery-dialog { width: 100%; height: 100dvh; margin: 0; padding: 16px; border: 0; }
  .activity-gallery-viewer-header { gap: 12px; }
  .activity-gallery-viewer-header h2 { font-size: 24px; }
  .activity-gallery-viewer-header button { padding-inline: 10px; font-size: 13px; }
  .activity-gallery-navigation { gap: 8px; }
  .activity-gallery-navigation .activity-gallery-button { padding-inline: 10px; font-size: 13px; }
}
@media (max-height: 500px) {
  .activity-gallery-dialog[open] { gap: 8px; }
  .activity-gallery-dialog { padding: 12px; }
  .activity-gallery-all-thumbnails { display: none; }
}
@media (max-height: 500px) and (min-width: 600px) {
  .activity-gallery-dialog[open] { grid-template-columns: minmax(0, 1fr) 240px; grid-template-rows: auto minmax(0, 1fr) auto; gap: 12px; }
  .activity-gallery-frame { grid-column: 1; grid-row: 1 / 4; }
  .activity-gallery-viewer-header { grid-column: 2; grid-row: 1; flex-wrap: wrap; gap: 8px; }
  .activity-gallery-viewer-header h2 { font-size: 24px; }
  .activity-gallery-viewer-caption { grid-column: 2; grid-row: 2; align-self: center; }
  .activity-gallery-navigation { grid-column: 2; grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .activity-gallery-navigation p { grid-column: 1 / -1; grid-row: 1; }
  .activity-gallery-navigation button { grid-row: 2; padding-inline: 8px; font-size: 13px; }
}
