/* Fullscreen screenshots retain their full proportions and readable captions. */
.gallery-dialog { position: fixed; inset: 0; width: 100vw; max-width: none; height: 100vh; height: 100dvh; max-height: none; margin: 0; padding: 0; overflow: hidden; border: 0; border-radius: 0; background: linear-gradient(125deg, #142a40f7, #081522fc); color: #fff; color-scheme: dark; font-family: 'IBM Plex Sans', Arial, sans-serif; font-size: 16px; line-height: 1.5; }
.gallery-dialog:not([open]) { display: none; }
.gallery-dialog[open] { display: block; }
.gallery-dialog *, .gallery-dialog *::before, .gallery-dialog *::after { box-sizing: border-box; }
.gallery-dialog [hidden] { display: none !important; }
.gallery-dialog::backdrop { background: #07121df2; -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
.gallery-dialog__shell { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 14px; width: 100%; height: 100%; padding: max(18px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left)); pointer-events: none; }
.gallery-dialog__header, .gallery-dialog__stage, .gallery-dialog__controls { pointer-events: auto; }
.gallery-dialog__header { display: flex; min-width: 0; min-height: 60px; align-items: flex-start; justify-content: space-between; gap: 24px; }
.gallery-dialog__heading { min-width: 0; }
.gallery-dialog__eyebrow { margin: 0 0 6px; color: #c3d9e7; font-size: 10px; font-weight: 500; line-height: 1.5; letter-spacing: .09em; text-transform: uppercase; }
.gallery-dialog h2 { margin: 0; color: #fff; font-size: clamp(19px, 1.7vw, 25px); font-weight: 500; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.gallery-dialog__close { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 1px solid #c3d9e75c; border-radius: 50%; background: #ffffff0d; color: #fff; cursor: pointer; transition: background 160ms, border-color 160ms; }
.gallery-dialog__close:hover { border-color: #c3d9e7; background: #ffffff1f; }
.gallery-dialog__close .nav-icon { width: 21px; height: 21px; }
.gallery-dialog__stage { position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) 44px; align-items: stretch; gap: 14px; min-width: 0; min-height: 0; }
.gallery-dialog__stage--single { grid-template-columns: minmax(0, 1fr); }
.gallery-dialog__slides { min-width: 0; min-height: 0; height: 100%; }
.gallery-dialog__slide { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 10px; min-width: 0; min-height: 0; height: 100%; margin: 0; }
.gallery-dialog__viewport { display: grid; min-width: 0; min-height: 0; place-items: center; overflow: hidden; border: 1px solid #c3d9e726; border-radius: 10px; background: #020911; touch-action: pan-y; }
.gallery-dialog__image { display: block; min-width: 0; min-height: 0; width: 100%; height: 100%; max-width: 100%; max-height: 100%; object-fit: contain; }
.gallery-dialog__placeholder { display: flex; min-width: 0; min-height: 0; align-items: center; justify-content: center; flex-direction: column; padding: 20px; color: #a8c3d7; text-align: center; }
.gallery-dialog__placeholder > svg { flex-shrink: 0; margin-bottom: 16px; color: #8eacc4; }
.gallery-dialog__placeholder > strong { color: #d1e1ed; font-size: 17px; font-weight: 500; line-height: 1.4; }
.gallery-dialog__placeholder > span { margin-top: 7px; font-size: 13px; line-height: 1.5; }
.gallery-dialog__caption { min-width: 0; min-height: 0; max-height: min(24vh, 190px); margin: 0; padding: 10px 12px; overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; border: 1px solid #c3d9e724; border-radius: 7px; background: #ffffff05; overflow-wrap: anywhere; }
.gallery-dialog__caption h3 { margin: 0; color: #fff; font-size: 16px; font-weight: 500; line-height: 1.35; }
.gallery-dialog__caption p { margin: 5px 0 0; color: #d1e1ed; font-size: 13px; line-height: 1.6; }
.gallery-dialog__arrow { display: grid; align-self: center; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 1px solid #c3d9e75c; border-radius: 7px; background: #142a40d9; color: #fff; cursor: pointer; transition: background 160ms, border-color 160ms; }
.gallery-dialog__arrow:hover { border-color: #ff8a3d; background: #ff8a3d1a; }
.gallery-dialog__arrow .nav-icon { width: 21px; height: 21px; }
.gallery-dialog__arrow--previous .nav-icon { transform: rotate(180deg); }
.gallery-dialog__controls { display: grid; grid-template-columns: 84px minmax(0, 1fr) 84px; align-items: center; gap: 12px; min-width: 0; min-height: 0; max-height: 24vh; overflow-y: auto; }
.gallery-dialog__controls--single { display: flex; justify-content: center; }
.gallery-dialog__counter { margin: 0; color: #bfd2e1; font: 400 12px/1.5 'IBM Plex Mono', monospace; text-align: center; white-space: nowrap; }
.gallery-dialog__dots { display: flex; min-width: 0; align-items: center; justify-content: center; flex-wrap: wrap; padding: 4px; }
.gallery-dialog__dot { display: grid; flex: 0 0 44px; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 6px; background: transparent; color: #fff; cursor: pointer; }
.gallery-dialog__dot > span { display: block; width: 6px; height: 6px; border-radius: 50%; background: #9bb5ca; }
.gallery-dialog__dot:is(:hover, [aria-current='true']) > span { background: #ff8a3d; }
.gallery-dialog :is(button, [data-gallery-full-caption]):focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

@media (max-width: 640px) {
  .gallery-dialog__shell { gap: 12px; padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left)); }
  .gallery-dialog__header { min-height: 60px; gap: 14px; }
  .gallery-dialog__eyebrow { font-size: 9px; }
  .gallery-dialog h2 { font-size: 18px; }
  .gallery-dialog__stage { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .gallery-dialog__viewport { border-radius: 7px; }
  .gallery-dialog__arrow { position: absolute; z-index: 1; top: 35%; border-radius: 50%; transform: translateY(-50%); }
  .gallery-dialog__arrow--previous { left: 4px; }
  .gallery-dialog__arrow--next { right: 4px; }
  .gallery-dialog__placeholder { padding: 16px; }
  .gallery-dialog__placeholder > svg { width: 44px; height: 44px; margin-bottom: 12px; }
  .gallery-dialog__placeholder > strong { font-size: 15px; }
  .gallery-dialog__placeholder > span { font-size: 12px; }
  .gallery-dialog__caption { padding: 9px 10px; }
  .gallery-dialog__caption h3 { font-size: 14px; }
  .gallery-dialog__caption p { font-size: 12px; }
  .gallery-dialog__controls { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .gallery-dialog__dots { order: 1; }
  .gallery-dialog__counter { order: 2; font-size: 11px; }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-dialog * { transition: none !important; }
}

@media print {
  .gallery-dialog { display: none !important; }
}
