/* Native HTML dialog, following the BLP gallery layout. */
html.gallery-open { overflow: hidden; }
.gallery { margin: auto; padding: 0; border: 0; max-width: 100vw; max-height: 100dvh; width: 100vw; height: 100dvh; background: transparent; color: #fff; overflow: hidden; }
.gallery::backdrop { background: rgba(20, 20, 20, .96); }
.gallery[open] { display: flex; flex-direction: column; }
.gallery [hidden] { display: none !important; }
.gallery button, .gallery a { color: #fff; background: #333; border: 1px solid #666; border-radius: 3px; padding: 8px 12px; font: inherit; font-size: 13px; line-height: 20px; min-height: 40px; text-decoration: none; cursor: pointer; }
.gallery button:hover, .gallery a:hover { background: #555; }
.gallery :focus-visible { outline-color: var(--accent-gold); }
.gallery-toolbar { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 6px; padding: 12px; }
#gallery-position { margin-right: auto; padding: 4px; }
.gallery [data-action="close"] { font-size: 26px; line-height: 20px; }
.gallery-stage { display: flex; flex: 1; min-height: 0; align-items: center; justify-content: space-between; gap: 10px; padding: 0 12px; }
.gallery-image-frame { overflow: auto; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-width: 0; }
#gallery-image { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.gallery .gallery-prev, .gallery .gallery-next { font-size: 35px; flex-shrink: 0; min-width: 44px; min-height: 44px; }
#gallery-caption { text-align: center; padding: 12px 20px; font-size: 14px; line-height: 20px; }
#gallery-status { text-align: center; font-size: 13px; color: #ddd; }
#gallery-status:empty { display: none; }
#gallery-copy { margin: 8px auto; padding: 8px; width: min(600px, 90%); }
.gallery-thumbnails { display: flex; flex-shrink: 0; justify-content: center; gap: 10px; padding: 0 16px 16px; overflow-x: auto; }
.gallery-thumbnails button { padding: 3px; min-height: 0; border: 2px solid transparent; background: transparent; flex-shrink: 0; }
.gallery-thumbnails [aria-current="true"] { border-color: var(--accent-gold); }
.gallery-thumbnails img { width: 60px; height: 40px; object-fit: cover; }
@media print { .gallery { display: none !important; } }
