.gallery-sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.postcard-gallery { margin-top: 12px; }
.gallery-open {
  width: fit-content; min-height: 44px; padding: 10px 0;
  color: var(--link); font-weight: 600; cursor: pointer;
}
.gallery-open span:not(.gallery-sr-only) { font-weight: 400; }
.gallery-open:hover { color: #ffdca3; }
.gallery-thumbnails {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(160px, 100%), 1fr));
  gap: 12px; margin-top: 8px;
}
.gallery-photo-link { display: block; border-radius: 12px; overflow: hidden; background: var(--ink-soft); }
.gallery-photo-link img { display: block; width: 100%; height: 240px; object-fit: contain; }

.gallery-modal-open { overflow: hidden; }
.gallery-dialog {
  width: min(1040px, calc(100% - 24px)); height: min(900px, calc(100dvh - 24px));
  max-width: none; max-height: calc(100dvh - 24px); padding: 20px;
  border: 1px solid var(--ink-line); border-radius: 18px;
  background: var(--ink); color: var(--paper);
}
.gallery-dialog::backdrop { background: rgb(0 0 0 / 85%); }
.gallery-dialog-content { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.gallery-dialog-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.gallery-dialog h2 { font-size: clamp(16px, 3vw, 22px); line-height: 1.3; overflow-wrap: anywhere; }
.gallery-control {
  flex-shrink: 0; min-height: 48px; padding: 10px 16px;
  border: 1px solid var(--paper-muted); border-radius: 999px;
  background: var(--ink-soft); color: var(--paper); font: inherit; font-size: 15px; font-weight: 600;
  cursor: pointer; touch-action: manipulation;
}
.gallery-control:hover { background: var(--ink-line); }
.gallery-close { display: inline-flex; align-items: center; gap: 8px; }
.gallery-close span { font-size: 22px; line-height: 1; }
.gallery-image-frame { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.gallery-load-message { color: var(--paper-muted); text-align: center; line-height: 1.5; }
.gallery-full-photo { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.gallery-description { color: var(--paper-muted); text-align: center; font-size: 14px; line-height: 1.4; }
.gallery-navigation { display: grid; grid-template-columns: 1fr auto 1fr; gap: 12px; align-items: center; }
.gallery-previous { justify-self: start; }
.gallery-next { justify-self: end; }
.gallery-position { font-size: 14px; white-space: nowrap; }

@media (max-width: 560px) {
  .gallery-dialog { padding: 12px; border-radius: 12px; }
  .gallery-dialog-content { gap: 10px; }
  .gallery-control { padding: 10px 12px; font-size: 14px; }
  .gallery-navigation { gap: 6px; }
}
