.jwa-gallery-open { overflow: hidden; }
.wp-block-gallery .jwa-gallery-trigger { cursor: zoom-in; }
.wp-block-gallery .jwa-gallery-trigger:focus-visible { outline: 3px solid #946b45; outline-offset: 4px; }
.wp-block-gallery .lightbox-trigger[hidden] { display: none !important; }
dialog.jwa-gallery-dialog {
  box-sizing: border-box; position: fixed; inset: 0;
  width: 100%; height: 100vh; height: 100dvh;
  max-width: none; max-height: none; margin: 0; padding: 16px;
  border: 0; background: rgba(24, 21, 18, .98); color: #faf7f2;
  font-family: Arial, sans-serif; overflow: hidden;
}
.jwa-gallery-dialog:not([open]) { display: none; }
.jwa-gallery-dialog[open] { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; }
.jwa-gallery-dialog::backdrop { background: #181512; }
.jwa-gallery-dialog *, .jwa-gallery-dialog *::before, .jwa-gallery-dialog *::after { box-sizing: border-box; }
.jwa-gallery-toolbar { display: flex; align-items: center; gap: 16px; min-height: 48px; }
.jwa-gallery-counter { margin-right: auto; font-size: 14px; white-space: nowrap; }
.jwa-gallery-original { color: #faf7f2; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
.jwa-gallery-dialog button {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0; width: 48px; height: 48px; flex: 0 0 48px;
  border: 1px solid #756c62; border-radius: 50%; background: #29231d;
  color: #fff; font: 36px/1 Arial, sans-serif; cursor: pointer;
}
.jwa-gallery-dialog button:hover { background: #675039; }
.jwa-gallery-dialog :focus-visible { outline: 3px solid #e6bd8b; outline-offset: 3px; }
.jwa-gallery-stage { position: relative; min-height: 0; display: flex; align-items: center; justify-content: center; }
.jwa-gallery-frame { width: 100%; height: 100%; min-height: 0; padding: 0 60px; display: flex; align-items: center; justify-content: center; }
.jwa-gallery-photo { display: block; max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; margin: 0; touch-action: pan-y pinch-zoom; }
.jwa-gallery-prev, .jwa-gallery-next { position: absolute; z-index: 2; top: calc(50% - 24px); }
.jwa-gallery-prev { left: 0; }
.jwa-gallery-next { right: 0; }
.jwa-gallery-dialog [hidden] { display: none !important; }
.jwa-gallery-status { position: absolute; top: 45%; left: 20%; width: 60%; text-align: center; pointer-events: none; background: #29231d; padding: 12px; font-size: 15px; }
.jwa-gallery-status:empty { display: none; }
.jwa-gallery-caption { text-align: center; font-size: 14px; line-height: 1.5; margin: 0; max-height: 12vh; overflow-y: auto; }
.jwa-gallery-caption:empty { display: none; }
@media (max-width: 600px) {
  dialog.jwa-gallery-dialog { padding: 8px; padding-top: max(8px, env(safe-area-inset-top)); padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .jwa-gallery-toolbar { gap: 8px; }
  .jwa-gallery-original { font-size: 12px; }
  .jwa-gallery-frame { padding: 0; }
  .jwa-gallery-prev, .jwa-gallery-next { top: auto; bottom: 12px; background: rgba(41, 35, 29, .9) !important; }
  .jwa-gallery-status { left: 10%; width: 80%; }
}
