/* Current viewer geometry and interaction hooks; no theme-token dependency. */
/* Native Gallery captions may overlay small thumbnails. Text must not block
   the underlying progressive image link; intentional caption links stay live. */
.panda-gallery figcaption { pointer-events: none; }
.panda-gallery figcaption a { pointer-events: auto; }
body.panda-viewing { overflow: hidden; }
.panda-viewer { box-sizing: border-box; width: min(96vw, 1400px); max-width: 96vw; max-height: 94vh; border: 0; padding: 20px; border-radius: 20px; background: var(--wp--preset--color--base, Canvas); color: var(--wp--preset--color--contrast, CanvasText); font: inherit; overflow: auto; }
.panda-viewer:not([open]) { display: none; }
.panda-viewer[open] { display: flex; flex-direction: column; gap: 16px; }
.panda-viewer::backdrop { background: rgb(0 0 0 / 85%); }
.panda-viewer [hidden] { display: none; }
.panda-viewer-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 0; }
.panda-viewer-toolbar p { margin: 0; overflow-wrap: anywhere; }
.panda-viewer-toolbar button { flex: none; min-height: 44px; padding: 12px 28px; font: inherit; cursor: pointer; }
.panda-viewer-image { display: block; width: auto; max-width: 100%; height: auto; max-height: 65vh; max-height: 65dvh; margin: auto; object-fit: contain; flex: 0 0 auto; touch-action: pan-y pinch-zoom; }
.panda-viewer-details { max-width: 75ch; width: 100%; margin-inline: auto; }
.panda-viewer-details:has(p:not([hidden]),div:not([hidden])) { padding-inline: 4px; }
.panda-viewer-details a { color: inherit; text-decoration: underline; }
.panda-viewer-details p { margin: 0; line-height: 1.6; overflow-wrap: anywhere; white-space: pre-line; }
#panda-viewer-caption { font-weight: 600; }
#panda-viewer-description { margin-top: 6px; }
#panda-viewer-description p { margin-top: 8px; }
#panda-viewer-archive { margin-top: 20px; }
#panda-viewer-archive summary { cursor: pointer; }
#panda-viewer-archive ol { padding-left: 24px; }
#panda-viewer-archive li { margin-block: 20px; }
#panda-viewer-archive li p { margin-bottom: 8px; }
.panda-viewer-navigation { display: flex; justify-content: center; gap: 12px; }
.panda-viewer-navigation button { min-height: 44px; padding: 10px 24px; font: inherit; cursor: pointer; }
.panda-viewer-navigation button:disabled { opacity: .4; cursor: default; }
.panda-viewer button:focus-visible, .panda-viewer a:focus-visible, .panda-viewer summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
@media (max-width: 640px) {
  .panda-viewer { padding: 14px; }
  .panda-viewer-toolbar { gap: 12px; }
  .panda-viewer-toolbar button { padding-inline: 18px; }
}
